Solving issue 1851: "RT crashes in Single Editor Tab Mode when trying to save with Ctrl-S"
This commit is contained in:
@@ -179,7 +179,7 @@ if (WIN32)
|
|||||||
add_definitions (-D__MINGW32__)
|
add_definitions (-D__MINGW32__)
|
||||||
endif (MINGW)
|
endif (MINGW)
|
||||||
|
|
||||||
set (EXTRA_LIB "-lws2_32")
|
set (EXTRA_LIB "-lws2_32 -lshlwapi")
|
||||||
endif (WIN32)
|
endif (WIN32)
|
||||||
# you may need lcms v1.xx for older version : pkg_check_modules (LCMS REQUIRED lcms<=1.99)
|
# you may need lcms v1.xx for older version : pkg_check_modules (LCMS REQUIRED lcms<=1.99)
|
||||||
pkg_check_modules (LCMS REQUIRED lcms2)
|
pkg_check_modules (LCMS REQUIRED lcms2)
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <Shlwapi.h>
|
||||||
// for GCC32
|
// for GCC32
|
||||||
#ifndef _WIN32_IE
|
#ifndef _WIN32_IE
|
||||||
#define _WIN32_IE 0x0600
|
#define _WIN32_IE 0x0600
|
||||||
@@ -414,8 +415,7 @@ Glib::ustring safe_get_user_picture_dir() {
|
|||||||
* Warning: this function is a workaround for Windows platform, and not necessarily bullet proof
|
* Warning: this function is a workaround for Windows platform, and not necessarily bullet proof
|
||||||
*/
|
*/
|
||||||
bool safe_is_root_dir (const Glib::ustring& path) {
|
bool safe_is_root_dir (const Glib::ustring& path) {
|
||||||
Glib::ustring t = Glib::path_skip_root(path);
|
return PathIsRootA(path.c_str());
|
||||||
return t.empty();
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -945,13 +945,13 @@ bool EditorPanel::handleShortcutKey (GdkEventKey* event) {
|
|||||||
openThm->openDefaultViewer(event->state & GDK_SHIFT_MASK ? 2 : 1);
|
openThm->openDefaultViewer(event->state & GDK_SHIFT_MASK ? 2 : 1);
|
||||||
return true;
|
return true;
|
||||||
case GDK_y: // synchronize filebrowser with image in Editor
|
case GDK_y: // synchronize filebrowser with image in Editor
|
||||||
if (!simpleEditor && fPanel && fname!=""){
|
if (!simpleEditor && fPanel && !fname.empty()){
|
||||||
fPanel->fileCatalog->selectImage(fname, false);
|
fPanel->fileCatalog->selectImage(fname, false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break; // to avoid gcc complain
|
break; // to avoid gcc complain
|
||||||
case GDK_x: // clear filters and synchronize filebrowser with image in Editor
|
case GDK_x: // clear filters and synchronize filebrowser with image in Editor
|
||||||
if (!simpleEditor && fPanel && fname!=""){
|
if (!simpleEditor && fPanel && !fname.empty()){
|
||||||
fPanel->fileCatalog->selectImage(fname, true);
|
fPanel->fileCatalog->selectImage(fname, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1000,13 +1000,13 @@ bool EditorPanel::handleShortcutKey (GdkEventKey* event) {
|
|||||||
if (shift){
|
if (shift){
|
||||||
switch (event->keyval) {
|
switch (event->keyval) {
|
||||||
case GDK_F3: // open Previous image from Editor's perspective
|
case GDK_F3: // open Previous image from Editor's perspective
|
||||||
if (!simpleEditor && fPanel && fname!=""){
|
if (!simpleEditor && fPanel && !fname.empty()){
|
||||||
EditorPanel::openPreviousEditorImage();
|
EditorPanel::openPreviousEditorImage();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
break; // to avoid gcc complain
|
break; // to avoid gcc complain
|
||||||
case GDK_F4: // open next image from Editor's perspective
|
case GDK_F4: // open next image from Editor's perspective
|
||||||
if (!simpleEditor && fPanel && fname!=""){
|
if (!simpleEditor && fPanel && !fname.empty()){
|
||||||
EditorPanel::openNextEditorImage();
|
EditorPanel::openNextEditorImage();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1234,17 +1234,17 @@ void EditorPanel::sendToGimpPressed () {
|
|||||||
|
|
||||||
|
|
||||||
void EditorPanel::openPreviousEditorImage() {
|
void EditorPanel::openPreviousEditorImage() {
|
||||||
if (!simpleEditor && fPanel && fname!="")
|
if (!simpleEditor && fPanel && !fname.empty())
|
||||||
fPanel->fileCatalog->openNextPreviousEditorImage(fname, true, NAV_PREVIOUS);
|
fPanel->fileCatalog->openNextPreviousEditorImage(fname, true, NAV_PREVIOUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorPanel::openNextEditorImage() {
|
void EditorPanel::openNextEditorImage() {
|
||||||
if (!simpleEditor && fPanel && fname!="")
|
if (!simpleEditor && fPanel && !fname.empty())
|
||||||
fPanel->fileCatalog->openNextPreviousEditorImage(fname, true, NAV_NEXT);
|
fPanel->fileCatalog->openNextPreviousEditorImage(fname, true, NAV_NEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorPanel::syncFileBrowser() { // synchronize filebrowser with image in Editor
|
void EditorPanel::syncFileBrowser() { // synchronize filebrowser with image in Editor
|
||||||
if (!simpleEditor && fPanel && fname!="")
|
if (!simpleEditor && fPanel && !fname.empty())
|
||||||
fPanel->fileCatalog->selectImage(fname, true);
|
fPanel->fileCatalog->selectImage(fname, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -156,7 +156,7 @@ bool SaveAsDialog::getAutoSuffix () {
|
|||||||
|
|
||||||
bool SaveAsDialog::getImmediately () {
|
bool SaveAsDialog::getImmediately () {
|
||||||
|
|
||||||
return saveMethod[0]->get_active ();
|
return simpleEditor ? true : saveMethod[0]->get_active ();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SaveAsDialog::getToHeadOfQueue () {
|
bool SaveAsDialog::getToHeadOfQueue () {
|
||||||
@@ -170,6 +170,8 @@ bool SaveAsDialog::getToTailOfQueue () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int SaveAsDialog::getSaveMethodNum () {
|
int SaveAsDialog::getSaveMethodNum () {
|
||||||
|
if (simpleEditor)
|
||||||
|
return 0;
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
if (saveMethod[i]->get_active())
|
if (saveMethod[i]->get_active())
|
||||||
return i;
|
return i;
|
||||||
@@ -263,7 +265,7 @@ void SaveAsDialog::setImagePath (Glib::ustring ipath) {
|
|||||||
if (!safe_is_root_dir(path))
|
if (!safe_is_root_dir(path))
|
||||||
#endif
|
#endif
|
||||||
try {
|
try {
|
||||||
fchooser->add_shortcut_folder(Glib::path_get_dirname(path));
|
fchooser->add_shortcut_folder(path);
|
||||||
}
|
}
|
||||||
catch (Gtk::FileChooserError &err) {}
|
catch (Gtk::FileChooserError &err) {}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user