Skip to content
Snippets Groups Projects
Commit 3c701808 authored by deuce's avatar deuce
Browse files

Remove/Delete buttons and menu items working.

parent be19a965
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,7 @@ void load_user(GtkWidget *wiggy, gpointer data)
{
GtkWidget *w;
char str[1024];
gboolean b;
user.number=current_user;
if(user.number < 1 || user.number > totalusers) {
......@@ -25,6 +26,32 @@ void load_user(GtkWidget *wiggy, gpointer data)
return;
}
/* Toolbar indicators */
b=user.misc&DELETED?TRUE:FALSE;
w=glade_xml_get_widget(xml, "bDelete");
if(w==NULL)
fprintf(stderr,"Cannot get the deleted toolbar widget\n");
else
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(w),b);
w=glade_xml_get_widget(xml, "delete1");
if(w==NULL)
fprintf(stderr,"Cannot get the deleted menu widget\n");
else
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(w),b);
b=user.misc&INACTIVE?TRUE:FALSE;
w=glade_xml_get_widget(xml, "bRemove");
if(w==NULL)
fprintf(stderr,"Cannot get the removed toolbar widget\n");
else
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(w),b);
w=glade_xml_get_widget(xml, "remove1");
if(w==NULL)
fprintf(stderr,"Cannot get the remove menu widget\n");
else
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(w),b);
/* Peronal Tab */
/* Alias */
w=glade_xml_get_widget(xml, "eUserAlias");
......@@ -469,3 +496,41 @@ void show_about_box(GtkWidget *w, gpointer data)
GladeXML *ab;
ab=glade_xml_new("gtkuseredit.glade", "AboutWindow", NULL);
}
void user_toggle_delete(GtkWidget *t, gpointer data)
{
gboolean deleted;
GtkWidget *w;
g_object_get(G_OBJECT(t), "active", &deleted, NULL);
w=glade_xml_get_widget(xml, "bDelete");
if(w==NULL)
fprintf(stderr,"Cannot get the deleted toolbar widget\n");
else
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(w),deleted);
w=glade_xml_get_widget(xml, "delete1");
if(w==NULL)
fprintf(stderr,"Cannot get the deleted menu widget\n");
else
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(w),deleted);
}
void user_toggle_inactive(GtkWidget *t, gpointer data)
{
gboolean inactive;
GtkWidget *w;
g_object_get(G_OBJECT(t), "active", &inactive, NULL);
w=glade_xml_get_widget(xml, "bRemove");
if(w==NULL)
fprintf(stderr,"Cannot get the removed toolbar widget\n");
else
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(w),inactive);
w=glade_xml_get_widget(xml, "remove1");
if(w==NULL)
fprintf(stderr,"Cannot get the remove menu widget\n");
else
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(w),inactive);
}
......@@ -70,20 +70,22 @@
</child>
<child>
<widget class="GtkImageMenuItem" id="delete2">
<widget class="GtkCheckMenuItem" id="delete1">
<property name="visible">True</property>
<property name="label">gtk-delete</property>
<property name="use_stock">True</property>
<signal name="activate" handler="delete_user" last_modification_time="Fri, 10 Mar 2006 02:20:53 GMT"/>
<property name="label" translatable="yes">_Delete</property>
<property name="use_underline">True</property>
<property name="active">False</property>
<signal name="activate" handler="user_toggle_delete" last_modification_time="Sun, 12 Mar 2006 01:51:53 GMT"/>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="remove1">
<widget class="GtkCheckMenuItem" id="remove1">
<property name="visible">True</property>
<property name="label">gtk-remove</property>
<property name="use_stock">True</property>
<signal name="activate" handler="disable_user" last_modification_time="Fri, 10 Mar 2006 02:20:53 GMT"/>
<property name="label" translatable="yes">_Remove</property>
<property name="use_underline">True</property>
<property name="active">False</property>
<signal name="activate" handler="user_toggle_inactive" last_modification_time="Sun, 12 Mar 2006 01:52:33 GMT"/>
</widget>
</child>
......@@ -144,7 +146,7 @@
<property name="show_arrow">True</property>
<child>
<widget class="GtkToolButton" id="newuserbutton">
<widget class="GtkToolButton" id="bNewUser">
<property name="visible">True</property>
<property name="label" translatable="yes">New</property>
<property name="use_underline">True</property>
......@@ -178,7 +180,7 @@
</child>
<child>
<widget class="GtkToolButton" id="toolbutton9">
<widget class="GtkToolButton" id="bRefresh">
<property name="visible">True</property>
<property name="label" translatable="yes">Refresh</property>
<property name="use_underline">True</property>
......@@ -195,15 +197,14 @@
</child>
<child>
<widget class="GtkToolButton" id="toolbutton10">
<widget class="GtkToggleToolButton" id="bDelete">
<property name="visible">True</property>
<property name="label" translatable="yes">Delete</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-delete</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">True</property>
<signal name="clicked" handler="delete_user" last_modification_time="Fri, 10 Mar 2006 02:24:05 GMT"/>
<property name="is_important">False</property>
<property name="active">False</property>
<signal name="toggled" handler="user_toggle_delete" last_modification_time="Sun, 12 Mar 2006 01:50:28 GMT"/>
</widget>
<packing>
<property name="expand">False</property>
......@@ -212,13 +213,14 @@
</child>
<child>
<widget class="GtkToolButton" id="toolbutton11">
<widget class="GtkToggleToolButton" id="bRemove">
<property name="visible">True</property>
<property name="stock_id">gtk-remove</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">True</property>
<signal name="clicked" handler="disable_user" last_modification_time="Fri, 10 Mar 2006 02:25:11 GMT"/>
<property name="is_important">False</property>
<property name="active">False</property>
<signal name="toggled" handler="user_toggle_inactive" last_modification_time="Sun, 12 Mar 2006 01:51:10 GMT"/>
</widget>
<packing>
<property name="expand">False</property>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment