changeset 18521:713193ffc8c4 gui-release

allow to select mutliple files in the editors open file dialog (bug #41664) * file-editor.cc (request_open_file (void)): allow to select multiple files in the open file dialog, connect filesSelected signal to new slot; (request_open_files): slot for the open file dialogs signal filesSelected * file-editor.h: new slot request_open_files
author Torsten <ttl@justmail.de>
date Sun, 23 Feb 2014 19:18:24 +0100
parents ed670b8128e0
children fa58514e7383
files libgui/src/m-editor/file-editor.cc libgui/src/m-editor/file-editor.h
diffstat 2 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc	Fri Feb 21 18:50:33 2014 -0500
+++ b/libgui/src/m-editor/file-editor.cc	Sun Feb 23 19:18:24 2014 +0100
@@ -211,10 +211,11 @@
 
   fileDialog->setAcceptMode (QFileDialog::AcceptOpen);
   fileDialog->setViewMode (QFileDialog::Detail);
+  fileDialog->setFileMode (QFileDialog::ExistingFiles);
   fileDialog->setDirectory (ced);
 
-  connect (fileDialog, SIGNAL (fileSelected (const QString&)),
-           this, SLOT (request_open_file (const QString&)));
+  connect (fileDialog, SIGNAL (filesSelected (const QStringList&)),
+           this, SLOT (request_open_files (const QStringList&)));
 
   fileDialog->setWindowModality (Qt::NonModal);
   fileDialog->setAttribute (Qt::WA_DeleteOnClose);
@@ -266,6 +267,13 @@
 }
 
 void
+file_editor::request_open_files (const QStringList& open_file_names)
+{
+  for (int i = 0; i < open_file_names.count (); i++)
+    request_open_file (open_file_names.at (i));
+}
+
+void
 file_editor::request_open_file (const QString& openFileName, int line,
                                 bool debug_pointer,
                                 bool breakpoint_marker, bool insert)
--- a/libgui/src/m-editor/file-editor.h	Fri Feb 21 18:50:33 2014 -0500
+++ b/libgui/src/m-editor/file-editor.h	Sun Feb 23 19:18:24 2014 +0100
@@ -185,6 +185,7 @@
 
 private slots:
 
+  void request_open_files (const QStringList&);
   void request_open_file (const QString& fileName, int line = -1,
                           bool debug_pointer = false,
                           bool breakpoint_marker = false, bool insert = true);