After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 488783 - memory registers not available if you start in Advanced mode
memory registers not available if you start in Advanced mode
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
5.21.x
Other Linux
: Normal normal
: ---
Assigned To: Rich Burridge
Rich Burridge
Depends on: 485919
Blocks:
 
 
Reported: 2007-10-20 23:07 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2007-10-22 18:52 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
Patch to fix the initial problem. (949 bytes, patch)
2007-10-22 18:52 UTC, Rich Burridge
committed Details | Review

Description Joanmarie Diggs (IRC: joanie) 2007-10-20 23:07:35 UTC
This seems to be a change/regression from the Glade conversion.

Steps to reproduce:

1. Launch gcalctool, switch to Advanced mode, then quit gcalctool.
2. Re-launch gcalctool.
3. Look in the View menu.

Expected results: Memory Registers would not be greyed out.

Actual results: Memory Registers is greyed out.

(If you choose Advanced at this point, Memory Registers becomes available.)
Comment 1 Joanmarie Diggs (IRC: joanie) 2007-10-21 15:45:37 UTC
Actually this seems to be a broader/more generic problem than what I original reported.

1. Launch gcalctool, switch to Advanced or Scientific mode, then quit
   gcalctool.
2. Re-launch gcalctool.
3. Press  any of the shortcuts for the keys in the mode you chose,
   like i for Int or @ for ^2.

Expected results:  The shortcuts would work.

Actual results:  The shortcuts don't work until you go back and re-choose your mode from the View menu.

Other observation:  Pressing C for +/- in step 3 does work as expected.  This is also a shortcut available in the Basic mode.  So maybe the bug is really that gcalctool doesn't realize that it's not in Basic mode when you first launch it??
Comment 2 Rich Burridge 2007-10-22 17:38:24 UTC
You're wedging more than one bug into one bugzilla bug report again 
Joanie! ;-) Could you file a separate bug for the problem you report 
in comment #1 please?

To address the initial problem.

As the main gcalctool frame is being created, in create_kframe() in gtk.c,
one of the things that is being done is adjust the sensitivity of the
"Memory Registers..." menu item in the view menu depending upon what
mode we are currently in. This is at line 1190 in gtk.c:

    gtk_widget_set_sensitive(GET_WIDGET("show_registers_menu"), (v->modetype != BASIC));

At the end of make_frames() in gtk.c, there is:

    set_memory_toggle(v->rstate);

This routine is now:

static void
set_memory_toggle(int state)
{
    GtkWidget *radio;

    radio = GET_WIDGET("show_registers_menu");
    gtk_widget_set_sensitive(radio, state);
}

this routine used to be:

static void
set_memory_toggle(int state)
{
    GtkWidget *reg;

    reg = gtk_ui_manager_get_widget(X->ui, "/MenuBar/ViewMenu/Memory");
    gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(reg), state);
}


In other words, we are changing the [un]setting of the active state for
the [un]setting of the sensitive state. I think this is wrong.

Should it now be:

static void
set_memory_toggle(int state)
{
    GtkWidget *radio;

    radio = GET_WIDGET("show_registers_menu");
    gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(reg), state);
}

?

That certainly seems to fix the problem.

I've sent email to Christian Persch regarding this as it was recent patches
from him that have caused this unexpected side-effect.
Comment 3 Joanmarie Diggs (IRC: joanie) 2007-10-22 17:52:46 UTC
I thought it might be the same bug (just a different flavor/symptom).

Just filed bug 489105 for the problem in comment #1.
Comment 4 Rich Burridge 2007-10-22 18:52:06 UTC
Created attachment 97662 [details] [review]
Patch to fix the initial problem.

Confirmed with Christian. Patch committed to SVN trunk. Closing as FIXED.