change comment's and fix bug (xslt transform)
[mdictionary] / src / plugins / google / GoogleDialog.cpp
index 2810b0e..45bf724 100644 (file)
@@ -18,8 +18,8 @@
     Copyright 2010 Comarch S.A.
 
 *******************************************************************************/
-
-/*! \file GoogleSettingsDialog.cpp
+/*!
+    \file GoogleSettingsDialog.cpp
     \author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
 */
 
@@ -62,6 +62,10 @@ GoogleDialog::GoogleDialog(GooglePlugin *plugin,
 
 
 void GoogleDialog::initializeUI() {
+    int i=0,j=0;
+    int actualLangTo=0;
+    int actualLangFrom=0;
+
     setWindowTitle(tr("Google Plugin Settings"));
 
     langFromLabel = new QLabel(tr("From:"));
@@ -70,16 +74,14 @@ void GoogleDialog::initializeUI() {
     verticalLayout = new QVBoxLayout;
     setLayout(verticalLayout);
 
-
     langLayout = new QVBoxLayout;
     langsFormLayout = new QFormLayout;
     changeLangLayout = new QHBoxLayout;
 
-
     #ifdef Q_WS_MAEMO_5
         setMinimumHeight(370);
         changeLangButton=new QPushButton(
-                                 QIcon::fromTheme("general_refresh"), "");
+                QIcon::fromTheme("general_refresh"), "");
     #else
         changeLangButton=new QPushButton(
                 QIcon::fromTheme("object-flip-vertical"),"");
@@ -91,23 +93,16 @@ void GoogleDialog::initializeUI() {
                    tr("To: ") + _langTo);
     verticalLayout->addWidget(infoLabel);
 
-
     #ifdef Q_WS_MAEMO_5
         connectInfoLabel = new QLabel(tr("Google plugin makes use of Internet "
                                          "connection, so it may cost You."));
         connectInfoLabel->setWordWrap(true);
-
         verticalLayout->addWidget(connectInfoLabel);
     #endif
 
     langFromComboBox = new QComboBox;
     langToComboBox = new QComboBox;
 
-    int i=0;
-    int j=0;
-    int actualLangTo=0;
-    int actualLangFrom=0;
-
     foreach(QString langs, GooglePlugin::languages.keys()){
         if(langs==_langTo)
             actualLangTo=j;
@@ -127,7 +122,6 @@ void GoogleDialog::initializeUI() {
     langLayout->addLayout(langsFormLayout);
 
     langsFormLayout->addRow(langFromLabel, langFromComboBox);
-
     langsFormLayout->addRow(langToLabel, langToComboBox);
 
     changeLangLayout->addLayout(langLayout);
@@ -146,22 +140,22 @@ void GoogleDialog::initializeUI() {
     verticalLayout->addWidget(confirmButton);
 
     setModal(true);
-
     setMinimumSize(sizeHint());
     setMaximumSize(sizeHint());
 }
 
+
 void GoogleDialog::langFromChanged(int index) {
     _langFrom=langFromComboBox->itemText(index);
 }
 
+
 void GoogleDialog::langToChanged(int index) {
      _langTo=langToComboBox->itemText(index);
 }
 
-void GoogleDialog::changeLangButtonClicked() {
-    //int tempIndexTo=langToComboBox->currentIndex();
 
+void GoogleDialog::changeLangButtonClicked() {
     int indexTo=langToComboBox->findText(langFromComboBox->currentText());
     int indexFrom=langFromComboBox->findText(langToComboBox->currentText());
 
@@ -169,17 +163,15 @@ void GoogleDialog::changeLangButtonClicked() {
         langToComboBox->setCurrentIndex(indexTo);
         langFromComboBox->setCurrentIndex(indexFrom);
     }
-
-   // langToComboBox->setCurrentIndex(langFromComboBox->currentIndex());
-    //langFromComboBox->setCurrentIndex(tempIndexTo);
 }
 
+
 void GoogleDialog::accept() {
     saveSettings();
-
     QDialog::accept();
 }
 
+
 void GoogleDialog::saveSettings() {
     _settings = new Settings;
     if(plugin) {
@@ -193,6 +185,7 @@ void GoogleDialog::saveSettings() {
                         GooglePlugin::languages.value(_langFrom));
 }
 
+
 Settings* GoogleDialog::getSettings() {
     return _settings;
 }