Changeset - 91504904883a
[Not reviewed]
Hasan Yavuz Ă–ZDERYA - 10 years ago 2015-10-10 14:19:37
hy@ozderya.net
instead of keeping different ascii and hex commands, convert between them
2 files changed with 2 insertions and 10 deletions:
0 comments (0 inline, 0 general)
commandedit.cpp
Show inline comments
 
@@ -76,10 +76,12 @@ void CommandEdit::setMode(bool ascii)
 
    if (ascii)
 
    {
 
        setValidator(asciiValidator);
 
        setText(QByteArray::fromHex(text().remove(" ").toLatin1()));
 
    }
 
    else
 
    {
 
        setValidator(hexValidator);
 
        setText(text().toLatin1().toHex());
 
    }
 
}
 

	
commandwidget.cpp
Show inline comments
 
@@ -77,16 +77,6 @@ void CommandWidget::onSendClicked()
 
void CommandWidget::onASCIIToggled(bool checked)
 
{
 
    ui->leCommand->setMode(checked);
 
    if (checked)
 
    {
 
        storedHexText = ui->leCommand->text();
 
        ui->leCommand->setText(storedAsciiText);
 
    }
 
    else
 
    {
 
        storedAsciiText = ui->leCommand->text();
 
        ui->leCommand->setText(storedHexText);
 
    }
 
}
 

	
 
bool CommandWidget::isASCIIMode()
0 comments (0 inline, 0 general)