? aclocal.m4
? intltool-extract.in
? intltool-merge.in
? config.h.in
? intltool-update.in
? autom4te.cache
? Makefile.in
? configure
? config.log
? stamp-h1
? config.status
? gcalctool.desktop
? Makefile
? config.h
? intltool-extract
? intltool-merge
? intltool-update
? gcalctool/Makefile.in
? gcalctool/Makefile
? gcalctool/gcalctool
? help/Makefile.in
? help/Makefile
? help/C/Makefile.in
? help/C/Makefile
? help/C/omf_timestamp
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gcalctool/ChangeLog,v
retrieving revision 1.109
diff -u -r1.109 ChangeLog
--- ChangeLog	19 Mar 2003 16:39:33 -0000	1.109
+++ ChangeLog	24 Mar 2003 20:00:29 -0000
@@ -7,6 +7,19 @@
 gcalctool change history.
 =========================
 
+v4.2.76 - 24th March 2003.	  (richb)
+
+* Slight adjustments to bug 108226
+  (http://bugzilla.gnome.org/show_bug.cgi?id=108226)
+
+  Menu item is now "Show Trailing Zeroes", with a Control-T accelerator.
+  Added a similar menu item to the View menu on the menu bar (only active
+  in Scientific mode). Adjusted program logic. Cases of "rm_zeroes" now
+  become "show_zeroes". Updated the manual pages and the gcalctool
+  schemas file.
+
+----
+
 v4.2.75 - 19th March 2003.       (Dennis Cranston)
 
 * Fixed bug 108729 (http://bugzilla.gnome.org/show_bug.cgi?id=108729)
Index: NEWS
===================================================================
RCS file: /cvs/gnome/gcalctool/NEWS,v
retrieving revision 1.51
diff -u -r1.51 NEWS
--- NEWS	19 Mar 2003 16:39:34 -0000	1.51
+++ NEWS	24 Mar 2003 20:00:29 -0000
@@ -5,6 +5,14 @@
  *  All Rights Reserved.
  */
 
+Overview of changes in gcalctool 4.2.76
+
+* Slight adjustments to Bugzilla bug 108226 . Menu item is now
+  "Show Trailing Zeroes", with a Control-T accelerator. Added a similar
+  menu item to the View menu on the menu bar.
+
+----
+
 Overview of changes in gcalctool 4.2.75
 
 * Fixed Bugzilla bug 108729. 
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gcalctool/configure.in,v
retrieving revision 1.116
diff -u -r1.116 configure.in
--- configure.in	19 Mar 2003 16:39:34 -0000	1.116
+++ configure.in	24 Mar 2003 20:00:29 -0000
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT(configure.in)
-AM_INIT_AUTOMAKE(gcalctool, 4.2.75)
+AM_INIT_AUTOMAKE(gcalctool, 4.2.76)
 AM_CONFIG_HEADER(config.h)
 AM_MAINTAINER_MODE
 
Index: gcalctool.schemas
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool.schemas,v
retrieving revision 1.3
diff -u -r1.3 gcalctool.schemas
--- gcalctool.schemas	18 Mar 2003 16:29:43 -0000	1.3
+++ gcalctool.schemas	24 Mar 2003 20:00:29 -0000
@@ -79,16 +79,16 @@
       </locale>
     </schema>
     <schema>
-      <applyto>/apps/gcalctool/removezeroes</applyto>
-      <key>/schemas/apps/gcalctool/removezeroes</key>
+      <applyto>/apps/gcalctool/showzeroes</applyto>
+      <key>/schemas/apps/gcalctool/showzeroes</key>
       <owner>gcalctool</owner>
       <type>string</type>
       <locale name="C">
-        <default>true</default>
-        <short>Remove Trailing Zeroes</short>
+        <default>false</default>
+        <short>Show Trailing Zeroes</short>
         <long>
           Indicates whether any trailing zeroes after the 
-          number point should be removed from the display value.
+          number point should be shown in the display value.
         </long>
       </locale>
     </schema>
Index: gcalctool/calctool.h
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/calctool.h,v
retrieving revision 1.30
diff -u -r1.30 calctool.h
--- gcalctool/calctool.h	18 Mar 2003 16:29:46 -0000	1.30
+++ gcalctool/calctool.h	24 Mar 2003 20:00:29 -0000
@@ -46,8 +46,8 @@
 #define UNLINK       (void) unlink
 
 /* Menu bar menu types. */
-enum mb_type { M_ASCII, M_BASIC, M_CONTENTS, M_COPY,  
-               M_FIN,   M_PASTE, M_QUIT,     M_REGS, M_SCI };
+enum mb_type { M_ASCII, M_BASIC, M_CONTENTS, M_COPY,  M_FIN,
+               M_PASTE, M_QUIT,  M_REGS,     M_SCI,   M_ZEROES };
 
 enum base_type { BIN, OCT, DEC, HEX };      /* Base definitions. */
 
@@ -298,6 +298,7 @@
     int beep;          /* Indicates whether there is a beep sound on error. */
     int cur_ch;        /* Current character if keyboard event. */
     int cur_op;        /* Current arithmetic operation. */
+    int doing_mi;      /* Set if adjusting the "show zeroes" menu item. */
     int down;          /* Indicates is a mouse button is down. */
     int error;         /* Indicates some kind of display error. */
     int hyperbolic;    /* If set, trig functions will be hyperbolic. */
@@ -316,8 +317,8 @@
     int pending_op;    /* Arithmetic operation for pending command. */
     int pointed;       /* Whether a decimal point has been given. */
     int rstate;        /* Indicates if memory register frame is displayed. */
-    int rm_zeroes;     /* Set if trailing zeroes should be removed. */
     int show_paren;    /* Set if we wish to show DISPLAYITEM during parens. */
+    int show_zeroes;   /* Set if trailing zeroes should be shown. */
     int started;       /* Set just before window is displayed. */
     int toclear;       /* Indicates if display should be cleared. */
 } CalcVars;
@@ -417,7 +418,6 @@
 void set_inv_item(int);
 void set_mode(enum mode_type);
 void set_title(enum fcp_type, char *);
-void set_rm_zeroes_toggle(int);
 void show_ascii_frame();
 void show_display(int *);
 void srand48();
Index: gcalctool/display.c
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/display.c,v
retrieving revision 1.18
diff -u -r1.18 display.c
--- gcalctool/display.c	18 Mar 2003 16:29:46 -0000	1.18
+++ gcalctool/display.c	24 Mar 2003 20:00:29 -0000
@@ -158,7 +158,7 @@
     v->toclear = 1;
     v->pointed = 0;
 
-    if (v->rm_zeroes && v->accuracy != 0) {
+    if (!v->show_zeroes && v->accuracy != 0) {
         optr = v->fnum + strlen(v->fnum) - 1;
         while (*optr == '0') {
             optr--;
Index: gcalctool/functions.c
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/functions.c,v
retrieving revision 1.19
diff -u -r1.19 functions.c
--- gcalctool/functions.c	18 Mar 2003 16:29:46 -0000	1.19
+++ gcalctool/functions.c	24 Mar 2003 20:00:29 -0000
@@ -51,23 +51,13 @@
     char intval[5];
     int i;
 
-    if (!v->started) {
-        return;
-    }
-
-    if (v->current->value == 'R') {     /* "Remove trailing zeroes" entry? */
-        v->rm_zeroes = !v->rm_zeroes;
-        put_resource(R_ZEROES, set_bool(v->rm_zeroes == TRUE));
-        make_registers();
-    } else {
-        for (i = 0; i <= 9; i++) {
-            if (v->current->value == get_menu_entry(M_ACC, i)) {
-                v->accuracy = char_val(v->current->value);
-                SPRINTF(intval, "%d", v->accuracy);
-                put_resource(R_ACCURACY, intval);
-                make_registers();
-                return;
-            }
+    for (i = 0; i <= 9; i++) {
+        if (v->current->value == get_menu_entry(M_ACC, i)) {
+            v->accuracy = char_val(v->current->value);
+            SPRINTF(intval, "%d", v->accuracy);
+            put_resource(R_ACCURACY, intval);
+            make_registers();
+            return;
         }
     }
 }
Index: gcalctool/gcalctool.1
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/gcalctool.1,v
retrieving revision 1.17
diff -u -r1.17 gcalctool.1
--- gcalctool/gcalctool.1	18 Mar 2003 16:29:46 -0000	1.17
+++ gcalctool/gcalctool.1	24 Mar 2003 20:00:29 -0000
@@ -1,5 +1,5 @@
 .\" Copyright (c) 1987-2003 - Sun Microsystems, Inc.
-.TH gcalctool 1 "18 March 2003"
+.TH gcalctool 1 "24 March 2003"
 .SH NAME
 gcalctool \- a desktop calculator
 .SH SYNOPSIS
@@ -34,11 +34,13 @@
 Internal arithmetic is now done with multi-precision floating point numbers.
 Accuracy can be adjusted from zero to nine numeric places in fixed notation,
 but numbers can be displayed in engineering and scientific notation as well.
+There is also an option to show or remove trailing zeroes after the numeric
+point.
 The calculator reverts to scientific notation when the number is larger than
 the display would allow in fixed notation. In the scientific mode, the base 
 of operation can be changed between binary, octal, decimal and hexadecimal.
-Numbers are initially displayed in fixed notation to two numeric places, 
-in the decimal base.
+Numbers are initially displayed in fixed notation to nine numeric places,
+with trailing zeroes removed, in the decimal base.
 .LP
 You can use the
 .I Copy
@@ -139,13 +141,13 @@
 .sp
 .TP
 .B Resource:
-/schemes/apps/gcalctool/removezeroes
+/schemes/apps/gcalctool/showzeroes
 .TP
 .B Values:
 true, false (true)
 .TP
 .B Description
-Whether trailing zeroes, after the numeric point, are removed from the 
+Whether trailing zeroes, after the numeric point, are shown in the
 display value.
 .sp
 .TP
Index: gcalctool/get.c
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/get.c,v
retrieving revision 1.19
diff -u -r1.19 get.c
--- gcalctool/get.c	18 Mar 2003 16:29:46 -0000	1.19
+++ gcalctool/get.c	24 Mar 2003 20:00:29 -0000
@@ -195,7 +195,7 @@
     int acc, i, n, size;
 
     v->accuracy      = 9;      /* Initial accuracy. */
-    v->rm_zeroes     = TRUE;   /* Remove trailing zeroes. */
+    v->show_zeroes   = FALSE;  /* Don't show trailing zeroes. */
     v->base          = DEC;    /* Initial base. */
     v->dtype         = FIX;    /* Initial number display mode. */
     v->ttype         = DEG;    /* Initial trigonometric type. */
@@ -325,7 +325,7 @@
     }
 
     if (get_bool_resource(R_ZEROES, &boolval)) {
-        v->rm_zeroes = boolval;
+        v->show_zeroes = boolval;
     }
 }
 
Index: gcalctool/gtk.c
===================================================================
RCS file: /cvs/gnome/gcalctool/gcalctool/gtk.c,v
retrieving revision 1.79
diff -u -r1.79 gtk.c
--- gcalctool/gtk.c	19 Mar 2003 16:39:34 -0000	1.79
+++ gcalctool/gtk.c	24 Mar 2003 20:00:30 -0000
@@ -161,6 +161,7 @@
 static void add_cf_column(GtkTreeView *, gchar *, gint, gboolean);
 static void aframe_cancel_cb(GtkButton *, gpointer);
 static void aframe_ok_cb(GtkButton *, gpointer);
+static void astz_proc(gpointer, int, GtkWidget *);
 static void base_cb(GtkToggleButton *, gpointer);
 static void cell_edited(GtkCellRendererText *, 
                         const gchar *, const gchar *, gpointer);
@@ -174,6 +175,7 @@
 static void menu_pos_func(GtkMenu *, gint *, gint *, gboolean *, gpointer);
 static void menu_proc_cb(GtkMenuItem *, gpointer);
 static void menu_proc(gpointer, int, GtkWidget *);
+static void mstz_proc(gpointer, int, GtkWidget *);
 static void new_cf_value(GtkMenuItem *, gpointer);
 static void put_constant(int, char *, char *);
 static void put_function(int, char *, char *);
@@ -203,6 +205,8 @@
     { N_("/View/_Financial Mode"), "<control>F", mb_proc, M_FIN, "/View/Basic Mode" },
     { N_("/View/_Scientific Mode"),"<control>S", mb_proc, M_SCI, "/View/Basic Mode" },
     { N_("/View/sep1"),            NULL, NULL,    0,       "<Separator>" },
+    { N_("/View/Show _Trailing Zeroes"),"<control>T", mstz_proc, M_ZEROES, "<ToggleItem>" },
+    { N_("/View/sep2"),	           NULL, NULL,	  0,       "<Separator>" },
     { N_("/View/_Memory Registers"),"<control>M", mb_proc, M_REGS, "<ToggleItem>" },
 
     { N_("/_Help"),                NULL, NULL,    0,       "<Branch>" },
@@ -222,7 +226,7 @@
     { N_("/8 radix places"), NULL, menu_proc, '8', "/0 radix places" },
     { N_("/9 radix places"), NULL, menu_proc, '9', "/0 radix places" },
     { N_("/sep1"),           NULL, NULL,       0,  "<Separator>" },
-    { N_("/_Remove Trailing Zeroes"),"<control>R", menu_proc, 'R', "<ToggleItem>" },
+    { N_("/Show _Trailing Zeroes"),"<control>T", astz_proc, 'T', "<ToggleItem>" },
 };
 
 static GtkItemFactoryEntry lshift_menu[] = {
@@ -428,6 +432,25 @@
 
 
 static void
+astz_proc(gpointer data, int choice, GtkWidget *item)
+{
+    GtkWidget *mi;
+
+    if (!v->doing_mi) {
+        v->show_zeroes = !v->show_zeroes;
+        v->doing_mi = 1;
+        mi = gtk_item_factory_get_widget_by_action(X->mb_fact, M_ZEROES);
+        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mi), v->show_zeroes);
+        v->doing_mi = 0;
+
+        show_display(v->MPdisp_val);
+	put_resource(R_ZEROES, set_bool(v->show_zeroes == TRUE));
+	make_registers();
+    }
+}
+
+
+static void
 base_cb(GtkToggleButton *button, gpointer user_data)
 {
     do_base((enum base_type) g_object_get_data(G_OBJECT(button), "base"));
@@ -1461,7 +1484,7 @@
     n = (struct button *) g_object_get_data(G_OBJECT(BUT_ACC), "button");
     menu = create_menu(n->mtype, n);
     set_accuracy_toggle(v->accuracy);
-    set_rm_zeroes_toggle(v->rm_zeroes);
+    set_show_zeroes_toggle(v->show_zeroes);
 }
 
 
@@ -1754,8 +1777,7 @@
             break;
 
         case M_SCI:
-            v->modetype = SCIENTIFIC;
-            do_mode();
+            reset_mode_values(SCIENTIFIC);
             break;
 
         case M_REGS:
@@ -1777,6 +1799,26 @@
 }
 
 
