diff --git a/rtgui/main.cc b/rtgui/main.cc index 6885e44fe..bc6c4a977 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -85,9 +85,15 @@ int main(int argc, char **argv) argv1_ = argv[1]; else argv1_ = ""; - - argv0 = Glib::filename_to_utf8 (argv0_); - argv1 = Glib::filename_to_utf8 (argv1_); + +#ifdef GLIBMM_EXCEPTIONS_ENABLED + argv0 = Glib::filename_to_utf8 (argv0); + argv1 = Glib::filename_to_utf8 (argv1); +#else + std::auto_ptr error; + argv0 = Glib::filename_to_utf8 (argv0_, error); + argv1 = Glib::filename_to_utf8 (argv1_, error); +#endif //GLIBMM_EXCEPTIONS_ENABLED Glib::thread_init(); gdk_threads_init(); diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 49d73c62e..84950335a 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -1018,8 +1018,8 @@ void Preferences::savePressed () { void Preferences::okPressed () { storePreferences (); - options.copyFrom (&moptions); workflowUpdate(); + options.copyFrom (&moptions); hide (); } @@ -1120,10 +1120,15 @@ void Preferences::switchThemeTo(Glib::ustring newTheme) { void Preferences::workflowUpdate (){ - if(moptions.tabbedUI) - parent->epanel->hide_all(); - else - parent->epanel->show_all(); + if(moptions.tabbedUI != options.tabbedUI) + { + parent->MoveFileBrowserToMain(); + parent->SetMainCurrent(); + if(moptions.tabbedUI) + parent->epanel->hide_all(); + else + parent->epanel->show_all(); + } } void Preferences::switchFontTo(Glib::ustring newFont) { diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 53333b088..1f03da590 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -324,16 +324,33 @@ void RTWindow::SetEditorCurrent() mainNB->set_current_page (mainNB->page_num (*epanel)); } +void RTWindow::SetMainCurrent() +{ + mainNB->set_current_page (mainNB->page_num (*fpanel)); +} + +void RTWindow::MoveFileBrowserToMain() +{ + FileCatalog *fCatalog = fpanel->fileCatalog; + epanel->catalogPane->remove(*fCatalog); + fpanel->ribbonPane->add(*fCatalog); + fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Vertical); + fCatalog->redrawAll(); +} + +void RTWindow::MoveFileBrowserToEditor() +{ + FileCatalog *fCatalog = fpanel->fileCatalog; + fpanel->ribbonPane->remove(*fCatalog); + epanel->catalogPane->add(*fCatalog); + fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Horizontal); + fCatalog->redrawAll(); +} + bool RTWindow::on_expose_event_epanel(GdkEventExpose* event) { - - if(!options.tabbedUI && epanel->catalogPane->get_children().size() ==0 ){ - FileCatalog *fCatalog = fpanel->fileCatalog; - fpanel->ribbonPane->remove(*fCatalog); - epanel->catalogPane->add(*fCatalog); - fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Horizontal); - fCatalog->redrawAll(); - } + if(!options.tabbedUI && epanel->catalogPane->get_children().size() ==0 ) + MoveFileBrowserToEditor(); return false; // Gtk::VBox::on_expose_event(event); } @@ -341,13 +358,7 @@ bool RTWindow::on_expose_event_epanel(GdkEventExpose* event) bool RTWindow::on_expose_event_fpanel(GdkEventExpose* event) { - if(!options.tabbedUI && fpanel->ribbonPane->get_children().size() ==0 ){ - FileCatalog *fCatalog = fpanel->fileCatalog; - epanel->catalogPane->remove(*fCatalog); - //dirpaned->pack2(*fileCatalog,true,true); - fpanel->ribbonPane->add(*fCatalog); - fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Vertical); - fCatalog->redrawAll(); - } + if(!options.tabbedUI && fpanel->ribbonPane->get_children().size() ==0 ) + MoveFileBrowserToMain(); return false; // Gtk::HPaned::on_expose_event(event); } \ No newline at end of file diff --git a/rtgui/rtwindow.h b/rtgui/rtwindow.h index 0e293513d..afd4af067 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -67,6 +67,9 @@ class RTWindow : public Gtk::Window, public rtengine::ProgressListener{ rtengine::ProgressListener* getProgressListener () { return pldBridge; } EditorPanel* epanel; void SetEditorCurrent(); + void SetMainCurrent(); + void MoveFileBrowserToEditor(); + void MoveFileBrowserToMain(); }; #endif