Segregated translations files in different packages
authorNikolay Tischenko <niktischenko@gmail.com>
Fri, 12 Nov 2010 16:46:46 +0000 (22:46 +0600)
committerNikolay Tischenko <niktischenko@gmail.com>
Fri, 12 Nov 2010 16:46:46 +0000 (22:46 +0600)
src/settingsform.cpp
src/someplayer.h
src/ui/settingsform.ui

index d8dbd18..dde85ef 100644 (file)
@@ -21,6 +21,8 @@
 #include "settingsform.h"
 #include "ui_settingsform.h"
 #include <QDebug>
+#include <QFile>
+#include "someplayer.h"
 
 using namespace SomePlayer::Storage;
 
@@ -79,6 +81,9 @@ SettingsForm::SettingsForm(QWidget *parent) :
        } else if (track_color == "light") {
                ui->cLightButton->setChecked(true);
        }
+       if (!QFile::exists(QString(_APPLICATION_PATH_)+"/someplayer_ru.qm")) {
+               ui->langBox->hide();
+       } // refactor this when more translations will be added
        connect (ui->albumsSortAButton, SIGNAL(toggled(bool)), this, SLOT(_set_album_sorting_alphabet(bool)));
        connect (ui->albumsSortDButton, SIGNAL(toggled(bool)), this, SLOT(_set_album_sorting_date(bool)));
        connect (ui->showTrackLenghtNButton, SIGNAL(toggled(bool)), this, SLOT(_set_track_lenght_show_no(bool)));
index 97b573a..4f9c485 100644 (file)
@@ -52,4 +52,6 @@ namespace SomePlayer {
 
 #define _SERVICE_NAME_ "ru.somebody.someplayer"
 
+#define _APPLICATION_PATH_ "/opt/someplayer"
+
 #endif
index 1aec66e..4ac5d69 100644 (file)
@@ -32,7 +32,7 @@
       <property name="geometry">
        <rect>
         <x>0</x>
-        <y>-34</y>
+        <y>-47</y>
         <width>780</width>
         <height>403</height>
        </rect>
         </widget>
        </item>
        <item>
-        <widget class="QGroupBox" name="groupBox_5">
+        <widget class="QGroupBox" name="langBox">
          <property name="title">
           <string/>
          </property>