From 76b8fbad674d015dedb119a26fdc6e7c7d6da4b4 Mon Sep 17 00:00:00 2001 From: sfb Date: Sat, 22 Oct 2011 14:23:54 -0500 Subject: [PATCH] Changed: Fixed an error when cancelling a merge window, added double click support on merge source. Fixed window scaling on merge windows. --HG-- branch : gsoc2011-translationovqt --- .../translation_manager/ftp_selection.ui | 219 ++++++++---------- .../translation_manager/source_selection.cpp | 16 +- .../translation_manager/source_selection.h | 1 + .../translation_manager/source_selection.ui | 78 +++---- .../translation_manager_main_window.cpp | 20 +- 5 files changed, 159 insertions(+), 175 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/ftp_selection.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/ftp_selection.ui index 444a7d97e..7b3041c04 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/ftp_selection.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/ftp_selection.ui @@ -6,133 +6,112 @@ 0 0 - 446 - 560 + 640 + 576 Dialog - - - - 10 - 10 - 421 - 541 - - - - FTP Server informations - - - - - 10 - 110 - 401 - 381 - - - - Content - - - - - 10 - 20 - 141 - 21 - + + + + + FTP Server informations - - Please select the file - - - - - - 10 - 40 - 381 - 311 - - - - - 1 - - + + + + + + + Ftp server + + + + + + + + + + + + + + :/translationManager/images/cdtoparent.png:/translationManager/images/cdtoparent.png + + + + + + + Connect + + + + + + + + + Content + + + + + + Please select the file + + + + + + + + 1 + + + + + + + + Qt::Vertical + + + + 20 + 378 + + + + + + + + + + + + + Done + + + + + + + Cancel + + + + + + - - - - - 10 - 500 - 401 - 33 - - - - - - - Done - - - - - - - Cancel - - - - - - - - - 10 - 20 - 411 - 81 - - - - - - - Ftp server - - - - - - - - - - - - - - :/translationManager/images/cdtoparent.png:/translationManager/images/cdtoparent.png - - - - - - - Connect - - - - - - + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.cpp index b4733c7b9..3015b447d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.cpp @@ -14,7 +14,9 @@ CSourceDialog::CSourceDialog(QWidget *parent): QDialog(parent) connect(_ui.ok_button, SIGNAL(clicked()), this, SLOT(OkButtonClicked())); // Set signal and slot for "Cancel Button" connect(_ui.cancel_button, SIGNAL(clicked()), this, SLOT(reject())); - _ui.listWidget->setSortingEnabled(false); + _ui.sourceSelectionListWidget->setSortingEnabled(false); + connect(_ui.sourceSelectionListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), + this, SLOT(itemDoubleClicked(QListWidgetItem *))); } // Insert options in the source dialog. Options like: from FTP Server, from Local directory etc. @@ -24,14 +26,20 @@ void CSourceDialog::setSourceOptions(map options) for(it = options.begin(); it != options.end(); ++it) { - _ui.listWidget->addItem((*it).first); + _ui.sourceSelectionListWidget->addItem((*it).first); } } void CSourceDialog::OkButtonClicked() { - selected_item = _ui.listWidget->currentItem(); - reject(); + selected_item = _ui.sourceSelectionListWidget->currentItem(); + accept(); +} + +void CSourceDialog::itemDoubleClicked(QListWidgetItem *item) +{ + selected_item = item; + accept(); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.h index 99636d410..d32bfcb02 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.h @@ -22,6 +22,7 @@ private: Ui::SourceSelectionDialog _ui; private Q_SLOTS: void OkButtonClicked(); + void itemDoubleClicked(QListWidgetItem *item); public: CSourceDialog(QWidget *parent = 0); ~CSourceDialog(){} diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.ui index 6e6f822fe..e64ba78c4 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/source_selection.ui @@ -12,8 +12,8 @@ 0 0 - 396 - 197 + 316 + 155 @@ -22,48 +22,38 @@ true - - - - 10 - 10 - 381 - 181 - - - - Select source for merge operation - - - - - 10 - 30 - 361 - 141 - - - - - - - - - - OK - - - - - - - Cancel - - - - - - + + + + + Select source for merge operation + + + + + + + + + + + OK + + + + + + + Cancel + + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.cpp index 8151ea234..651050835 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/translation_manager/translation_manager_main_window.cpp @@ -472,17 +472,23 @@ void CMainWindow::mergeSingleFile() if(dialog->selected_item == local_item) // Local directory { file_name = QFileDialog::getOpenFileName(this); - } else if(dialog->selected_item == ftp_item) { // Ftp directory + } + else if(dialog->selected_item == ftp_item) // Ftp directory + { CFtpSelection* ftp_dialog = new CFtpSelection(this); ftp_dialog->show(); - ftp_dialog->exec(); - if(ftp_dialog->status == true) - { + + if(ftp_dialog->exec() && ftp_dialog->status == true) file_name = ftp_dialog->file->fileName(); - } - } else { + + delete ftp_dialog; + } + else return; - } + + // Make sure we retrieved a file name + if(file_name.isEmpty()) + return; editor_window->activateWindow(); CEditorWorksheet* current_window = qobject_cast(editor_window);