[ghex] Show file offset in statusbar as 0xOFFSET instead of OFFSET
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ghex] Show file offset in statusbar as 0xOFFSET instead of OFFSET
- Date: Sun, 1 Apr 2012 19:14:07 +0000 (UTC)
commit 3aea291ba48f1cd8a3d0b71afbe44f1c6a2166a6
Author: Martin Olsson <martin minimum se>
Date: Sat Mar 24 21:24:08 2012 +0100
Show file offset in statusbar as 0xOFFSET instead of OFFSET
Prepends a "0x" before the offset when "hexadecimal" offset has
been selected in the dropdown box under Preferences::Editing.
data/org.gnome.GHex.gschema.xml | 2 +-
src/preferences.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/data/org.gnome.GHex.gschema.xml b/data/org.gnome.GHex.gschema.xml
index a73ca53..d41d263 100644
--- a/data/org.gnome.GHex.gschema.xml
+++ b/data/org.gnome.GHex.gschema.xml
@@ -17,7 +17,7 @@
<default>100</default>
</key>
<key name="offset-format" type="s">
- <default>'%X'</default>
+ <default>'0x%X'</default>
</key>
<key name="print-font-data" type="s">
<default>'Courier 10'</default>
diff --git a/src/preferences.c b/src/preferences.c
index 0a08aad..3849ade 100644
--- a/src/preferences.c
+++ b/src/preferences.c
@@ -361,7 +361,7 @@ void set_current_prefs(PropertyUI *pui) {
gtk_entry_set_text(GTK_ENTRY(pui->format), offset_fmt);
if(strcmp(offset_fmt, "%d") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(pui->offset_menu), 0);
- else if(strcmp(offset_fmt, "%X") == 0)
+ else if(strcmp(offset_fmt, "0x%X") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(pui->offset_menu), 1);
else {
gtk_combo_box_set_active(GTK_COMBO_BOX(pui->offset_menu), 2);
@@ -602,7 +602,7 @@ offset_cb(GtkWidget *w, PropertyUI *pui)
gtk_widget_set_sensitive(pui->format, FALSE);
break;
case 1:
- gtk_entry_set_text(GTK_ENTRY(pui->format), "%X");
+ gtk_entry_set_text(GTK_ENTRY(pui->format), "0x%X");
gtk_widget_set_sensitive(pui->format, FALSE);
break;
case 2:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]