Changeset - 40c94e30a042
[Not reviewed]
Hasan Yavuz Ă–ZDERYA - 10 years ago 2015-10-10 13:21:53
hy@ozderya.net
seperately buffer the ASCII and HEX command texts
2 files changed with 13 insertions and 0 deletions:
0 comments (0 inline, 0 general)
commandwidget.cpp
Show inline comments
 
@@ -74,12 +74,22 @@ void CommandWidget::onSendClicked()
 
    emit sendCommand(command, ui->pbASCII->isChecked());
 
}
 

	
 
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()
 
{
 
    return ui->pbASCII->isChecked();
 
}
commandwidget.h
Show inline comments
 
@@ -43,12 +43,15 @@ signals:
 
    // in case of hex mode, command text should be a hexadecimal
 
    // string containing hexadecimal characters only (not even spaces)
 
    void sendCommand(QString command, bool ascii);
 

	
 
private:
 
    Ui::CommandWidget *ui;
 
    QString storedAsciiText;
 
    QString storedHexText;
 

	
 
    bool isASCIIMode(); // true: ascii mode, false hex mode
 

	
 
private slots:
 
    void onDeleteClicked();
 
    void onSendClicked();
 
    void onASCIIToggled(bool checked);
0 comments (0 inline, 0 general)