Make file catalog work in both main and editor panels!!!
This commit is contained in:
@@ -187,19 +187,24 @@ EditorPanel::EditorPanel (FilePanel* filePanel) : beforePreviewHandler(NULL), be
|
|||||||
}
|
}
|
||||||
|
|
||||||
ipc = NULL;
|
ipc = NULL;
|
||||||
btpCoordinator = new BatchToolPanelCoordinator (filePanel);
|
// btpCoordinator = new BatchToolPanelCoordinator (filePanel);
|
||||||
fCatalog = new FileCatalog (btpCoordinator->coarse, btpCoordinator->getToolBar()); //, filePanel->fileCatalog->fileBrowser);
|
// fCatalog = new FileCatalog (btpCoordinator->coarse, btpCoordinator->getToolBar()); //, filePanel->fileCatalog->fileBrowser);
|
||||||
filePanel->dirBrowser->addDirSelectionListener (fCatalog);
|
// filePanel->dirBrowser->addDirSelectionListener (fCatalog);
|
||||||
// fCatalog->setFilterPanel (filePanel->filterPanel);
|
// // fCatalog->setFilterPanel (filePanel->filterPanel);
|
||||||
fCatalog->setImageAreaToolListener (btpCoordinator);
|
// fCatalog->setImageAreaToolListener (btpCoordinator);
|
||||||
fCatalog->setFileSelectionListener (filePanel);
|
// fCatalog->setFileSelectionListener (filePanel);
|
||||||
fCatalog->setFileSelectionChangeListener (btpCoordinator);
|
// fCatalog->setFileSelectionChangeListener (btpCoordinator);
|
||||||
fCatalog->setEnabled(true);
|
// 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(*fCatalog, false, true);
|
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);
|
||||||
hpanedl->pack2(*vbfr, true, true);
|
hpanedl->pack2(*vbfr, true, true);
|
||||||
@@ -274,7 +279,7 @@ EditorPanel::~EditorPanel () {
|
|||||||
delete green;
|
delete green;
|
||||||
delete leftbox;
|
delete leftbox;
|
||||||
delete vboxright;
|
delete vboxright;
|
||||||
|
delete catalogPane;
|
||||||
delete saveAsDialog;
|
delete saveAsDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -976,3 +981,15 @@ 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(catalogPane->get_children().size() ==0 ){
|
||||||
|
fPanel->dirpaned->remove(*fPanel->fileCatalog);
|
||||||
|
catalogPane->add(*fCatalog);
|
||||||
|
fCatalog->fileBrowser->setArrangement(ThumbBrowserBase::TB_Horizontal);
|
||||||
|
fCatalog->redrawAll();
|
||||||
|
}
|
||||||
|
return Gtk::VBox::on_expose_event(event);
|
||||||
|
}
|
@@ -84,6 +84,8 @@ class EditorPanel : public Gtk::VBox,
|
|||||||
SaveAsDialog* saveAsDialog;
|
SaveAsDialog* saveAsDialog;
|
||||||
BatchToolPanelCoordinator* btpCoordinator;
|
BatchToolPanelCoordinator* btpCoordinator;
|
||||||
FileCatalog* fCatalog;
|
FileCatalog* fCatalog;
|
||||||
|
FilePanel* fPanel;
|
||||||
|
|
||||||
|
|
||||||
Thumbnail* openThm;
|
Thumbnail* openThm;
|
||||||
rtengine::InitialImage* isrc;
|
rtengine::InitialImage* isrc;
|
||||||
@@ -142,6 +144,9 @@ class EditorPanel : public Gtk::VBox,
|
|||||||
bool handleShortcutKey (GdkEventKey* event);
|
bool handleShortcutKey (GdkEventKey* event);
|
||||||
|
|
||||||
void saveOptions ();
|
void saveOptions ();
|
||||||
|
|
||||||
|
Gtk::Paned *catalogPane;
|
||||||
|
bool on_expose_event(GdkEventExpose* event);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -38,7 +38,7 @@ FilePanel::FilePanel () : parent(NULL) {
|
|||||||
placesBrowser = new PlacesBrowser ();
|
placesBrowser = new PlacesBrowser ();
|
||||||
recentBrowser = new RecentBrowser ();
|
recentBrowser = new RecentBrowser ();
|
||||||
|
|
||||||
placespaned = new Gtk::HPaned ();
|
placespaned = new Gtk::VPaned ();
|
||||||
placespaned->set_position (options.dirBrowserHeight);
|
placespaned->set_position (options.dirBrowserHeight);
|
||||||
|
|
||||||
Gtk::VBox* obox = Gtk::manage (new Gtk::VBox ());
|
Gtk::VBox* obox = Gtk::manage (new Gtk::VBox ());
|
||||||
@@ -51,6 +51,20 @@ FilePanel::FilePanel () : parent(NULL) {
|
|||||||
dirpaned->pack1 (*placespaned, true, true);
|
dirpaned->pack1 (*placespaned, true, true);
|
||||||
tpc = new BatchToolPanelCoordinator (this);
|
tpc = new BatchToolPanelCoordinator (this);
|
||||||
|
|
||||||
|
fileCatalog = new FileCatalog (tpc->coarse, tpc->getToolBar());
|
||||||
|
dirpaned->pack2 (*fileCatalog, true, true);
|
||||||
|
dirBrowser->addDirSelectionListener (fileCatalog);
|
||||||
|
fileCatalog->setFileSelectionListener (this);
|
||||||
|
fileCatalog->setFileSelectionChangeListener (tpc);
|
||||||
|
Gtk::ScrolledWindow* sFilterPanel = new Gtk::ScrolledWindow();
|
||||||
|
filterPanel = new FilterPanel ();
|
||||||
|
sFilterPanel->add (*filterPanel);
|
||||||
|
sFilterPanel->set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
|
||||||
|
|
||||||
|
fileCatalog->setFilterPanel (filterPanel);
|
||||||
|
fileCatalog->setImageAreaToolListener (tpc);
|
||||||
|
|
||||||
|
|
||||||
placesBrowser->setDirBrowserRemoteInterface (dirBrowser);
|
placesBrowser->setDirBrowserRemoteInterface (dirBrowser);
|
||||||
recentBrowser->setDirBrowserRemoteInterface (dirBrowser);
|
recentBrowser->setDirBrowserRemoteInterface (dirBrowser);
|
||||||
dirBrowser->addDirSelectionListener (recentBrowser);
|
dirBrowser->addDirSelectionListener (recentBrowser);
|
||||||
@@ -163,3 +177,16 @@ bool FilePanel::handleShortcutKey (GdkEventKey* event) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FilePanel::on_expose_event(GdkEventExpose* event)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(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);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -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,6 +59,7 @@ class FilePanel : public Gtk::HPaned,
|
|||||||
DirBrowser* dirBrowser;
|
DirBrowser* dirBrowser;
|
||||||
FilterPanel* filterPanel;
|
FilterPanel* filterPanel;
|
||||||
FileCatalog* fileCatalog;
|
FileCatalog* fileCatalog;
|
||||||
|
Gtk::HPaned* dirpaned;
|
||||||
|
|
||||||
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
|
||||||
@@ -76,6 +77,7 @@ 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
|
||||||
|
Reference in New Issue
Block a user