# HG changeset patch # User Torsten # Date 1393179504 -3600 # Node ID 713193ffc8c4825f827a0007e769ee109460edc4 # Parent ed670b8128e068ff4e633a9b61d9f38866ae0c02 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 diff -r ed670b8128e0 -r 713193ffc8c4 libgui/src/m-editor/file-editor.cc --- 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) diff -r ed670b8128e0 -r 713193ffc8c4 libgui/src/m-editor/file-editor.h --- 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);