Mercurial > hg > octave-lyh
changeset 16912:6bd74153c3ae
no native dialogs to prevent hangs in KDE (patch #7948 by Andre da Costa Barros)
* main-window.cc(handle_save_workspace_request,handle_load_workspace_request,
browse_for_directory): open the dialogs as qt instead native dialogs
* file-editor.cc(request_open_file): configure the file dialog not being native
* file-editor-tab.cc(save_file_as): configure the file dialog not being native
* files-Dock-widget.cc(popdownmenu_search_dir): search dir dialog not native
author | Torsten <ttl@justmail.de> |
---|---|
date | Sun, 07 Jul 2013 19:07:23 +0200 |
parents | 5ea6a6d2b83f |
children | d0558ee259ad |
files | libgui/src/files-dock-widget.cc libgui/src/m-editor/file-editor-tab.cc libgui/src/m-editor/file-editor.cc libgui/src/main-window.cc |
diffstat | 4 files changed, 16 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/files-dock-widget.cc +++ b/libgui/src/files-dock-widget.cc @@ -644,7 +644,8 @@ files_dock_widget::popdownmenu_search_dir (bool) { QString dir = QFileDialog::getExistingDirectory - (this, tr ("Set directory of file browser"),_file_system_model->rootPath()); + (this, tr ("Set directory of file browser"),_file_system_model->rootPath(), + QFileDialog::DontUseNativeDialog); set_current_directory (dir); }
--- a/libgui/src/m-editor/file-editor-tab.cc +++ b/libgui/src/m-editor/file-editor-tab.cc @@ -1010,6 +1010,11 @@ else fileDialog = new QFileDialog (this); + // Giving trouble under KDE (problem is related to Qt signal handling on unix, + // see https://bugs.kde.org/show_bug.cgi?id=260719 , + // it had/has no effect on Windows, though) + fileDialog->setOption(QFileDialog::DontUseNativeDialog, true); + if (!_file_name.isEmpty () && _file_name.at (_file_name.count () - 1) != '/') { fileDialog->selectFile (_file_name);
--- a/libgui/src/m-editor/file-editor.cc +++ b/libgui/src/m-editor/file-editor.cc @@ -176,6 +176,12 @@ // Create a NonModal message. QFileDialog *fileDialog = new QFileDialog (this); fileDialog->setNameFilter (tr ("Octave Files (*.m);;All Files (*)")); + + // Giving trouble under KDE (problem is related to Qt signal handling on unix, + // see https://bugs.kde.org/show_bug.cgi?id=260719 , + // it had/has no effect on Windows, though) + fileDialog->setOption(QFileDialog::DontUseNativeDialog, true); + fileDialog->setAcceptMode (QFileDialog::AcceptOpen); fileDialog->setViewMode (QFileDialog::Detail); fileDialog->setDirectory (ced);
--- a/libgui/src/main-window.cc +++ b/libgui/src/main-window.cc @@ -139,7 +139,7 @@ main_window::handle_save_workspace_request (void) { QString file = - QFileDialog::getSaveFileName (this, tr ("Save Workspace As"), "."); + QFileDialog::getSaveFileName (this, tr ("Save Workspace As"), ".", 0, 0, QFileDialog::DontUseNativeDialog); if (! file.isEmpty ()) octave_link::post_event (this, &main_window::save_workspace_callback, @@ -152,7 +152,7 @@ QString file = file_arg; if (file.isEmpty ()) - file = QFileDialog::getOpenFileName (this, tr ("Load Workspace"), "."); + file = QFileDialog::getOpenFileName (this, tr ("Load Workspace"), ".", 0, 0, QFileDialog::DontUseNativeDialog); if (! file.isEmpty ()) octave_link::post_event (this, &main_window::load_workspace_callback, @@ -354,7 +354,7 @@ main_window::browse_for_directory (void) { QString dir - = QFileDialog::getExistingDirectory (this, tr ("Set working directory")); + = QFileDialog::getExistingDirectory (this, tr ("Set working directory"), 0, QFileDialog::DontUseNativeDialog); set_current_working_directory (dir);