MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / SetParameter

Method SetParameter

Src/Terminal/ParameterTerminalUI.cpp:81–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81int CParameterTerminalUI::SetParameter(CParameter *pParameter)
82{
83 m_pPara = qobject_cast<CParameterTerminal*>(pParameter);
84 Q_ASSERT(m_pPara);
85 if(!m_pPara) return -1;
86
87 QFont f = m_pPara->GetFont();
88 ui->spFontSize->setValue(f.pointSize());
89 ui->lbFont->setFont(f);
90
91 ui->fontComboBox->setFontFilters(QFontComboBox::MonospacedFonts
92 | QFontComboBox::NonScalableFonts
93 | QFontComboBox::ScalableFonts);
94 ui->fontComboBox->setCurrentFont(f);
95 ui->fontComboBox->setEditable(false);
96
97 ui->cbShowResize->setChecked(m_pPara->GetSizeHint());
98
99 ui->cbCursorShape->addItem(tr("BlockCursor"), (int)Konsole::Emulation::KeyboardCursorShape::BlockCursor);
100 ui->cbCursorShape->addItem(tr("UnderlineCursor"), (int)Konsole::Emulation::KeyboardCursorShape::UnderlineCursor);
101 ui->cbCursorShape->addItem(tr("IBeamCursor"), (int)Konsole::Emulation::KeyboardCursorShape::BlockCursor);
102 ui->cbCursorShape->setCurrentIndex((int)m_pPara->GetCursorShape());
103
104 ui->cbColorScheme->addItems(QTermWidget::availableColorSchemes());
105 if(!m_pPara->GetColorScheme().isEmpty())
106 ui->cbColorScheme->setCurrentText(m_pPara->GetColorScheme());
107
108 ui->cbScrollBarPositioin->addItem(tr("None"), QTermWidget::NoScrollBar);
109 ui->cbScrollBarPositioin->addItem(tr("Left"), QTermWidget::ScrollBarLeft);
110 ui->cbScrollBarPositioin->addItem(tr("Right"), QTermWidget::ScrollBarRight);
111 ui->cbScrollBarPositioin->setCurrentIndex(m_pPara->GetScrollBarPosition());
112
113 ui->spTerminalTransparecy->setValue(m_pPara->GetTransparency());
114 ui->cbFlowControl->setChecked(m_pPara->GetFlowControl());
115 ui->cbBiDirectional->setChecked(m_pPara->GetDirectional());
116 ui->leImage->setText(m_pPara->GetBackgroupImage());
117
118 ui->cbKeyBinding->addItems(QTermWidget::availableKeyBindings());
119 ui->cbKeyBinding->setCurrentText(m_pPara->GetKeyBindings());
120
121 if(0 > m_pPara->GetHistorySize())
122 {
123 ui->cbHistoryUnlimited->setChecked(true);
124 ui->sbHistorySize->setValue(1000);
125 }
126 else
127 {
128 ui->cbHistorySize->setChecked(true);
129 ui->sbHistorySize->setValue(m_pPara->GetHistorySize());
130 }
131 return 0;
132}

Callers

nothing calls this directly

Calls 9

GetSizeHintMethod · 0.80
addItemMethod · 0.80
GetCursorShapeMethod · 0.80
GetScrollBarPositionMethod · 0.80
GetTransparencyMethod · 0.80
GetDirectionalMethod · 0.80
GetHistorySizeMethod · 0.80
isEmptyMethod · 0.45
GetFlowControlMethod · 0.45

Tested by

no test coverage detected