From 7f41eb294430443ac833d3d16cc372c082764ad1 Mon Sep 17 00:00:00 2001 From: Duke Date: Mon, 27 Feb 2023 22:45:44 -0500 Subject: [PATCH] Update mining thread combobox when lang changes --- src/mainwindow.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4cb2a04..6e26465 100755 --- a/src/mainwindow.cpp +++ b/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("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