GNOME Bugzilla – Bug 488783
memory registers not available if you start in Advanced mode
Last modified: 2007-10-22 18:52:26 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.)
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??
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.
I thought it might be the same bug (just a different flavor/symptom). Just filed bug 489105 for the problem in comment #1.
Created attachment 97662 [details] [review] Patch to fix the initial problem. Confirmed with Christian. Patch committed to SVN trunk. Closing as FIXED.