add tabbedUI option, prepare infrastructure to support 2 workflows

This commit is contained in:
askvortsov 2010-10-01 16:43:08 -07:00
parent bcd42c3fc2
commit e679dd1a8f
7 changed files with 42 additions and 33 deletions

View File

@ -26,7 +26,7 @@
using namespace rtengine::procparams; using namespace rtengine::procparams;
EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), beforeIarea(NULL), parent(NULL), beforeIpc(NULL) { EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), beforeIarea(NULL), parent(NULL), beforeIpc(NULL), ipc(NULL), catalogPane(NULL) {
epih = new EditorPanelIdleHelper; epih = new EditorPanelIdleHelper;
epih->epanel = this; epih->epanel = this;
@ -186,24 +186,16 @@ EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), be
hpanedl->set_position (options.historyPanelWidth); hpanedl->set_position (options.historyPanelWidth);
} }
ipc = NULL;
// btpCoordinator = new BatchToolPanelCoordinator (filePanel);
// fCatalog = new FileCatalog (btpCoordinator->coarse, btpCoordinator->getToolBar()); //, filePanel->fileCatalog->fileBrowser);
// filePanel->dirBrowser->addDirSelectionListener (fCatalog);
// // fCatalog->setFilterPanel (filePanel->filterPanel);
// fCatalog->setImageAreaToolListener (btpCoordinator);
// fCatalog->setFileSelectionListener (filePanel);
// fCatalog->setFileSelectionChangeListener (btpCoordinator);
// fCatalog->setEnabled(true);
catalogPane = new Gtk::Paned();
Gtk::VPaned * viewpaned = Gtk::manage (new Gtk::VPaned()); Gtk::VPaned * viewpaned = Gtk::manage (new Gtk::VPaned());
viewpaned->pack1(*catalogPane, false, true); fPanel = filePanel;
if(filePanel)
{
catalogPane = new Gtk::Paned();
viewpaned->pack1(*catalogPane, false, true);
}
viewpaned->pack2(*editbox, true, true); viewpaned->pack2(*editbox, true, true);
fPanel = filePanel;
fCatalog = filePanel->fileCatalog;
Gtk::Frame* vbfr = Gtk::manage (new Gtk::Frame ()); Gtk::Frame* vbfr = Gtk::manage (new Gtk::Frame ());
vbfr->add (*viewpaned); vbfr->add (*viewpaned);
@ -263,6 +255,7 @@ EditorPanel::~EditorPanel () {
beforeIpc->setPreviewImageListener (NULL); beforeIpc->setPreviewImageListener (NULL);
delete previewHandler; delete previewHandler;
previewHandler = NULL;
delete beforePreviewHandler; delete beforePreviewHandler;
if (ipc) if (ipc)
@ -278,9 +271,10 @@ EditorPanel::~EditorPanel () {
delete red; delete red;
delete green; delete green;
delete leftbox; delete leftbox;
delete vboxright; delete vboxright;
delete catalogPane;
delete saveAsDialog; delete saveAsDialog;
if(catalogPane)
delete catalogPane;
} }
void EditorPanel::open (Thumbnail* tmb, rtengine::InitialImage* isrc) { void EditorPanel::open (Thumbnail* tmb, rtengine::InitialImage* isrc) {
@ -514,8 +508,8 @@ void EditorPanel::info_toggled () {
// M("QINFO_ISO"), idata->getISOSpeed(), // M("QINFO_ISO"), idata->getISOSpeed(),
// M("QINFO_FOCALLENGTH"), idata->getFocalLen()) // M("QINFO_FOCALLENGTH"), idata->getFocalLen())
// + Glib::ustring::compose ("%1: %2", M("QINFO_LENS"), Glib::ustring(idata->getLens())); // + Glib::ustring::compose ("%1: %2", M("QINFO_LENS"), Glib::ustring(idata->getLens()));
infoString = Glib::ustring::compose ( infoString = Glib::ustring::compose (
"%1 + %2\n<span size=\"xx-large\">%3</span>s f/<span size=\"xx-large\">%4</span> %5<span size=\"xx-large\">%6</span> f=<span size=\"xx-large\">%7</span>mm", "%1 + %2\n<span size=\"large\">%3</span>s f/<span size=\"large\">%4</span> %5<span size=\"large\">%6</span> f=<span size=\"large\">%7</span>mm",
Glib::ustring(idata->getModel()), Glib::ustring(idata->getModel()),
Glib::ustring(idata->getLens()), Glib::ustring(idata->getLens()),
Glib::ustring(idata->shutterToString(idata->getShutterSpeed())), Glib::ustring(idata->shutterToString(idata->getShutterSpeed())),
@ -904,8 +898,8 @@ 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 && fCatalog->lastSelectedDir ()!="") if (options.startupDir==STARTUPDIR_LAST && fPanel->fileCatalog->lastSelectedDir ()!="")
options.startupPath = fCatalog->lastSelectedDir (); options.startupPath = fPanel->fileCatalog->lastSelectedDir ();
} }
@ -986,9 +980,10 @@ void EditorPanel::histogramChanged (unsigned int* rh, unsigned int* gh, unsigned
bool EditorPanel::on_expose_event(GdkEventExpose* event) bool EditorPanel::on_expose_event(GdkEventExpose* event)
{ {
if(catalogPane->get_children().size() ==0 ){ if(!options.tabbedUI && catalogPane->get_children().size() ==0 ){
fPanel->dirpaned->remove(*fPanel->fileCatalog); FileCatalog *fCatalog = fPanel->fileCatalog;
catalogPane->add(*fCatalog); fPanel->dirpaned->remove(*fCatalog);
catalogPane->add(*fCatalog);
fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Horizontal); fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Horizontal);
fCatalog->redrawAll(); fCatalog->redrawAll();
} }

View File

@ -82,8 +82,7 @@ class EditorPanel : public Gtk::VBox,
ToolPanelCoordinator* tpc; ToolPanelCoordinator* tpc;
RTWindow* parent; RTWindow* parent;
SaveAsDialog* saveAsDialog; SaveAsDialog* saveAsDialog;
BatchToolPanelCoordinator* btpCoordinator; BatchToolPanelCoordinator* btpCoordinator;
FileCatalog* fCatalog;
FilePanel* fPanel; FilePanel* fPanel;
@ -105,7 +104,7 @@ class EditorPanel : public Gtk::VBox,
int err; int err;
public: public:
EditorPanel (FilePanel* filePanel); EditorPanel (FilePanel* filePanel = NULL);
virtual ~EditorPanel (); virtual ~EditorPanel ();
void open (Thumbnail* tmb, rtengine::InitialImage* isrc); void open (Thumbnail* tmb, rtengine::InitialImage* isrc);

View File

@ -51,7 +51,7 @@ FileCatalog::FileCatalog (CoarsePanel* cp, ToolBar* tb) : listener(NULL), fslist
// construct and initialize thumbnail browsers // construct and initialize thumbnail browsers
fileBrowser = new FileBrowser(); fileBrowser = new FileBrowser();
fileBrowser->setFileBrowserListener (this); fileBrowser->setFileBrowserListener (this);
fileBrowser->setArrangement (ThumbBrowserBase::TB_Horizontal); fileBrowser->setArrangement (ThumbBrowserBase::TB_Vertical);
fileBrowser->show (); fileBrowser->show ();
set_size_request(0,250); set_size_request(0,250);

View File

@ -148,7 +148,17 @@ bool FilePanel::fileSelected (Thumbnail* thm) {
bool FilePanel::imageLoaded( Thumbnail* thm, ProgressConnector<rtengine::InitialImage*> *pc ){ bool FilePanel::imageLoaded( Thumbnail* thm, ProgressConnector<rtengine::InitialImage*> *pc ){
if (pc->returnValue() && thm) { if (pc->returnValue() && thm) {
parent->epanel->open(thm, pc->returnValue() );
if (options.tabbedUI)
{
EditorPanel* epanel = Gtk::manage (new EditorPanel ());
parent->addEditorPanel (epanel,Glib::path_get_basename (thm->getFileName()));
epanel->open(thm, pc->returnValue() );
}
else
parent->epanel->open(thm, pc->returnValue() );
}else { }else {
Glib::ustring msg_ = Glib::ustring("<b>") + M("MAIN_MSG_CANNOTLOAD") + " \"" + thm->getFileName() + "\" .\n</b>"; Glib::ustring msg_ = Glib::ustring("<b>") + M("MAIN_MSG_CANNOTLOAD") + " \"" + thm->getFileName() + "\" .\n</b>";
Gtk::MessageDialog msgd (msg_, true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); Gtk::MessageDialog msgd (msg_, true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
@ -220,7 +230,7 @@ bool FilePanel::handleShortcutKey (GdkEventKey* event) {
bool FilePanel::on_expose_event(GdkEventExpose* event) bool FilePanel::on_expose_event(GdkEventExpose* event)
{ {
if(dirpaned->get_children().size() ==1 ){ if(!options.tabbedUI && dirpaned->get_children().size() ==1 ){
parent->epanel->catalogPane->remove(*fileCatalog); parent->epanel->catalogPane->remove(*fileCatalog);
fileCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Vertical); fileCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Vertical);

View File

@ -116,6 +116,7 @@ void Options::setDefaults () {
thumbnailZoomRatios.push_back (1.0); thumbnailZoomRatios.push_back (1.0);
overlayedFileNames = true; overlayedFileNames = true;
showFileNames = true; showFileNames = true;
tabbedUI = false;
int babehav[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0}; int babehav[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0};
baBehav = std::vector<int> (babehav, babehav+ADDSET_PARAM_NUM); baBehav = std::vector<int> (babehav, babehav+ADDSET_PARAM_NUM);

View File

@ -124,6 +124,7 @@ class Options {
std::vector<double> thumbnailZoomRatios; std::vector<double> thumbnailZoomRatios;
bool overlayedFileNames; bool overlayedFileNames;
bool showFileNames; bool showFileNames;
bool tabbedUI;
Options (); Options ();

View File

@ -81,7 +81,7 @@ RTWindow::RTWindow () {
hbe->set_spacing (2); hbe->set_spacing (2);
hbe->show_all (); hbe->show_all ();
mainNB->append_page (*epanel, *hbe); mainNB->append_page (*epanel, *hbe);
mainNB->set_current_page (mainNB->page_num (*epanel)); mainNB->set_current_page (mainNB->page_num (*fpanel));
signal_key_press_event().connect( sigc::mem_fun(*this, &RTWindow::keyPressed) ); signal_key_press_event().connect( sigc::mem_fun(*this, &RTWindow::keyPressed) );
@ -116,6 +116,9 @@ RTWindow::RTWindow () {
add (*mainBox); add (*mainBox);
show_all (); show_all ();
if(options.tabbedUI)
epanel->hide_all();
} }
void RTWindow::on_realize () { void RTWindow::on_realize () {
@ -153,7 +156,7 @@ void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) {
epanels[ name ] = ep; epanels[ name ] = ep;
filesEdited.insert ( name ); filesEdited.insert ( name );
fpanel->refreshEditedState (filesEdited); fpanel->refreshEditedState (filesEdited);
} }
void RTWindow::remEditorPanel (EditorPanel* ep) { void RTWindow::remEditorPanel (EditorPanel* ep) {