Linux multi-monitor fullscreen support
[ryzomcore.git] / studio / src / plugins / translation_manager / source_selection.cpp
blob043d82b3d8230a3bba014bb17f2dc8afc1d04f08
1 // Translation Manager Plugin - OVQT Plugin <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2011 Emanuel COSTEA <cemycc@gmail.com>
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2010 Winch Gate Property Limited
6 // Copyright (C) 2011 Dzmitry KAMIAHIN (dnk-88) <dnk-88@tut.by>
7 // Copyright (C) 2011 Matt RAYKOWSKI (sfb) <matt.raykowski@gmail.com>
8 //
9 // This program is free software: you can redistribute it and/or modify
10 // it under the terms of the GNU Affero General Public License as
11 // published by the Free Software Foundation, either version 3 of the
12 // License, or (at your option) any later version.
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU Affero General Public License for more details.
19 // You should have received a copy of the GNU Affero General Public License
20 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "source_selection.h"
24 #include <QtGui/QListWidget>
26 namespace TranslationManager
29 CSourceDialog::CSourceDialog(QWidget *parent): QDialog(parent)
31 _ui.setupUi(this);
33 connect(_ui.ok_button, SIGNAL(clicked()), this, SLOT(OkButtonClicked()));
34 connect(_ui.cancel_button, SIGNAL(clicked()), this, SLOT(reject()));
36 _ui.sourceSelectionListWidget->setSortingEnabled(false);
37 connect(_ui.sourceSelectionListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)),
38 this, SLOT(itemDoubleClicked(QListWidgetItem *)));
41 // Insert options in the source dialog. Options like: from FTP Server, from Local directory etc.
42 void CSourceDialog::setSourceOptions(std::map<QListWidgetItem *, int> &options)
44 std::map<QListWidgetItem *,int>::iterator it;
46 for(it = options.begin(); it != options.end(); ++it)
48 _ui.sourceSelectionListWidget->addItem((*it).first);
52 void CSourceDialog::OkButtonClicked()
54 selected_item = _ui.sourceSelectionListWidget->currentItem();
55 accept();
58 void CSourceDialog::itemDoubleClicked(QListWidgetItem *item)
60 selected_item = item;
61 accept();