diff --git a/rtgui/batchqueuepanel.cc b/rtgui/batchqueuepanel.cc index 1f9a36280..2c7f81729 100644 --- a/rtgui/batchqueuepanel.cc +++ b/rtgui/batchqueuepanel.cc @@ -324,7 +324,7 @@ void BatchQueuePanel::saveOptions () void BatchQueuePanel::pathFolderButtonPressed () { - Gtk::FileChooserDialog fc(M("PREFERENCES_OUTDIRFOLDER"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER ); + Gtk::FileChooserDialog fc (getToplevelWindow (this), M("PREFERENCES_OUTDIRFOLDER"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER ); fc.add_button( Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); fc.add_button( Gtk::StockID("gtk-ok"), Gtk::RESPONSE_OK); fc.set_filename(options.savePathFolder); diff --git a/rtgui/curveeditorgroup.cc b/rtgui/curveeditorgroup.cc index ea97b4e9e..f703169ed 100644 --- a/rtgui/curveeditorgroup.cc +++ b/rtgui/curveeditorgroup.cc @@ -421,7 +421,7 @@ void CurveEditorSubGroup::updateEditButton(CurveEditor* curve, Gtk::ToggleButton Glib::ustring CurveEditorSubGroup::outputFile () { - Gtk::FileChooserDialog dialog(M("CURVEEDITOR_SAVEDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_SAVE); + Gtk::FileChooserDialog dialog (getToplevelWindow (parent), M("CURVEEDITOR_SAVEDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_SAVE); bindCurrentFolder (dialog, curveDir); dialog.set_current_name (lastFilename); @@ -466,7 +466,7 @@ Glib::ustring CurveEditorSubGroup::outputFile () Glib::ustring CurveEditorSubGroup::inputFile () { - Gtk::FileChooserDialog dialog(M("CURVEEDITOR_LOADDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN); + Gtk::FileChooserDialog dialog (getToplevelWindow (parent), M("CURVEEDITOR_LOADDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN); bindCurrentFolder (dialog, curveDir); dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index 69dc4940c..f8a8f225f 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -833,7 +833,7 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m) } else if (m == selectDF) { if( !mselected.empty() ) { rtengine::procparams::ProcParams pp = mselected[0]->thumbnail->getProcParams(); - Gtk::FileChooserDialog fc("Dark Frame", Gtk::FILE_CHOOSER_ACTION_OPEN ); + Gtk::FileChooserDialog fc (getToplevelWindow (this), "Dark Frame", Gtk::FILE_CHOOSER_ACTION_OPEN ); bindCurrentFolder (fc, options.lastDarkframeDir); fc.add_button( Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); fc.add_button( Gtk::StockID("gtk-apply"), Gtk::RESPONSE_APPLY); @@ -909,7 +909,7 @@ void FileBrowser::menuItemActivated (Gtk::MenuItem* m) } else if (m == selectFF) { if( !mselected.empty() ) { rtengine::procparams::ProcParams pp = mselected[0]->thumbnail->getProcParams(); - Gtk::FileChooserDialog fc("Flat Field", Gtk::FILE_CHOOSER_ACTION_OPEN ); + Gtk::FileChooserDialog fc (getToplevelWindow (this), "Flat Field", Gtk::FILE_CHOOSER_ACTION_OPEN ); bindCurrentFolder (fc, options.lastFlatfieldDir); fc.add_button( Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); fc.add_button( Gtk::StockID("gtk-apply"), Gtk::RESPONSE_APPLY); diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 47adae7d7..3ed7608f1 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -982,7 +982,7 @@ void FileCatalog::copyMoveRequested (std::vector tbe, bool m fc_title = M("FILEBROWSER_POPUPCOPYTO"); } - Gtk::FileChooserDialog fc(fc_title, Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER ); + Gtk::FileChooserDialog fc (getToplevelWindow (this), fc_title, Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER ); fc.add_button( Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL); fc.add_button( Gtk::StockID("gtk-ok"), Gtk::RESPONSE_OK); // open dialog at the 1-st file's path diff --git a/rtgui/guiutils.h b/rtgui/guiutils.h index c43d85b07..f91bb0245 100644 --- a/rtgui/guiutils.h +++ b/rtgui/guiutils.h @@ -490,4 +490,9 @@ inline void setActiveTextOrIndex (Gtk::ComboBoxText& comboBox, const Glib::ustri comboBox.set_active (index); } +inline Gtk::Window& getToplevelWindow (Gtk::Widget* widget) +{ + return *static_cast (widget->get_toplevel ()); +} + #endif diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index abee4aa72..efce343c0 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -943,7 +943,7 @@ void ICMPanel::saveReferencePressed () return; } - Gtk::FileChooserDialog dialog(M("TP_ICM_SAVEREFERENCE"), Gtk::FILE_CHOOSER_ACTION_SAVE); + Gtk::FileChooserDialog dialog (getToplevelWindow (this), M("TP_ICM_SAVEREFERENCE"), Gtk::FILE_CHOOSER_ACTION_SAVE); bindCurrentFolder (dialog, options.lastProfilingReferenceDir); dialog.set_current_name (lastRefFilename); diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index b4231744e..10800d527 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -1845,7 +1845,7 @@ void Preferences::cancelPressed () void Preferences::selectStartupDir () { - Gtk::FileChooserDialog dialog(M("PREFERENCES_DIRSELECTDLG"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER); + Gtk::FileChooserDialog dialog (getToplevelWindow (this), M("PREFERENCES_DIRSELECTDLG"), Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER); // dialog.set_transient_for(*this); //Add response buttons the the dialog: diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index b607f0968..5974b2242 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -287,7 +287,7 @@ void ProfilePanel::save_clicked (GdkEventButton* event) return; } - Gtk::FileChooserDialog dialog(M("PROFILEPANEL_SAVEDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_SAVE); + Gtk::FileChooserDialog dialog (getToplevelWindow (this), M("PROFILEPANEL_SAVEDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_SAVE); bindCurrentFolder (dialog, options.loadSaveProfilePath); dialog.set_current_name (lastFilename); @@ -453,7 +453,7 @@ void ProfilePanel::load_clicked (GdkEventButton* event) return; } - Gtk::FileChooserDialog dialog(M("PROFILEPANEL_LOADDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN); + Gtk::FileChooserDialog dialog (getToplevelWindow (this), M("PROFILEPANEL_LOADDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN); bindCurrentFolder (dialog, options.loadSaveProfilePath); //Add the user's default (or global if multiuser=false) profile path to the Shortcut list