add language selector also in the server GUI

This commit is contained in:
Volker Fischer 2020-07-06 19:31:42 +02:00
parent bb9b82d2be
commit 399f1da5a7
4 changed files with 31 additions and 4 deletions

View File

@ -21,7 +21,6 @@
TODO add support to change language (#297)
TODO add language selector also in the server GUI
TODO search in the code for "TODO maybe first try to find the complete string, if not found use only first two letters instead"
TODO bug fix: incorrect selection of UI language (#408) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!

View File

@ -334,6 +334,9 @@ lvwClients->setMinimumHeight ( 140 );
UpdateRecorderStatus ( QString::null );
// language combo box (corrects the setting if language not found)
cbxLanguage->Init ( pSettings->strLanguage );
// update GUI dependencies
UpdateGUIDependencies();
@ -397,6 +400,9 @@ lvwClients->setMinimumHeight ( 140 );
QObject::connect ( cbxCentServAddrType, static_cast<void (QComboBox::*) ( int )> ( &QComboBox::activated ),
this, &CServerDlg::OnCentServAddrTypeActivated );
QObject::connect ( cbxLanguage, &CLanguageComboBox::LanguageChanged,
this, &CServerDlg::OnLanguageChanged );
// push buttons
QObject::connect ( pbtRecordingDir, &QPushButton::released,
this, &CServerDlg::OnRecordingDirClicked );

View File

@ -117,6 +117,7 @@ public slots:
void keyPressEvent ( QKeyEvent *e ) // block escape key
{ if ( e->key() != Qt::Key_Escape ) QDialog::keyPressEvent ( e ); }
void OnLanguageChanged ( QString strLanguage ) { pSettings->strLanguage = strLanguage; }
void OnNewRecordingClicked() { pServer->RequestNewRecording(); }
void OnRecordingDirClicked();
void OnClearRecordingDirClicked();

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>588</width>
<height>419</height>
<height>447</height>
</rect>
</property>
<property name="windowTitle">
@ -186,8 +186,7 @@
</widget>
</item>
<item>
<widget class="QToolButton" name="tbtClearRecordingDir">
</widget>
<widget class="QToolButton" name="tbtClearRecordingDir"/>
</item>
</layout>
</item>
@ -223,6 +222,20 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="lblLanguage">
<property name="text">
<string>Language</string>
</property>
</widget>
</item>
<item>
<widget class="CLanguageComboBox" name="cbxLanguage"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<property name="spacing">
@ -270,6 +283,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>CLanguageComboBox</class>
<extends>QComboBox</extends>
<header>util.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>lvwClients</tabstop>
<tabstop>chbStartOnOSStart</tabstop>
@ -286,6 +306,7 @@
<tabstop>chbEnableRecorder</tabstop>
<tabstop>edtCurrentSessionDir</tabstop>
<tabstop>pbtNewRecording</tabstop>
<tabstop>cbxLanguage</tabstop>
</tabstops>
<resources>
<include location="resources.qrc"/>