|
|
|
|
@ -8,6 +8,7 @@ AbstractItem::AbstractItem(string id, ActionHandler* handler, ActionType action, |
|
|
|
|
this->action = action; |
|
|
|
|
this->menuitem = NULL; |
|
|
|
|
this->checkMenuItem = false; |
|
|
|
|
this->ignoreNextCheckMenuEvent = false; |
|
|
|
|
this->menuSignalHandler = 0; |
|
|
|
|
this->group = GROUP_NOGROUP; |
|
|
|
|
this->enabled = true; |
|
|
|
|
@ -64,6 +65,10 @@ void AbstractItem::actionSelected(ActionGroup group, ActionType action) |
|
|
|
|
{ |
|
|
|
|
if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(this->menuitem)) != itemActive) |
|
|
|
|
{ |
|
|
|
|
if (checkMenuItem) |
|
|
|
|
{ |
|
|
|
|
ignoreNextCheckMenuEvent = true; |
|
|
|
|
} |
|
|
|
|
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(this->menuitem), itemActive); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -135,6 +140,12 @@ void AbstractItem::activated(GdkEvent* event, GtkMenuItem* menuitem, GtkToolButt |
|
|
|
|
selected = gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(toolbutton)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (checkMenuItem && ignoreNextCheckMenuEvent) |
|
|
|
|
{ |
|
|
|
|
ignoreNextCheckMenuEvent = false; |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
actionPerformed(action, group, event, menuitem, toolbutton, selected); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -142,12 +153,6 @@ void AbstractItem::actionPerformed(ActionType action, ActionGroup group, |
|
|
|
|
GdkEvent* event, GtkMenuItem* menuitem, |
|
|
|
|
GtkToolButton* toolbutton, bool selected) |
|
|
|
|
{ |
|
|
|
|
if (checkMenuItem) |
|
|
|
|
{ |
|
|
|
|
printf("-->%i\n", selected); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
handler->actionPerformed(action, group, event, menuitem, toolbutton, selected); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|