tabular and single tab workflows reunited! option in preferences

This commit is contained in:
Andrey Skvortsov
2010-10-01 22:10:07 -07:00
parent e679dd1a8f
commit 60fea52af1
8 changed files with 85 additions and 56 deletions

View File

@@ -247,19 +247,13 @@ EditorPanel::~EditorPanel () {
history->setHistoryBeforeLineListener (NULL); history->setHistoryBeforeLineListener (NULL);
// the order is important! // the order is important!
delete iarea; delete iarea;
iarea = NULL;
delete beforeIarea; delete beforeIarea;
beforeIarea = NULL;
if (ipc)
ipc->setPreviewImageListener (NULL);
if (beforeIpc)
beforeIpc->setPreviewImageListener (NULL);
delete previewHandler;
previewHandler = NULL;
delete beforePreviewHandler; delete beforePreviewHandler;
if (ipc) close ();
close ();
if (epih->pending) if (epih->pending)
epih->destroyed = true; epih->destroyed = true;
@@ -350,8 +344,11 @@ void EditorPanel::close () {
rtengine::StagedImageProcessor::destroy (ipc); rtengine::StagedImageProcessor::destroy (ipc);
ipc = NULL; ipc = NULL;
iarea->imageArea->setPreviewHandler (NULL); if(iarea)
iarea->imageArea->setImProcCoordinator (NULL); {
iarea->imageArea->setPreviewHandler (NULL);
iarea->imageArea->setImProcCoordinator (NULL);
}
navigator->previewWindow->setPreviewHandler (NULL); navigator->previewWindow->setPreviewHandler (NULL);
// navigator->previewWindow->setImageArea (NULL); // navigator->previewWindow->setImageArea (NULL);
@@ -896,10 +893,9 @@ bool EditorPanel::idle_sentToGimp(ProgressConnector<int> *pc,rtengine::IImage16*
void EditorPanel::saveOptions () { void EditorPanel::saveOptions () {
//options.historyPanelWidth = hpanedl->get_position ();//older code //options.historyPanelWidth = hpanedl->get_position ();//older code
//options.toolPanelWidth = vboxright->get_width ();//older code //options.toolPanelWidth = vboxright->get_width ();//older code
if (options.startupDir==STARTUPDIR_LAST && fPanel->fileCatalog->lastSelectedDir ()!="") //options.toolPanelWidth = hpanedr->get_position ();//Hombre's change which screws up OSX build
options.startupPath = fPanel->fileCatalog->lastSelectedDir ();
} }
@@ -976,16 +972,3 @@ void EditorPanel::histogramChanged (unsigned int* rh, unsigned int* gh, unsigned
histogramPanel->histogramChanged (rh, gh, bh, lh); histogramPanel->histogramChanged (rh, gh, bh, lh);
tpc->updateCurveBackgroundHistogram (bcrgb, bcl); tpc->updateCurveBackgroundHistogram (bcrgb, bcl);
} }
bool EditorPanel::on_expose_event(GdkEventExpose* event)
{
if(!options.tabbedUI && catalogPane->get_children().size() ==0 ){
FileCatalog *fCatalog = fPanel->fileCatalog;
fPanel->dirpaned->remove(*fCatalog);
catalogPane->add(*fCatalog);
fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Horizontal);
fCatalog->redrawAll();
}
return Gtk::VBox::on_expose_event(event);
}

View File

@@ -145,7 +145,6 @@ class EditorPanel : public Gtk::VBox,
void saveOptions (); void saveOptions ();
Gtk::Paned *catalogPane; Gtk::Paned *catalogPane;
bool on_expose_event(GdkEventExpose* event);
}; };
#endif #endif

View File

