1#include "FrmParameterTerminalBehavior.h"
2#include "ui_FrmParameterTerminalBehavior.h"
3#include <QLoggingCategory>
5Q_DECLARE_LOGGING_CATEGORY(Terminal)
7CFrmParameterTerminalBehavior::CFrmParameterTerminalBehavior(
CParameterTerminal *pPara, QWidget *parent) :
15 ui->cbKeyBinding->addItems(QTermWidget::availableKeyBindings());
16 ui->cbKeyBinding->setCurrentText(pPara->GetKeyBindings());
18 foreach(
auto c, QTextCodec::availableCodecs())
20 ui->cbTextCodecs->addItem(QString(c));
22 ui->cbTextCodecs->setCurrentText(pPara->GetTextCodec());
23 if(0 > m_pPara->GetHistorySize())
25 ui->cbHistoryUnlimited->setChecked(
true);
26 ui->sbHistorySize->setValue(1000);
30 ui->cbHistorySize->setChecked(
true);
31 ui->sbHistorySize->setValue(pPara->GetHistorySize());
35CFrmParameterTerminalBehavior::~CFrmParameterTerminalBehavior()
40int CFrmParameterTerminalBehavior::AcceptSettings()
42 if(!m_pPara)
return -1;
44 m_pPara->SetKeyBindings(ui->cbKeyBinding->currentText());
45 m_pPara->SetTextCodec(ui->cbTextCodecs->currentText());
46 if(ui->cbHistoryUnlimited->isChecked())
47 m_pPara->SetHistorySize(-1);
49 m_pPara->SetHistorySize(ui->sbHistorySize->value());