Minor bugfixes
authorNikolay Tischenko <niktischenko@gmail.com>
Sun, 6 Mar 2011 10:09:08 +0000 (16:09 +0600)
committerNikolay Tischenko <niktischenko@gmail.com>
Sun, 6 Mar 2011 10:09:08 +0000 (16:09 +0600)
src/directoryview.cpp
src/mainwindow.cpp
src/playerform.cpp
src/resources/defaultcover.png
src/resources/someplayer_cn.ts
src/resources/someplayer_ru.ts
src/settingsform.cpp
src/settingsform.h
src/ui/settingsform.ui

index 8953d74..cc4bfdc 100644 (file)
@@ -297,6 +297,7 @@ void DirectoryView::portraitMode() {
 
 void DirectoryView::updateTranslations() {
        ui->retranslateUi(this);
+       homeScreen();
 }
 
 void DirectoryView::homeScreen() {
index 7e2ee18..9bdd86e 100644 (file)
@@ -432,10 +432,13 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
                return QObject::eventFilter(obj, event);
        }
        QKeyEvent *keyEvent = (QKeyEvent *) event;
+       int mod = keyEvent->modifiers();
 
        switch (keyEvent->key()) {
        case Qt::Key_Space:
-               _player_form->toggle();
+               if ((mod & Qt::ControlModifier) == 0) {
+                       _player_form->toggle();
+               }
                break;
        case Qt::Key_Enter:
                // TODO
@@ -446,12 +449,9 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
        case Qt::Key_Left:
                _player_form->prev();
                break;
-       case Qt::Key_S:
+       case Qt::Key_T:
                _player_form->stop();
                break;
-       case Qt::Key_F:
-               _fullscreen(!isFullScreen());
-               break;
        case Qt::Key_R:
                _player_form->toggleRandom();
                break;
@@ -467,7 +467,7 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
        case Qt::Key_E:
                _player_form->toggleRepeat();
                break;
-       case Qt::Key_Control:
+       case Qt::Key_S:
                _player_form->toggleToolsWidget();
                break;
        default:
index 0b9a81b..4ad3114 100644 (file)
@@ -600,6 +600,9 @@ void PlayerForm::portraitMode() {
 }
 
 void PlayerForm::toggleToolsWidget() {
+       if (0 != ui->stackedWidget->currentIndex()) {
+               return;
+       }
        if (_tools_widget->isVisible()) {
                ui->moreButton->setIcon(QIcon(":/icons/"+_icons_theme+"/more.png"));
                _tools_widget->hide();
index eb64ff2..b3de942 100644 (file)
Binary files a/src/resources/defaultcover.png and b/src/resources/defaultcover.png differ
index 4acd3b7..115f8d1 100644 (file)
@@ -518,7 +518,7 @@ MrClon (maemoworld.ru)&lt;br /&gt;hxka (maemoworld.ru)&lt;br /&gt;jerich0 (maemo
     </message>
     <message>
         <source>red</source>
-        <translation>红色</translation>
+        <translation type="obsolete">红色</translation>
     </message>
     <message>
         <source>Auto</source>
@@ -526,11 +526,11 @@ MrClon (maemoworld.ru)&lt;br /&gt;hxka (maemoworld.ru)&lt;br /&gt;jerich0 (maemo
     </message>
     <message>
         <source>blue</source>
-        <translation>蓝色</translation>
+        <translation type="obsolete">蓝色</translation>
     </message>
     <message>
         <source>dark</source>
-        <translation>深色</translation>
+        <translation type="obsolete">深色</translation>
     </message>
     <message>
         <source>Black</source>
@@ -542,15 +542,15 @@ MrClon (maemoworld.ru)&lt;br /&gt;hxka (maemoworld.ru)&lt;br /&gt;jerich0 (maemo
     </message>
     <message>
         <source>black</source>
-        <translation>黑色</translation>
+        <translation type="obsolete">黑色</translation>
     </message>
     <message>
         <source>light</source>
-        <translation>浅色</translation>
+        <translation type="obsolete">浅色</translation>
     </message>
     <message>
         <source>white</source>
-        <translation>白色</translation>
+        <translation type="obsolete">白色</translation>
     </message>
     <message>
         <source>Show track lenght in library view:</source>
@@ -566,7 +566,7 @@ MrClon (maemoworld.ru)&lt;br /&gt;hxka (maemoworld.ru)&lt;br /&gt;jerich0 (maemo
     </message>
     <message>
         <source>magenta</source>
-        <translation>品红</translation>
+        <translation type="obsolete">品红</translation>
     </message>
     <message>
         <source>Zoom keys control:</source>
@@ -610,7 +610,7 @@ MrClon (maemoworld.ru)&lt;br /&gt;hxka (maemoworld.ru)&lt;br /&gt;jerich0 (maemo
     </message>
     <message>
         <source>yellow</source>
-        <translation>黄色</translation>
+        <translation type="obsolete">黄色</translation>
     </message>
     <message>
         <source>Use FMTX</source>
@@ -652,6 +652,30 @@ MrClon (maemoworld.ru)&lt;br /&gt;hxka (maemoworld.ru)&lt;br /&gt;jerich0 (maemo
         <source>Chinese</source>
         <translation>Chinese</translation>
     </message>
+    <message>
+        <source>Blue</source>
+        <translation>蓝色</translation>
+    </message>
+    <message>
+        <source>Magenta</source>
+        <translation>品红</translation>
+    </message>
+    <message>
+        <source>Red</source>
+        <translation>红色</translation>
+    </message>
+    <message>
+        <source>Yellow</source>
+        <translation>黄色</translation>
+    </message>
+    <message>
+        <source>Light</source>
+        <translation>浅色</translation>
+    </message>
+    <message>
+        <source>Dark</source>
+        <translation>深色</translation>
+    </message>
 </context>
 <context>
     <name>TimerDialog</name>
index b8494ee..f137d11 100644 (file)
@@ -58,12 +58,12 @@ MrClon (maemoworld.ru)&lt;br /&gt;hxka (maemoworld.ru)&lt;br /&gt;jerich0 (maemo
         <translation>Аудиоклипы</translation>
     </message>
     <message>
-        <location filename="../directoryview.cpp" line="309"/>
+        <location filename="../directoryview.cpp" line="310"/>
         <source>Inner memory</source>
         <translation>Внутренняя память</translation>
     </message>
     <message>
-        <location filename="../directoryview.cpp" line="311"/>
+        <location filename="../directoryview.cpp" line="312"/>
         <source>Memory card</source>
         <translation>Карта памяти</translation>
     </message>
@@ -545,13 +545,13 @@ MrClon (maemoworld.ru)&lt;br /&gt;hxka (maemoworld.ru)&lt;br /&gt;jerich0 (maemo
     </message>
     <message>
         <location filename="../playerform.cpp" line="91"/>
-        <location filename="../playerform.cpp" line="771"/>
+        <location filename="../playerform.cpp" line="774"/>
         <source>Clear playlist</source>
         <translation>Очистить плейлист</translation>
     </message>
     <message>
         <location filename="../playerform.cpp" line="92"/>
-        <location filename="../playerform.cpp" line="772"/>
+        <location filename="../playerform.cpp" line="775"/>
         <source>Delete</source>
         <translation>Удалить</translation>
     </message>
@@ -559,25 +559,25 @@ MrClon (maemoworld.ru)&lt;br /&gt;hxka (maemoworld.ru)&lt;br /&gt;jerich0 (maemo
         <location filename="../playerform.cpp" line="93"/>
         <location filename="../playerform.cpp" line="239"/>
         <location filename="../playerform.cpp" line="279"/>
-        <location filename="../playerform.cpp" line="773"/>
+        <location filename="../playerform.cpp" line="776"/>
         <source>Add to favorites</source>
         <translation>В избранное</translation>
     </message>
     <message>
         <location filename="../playerform.cpp" line="94"/>
-        <location filename="../playerform.cpp" line="774"/>
+        <location filename="../playerform.cpp" line="777"/>
         <source>Enqueue</source>
         <translation>В очередь</translation>
     </message>
     <message>
         <location filename="../playerform.cpp" line="95"/>
-        <location filename="../playerform.cpp" line="775"/>
+        <location filename="../playerform.cpp" line="778"/>
         <source>Add to playlists</source>
         <translation>Добавить в плейлисты</translation>
     </message>
     <message>
         <location filename="../playerform.cpp" line="96"/>
-        <location filename="../playerform.cpp" line="776"/>
+        <location filename="../playerform.cpp" line="779"/>
         <source>Edit tags</source>
         <translation>Редактировать теги</translation>
     </message>
@@ -634,7 +634,7 @@ MrClon (maemoworld.ru)&lt;br /&gt;hxka (maemoworld.ru)&lt;br /&gt;jerich0 (maemo
     <name>SettingsForm</name>
     <message>
         <location filename="../ui/settingsform.ui" line="14"/>
-        <location filename="../ui/settingsform.ui" line="713"/>
+        <location filename="../ui/settingsform.ui" line="661"/>
         <source>Settings</source>
         <translation>Настройки</translation>
     </message>
@@ -655,11 +655,13 @@ MrClon (maemoworld.ru)&lt;br /&gt;hxka (maemoworld.ru)&lt;br /&gt;jerich0 (maemo
     </message>
     <message>
         <location filename="../ui/settingsform.ui" line="129"/>
+        <location filename="../ui/settingsform.ui" line="235"/>
         <source>White</source>
         <translation>Белые</translation>
     </message>
     <message>
         <location filename="../ui/settingsform.ui" line="136"/>
+        <location filename="../ui/settingsform.ui" line="240"/>
         <source>Black</source>
         <translation>Чёрные</translation>
     </message>
@@ -670,15 +672,15 @@ MrClon (maemoworld.ru)&lt;br /&gt;hxka (maemoworld.ru)&lt;br /&gt;jerich0 (maemo
     </message>
     <message>
         <location filename="../ui/settingsform.ui" line="174"/>
-        <location filename="../ui/settingsform.ui" line="530"/>
-        <location filename="../ui/settingsform.ui" line="617"/>
+        <location filename="../ui/settingsform.ui" line="478"/>
+        <location filename="../ui/settingsform.ui" line="565"/>
         <source>Yes</source>
         <translation>Да</translation>
     </message>
     <message>
         <location filename="../ui/settingsform.ui" line="181"/>
-        <location filename="../ui/settingsform.ui" line="537"/>
-        <location filename="../ui/settingsform.ui" line="624"/>
+        <location filename="../ui/settingsform.ui" line="485"/>
+        <location filename="../ui/settingsform.ui" line="572"/>
         <source>No</source>
         <translation>Нет</translation>
     </message>
@@ -688,92 +690,114 @@ MrClon (maemoworld.ru)&lt;br /&gt;hxka (maemoworld.ru)&lt;br /&gt;jerich0 (maemo
         <translation>Цвет текущего трека:</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="222"/>
+        <location filename="../ui/settingsform.ui" line="215"/>
+        <source>Blue</source>
+        <translation>Голубой</translation>
+    </message>
+    <message>
+        <location filename="../ui/settingsform.ui" line="220"/>
+        <source>Magenta</source>
+        <translation>Фиолетовый</translation>
+    </message>
+    <message>
+        <location filename="../ui/settingsform.ui" line="225"/>
+        <source>Red</source>
+        <translation>Красный</translation>
+    </message>
+    <message>
+        <location filename="../ui/settingsform.ui" line="230"/>
+        <source>Yellow</source>
+        <translation>Жёлтый</translation>
+    </message>
+    <message>
+        <location filename="../ui/settingsform.ui" line="245"/>
+        <source>Light</source>
+        <translation>Светлый</translation>
+    </message>
+    <message>
+        <location filename="../ui/settingsform.ui" line="250"/>
+        <source>Dark</source>
+        <translation>Тёмный</translation>
+    </message>
+    <message>
         <source>blue</source>
-        <translation>голубой</translation>
+        <translation type="obsolete">голубой</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="232"/>
         <source>magenta</source>
-        <translation>фиолетовый</translation>
+        <translation type="obsolete">фиолетовый</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="242"/>
         <source>red</source>
-        <translation>красный</translation>
+        <translation type="obsolete">красный</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="252"/>
         <source>yellow</source>
-        <translation>жёлтый</translation>
+        <translation type="obsolete">жёлтый</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="262"/>
         <source>white</source>
-        <translation>белый</translation>
+        <translation type="obsolete">белый</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="272"/>
         <source>black</source>
-        <translation>чёрный</translation>
+        <translation type="obsolete">чёрный</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="282"/>
         <source>light</source>
-        <translation>светлый</translation>
+        <translation type="obsolete">светлый</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="292"/>
         <source>dark</source>
-        <translation>тёмный</translation>
+        <translation type="obsolete">тёмный</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="396"/>
+        <location filename="../ui/settingsform.ui" line="345"/>
         <source>Chinese</source>
         <translation>Китайский</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="459"/>
+        <location filename="../ui/settingsform.ui" line="407"/>
         <source>Sort album:</source>
         <translation>Сортировка альбомов:</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="485"/>
+        <location filename="../ui/settingsform.ui" line="433"/>
         <source>Alphabetical</source>
         <translation>По алфавиту</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="492"/>
+        <location filename="../ui/settingsform.ui" line="440"/>
         <source>By date</source>
         <translation>По дате</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="636"/>
+        <location filename="../ui/settingsform.ui" line="584"/>
         <source>Use hardware keys</source>
         <translation>Аппаратные кнопки</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="657"/>
+        <location filename="../ui/settingsform.ui" line="605"/>
         <source>Zoom keys control:</source>
         <translation>«Качелька» управляет:</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="666"/>
+        <location filename="../ui/settingsform.ui" line="614"/>
         <source>Volume</source>
         <translation>Звуком</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="673"/>
+        <location filename="../ui/settingsform.ui" line="621"/>
         <source>Tracks</source>
         <translation>Треками</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="685"/>
+        <location filename="../ui/settingsform.ui" line="633"/>
         <source>Use FMTX</source>
         <translation>Включить FMTX</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="304"/>
+        <location filename="../ui/settingsform.ui" line="261"/>
         <source>Orientation:</source>
         <translation>Ориентация:</translation>
     </message>
@@ -783,42 +807,42 @@ MrClon (maemoworld.ru)&lt;br /&gt;hxka (maemoworld.ru)&lt;br /&gt;jerich0 (maemo
         <translation>Система</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="330"/>
+        <location filename="../ui/settingsform.ui" line="287"/>
         <source>Landscape</source>
         <translation>Ландшафтный</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="337"/>
+        <location filename="../ui/settingsform.ui" line="294"/>
         <source>Portrait</source>
         <translation>Портретный</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="344"/>
+        <location filename="../ui/settingsform.ui" line="301"/>
         <source>Auto</source>
         <translation>Авто</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="504"/>
+        <location filename="../ui/settingsform.ui" line="452"/>
         <source>Show track lenght in library view:</source>
         <translation>Показывать длину трека:</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="356"/>
+        <location filename="../ui/settingsform.ui" line="313"/>
         <source>Language:</source>
         <translation>Язык:</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="382"/>
+        <location filename="../ui/settingsform.ui" line="335"/>
         <source>English</source>
         <translation>Английский</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="389"/>
+        <location filename="../ui/settingsform.ui" line="340"/>
         <source>Russian</source>
         <translation>Русский</translation>
     </message>
     <message>
-        <location filename="../ui/settingsform.ui" line="597"/>
+        <location filename="../ui/settingsform.ui" line="545"/>
         <source>Pause when headphones unplugged:</source>
         <translation>Пауза при отключении наушников:</translation>
     </message>
index 0e33687..530ed28 100644 (file)
@@ -33,6 +33,11 @@ SettingsForm::SettingsForm(QWidget *parent) :
 {
        ui->setupUi(this);
        Config config;
+
+       _color_map << "blue" << "magenta" << "red" << "yellow" <<
+                       "white" << "black" << "light" << "dark";
+       _lang_map << "en" << "ru" << "cn";
+
        QString albumSorting = config.getValue("ui/albumsorting").toString();
        QString showTrackLenght = config.getValue("ui/showtracklenght").toString();
        QString orientation = config.getValue("ui/orientation").toString();
@@ -45,8 +50,8 @@ SettingsForm::SettingsForm(QWidget *parent) :
        ui->orientationLButton->setChecked(true);
        ui->iconsWButton->setChecked(true);
        ui->gradientYButton->setChecked(true);
-       ui->engLangButton->setChecked(true);
-       ui->cBlueButton->setChecked(true);
+       ui->langComboBox->setCurrentIndex(_lang_map.indexOf(language));
+       ui->colorComboBox->setCurrentIndex(_color_map.indexOf(track_color));
        ui->pauseHPNoButton->setChecked(true);
        ui->hwKeysBox->setChecked(false);
        ui->hwkeysLabel->setEnabled(false);
@@ -70,27 +75,6 @@ SettingsForm::SettingsForm(QWidget *parent) :
        if (gradient == "no") {
                ui->gradientNButton->setChecked(true);
        }
-       if (language == "ru") {
-               ui->ruLangButton->setChecked(true);
-       }
-       if (language == "cn") {
-               ui->cnLangButton->setChecked(true);
-       }
-       if (track_color == "black") {
-               ui->cBlackButton->setChecked(true);
-       } else if (track_color == "magenta") {
-               ui->cMagentaButton->setChecked(true);
-       } else if (track_color == "Red") {
-               ui->cRedButton->setChecked(true);
-       } else if (track_color == "yellow") {
-               ui->cYellowButton->setChecked(true);
-       } else if (track_color == "white") {
-               ui->cWhiteButton->setChecked(true);
-       } else if (track_color == "dark") {
-               ui->cDarkButton->setChecked(true);
-       } else if (track_color == "light") {
-               ui->cLightButton->setChecked(true);
-       }
        if (config.getValue("hw/hpautopause").toString() == "yes") {
                ui->pauseHPYesButton->setChecked(true);
        }
@@ -127,17 +111,6 @@ SettingsForm::SettingsForm(QWidget *parent) :
        connect (ui->iconsWButton, SIGNAL(toggled(bool)), this, SLOT(_set_icons_white(bool)));
        connect (ui->gradientNButton, SIGNAL(toggled(bool)), this, SLOT(_set_gradient_no(bool)));
        connect (ui->gradientYButton, SIGNAL(toggled(bool)), this, SLOT(_set_gradient_yes(bool)));
-       connect (ui->engLangButton, SIGNAL(toggled(bool)), this, SLOT(_set_lang_en(bool)));
-       connect (ui->ruLangButton, SIGNAL(toggled(bool)), this, SLOT(_set_lang_ru(bool)));
-       connect (ui->cnLangButton, SIGNAL(toggled(bool)), this, SLOT(_set_lang_cn(bool)));
-       connect (ui->cBlackButton, SIGNAL(toggled(bool)), this, SLOT(_set_color_black(bool)));
-       connect (ui->cBlueButton, SIGNAL(toggled(bool)), this, SLOT(_set_color_blue(bool)));
-       connect (ui->cDarkButton, SIGNAL(toggled(bool)), this, SLOT(_set_color_dark(bool)));
-       connect (ui->cLightButton, SIGNAL(toggled(bool)), this, SLOT(_set_color_light(bool)));
-       connect (ui->cMagentaButton, SIGNAL(toggled(bool)), this, SLOT(_set_color_magenta(bool)));
-       connect (ui->cRedButton, SIGNAL(toggled(bool)), this, SLOT(_set_color_red(bool)));
-       connect (ui->cWhiteButton, SIGNAL(toggled(bool)), this, SLOT(_set_color_white(bool)));
-       connect (ui->cYellowButton, SIGNAL(toggled(bool)), this, SLOT(_set_color_yellow(bool)));
        connect (ui->pauseHPNoButton, SIGNAL(toggled(bool)), this, SLOT(_set_pause_hp_no(bool)));
        connect (ui->pauseHPYesButton, SIGNAL(toggled(bool)), this, SLOT(_set_pause_hp_yes(bool)));
        connect (ui->hwKeysBox, SIGNAL(toggled(bool)), this, SLOT(_toggle_hw_settings(bool)));
@@ -148,6 +121,8 @@ SettingsForm::SettingsForm(QWidget *parent) :
        connect (ui->libraryButton, SIGNAL(clicked()), this, SLOT(_toggle_view_lib()));
        connect (ui->fmtxSettingsButton, SIGNAL(clicked()), this, SLOT(_open_fmtx_settings()));
        connect (ui->fmtxGroupBox, SIGNAL(toggled(bool)), this, SLOT(_toggle_fmtx_settings(bool)));
+       connect (ui->colorComboBox, SIGNAL(activated(int)), this, SLOT(_set_color(int)));
+       connect (ui->langComboBox, SIGNAL(activated(int)), this, SLOT(_set_language(int)));
        _toggle_view_ui();
        setAttribute(Qt::WA_Maemo5StackedWindow);
        setWindowFlags(Qt::Window | windowFlags());
@@ -235,80 +210,15 @@ void SettingsForm::_set_gradient_yes(bool checked) {
        emit gradientChanged();
 }
 
-void SettingsForm::_set_color_black(bool checked) {
-       if (!checked) return;
-       Config config;
-       config.setValue("ui/trackcolor", "black");
-       emit trackColorChanged();
-}
-
-void SettingsForm::_set_color_blue(bool checked) {
-       if (!checked) return;
-       Config config;
-       config.setValue("ui/trackcolor", "blue");
-       emit trackColorChanged();
-}
-
-void SettingsForm::_set_color_dark(bool checked) {
-       if (!checked) return;
-       Config config;
-       config.setValue("ui/trackcolor", "dark");
-       emit trackColorChanged();
-}
-
-void SettingsForm::_set_color_light(bool checked) {
-       if (!checked) return;
-       Config config;
-       config.setValue("ui/trackcolor", "light");
-       emit trackColorChanged();
-}
-
-void SettingsForm::_set_color_magenta(bool checked) {
-       if (!checked) return;
+void SettingsForm::_set_color(int code) {
        Config config;
-       config.setValue("ui/trackcolor", "magenta");
+       config.setValue("ui/trackcolor", _color_map[code]);
        emit trackColorChanged();
 }
 
-void SettingsForm::_set_color_red(bool checked) {
-       if (!checked) return;
+void SettingsForm::_set_language(int code) {
        Config config;
-       config.setValue("ui/trackcolor", "red");
-       emit trackColorChanged();
-}
-
-void SettingsForm::_set_color_white(bool checked) {
-       if (!checked) return;
-       Config config;
-       config.setValue("ui/trackcolor", "white");
-       emit trackColorChanged();
-}
-
-void SettingsForm::_set_color_yellow(bool checked) {
-       if (!checked) return;
-       Config config;
-       config.setValue("ui/trackcolor", "yellow");
-       emit trackColorChanged();
-}
-
-void SettingsForm::_set_lang_en(bool checked) {
-       if (!checked) return;
-       Config config;
-       config.setValue("ui/language", "en");
-       emit translationChanged();
-}
-
-void SettingsForm::_set_lang_ru(bool checked) {
-       if (!checked) return;
-       Config config;
-       config.setValue("ui/language", "ru");
-       emit translationChanged();
-}
-
-void SettingsForm::_set_lang_cn(bool checked) {
-       if (!checked) return;
-       Config config;
-       config.setValue("ui/language", "cn");
+       config.setValue("ui/language", _lang_map[code]);
        emit translationChanged();
 }
 
@@ -367,27 +277,13 @@ void SettingsForm::_toggle_view_hw() {
 }
 
 void SettingsForm::updateTranslations() {
+       Config config;
        ui->retranslateUi(this);
+       ui->langComboBox->setCurrentIndex(_lang_map.indexOf(config.getValue("ui/language").toString()));
+       ui->colorComboBox->setCurrentIndex(_color_map.indexOf(config.getValue("ui/trackcolor").toString()));
 }
 
 void SettingsForm::landscapeMode() {
-       ui->cButtonsLayout->removeWidget(ui->cBlueButton);
-       ui->cButtonsLayout->removeWidget(ui->cMagentaButton);
-       ui->cButtonsLayout->removeWidget(ui->cRedButton);
-       ui->cButtonsLayout->removeWidget(ui->cYellowButton);
-       ui->cButtonsLayout->removeWidget(ui->cWhiteButton);
-       ui->cButtonsLayout->removeWidget(ui->cBlackButton);
-       ui->cButtonsLayout->removeWidget(ui->cLightButton);
-       ui->cButtonsLayout->removeWidget(ui->cDarkButton);
-       ui->cButtonsLayout->addWidget(ui->cBlueButton, 0, 0);
-       ui->cButtonsLayout->addWidget(ui->cMagentaButton, 0, 1);
-       ui->cButtonsLayout->addWidget(ui->cRedButton, 0, 2);
-       ui->cButtonsLayout->addWidget(ui->cYellowButton, 0, 3);
-       ui->cButtonsLayout->addWidget(ui->cWhiteButton, 1, 0);
-       ui->cButtonsLayout->addWidget(ui->cBlackButton, 1, 1);
-       ui->cButtonsLayout->addWidget(ui->cLightButton, 1, 2);
-       ui->cButtonsLayout->addWidget(ui->cDarkButton, 1, 3);
-
        ui->orientationGridLayout->removeWidget(ui->orientationAButton);
        ui->orientationGridLayout->removeWidget(ui->orientationLButton);
        ui->orientationGridLayout->removeWidget(ui->orientationPButton);
@@ -397,23 +293,6 @@ void SettingsForm::landscapeMode() {
 }
 
 void SettingsForm::portraitMode() {
-       ui->cButtonsLayout->removeWidget(ui->cBlueButton);
-       ui->cButtonsLayout->removeWidget(ui->cMagentaButton);
-       ui->cButtonsLayout->removeWidget(ui->cRedButton);
-       ui->cButtonsLayout->removeWidget(ui->cYellowButton);
-       ui->cButtonsLayout->removeWidget(ui->cWhiteButton);
-       ui->cButtonsLayout->removeWidget(ui->cBlackButton);
-       ui->cButtonsLayout->removeWidget(ui->cLightButton);
-       ui->cButtonsLayout->removeWidget(ui->cDarkButton);
-       ui->cButtonsLayout->addWidget(ui->cBlueButton, 0, 0);
-       ui->cButtonsLayout->addWidget(ui->cMagentaButton, 0, 1);
-       ui->cButtonsLayout->addWidget(ui->cRedButton, 1, 0);
-       ui->cButtonsLayout->addWidget(ui->cYellowButton, 1, 1);
-       ui->cButtonsLayout->addWidget(ui->cWhiteButton, 2, 0);
-       ui->cButtonsLayout->addWidget(ui->cBlackButton, 2, 1);
-       ui->cButtonsLayout->addWidget(ui->cLightButton, 3, 0);
-       ui->cButtonsLayout->addWidget(ui->cDarkButton, 3, 1);
-
        ui->orientationGridLayout->removeWidget(ui->orientationAButton);
        ui->orientationGridLayout->removeWidget(ui->orientationLButton);
        ui->orientationGridLayout->removeWidget(ui->orientationPButton);
index 1354abe..fafe48e 100644 (file)
@@ -52,6 +52,8 @@ signals:
 
 private:
        Ui::SettingsForm *ui;
+       QStringList _color_map;
+       QStringList _lang_map;
 
 private slots:
        void _set_album_sorting_alphabet(bool);
@@ -65,17 +67,6 @@ private slots:
        void _set_icons_black(bool);
        void _set_gradient_yes(bool);
        void _set_gradient_no(bool);
-       void _set_lang_en(bool);
-       void _set_lang_ru(bool);
-       void _set_lang_cn(bool);
-       void _set_color_blue(bool);
-       void _set_color_magenta(bool);
-       void _set_color_red(bool);
-       void _set_color_yellow(bool);
-       void _set_color_white(bool);
-       void _set_color_black(bool);
-       void _set_color_light(bool);
-       void _set_color_dark(bool);
        void _set_pause_hp_yes(bool);
        void _set_pause_hp_no(bool);
        void _toggle_hw_settings(bool);
@@ -86,6 +77,8 @@ private slots:
        void _toggle_view_hw();
        void _open_fmtx_settings();
        void _toggle_fmtx_settings(bool);
+       void _set_color(int);
+       void _set_language(int);
 };
 
 #endif // SETTINGSFORM_H
index ee092eb..2b8eb55 100644 (file)
                <number>0</number>
               </property>
               <item>
-               <layout class="QGridLayout" name="cButtonsLayout" rowstretch="0,0">
-                <property name="spacing">
-                 <number>0</number>
-                </property>
-                <item row="0" column="0">
-                 <widget class="QRadioButton" name="cBlueButton">
-                  <property name="styleSheet">
-                   <string notr="true">color: rgb(100, 150, 220)</string>
-                  </property>
-                  <property name="text">
-                   <string>blue</string>
-                  </property>
-                 </widget>
+               <widget class="QComboBox" name="colorComboBox">
+                <item>
+                 <property name="text">
+                  <string>Blue</string>
+                 </property>
                 </item>
-                <item row="0" column="1">
-                 <widget class="QRadioButton" name="cMagentaButton">
-                  <property name="styleSheet">
-                   <string notr="true">color: rgb(150, 80, 150);</string>
-                  </property>
-                  <property name="text">
-                   <string>magenta</string>
-                  </property>
-                 </widget>
+                <item>
+                 <property name="text">
+                  <string>Magenta</string>
+                 </property>
                 </item>
-                <item row="0" column="2">
-                 <widget class="QRadioButton" name="cRedButton">
-                  <property name="styleSheet">
-                   <string notr="true">color: rgb(220, 100, 100);</string>
-                  </property>
-                  <property name="text">
-                   <string>red</string>
-                  </property>
-                 </widget>
+                <item>
+                 <property name="text">
+                  <string>Red</string>
+                 </property>
                 </item>
-                <item row="0" column="3">
-                 <widget class="QRadioButton" name="cYellowButton">
-                  <property name="styleSheet">
-                   <string notr="true">color: rgb(220, 220, 100);</string>
-                  </property>
-                  <property name="text">
-                   <string>yellow</string>
-                  </property>
-                 </widget>
+                <item>
+                 <property name="text">
+                  <string>Yellow</string>
+                 </property>
                 </item>
-                <item row="1" column="0">
-                 <widget class="QRadioButton" name="cWhiteButton">
-                  <property name="styleSheet">
-                   <string notr="true">color: rgb(255, 255, 255);</string>
-                  </property>
-                  <property name="text">
-                   <string>white</string>
-                  </property>
-                 </widget>
+                <item>
+                 <property name="text">
+                  <string>White</string>
+                 </property>
                 </item>
-                <item row="1" column="1">
-                 <widget class="QRadioButton" name="cBlackButton">
-                  <property name="styleSheet">
-                   <string notr="true">color: rgb(0,0,0);</string>
-                  </property>
-                  <property name="text">
-                   <string>black</string>
-                  </property>
-                 </widget>
+                <item>
+                 <property name="text">
+                  <string>Black</string>
+                 </property>
                 </item>
-                <item row="1" column="2">
-                 <widget class="QRadioButton" name="cLightButton">
-                  <property name="styleSheet">
-                   <string notr="true">color: rgb(200, 200, 200);</string>
-                  </property>
-                  <property name="text">
-                   <string>light</string>
-                  </property>
-                 </widget>
+                <item>
+                 <property name="text">
+                  <string>Light</string>
+                 </property>
                 </item>
-                <item row="1" column="3">
-                 <widget class="QRadioButton" name="cDarkButton">
-                  <property name="styleSheet">
-                   <string notr="true">color: rgb(70, 70, 70);</string>
-                  </property>
-                  <property name="text">
-                   <string>dark</string>
-                  </property>
-                 </widget>
+                <item>
+                 <property name="text">
+                  <string>Dark</string>
+                 </property>
                 </item>
-               </layout>
+               </widget>
               </item>
              </layout>
             </widget>
                <number>0</number>
               </property>
               <item>
-               <layout class="QHBoxLayout" name="horizontalLayout_7">
-                <property name="spacing">
-                 <number>0</number>
-                </property>
+               <widget class="QComboBox" name="langComboBox">
                 <item>
-                 <widget class="QRadioButton" name="engLangButton">
-                  <property name="text">
-                   <string>English</string>
-                  </property>
-                 </widget>
+                 <property name="text">
+                  <string>English</string>
+                 </property>
                 </item>
                 <item>
-                 <widget class="QRadioButton" name="ruLangButton">
-                  <property name="text">
-                   <string>Russian</string>
-                  </property>
-                 </widget>
+                 <property name="text">
+                  <string>Russian</string>
+                 </property>
                 </item>
                 <item>
-                 <widget class="QRadioButton" name="cnLangButton">
-                  <property name="text">
-                   <string>Chinese</string>
-                  </property>
-                 </widget>
+                 <property name="text">
+                  <string>Chinese</string>
+                 </property>
                 </item>
-               </layout>
+               </widget>
               </item>
               <item>
                <spacer name="verticalSpacer">