Bugfix for two crashes and some window title issues, see Issue 1493 for details

This commit is contained in:
Ingo
2014-11-03 21:43:27 +01:00
parent 1f64148fc9
commit a5e66f8dfc
3 changed files with 49 additions and 35 deletions

View File

@@ -1098,7 +1098,8 @@ bool EditorPanel::idle_saveImage (ProgressConnector<rtengine::IImage16*> *pc, Gl
msgd.run (); msgd.run ();
saveimgas->set_sensitive(true); saveimgas->set_sensitive(true);
sendtogimp->set_sensitive(true); sendtogimp->set_sensitive(true);
isProcessing = false;
} }
rtengine::ImageSource* imgsrc = isrc->getImageSource (); rtengine::ImageSource* imgsrc = isrc->getImageSource ();
@@ -1134,7 +1135,9 @@ bool EditorPanel::idle_imageSaved(ProgressConnector<int> *pc,rtengine::IImage16*
setProgressState(false); setProgressState(false);
delete pc; delete pc;
SoundManager::playSoundAsync(options.sndBatchQueueDone);
isProcessing = false;
return false; return false;
} }
@@ -1214,7 +1217,8 @@ void EditorPanel::saveAsPressed () {
fnameOK = confirmOverwrite (*saveAsDialog, fnameOut); fnameOK = confirmOverwrite (*saveAsDialog, fnameOut);
} }
if (fnameOK) { if (fnameOK) {
isProcessing = true;
// save image // save image
rtengine::procparams::ProcParams pparams; rtengine::procparams::ProcParams pparams;
ipc->getParams (&pparams); ipc->getParams (&pparams);

View File

@@ -361,29 +361,31 @@ bool RTWindow::on_window_state_event(GdkEventWindowState* event) {
} }
void RTWindow::on_mainNB_switch_page(GtkNotebookPage* page, guint page_num) { void RTWindow::on_mainNB_switch_page(GtkNotebookPage* page, guint page_num) {
if (page_num > 1) { if(!on_delete_has_run) {
if (isSingleTabMode()) MoveFileBrowserToEditor(); if(isEditorPanel(page_num)) {
if (isSingleTabMode() && epanel)
MoveFileBrowserToEditor();
EditorPanel *ep = static_cast<EditorPanel*>(mainNB->get_nth_page(page_num));
ep->setAspect();
if (!isSingleTabMode()){
if (filesEdited.size()>0){
set_title_decorated(ep->getFileName());
}
}
} else {
// in single tab mode with command line filename epanel does not exist yet
if (isSingleTabMode() && epanel) {
// Save profile on leaving the editor panel
epanel->saveProfile();
EditorPanel *ep = static_cast<EditorPanel*>(mainNB->get_nth_page(page_num)); // Moving the FileBrowser only if the user has switched to the FileBrowser tab
ep->setAspect(); if (mainNB->get_nth_page(page_num)==fpanel)
MoveFileBrowserToMain();
if (!isSingleTabMode() && mainNB->get_current_page ()>2){ }
if (mainNB->get_n_pages()>2 && filesEdited.size()>0){
set_title_decorated(ep->getFileName());
}
} }
}
} else {
// in single tab mode with command line filename epanel does not exist yet
if (isSingleTabMode() && epanel) {
// Save profile on leaving the editor panel
epanel->saveProfile();
// Moving the FileBrowser only if the user has switched to the FileBrowser tab
if (page_num==0)
MoveFileBrowserToMain();
}
}
} }
void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) { void RTWindow::addEditorPanel (EditorPanel* ep, const std::string &name) {
@@ -440,11 +442,9 @@ void RTWindow::remEditorPanel (EditorPanel* ep) {
mainNB->remove_page (*ep); mainNB->remove_page (*ep);
if (mainNB->get_current_page () == mainNB->page_num (*bpanel) || mainNB->get_current_page () == mainNB->page_num (*fpanel)){ if (!isEditorPanel(mainNB->get_current_page())){
mainNB->set_current_page (mainNB->page_num (*fpanel));
set_title_decorated(""); set_title_decorated("");
} } else {
else{
EditorPanel* ep = static_cast<EditorPanel*>(mainNB->get_nth_page (mainNB->get_current_page())); EditorPanel* ep = static_cast<EditorPanel*>(mainNB->get_nth_page (mainNB->get_current_page()));
set_title_decorated(ep->getFileName()); set_title_decorated(ep->getFileName());
} }
@@ -569,15 +569,14 @@ bool RTWindow::on_delete_event(GdkEventAny* event) {
else { else {
int pageCount=mainNB->get_n_pages(); int pageCount=mainNB->get_n_pages();
// First and second are file browser and batch queue for (int i=0;i<pageCount && !isProcessing;i++) {
if (pageCount>2) { if(isEditorPanel(i))
for (int i=2;i<pageCount;i++) isProcessing |= (static_cast<EditorPanel*>(mainNB->get_nth_page(i)))->getIsProcessing();
isProcessing |= (static_cast<EditorPanel*>(mainNB->get_nth_page(i)))->getIsProcessing(); }
}
} }
if (isProcessing) return true; if (isProcessing)
return true;
if( fpanel ) if( fpanel )
fpanel->saveOptions (); fpanel->saveOptions ();
@@ -774,3 +773,11 @@ void RTWindow::CloseOpenEditors(){
itr = epanels.begin(); itr = epanels.begin();
} }
} }
bool RTWindow::isEditorPanel(Widget* panel) {
return (panel != bpanel) && (panel != fpanel);
}
bool RTWindow::isEditorPanel(guint pageNum) {
return isEditorPanel(mainNB->get_nth_page(pageNum));
}

View File

@@ -53,6 +53,9 @@ class RTWindow : public Gtk::Window, public rtengine::ProgressListener{
bool on_expose_event_epanel(GdkEventExpose* event); bool on_expose_event_epanel(GdkEventExpose* event);
bool on_expose_event_fpanel(GdkEventExpose* event); bool on_expose_event_fpanel(GdkEventExpose* event);
bool splashClosed(GdkEventAny* event); bool splashClosed(GdkEventAny* event);
bool isEditorPanel(Widget* panel);
bool isEditorPanel(guint pageNum);
Glib::ustring versionStr; Glib::ustring versionStr;
#if defined(__APPLE__) #if defined(__APPLE__)
GtkosxApplication *osxApp; GtkosxApplication *osxApp;