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;
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->epanel = this;
@ -186,24 +186,16 @@ EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), be
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());
viewpaned->pack1(*catalogPane, false, true);
fPanel = filePanel;
if(filePanel)
{
catalogPane = new Gtk::Paned();
viewpaned->pack1(*catalogPane, false, true);
}
viewpaned->pack2(*editbox, true, true);
fPanel = filePanel;
fCatalog = filePanel->fileCatalog;
Gtk::Frame* vbfr = Gtk::manage (new Gtk::Frame ());
vbfr->add (*viewpaned);
@ -263,6 +255,7 @@ EditorPanel::~EditorPanel () {
beforeIpc->setPreviewImageListener (NULL);
delete previewHandler;
previewHandler = NULL;
delete beforePreviewHandler;
if (ipc)
@ -278,9 +271,10 @@ EditorPanel::~EditorPanel () {
delete red;
delete green;
delete leftbox;
delete vboxright;
delete catalogPane;
delete vboxright;
delete saveAsDialog;
if(catalogPane)
delete catalogPane;
}
void EditorPanel::open (Thumbnail* tmb, rtengine::InitialImage* isrc) {
@ -514,8 +508,8 @@ void EditorPanel::info_toggled () {
// M("QINFO_ISO"), idata->getISOSpeed(),
// M("QINFO_FOCALLENGTH"), idata->getFocalLen())
// + Glib::ustring::compose ("%1: %2", M("QINFO_LENS"), Glib::ustring(idata->getLens()));
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",
infoString = Glib::ustring::compose (
"%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->getLens()),
Glib::ustring(idata->shutterToString(idata->getShutterSpeed())),
@ -904,8 +898,8 @@ void EditorPanel::saveOptions () {
//options.historyPanelWidth = hpanedl->get_position ();//older code
//options.toolPanelWidth = vboxright->get_width ();//older code
if (options.startupDir==STARTUPDIR_LAST && fCatalog->lastSelectedDir ()!="")
options.startupPath = fCatalog->lastSelectedDir ();
if (options.startupDir==STARTUPDIR_LAST && fPanel->fileCatalog->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)
{
if(catalogPane->get_children().size() ==0 ){
fPanel->dirpaned->remove(*fPanel->fileCatalog);
catalogPane->add(*fCatalog);
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();
}

View File

@ -82,8 +82,7 @@ class EditorPanel : public Gtk::VBox,
ToolPanelCoordinator* tpc;
RTWindow* parent;
SaveAsDialog* saveAsDialog;
BatchToolPanelCoordinator* btpCoordinator;
FileCatalog* fCatalog;
BatchToolPanelCoordinator* btpCoordinator;
FilePanel* fPanel;
@ -105,7 +104,7 @@ class EditorPanel : public Gtk::VBox,
int err;
public:
EditorPanel (FilePanel* filePanel);
EditorPanel (FilePanel* filePanel = NULL);
virtual ~EditorPanel ();
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
fileBrowser = new FileBrowser();
fileBrowser->setFileBrowserListener (this);
fileBrowser->setArrangement (ThumbBrowserBase::TB_Horizontal);
fileBrowser->setArrangement (ThumbBrowserBase::TB_Vertical);
fileBrowser->show ();
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 ){
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 {
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);
@ -220,7 +230,7 @@ bool FilePanel::handleShortcutKey (GdkEventKey* 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);
fileCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Vertical);

View File

@ -116,6 +116,7 @@ void Options::setDefaults () {
thumbnailZoomRatios.push_back (1.0);
overlayedFileNames = 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};
baBehav = std::vector<int> (babehav, babehav+ADDSET_PARAM_NUM);

View File

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

View File

@ -81,7 +81,7 @@ RTWindow::RTWindow () {
hbe->set_spacing (2);
hbe->show_all ();
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) );
@ -116,6 +116,9 @@ RTWindow::RTWindow () {
add (*mainBox);
show_all ();
if(options.tabbedUI)
epanel->hide_all();
}
void RTWindow::on_realize () {
@ -153,7 +156,7 @@ void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) {
epanels[ name ] = ep;
filesEdited.insert ( name );
fpanel->refreshEditedState (filesEdited);
fpanel->refreshEditedState (filesEdited);
}
void RTWindow::remEditorPanel (EditorPanel* ep) {