Browse Source

Update mining thread combobox when lang changes

custom_themes
Duke 1 year ago
parent
commit
7f41eb2944
  1. 15
      src/mainwindow.cpp

15
src/mainwindow.cpp

@ -166,6 +166,21 @@ void MainWindow::retranslateMiningTab() {
DEBUG("found start mining button");
button2->setText( QObject::tr("Start Mining") );
}
auto combo = tab->findChild<QComboBox *>("genproclimit");
if(combo != nullptr) {
DEBUG("found genproclimit combo");
int hwc = std::thread::hardware_concurrency();
// TODO: Is there a better way than recreating this combobox?
combo->clear();
auto threadStr = tr("thread");
auto threadsStr = tr("threads");
// give options from 1 to hwc/2 , which should represent physical CPUs
for(int i=0; i < hwc/2; i++) {
combo->insertItem(i, QString::number(i+1) % " " % (i+1==1 ? threadStr : threadsStr));
}
}
}
// Called every time, when a menu entry of the language menu is called

Loading…
Cancel
Save