Fixed image should not open multiple times
see issue 1024
This commit is contained in:
@@ -115,13 +115,6 @@ void EditWindow::on_mainNB_switch_page(GtkNotebookPage* page, guint page_num) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void EditWindow::addEditorPanel (EditorPanel* ep, const std::string &name) {
|
void EditWindow::addEditorPanel (EditorPanel* ep, const std::string &name) {
|
||||||
if (epanels.find(name)!=epanels.end()) {
|
|
||||||
// remove existing panel
|
|
||||||
mainNB->remove_page (*epanels[name]);
|
|
||||||
epanels.erase (name);
|
|
||||||
filesEdited.erase (name);
|
|
||||||
}
|
|
||||||
|
|
||||||
ep->setParent (parent);
|
ep->setParent (parent);
|
||||||
|
|
||||||
// construct closeable tab for the image
|
// construct closeable tab for the image
|
||||||
@@ -162,6 +155,16 @@ void EditWindow::remEditorPanel (EditorPanel* ep) {
|
|||||||
// TODO: save options if wanted
|
// TODO: save options if wanted
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EditWindow::selectEditorPanel(const std::string &name) {
|
||||||
|
std::map<Glib::ustring, EditorPanel*>::iterator iep = epanels.find(name);
|
||||||
|
|
||||||
|
if (iep!=epanels.end()) {
|
||||||
|
mainNB->set_current_page (mainNB->page_num (*iep->second));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool EditWindow::keyPressed (GdkEventKey* event) {
|
bool EditWindow::keyPressed (GdkEventKey* event) {
|
||||||
if(event->keyval == GDK_F11) {
|
if(event->keyval == GDK_F11) {
|
||||||
toggleFullscreen();
|
toggleFullscreen();
|
||||||
|
@@ -45,6 +45,7 @@ class EditWindow : public Gtk::Window {
|
|||||||
|
|
||||||
void addEditorPanel (EditorPanel* ep,const std::string &name);
|
void addEditorPanel (EditorPanel* ep,const std::string &name);
|
||||||
void remEditorPanel (EditorPanel* ep);
|
void remEditorPanel (EditorPanel* ep);
|
||||||
|
bool selectEditorPanel(const std::string &name);
|
||||||
|
|
||||||
bool keyPressed (GdkEventKey* event);
|
bool keyPressed (GdkEventKey* event);
|
||||||
bool on_delete_event(GdkEventAny* event);
|
bool on_delete_event(GdkEventAny* event);
|
||||||
|
@@ -150,6 +150,10 @@ bool FilePanel::fileSelected (Thumbnail* thm) {
|
|||||||
if (!parent)
|
if (!parent)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Check if it's already open BEFORE loading the file
|
||||||
|
if (options.tabbedUI && parent->selectEditorPanel(Glib::path_get_basename (thm->getFileName())))
|
||||||
|
return true;
|
||||||
|
|
||||||
// try to open the file
|
// try to open the file
|
||||||
bool loading = thm->imageLoad( true );
|
bool loading = thm->imageLoad( true );
|
||||||
if( !loading ) return false;
|
if( !loading ) return false;
|
||||||
|
@@ -292,6 +292,22 @@ void RTWindow::remEditorPanel (EditorPanel* ep) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool RTWindow::selectEditorPanel(const std::string &name) {
|
||||||
|
if (EditWindow::isMultiDisplayEnabled()) {
|
||||||
|
EditWindow * wndEdit = EditWindow::getInstance(this);
|
||||||
|
if (wndEdit->selectEditorPanel(name)) return true;
|
||||||
|
} else {
|
||||||
|
std::map<Glib::ustring, EditorPanel*>::iterator iep = epanels.find(name);
|
||||||
|
|
||||||
|
if (iep!=epanels.end()) {
|
||||||
|
mainNB->set_current_page (mainNB->page_num (*iep->second));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool RTWindow::keyPressed (GdkEventKey* event) {
|
bool RTWindow::keyPressed (GdkEventKey* event) {
|
||||||
|
|
||||||
bool ctrl = event->state & GDK_CONTROL_MASK;
|
bool ctrl = event->state & GDK_CONTROL_MASK;
|
||||||
|
@@ -51,6 +51,7 @@ class RTWindow : public Gtk::Window, public rtengine::ProgressListener{
|
|||||||
|
|
||||||
void addEditorPanel (EditorPanel* ep,const std::string &name);
|
void addEditorPanel (EditorPanel* ep,const std::string &name);
|
||||||
void remEditorPanel (EditorPanel* ep);
|
void remEditorPanel (EditorPanel* ep);
|
||||||
|
bool selectEditorPanel(const std::string &name);
|
||||||
|
|
||||||
void addBatchQueueJob (BatchQueueEntry* bqe, bool head=false);
|
void addBatchQueueJob (BatchQueueEntry* bqe, bool head=false);
|
||||||
void addBatchQueueJobs (std::vector<BatchQueueEntry*> &entries);
|
void addBatchQueueJobs (std::vector<BatchQueueEntry*> &entries);
|
||||||
|
Reference in New Issue
Block a user