MCPcopy Create free account
hub / github.com/ccMSC/ckb / modeChanged

Method modeChanged

src/ckb/kbwidget.cpp:148–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148void KbWidget::modeChanged(bool spontaneous){
149 int index = device->currentProfile()->indexOf(device->currentMode());
150 if(index < 0)
151 return;
152 // Update tabs
153 ui->lightWidget->setLight(device->currentLight());
154 ui->bindWidget->setBind(device->currentBind(), device->currentProfile());
155 ui->kPerfWidget->setPerf(device->currentPerf(), device->currentProfile());
156 ui->mPerfWidget->setPerf(device->currentPerf(), device->currentProfile());
157 // Update selection
158 if(spontaneous)
159 ui->modesList->setCurrentRow(index);
160 // Connect signals
161 if(currentMode)
162 disconnect(currentMode, SIGNAL(updated()), this, SLOT(modeUpdate()));
163 currentMode = device->currentMode();
164 connect(currentMode, SIGNAL(updated()), this, SLOT(modeUpdate()));
165 modeUpdate();
166}
167
168void KbWidget::on_modesList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous){
169 if(!current)

Callers

nothing calls this directly

Calls 9

currentProfileMethod · 0.80
currentLightMethod · 0.80
currentBindMethod · 0.80
currentPerfMethod · 0.80
indexOfMethod · 0.45
currentModeMethod · 0.45
setLightMethod · 0.45
setBindMethod · 0.45
setPerfMethod · 0.45

Tested by

no test coverage detected