+static void
+mstz_proc(gpointer data, int choice, GtkWidget *item)
+{
+    GtkWidget *mi;
+
+
+    if (!v->doing_mi) {
+	v->show_zeroes = !v->show_zeroes;
+        v->doing_mi = 1;
+        mi = gtk_item_factory_get_widget_by_action(X->fact[(int) M_ACC], 'T');
+        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mi), v->show_zeroes);
+        v->doing_mi = 0;
+
+        show_display(v->MPdisp_val);
+	put_resource(R_ZEROES, set_bool(v->show_zeroes == TRUE));
+	make_registers();
+    }
+}
+
+
 /*ARGSUSED*/
 static void
 new_cf_value(GtkMenuItem *item, gpointer user_data)
@@ -1842,11 +1884,9 @@
     v->accuracy = 9;
     set_accuracy_toggle(v->accuracy);
 
-    v->started = 0;          /* Hack to get do_accuracy() to just return. */
-    v->rm_zeroes = TRUE;
-    set_rm_zeroes_toggle(v->rm_zeroes);
-    put_resource(R_ZEROES, set_bool(v->rm_zeroes == TRUE));
-    v->started = 1;
+    v->show_zeroes = FALSE;
+    set_show_zeroes_toggle(v->show_zeroes);
+    put_resource(R_ZEROES, set_bool(v->show_zeroes == TRUE));
 
     show_display(v->MPdisp_val);
     make_registers();
@@ -2034,12 +2074,18 @@
 
 
 void
-set_rm_zeroes_toggle(int state)
+set_show_zeroes_toggle(int state)
 {
-    GtkWidget *rmz;
+    GtkWidget *mi;
 
-    rmz = gtk_item_factory_get_widget_by_action(X->fact[(int) M_ACC], 'R');
-    gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(rmz), state);
+    v->doing_mi = 1;    /* Hack to get [a,m]stz_proc() to just return. */
+    mi = gtk_item_factory_get_widget_by_action(X->fact[(int) M_ACC], 'T');
+    gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mi), state);
+
+    mi = gtk_item_factory_get_widget_by_action(X->mb_fact, M_ZEROES);
+    gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mi), state);
+    gtk_widget_set_sensitive(mi, v->modetype == SCIENTIFIC);
+    v->doing_mi = 0;
 }
 
 
@@ -2063,6 +2109,7 @@
 {
     do_trigtype((enum trig_type) g_object_get_data(G_OBJECT(button), "trig"));
 }
+
 
 void
 start_tool()