@@ -52,7 +52,9 @@ FilePanel::FilePanel () : parent(NULL) {
tpc = new BatchToolPanelCoordinator (this); tpc = new BatchToolPanelCoordinator (this);
fileCatalog = new FileCatalog (tpc->coarse, tpc->getToolBar()); fileCatalog = new FileCatalog (tpc->coarse, tpc->getToolBar());
dirpaned->pack2 (*fileCatalog, true, true); ribbonPane = new Gtk::Paned();
ribbonPane->add(*fileCatalog);
dirpaned->pack2 (*ribbonPane, true, true);
placesBrowser->setDirBrowserRemoteInterface (dirBrowser); placesBrowser->setDirBrowserRemoteInterface (dirBrowser);
recentBrowser->setDirBrowserRemoteInterface (dirBrowser); recentBrowser->setDirBrowserRemoteInterface (dirBrowser);
@@ -226,17 +228,3 @@ bool FilePanel::handleShortcutKey (GdkEventKey* event) {
return false; return false;
} }
bool FilePanel::on_expose_event(GdkEventExpose* event)
{
if(!options.tabbedUI && dirpaned->get_children().size() ==1 ){
parent->epanel->catalogPane->remove(*fileCatalog);
fileCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Vertical);
dirpaned->pack2(*fileCatalog,true,true);
fileCatalog->redrawAll();
}
return Gtk::HPaned::on_expose_event(event);
}

View File

@@ -39,7 +39,7 @@ class FilePanel : public Gtk::HPaned,
protected: protected:
Gtk::Paned* placespaned; Gtk::Paned* placespaned;
Gtk::HPaned* dirpaned;
//DirBrowser* dirBrowser; //DirBrowser* dirBrowser;
PlacesBrowser* placesBrowser; PlacesBrowser* placesBrowser;
RecentBrowser* recentBrowser; RecentBrowser* recentBrowser;
@@ -59,7 +59,7 @@ class FilePanel : public Gtk::HPaned,
DirBrowser* dirBrowser; DirBrowser* dirBrowser;
FilterPanel* filterPanel; FilterPanel* filterPanel;
FileCatalog* fileCatalog; FileCatalog* fileCatalog;
Gtk::HPaned* dirpaned; Gtk::Paned *ribbonPane;
void setParent (RTWindow* p) { parent = p; } void setParent (RTWindow* p) { parent = p; }
void init (); // dont call it directly, the constructor calls it as idle source void init (); // dont call it directly, the constructor calls it as idle source
@@ -77,7 +77,6 @@ class FilePanel : public Gtk::HPaned,
bool imageLoaded( Thumbnail* thm, ProgressConnector<rtengine::InitialImage*> * ); bool imageLoaded( Thumbnail* thm, ProgressConnector<rtengine::InitialImage*> * );
bool handleShortcutKey (GdkEventKey* event); bool handleShortcutKey (GdkEventKey* event);
bool on_expose_event(GdkEventExpose* event);
}; };
#endif #endif

View File

