diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-07-11 01:42:16 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:56:55 -0500 |
commit | a25651cd227e6328c7ba755c60d2b74667dcb4a1 (patch) | |
tree | 74a0d498c7a25330c778321f5bf781b3fba14d7f /source4/gtk/tools/gwcrontab.c | |
parent | e3fd2d049216f79ced472e2af790ca6ffefba442 (diff) | |
download | samba-a25651cd227e6328c7ba755c60d2b74667dcb4a1.tar.gz samba-a25651cd227e6328c7ba755c60d2b74667dcb4a1.tar.bz2 samba-a25651cd227e6328c7ba755c60d2b74667dcb4a1.zip |
r1433: Properly use GtkTreeView:
- When a key is selected the values are immediately shown in gregedit
- Only allow deleting jobs if one is selected.
(This used to be commit afb5f4d765cb15ba8824d8db19879bad83829561)
Diffstat (limited to 'source4/gtk/tools/gwcrontab.c')
-rw-r--r-- | source4/gtk/tools/gwcrontab.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/gtk/tools/gwcrontab.c b/source4/gtk/tools/gwcrontab.c index cf162f2a25..9683570664 100644 --- a/source4/gtk/tools/gwcrontab.c +++ b/source4/gtk/tools/gwcrontab.c @@ -40,6 +40,7 @@ GtkWidget *tasks; GtkWidget *entry_cmd; GtkWidget *entry_repeat_weekly; GtkWidget *entry_repeat_monthly; +GtkWidget *delete; void update_joblist() { @@ -81,6 +82,13 @@ void update_joblist() gtk_widget_set_sensitive(tasks, TRUE); } +static void on_job_select(GtkTreeSelection *sel, + gpointer data) +{ + gtk_widget_set_sensitive(delete, gtk_tree_selection_get_selected(sel, NULL, NULL)); +} + + void on_connect_activate (GtkMenuItem *menuitem, gpointer user_data) @@ -224,7 +232,6 @@ create_mainwindow (void) GtkWidget *new; GtkCellRenderer *renderer; GtkTreeViewColumn *curcol; - GtkWidget *delete; GtkWidget *menuitem7; GtkWidget *menuitem7_menu; GtkWidget *about; @@ -277,6 +284,7 @@ create_mainwindow (void) gtk_container_add (GTK_CONTAINER (task_menu), new); delete = gtk_menu_item_new_with_mnemonic ("_Delete"); + gtk_widget_set_sensitive(delete, FALSE); gtk_widget_show (delete); gtk_container_add (GTK_CONTAINER (task_menu), delete); @@ -339,6 +347,8 @@ create_mainwindow (void) gtk_widget_show (tasks); gtk_container_add (GTK_CONTAINER (scrolledwindow), tasks); + g_signal_connect (gtk_tree_view_get_selection(GTK_TREE_VIEW(tasks)) , "changed", G_CALLBACK (on_job_select), NULL); + statusbar = gtk_statusbar_new (); gtk_widget_show (statusbar); gtk_box_pack_start (GTK_BOX (vbox), statusbar, FALSE, FALSE, 0); |