From 7647b01d62fcd315c4415c9fd0486ee1f6f58c72 Mon Sep 17 00:00:00 2001 From: Christoph Holzheuer Date: Fri, 23 Jan 2026 16:33:05 +0100 Subject: [PATCH] Language updates. --- bcdeviceview.cpp | 16 +--------------- bcmainwindow.cpp | 14 +++++++------- bcmainwindow.h | 2 +- bcmainwindow.ui | 15 +++++++++------ bcthemeswitchbutton.cpp | 5 +---- 5 files changed, 19 insertions(+), 33 deletions(-) diff --git a/bcdeviceview.cpp b/bcdeviceview.cpp index bc9c773..9c5678f 100644 --- a/bcdeviceview.cpp +++ b/bcdeviceview.cpp @@ -47,27 +47,13 @@ BCDeviceView::BCDeviceView(QWidget *parent) _itemDelegate = new BCValueDelegate( _valueModel.getValueList(), this); setItemDelegateForColumn( 1, _itemDelegate ); -/* - setStyleSheet( R"(QTableView::item:selected - { - background-color: green; - border: none; - } - QTableView:focus - { - outline: none; - } - })"); -*/ - - } void BCDeviceView::setDeviceID( BCDevice::ID deviceID ) { - _devideID = deviceID; + _devideID = deviceID; } BCDevice::ID BCDeviceView::deviceID() const diff --git a/bcmainwindow.cpp b/bcmainwindow.cpp index 81b80a7..f609e51 100644 --- a/bcmainwindow.cpp +++ b/bcmainwindow.cpp @@ -193,16 +193,16 @@ void BCMainWindow::initStatusBar() _statusBar->addPermanentWidget(themeBtn); connect(themeBtn, &BCThemeSwitchButton::themeChanged, this, [this](bool isDark) { - QString message = isDark ? "DarkMode aktiviert" : "LightMode aktiviert"; - _statusBar->showMessage( message, 3000); - setApplicationStyleSheet( isDark ? cDarkModeStyle : cLightModeStyle ); + QString message = isDark ? "using DarkMode." : "using LightMode."; + onShowMessage( message ); + setApplicationStyleSheet( isDark ? cDarkModeStyle : cLightModeStyle ); }); // Wir starten im light mode //themeBtn->setDarkMode( false ); - _statusBar->showMessage("Bereit. (Dummy-Treiber eingestellt)"); + onShowMessage("Ready. (Using dummy driver)"); setApplicationStyleSheet(cLightModeStyle); @@ -270,7 +270,7 @@ void BCMainWindow::onStartAnimation() void BCMainWindow::onDriverStateChanged( BCDriver::DriverState state, const QString& message ) { Q_UNUSED(state) - _statusBar->showMessage( message, 8000 ); + onShowMessage( message, 8000 ); } void BCMainWindow::onShowDevicePanel( BCDevice::ID deviceID ) @@ -318,7 +318,7 @@ void BCMainWindow::onValueUpdated(BCDevice::ID deviceID, int index, BCValue::Fla void BCMainWindow::onEndOfProcessing() { _syncButton->setEnabled( true ); - _statusBar->showMessage( "Synchronisation abgeschlossen.", 3000 ); + onShowMessage( "Synchronization complete."); } /** @@ -337,7 +337,7 @@ void BCMainWindow::onSyncDeviceView() _syncButton->setEnabled( false ); QString devName = _currentPanel->property( cBCKeyHeaderLabel ).toString(); - _statusBar->showMessage( "Lese: " + devName, 5000 ); + onShowMessage( "Reading: " + devName ); for( const BCValuePtr& value : currentList ) { diff --git a/bcmainwindow.h b/bcmainwindow.h index 57c61f2..a8c1399 100644 --- a/bcmainwindow.h +++ b/bcmainwindow.h @@ -65,7 +65,7 @@ public slots: void onEndOfProcessing(); void onSyncDeviceView(); - void onShowMessage( const QString& message, int timeOut=3000); + void onShowMessage( const QString& message, int timeOut=4000); void onStartAnimation(); signals: diff --git a/bcmainwindow.ui b/bcmainwindow.ui index 1bcdcc4..1884bc4 100644 --- a/bcmainwindow.ui +++ b/bcmainwindow.ui @@ -206,6 +206,9 @@ 64 + + Quit application. + Quit @@ -350,7 +353,7 @@ motor - Motoreinstellungen anzeigen und bearbeiten + Show and edit motor settings. @@ -365,7 +368,7 @@ battery - Batterieeinstellungen anzeigen und bearbeiten + Show and edit battery settings. @@ -380,7 +383,7 @@ console - Konseleneinstellungen anzeigen und bearbeiten + Show and edit console settings. @@ -395,7 +398,7 @@ connect - TinyCAN native Treiber laden + Load TinyCAN native driver. QAction::MenuRole::TextHeuristicRole @@ -410,10 +413,10 @@ sync - Einstellungen vom eBike synchroniseren + Synchronise with eBike settings. - QAction::MenuRole::NoRole + QAction::MenuRole::TextHeuristicRole diff --git a/bcthemeswitchbutton.cpp b/bcthemeswitchbutton.cpp index de571a9..31d237e 100644 --- a/bcthemeswitchbutton.cpp +++ b/bcthemeswitchbutton.cpp @@ -44,9 +44,6 @@ void BCThemeSwitchButton::toggleMode() void BCThemeSwitchButton::updateIcon() { - // Logik: - // Ist Dark Mode an? Zeige Mond (oder Sonne, je nach Geschmack). - // Hier: Zeige das Symbol des AKTUELLEN Modus. setText(_isDarkMode ? "🌙" : "☀️"); - setToolTip(_isDarkMode ? "Zum LightMode wechseln" : "Zum DarkMode wechseln"); + setToolTip(_isDarkMode ? "Use LightMode" : "Use DarkMode"); }