@@ -26,7 +26,7 @@
extern Options options; extern Options options;
extern Glib::ustring argv0; extern Glib::ustring argv0;
Preferences::Preferences (int initialPage) { Preferences::Preferences (RTWindow *rtwindow):parent(rtwindow) {
set_title (M("MAIN_BUTTON_PREFERENCES")); set_title (M("MAIN_BUTTON_PREFERENCES"));
@@ -77,7 +77,7 @@ Preferences::Preferences (int initialPage) {
nb->append_page (*getFileBrowserPanel(), M("PREFERENCES_TAB_BROWSER")); nb->append_page (*getFileBrowserPanel(), M("PREFERENCES_TAB_BROWSER"));
nb->append_page (*getColorManagementPanel(),M("PREFERENCES_TAB_COLORMGR")); nb->append_page (*getColorManagementPanel(),M("PREFERENCES_TAB_COLORMGR"));
nb->append_page (*getBatchProcPanel(), M("PREFERENCES_BATCH_PROCESSING")); nb->append_page (*getBatchProcPanel(), M("PREFERENCES_BATCH_PROCESSING"));
nb->set_current_page (initialPage); nb->set_current_page (0);
fillPreferences (); fillPreferences ();
@@ -395,6 +395,21 @@ Gtk::Widget* Preferences::getGeneralPanel () {
Gtk::VBox* mvbsd = new Gtk::VBox (); Gtk::VBox* mvbsd = new Gtk::VBox ();
Gtk::Frame* fworklflow = new Gtk::Frame (M("PREFERENCES_WORKFLOW"));
Gtk::HBox* hbworkflow = new Gtk::HBox ();
hbworkflow->set_border_width (4);
Gtk::Label* flayoutlab = new Gtk::Label (M("PREFERENCES_EDITORLAYOUT")+":");
editorLayout = new Gtk::ComboBoxText ();
editorLayout->append_text (M("PREFERENCES_SINGLETAB"));
editorLayout->append_text (M("PREFERENCES_MULTITAB"));
editorLayout->set_active (1);
hbworkflow->pack_start (*flayoutlab, Gtk::PACK_SHRINK, 4);
hbworkflow->pack_start (*editorLayout);
fworklflow->add (*hbworkflow);
mvbsd->pack_start (*fworklflow, Gtk::PACK_SHRINK, 4);
Gtk::Frame* flang = new Gtk::Frame (M("PREFERENCES_DEFAULTLANG")); Gtk::Frame* flang = new Gtk::Frame (M("PREFERENCES_DEFAULTLANG"));
Gtk::HBox* hblang = new Gtk::HBox (); Gtk::HBox* hblang = new Gtk::HBox ();
hblang->set_border_width (4); hblang->set_border_width (4);
@@ -833,6 +848,8 @@ void Preferences::storePreferences () {
for (Gtk::TreeIter sections=behModel->children().begin(); sections!=behModel->children().end(); sections++) for (Gtk::TreeIter sections=behModel->children().begin(); sections!=behModel->children().end(); sections++)
for (Gtk::TreeIter adjs=sections->children().begin(); adjs!=sections->children().end(); adjs++) for (Gtk::TreeIter adjs=sections->children().begin(); adjs!=sections->children().end(); adjs++)
moptions.baBehav[adjs->get_value (behavColumns.addsetid)] = adjs->get_value (behavColumns.badd); moptions.baBehav[adjs->get_value (behavColumns.addsetid)] = adjs->get_value (behavColumns.badd);
moptions.tabbedUI = (bool)editorLayout->get_active_row_number();
} }
void Preferences::fillPreferences () { void Preferences::fillPreferences () {
@@ -987,6 +1004,7 @@ void Preferences::okPressed () {
storePreferences (); storePreferences ();
options.copyFrom (&moptions); options.copyFrom (&moptions);
workflowUpdate();
hide (); hide ();
} }
@@ -1067,6 +1085,14 @@ void Preferences::themeChanged () {
gdk_event_send_clientmessage_toall ((GdkEvent*)&event); gdk_event_send_clientmessage_toall ((GdkEvent*)&event);
} }
void Preferences::workflowUpdate (){
if(moptions.tabbedUI)
parent->epanel->hide_all();
else
parent->epanel->show_all();
}
void Preferences::addExtPressed () { void Preferences::addExtPressed () {
Gtk::TreeNodeChildren c = extensionModel->children (); Gtk::TreeNodeChildren c = extensionModel->children ();

View File

@@ -23,6 +23,7 @@
#include <adjuster.h> #include <adjuster.h>
#include <options.h> #include <options.h>
#include <vector> #include <vector>
#include "rtwindow.h"
class Preferences : public Gtk::Dialog { class Preferences : public Gtk::Dialog {
@@ -109,6 +110,8 @@ class Preferences : public Gtk::Dialog {
Gtk::CheckButton* saveParamsFile; Gtk::CheckButton* saveParamsFile;
Gtk::CheckButton* saveParamsCache; Gtk::CheckButton* saveParamsCache;
Gtk::ComboBoxText* loadParamsPreference; Gtk::ComboBoxText* loadParamsPreference;
Gtk::ComboBoxText* editorLayout;
RTWindow* parent;
Options moptions; Options moptions;
sigc::connection dmconn, dmconnBatch, tconn, addc, setc; sigc::connection dmconn, dmconnBatch, tconn, addc, setc;
@@ -118,7 +121,7 @@ class Preferences : public Gtk::Dialog {
void parseDir (Glib::ustring dirname, std::vector<Glib::ustring>& items, Glib::ustring ext); void parseDir (Glib::ustring dirname, std::vector<Glib::ustring>& items, Glib::ustring ext);
void dmethodChanged (); void dmethodChanged ();
void dmethodBatchChanged (); void dmethodBatchChanged ();
void workflowUpdate();
void themeChanged (); void themeChanged ();
void appendBehavList (Gtk::TreeModel::iterator& parent, Glib::ustring label, int id, bool set); void appendBehavList (Gtk::TreeModel::iterator& parent, Glib::ustring label, int id, bool set);
@@ -130,7 +133,7 @@ class Preferences : public Gtk::Dialog {
Gtk::Widget* getBatchProcPanel (); Gtk::Widget* getBatchProcPanel ();
public: public:
Preferences (int initialPage=0); Preferences (RTWindow *rtwindow);
void savePressed (); void savePressed ();
void loadPressed (); void loadPressed ();

View File

@@ -59,6 +59,7 @@ RTWindow::RTWindow () {
hbf->set_spacing (2); hbf->set_spacing (2);
hbf->show_all (); hbf->show_all ();
mainNB->append_page (*fpanel, *hbf); mainNB->append_page (*fpanel, *hbf);
fpanel->signal_expose_event().connect( sigc::mem_fun(*this, &RTWindow::on_expose_event_fpanel) );
bpanel = new BatchQueuePanel (); bpanel = new BatchQueuePanel ();
bpanel->setParent (this); bpanel->setParent (this);
@@ -82,6 +83,7 @@ RTWindow::RTWindow () {
hbe->show_all (); hbe->show_all ();
mainNB->append_page (*epanel, *hbe); mainNB->append_page (*epanel, *hbe);
mainNB->set_current_page (mainNB->page_num (*fpanel)); mainNB->set_current_page (mainNB->page_num (*fpanel));
epanel->signal_expose_event().connect( sigc::mem_fun(*this, &RTWindow::on_expose_event_epanel) );
signal_key_press_event().connect( sigc::mem_fun(*this, &RTWindow::keyPressed) ); signal_key_press_event().connect( sigc::mem_fun(*this, &RTWindow::keyPressed) );
@@ -257,7 +259,7 @@ bool RTWindow::on_delete_event(GdkEventAny* event) {
void RTWindow::showPreferences () { void RTWindow::showPreferences () {
Preferences *pref = new Preferences (); Preferences *pref = new Preferences (this);
pref->run (); pref->run ();
delete pref; delete pref;
@@ -295,3 +297,31 @@ void RTWindow::toggle_fullscreen () {
void RTWindow::error (Glib::ustring descr){ void RTWindow::error (Glib::ustring descr){
prLabel.set_text ( descr ); prLabel.set_text ( descr );
} }
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();
}
return false; // Gtk::VBox::on_expose_event(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();
}
return false; // Gtk::HPaned::on_expose_event(event);
}

View File

@@ -41,7 +41,8 @@ class RTWindow : public Gtk::Window, public rtengine::ProgressListener{
bool is_fullscreen; bool is_fullscreen;
Gtk::Button * btn_fullscreen; Gtk::Button * btn_fullscreen;
bool on_expose_event_epanel(GdkEventExpose* event);
bool on_expose_event_fpanel(GdkEventExpose* event);
public: public:
RTWindow (); RTWindow ();