1 /*******************************************************************************
3 This file is part of mDictionary.
5 mDictionary is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 mDictionary is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with mDictionary. If not, see <http://www.gnu.org/licenses/>.
18 Copyright 2010 Comarch S.A.
20 *******************************************************************************/
22 /*! \file GoogleSettingsDialog.h
23 \brief Class creates dialog to get or change settings for Google Plugin
24 \author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
27 #ifndef GOOGLESETTINGSDIALOG_H
28 #define GOOGLESETTINGSDIALOG_H
31 #include "../../include/settings.h"
33 #include "GooglePlugin.h"
37 class GoogleSettingsDialog : public QDialog
41 explicit GoogleSettingsDialog(QWidget *parent = 0,
42 Settings *pluginSettings=0,
43 QString acceptButtonLabel = tr("Add"));
46 \param parent parent widget on which dialog will be displayed
47 \param langTo language which is displayed in the comboBox as a startup item
48 \param langFrom language which is displayed in the comboBox as a startup item
49 \returns function returns settings to GooglePlugin
51 static Settings* getSettings(QWidget *parent,
52 Settings *pluginSettings=0,
53 QString acceptButtonLabel = tr("Add"));
55 function sets a new settings in plugin;
56 \param plugin plugin whose settings you will change
57 \param parent parent widget on which dialog will be displayed
59 static void changeSettings(GooglePlugin* plugin, QWidget *parent);
61 //! \return source language code iso 639-2
64 //! \return destination language code iso 639-2
68 //! assigns the language chosen from a list(langFromComboBox) to _langFrom
69 void activatedFrom(int);
70 //! assigns the language chosen from a list(langToComboBox) to _langTo
71 void activatedTo(int);
72 //! handles the "swap languages" button
73 void changeLangButtonClicked();
78 QLabel* langFromLabel;
80 QLabel* connectInfoLabel;
81 QPushButton* saveButton;
82 QPushButton* changeLangButton;
83 QComboBox *langFromComboBox;
84 QComboBox *langToComboBox;
85 QVBoxLayout* verticalLayout;
86 QVBoxLayout* langLayout;
87 QHBoxLayout* langFromLayout;
88 QHBoxLayout* langToLayout;
89 QHBoxLayout* changelangLayout;
94 #endif // GOOGLESETTINGSDIALOG_H