[ghex/gtk4-port: 49/91] Few minor tweaks.




commit a4ad3866fd5b4eeaf94566336e31f504c14bac38
Author: Logan Rathbone <poprocks gmail com>
Date:   Fri Jan 22 13:10:12 2021 -0500

    Few minor tweaks.

 src/ghex-application-window.c | 15 +++++++++------
 src/gtkhex.c                  |  2 +-
 src/hex-document.c            |  1 -
 3 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/ghex-application-window.c b/src/ghex-application-window.c
index 4a4a7c94..7c439bde 100644
--- a/src/ghex-application-window.c
+++ b/src/ghex-application-window.c
@@ -1079,9 +1079,11 @@ save_as_response_cb (GtkNativeDialog *dialog,
 
                change_ok = hex_document_change_file_name (doc, new_file_path);
 
-               /* "set window to file-name" 
-                * if (change_ok) ..... */
-
+               if (! change_ok) {
+                       g_error ("%s: There was a fatal error changing the name of the "
+                                       "file path. This should NOT happen and may be indicative "
+                                       "of a bug or programer error. Please file a bug report.");
+               }
                gtk_file_name = g_filename_to_utf8 (doc->file_name,
                                -1, NULL, NULL, NULL);
 
@@ -1093,9 +1095,10 @@ save_as_response_cb (GtkNativeDialog *dialog,
        }
        else
        {
-               g_debug("%s: NOT IMPLEMENTED - show following message in GUI:",
-                               __func__);
-               g_debug(_("Error saving file!"));
+               display_error_dialog (GTK_WINDOW(self),
+                               _("There was an error saving the file to the path specified."
+                                       "\n\n"
+                                       "You may not have the required permissions."));
        }
        fclose(file);
 
diff --git a/src/gtkhex.c b/src/gtkhex.c
index 3659f4be..e3f2e964 100644
--- a/src/gtkhex.c
+++ b/src/gtkhex.c
@@ -2320,7 +2320,7 @@ void gtk_hex_delete_selection(GtkHex *gh)
        start = MIN(gh->selection.start, gh->selection.end);
        end = MAX(gh->selection.start, gh->selection.end);
 
-       gtk_hex_set_selection(gh, 0, 0);
+       gtk_hex_clear_selection (gh);
 
        if(start != end) {
                if(start < gh->cursor_pos)
diff --git a/src/hex-document.c b/src/hex-document.c
index 806d35fd..97524ea7 100644
--- a/src/hex-document.c
+++ b/src/hex-document.c
@@ -1151,7 +1151,6 @@ hex_document_change_file_name (HexDocument *doc, const char *new_file_name)
        if (new_path_end)
                g_free (new_path_end);
 
-
        if (doc->file_name && doc->path_end) {
                g_signal_emit (G_OBJECT(doc), hex_signals[FILE_NAME_CHANGED], 0);
                return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]