From 3b04d4b2c99f47e6a80f55c1b01cce7472fd72f1 Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 17 Feb 2015 09:38:42 -0500 Subject: [PATCH] Preference UI for filmstrip toolbar visibility (issue 2672) --- rtdata/languages/default | 1 + rtgui/filecatalog.cc | 8 ++++++++ rtgui/filecatalog.h | 1 + rtgui/preferences.cc | 8 ++++++++ rtgui/preferences.h | 1 + rtgui/rtwindow.cc | 4 ++++ rtgui/rtwindow.h | 1 + 7 files changed, 24 insertions(+) diff --git a/rtdata/languages/default b/rtdata/languages/default index 656036bb1..47fdb1bc1 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -908,6 +908,7 @@ PREFERENCES_SET;Set PREFERENCES_SHOWBASICEXIF;Show basic Exif info PREFERENCES_SHOWDATETIME;Show date and time PREFERENCES_SHOWEXPOSURECOMPENSATION;Append exposure compensation +PREFERENCES_SHOWFILMSTRIPTOOLBAR;Show filmstrip toolbar PREFERENCES_SHOWPROFILESELECTOR;Show processing profile selector PREFERENCES_SHTHRESHOLD;Threshold for clipped shadows PREFERENCES_SIMPLAUT;Tool mode diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 5722bd271..28c22dd80 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -1606,6 +1606,14 @@ void FileCatalog::updateFBQueryTB (bool singleRow) { hbToolBar1->unreference(); } +void FileCatalog::updateFBToolBarVisibility (bool showFilmStripToolBar){ + if (showFilmStripToolBar) + showToolBar(); + else + hideToolBar(); + refreshHeight(); +} + void FileCatalog::buttonBrowsePathPressed () { Glib::ustring BrowsePathValue = BrowsePath->get_text(); Glib::ustring DecodedPathPrefix=""; diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h index 7a0558e6b..6671c763c 100644 --- a/rtgui/filecatalog.h +++ b/rtgui/filecatalog.h @@ -236,6 +236,7 @@ class FileCatalog : public Gtk::VBox, void executeQuery (); bool Query_key_pressed(GdkEventKey *event); void updateFBQueryTB (bool singleRow); + void updateFBToolBarVisibility (bool showFilmStripToolBar); void tbLeftPanel_1_toggled (); void tbLeftPanel_1_visible (bool visible); diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index e8e616023..4ce0b34e9 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -779,8 +779,10 @@ Gtk::Widget* Preferences::getGeneralPanel () { Gtk::HBox* hbworkflow3 = Gtk::manage( new Gtk::HBox () ); ckbFileBrowserToolbarSingleRow = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_FILEBROWSERTOOLBARSINGLEROW")) ); + ckbShowFilmStripToolBar = Gtk::manage( new Gtk::CheckButton (M("PREFERENCES_SHOWFILMSTRIPTOOLBAR")) ); hbworkflow3->pack_start (*ckbFileBrowserToolbarSingleRow, Gtk::PACK_SHRINK, 4); + hbworkflow3->pack_start (*ckbShowFilmStripToolBar, Gtk::PACK_SHRINK, 4); vbworkflow->pack_start (*hbworkflow3, Gtk::PACK_SHRINK, 0); Gtk::HBox* hbworkflow4 = Gtk::manage( new Gtk::HBox () ); @@ -1406,6 +1408,7 @@ void Preferences::storePreferences () { moptions.histogramPosition = ckbHistogramPositionLeft->get_active() ? 1 : 2; moptions.showProfileSelector = ckbShowProfileSelector->get_active(); moptions.FileBrowserToolbarSingleRow = ckbFileBrowserToolbarSingleRow->get_active(); + moptions.showFilmStripToolBar = ckbShowFilmStripToolBar->get_active(); moptions.hideTPVScrollbar = ckbHideTPVScrollbar->get_active(); moptions.overwriteOutputFile = chOverwriteOutputFile->get_active (); moptions.UseIconNoText = ckbUseIconNoText->get_active(); @@ -1555,6 +1558,7 @@ void Preferences::fillPreferences () { // ckbHistogramWorking->set_active(moptions.histogramWorking==1); ckbShowProfileSelector->set_active(moptions.showProfileSelector); ckbFileBrowserToolbarSingleRow->set_active(moptions.FileBrowserToolbarSingleRow); + ckbShowFilmStripToolBar->set_active(moptions.showFilmStripToolBar); ckbHideTPVScrollbar->set_active(moptions.hideTPVScrollbar); ckbUseIconNoText->set_active(moptions.UseIconNoText); @@ -1859,6 +1863,10 @@ void Preferences::workflowUpdate (){ // Update the position of the Query toolbar parent->updateFBQueryTB(moptions.FileBrowserToolbarSingleRow); } + if(moptions.showFilmStripToolBar != options.showFilmStripToolBar) { + // Update the visibility of FB toolbar + parent->updateFBToolBarVisibility(moptions.showFilmStripToolBar); + } if(moptions.histogramPosition != options.histogramPosition) { // Update the position of the Histogram parent->updateHistogramPosition(options.histogramPosition, moptions.histogramPosition); diff --git a/rtgui/preferences.h b/rtgui/preferences.h index 781453a5b..c450c2b66 100644 --- a/rtgui/preferences.h +++ b/rtgui/preferences.h @@ -161,6 +161,7 @@ class Preferences : public Gtk::Dialog, public ProfileStoreListener { Gtk::CheckButton* ckbHistogramWorking; Gtk::CheckButton* ckbShowProfileSelector; Gtk::CheckButton* ckbFileBrowserToolbarSingleRow; + Gtk::CheckButton* ckbShowFilmStripToolBar; Gtk::CheckButton* ckbHideTPVScrollbar; Gtk::CheckButton* ckbUseIconNoText; diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index f4b24ce7f..c56b01d17 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -750,6 +750,10 @@ void RTWindow::updateFBQueryTB (bool singleRow) { fpanel->fileCatalog->updateFBQueryTB (singleRow); } +void RTWindow::updateFBToolBarVisibility (bool showFilmStripToolBar){ + fpanel->fileCatalog->updateFBToolBarVisibility (showFilmStripToolBar); +} + void RTWindow::updateHistogramPosition (int oldPosition, int newPosition) { epanel->updateHistogramPosition (oldPosition, newPosition); diff --git a/rtgui/rtwindow.h b/rtgui/rtwindow.h index 53d09bd17..8d84935ab 100644 --- a/rtgui/rtwindow.h +++ b/rtgui/rtwindow.h @@ -102,6 +102,7 @@ class RTWindow : public Gtk::Window, public rtengine::ProgressListener{ void updateHistogramPosition (int oldPosition, int newPosition); void updateTabsUsesIcons (bool useIcons); void updateFBQueryTB (bool singleRow); + void updateFBToolBarVisibility (bool showFilmStripToolBar); bool getIsFullscreen() { return is_fullscreen; } void set_title_decorated(Glib::ustring fname); void CloseOpenEditors();