Fixed image should not open multiple times

see issue 1024
This commit is contained in:
Oliver Duis
2011-10-03 19:04:44 +02:00
parent f5d3f60789
commit 6f5eb6b371
5 changed files with 32 additions and 7 deletions

View File

@@ -115,13 +115,6 @@ void EditWindow::on_mainNB_switch_page(GtkNotebookPage* page, guint page_num) {
}
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);
// construct closeable tab for the image
@@ -162,6 +155,16 @@ void EditWindow::remEditorPanel (EditorPanel* ep) {
// 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) {
if(event->keyval == GDK_F11) {
toggleFullscreen();