r1699: Formatting update, bugfixes
[samba.git] / source / gtk / tools / gwcrontab.c
index ba7d2bbcd44083e0ac3a6f3326708bfae0475285..aa5495bcc091f404edcb776c7fc047e1f80dc541 100644 (file)
@@ -74,7 +74,7 @@ void update_joblist(void)
 static void on_job_select(GtkTreeSelection *sel,
                                              gpointer data)
 {
-        gtk_widget_set_sensitive(delete, gtk_tree_selection_get_selected(sel, NULL, NULL));
+       gtk_widget_set_sensitive(delete, gtk_tree_selection_get_selected(sel, NULL, NULL));
 }
 
 
@@ -87,7 +87,7 @@ on_connect_activate                    (GtkMenuItem     *menuitem,
        gint result;
 
        d = GTK_RPC_BINDING_DIALOG(gtk_rpc_binding_dialog_new(FALSE));
-        result = gtk_dialog_run(GTK_DIALOG(d));
+    result = gtk_dialog_run(GTK_DIALOG(d));
        switch(result) {
                case GTK_RESPONSE_ACCEPT:
                        break;
@@ -101,17 +101,17 @@ on_connect_activate                    (GtkMenuItem     *menuitem,
        if(!NT_STATUS_IS_OK(status)) {
                gtk_show_ntstatus(mainwin, status);
                at_pipe = NULL;
-               gtk_widget_destroy(GTK_WIDGET(d));
+        gtk_widget_destroy(GTK_WIDGET(d));
                return;
        }
-        gtk_widget_destroy(GTK_WIDGET(d));
+       gtk_widget_destroy(GTK_WIDGET(d));
 
        update_joblist();
 }
 
 void
 on_quit_activate                      (GtkMenuItem     *menuitem,
-                                        gpointer         user_data)
+                                                                          gpointer         user_data)
 {
        if(at_pipe)dcerpc_pipe_close(at_pipe);
        gtk_main_quit();
@@ -122,7 +122,7 @@ static GtkWidget* create_new_job_dialog (void);
 
 void
 on_new_activate                        (GtkMenuItem     *menuitem,
-                                        gpointer         user_data)
+                                                                               gpointer         user_data)
 {
        GtkWidget *d = create_new_job_dialog();
        gint result = gtk_dialog_run(GTK_DIALOG(d));
@@ -170,16 +170,16 @@ on_delete_activate                     (GtkMenuItem     *menuitem,
 {
        GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tasks));
        GtkTreeModel *model = GTK_TREE_MODEL(store_jobs);
-        GtkTreeIter iter;
+       GtkTreeIter iter;
        gint id;
 
-        if (gtk_tree_selection_get_selected (sel, &model, &iter))
-        {
+       if (gtk_tree_selection_get_selected (sel, &model, &iter))
+       {
                struct atsvc_JobDel r;
                TALLOC_CTX *mem_ctx;
                NTSTATUS status;
-                gtk_tree_model_get (model, &iter, 1, &id, -1);
-               
+               gtk_tree_model_get (model, &iter, 1, &id, -1);
+
                r.in.servername = dcerpc_server_name(at_pipe);
                r.in.min_job_id = r.in.max_job_id = id;
 
@@ -190,184 +190,184 @@ on_delete_activate                     (GtkMenuItem     *menuitem,
                        gtk_show_ntstatus(mainwin, status);
                        return;
                }
-       
+
                update_joblist();
-        }
+       }
 }
 
 
 void
 on_about_activate                     (GtkMenuItem     *menuitem,
-                                        gpointer         user_data)
+                                                                          gpointer         user_data)
 {
        GtkDialog *aboutwin = GTK_DIALOG(create_gtk_samba_about_dialog("gwcrontab"));
-        gtk_dialog_run(aboutwin);
-        gtk_widget_destroy(GTK_WIDGET(aboutwin));
+       gtk_dialog_run(aboutwin);
+       gtk_widget_destroy(GTK_WIDGET(aboutwin));
 }
 
 GtkWidget*
 create_mainwindow (void)
 {
-  GtkWidget *mainwindow;
-  GtkWidget *vbox;
-  GtkWidget *menubar;
-  GtkWidget *menuitem4;
-  GtkWidget *menuitem4_menu;
-  GtkWidget *connect;
-  GtkWidget *separatormenuitem1;
-  GtkWidget *quit;
-  GtkWidget *task;
-  GtkWidget *task_menu;
-  GtkWidget *new;
-  GtkCellRenderer *renderer;
-  GtkTreeViewColumn *curcol;
-  GtkWidget *menuitem7;
-  GtkWidget *menuitem7_menu;
-  GtkWidget *about;
-  GtkWidget *scrolledwindow;
-  GtkWidget *statusbar;
-  GtkAccelGroup *accel_group;
-
-  accel_group = gtk_accel_group_new ();
-
-  mainwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-  gtk_window_set_default_size (GTK_WINDOW (mainwindow), 642, 562);
-  gtk_window_set_title (GTK_WINDOW (mainwindow), "Task Scheduler");
-
-  vbox = gtk_vbox_new (FALSE, 0);
-  gtk_widget_show (vbox);
-  gtk_container_add (GTK_CONTAINER (mainwindow), vbox);
-
-  menubar = gtk_menu_bar_new ();
-  gtk_widget_show (menubar);
-  gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, FALSE, 0);
-
-  menuitem4 = gtk_menu_item_new_with_mnemonic ("_File");
-  gtk_widget_show (menuitem4);
-  gtk_container_add (GTK_CONTAINER (menubar), menuitem4);
-
-  menuitem4_menu = gtk_menu_new ();
-  gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem4), menuitem4_menu);
-
-  connect = gtk_menu_item_new_with_mnemonic ("_Connect");
-  gtk_widget_show (connect);
-  gtk_container_add (GTK_CONTAINER (menuitem4_menu), connect);
-
-  separatormenuitem1 = gtk_separator_menu_item_new ();
-  gtk_widget_show (separatormenuitem1);
-  gtk_container_add (GTK_CONTAINER (menuitem4_menu), separatormenuitem1);
-  gtk_widget_set_sensitive (separatormenuitem1, FALSE);
-
-  quit = gtk_image_menu_item_new_from_stock ("gtk-quit", accel_group);
-  gtk_widget_show (quit);
-  gtk_container_add (GTK_CONTAINER (menuitem4_menu), quit);
-
-  task = gtk_menu_item_new_with_mnemonic ("_Task");
-  gtk_widget_show (task);
-  gtk_container_add (GTK_CONTAINER (menubar), task);
-
-  task_menu = gtk_menu_new ();
-  gtk_menu_item_set_submenu (GTK_MENU_ITEM (task), task_menu);
-
-  new = gtk_menu_item_new_with_mnemonic ("_New");
-  gtk_widget_show (new);
-  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);
-
-  menuitem7 = gtk_menu_item_new_with_mnemonic ("_Help");
-  gtk_widget_show (menuitem7);
-  gtk_container_add (GTK_CONTAINER (menubar), menuitem7);
-
-  menuitem7_menu = gtk_menu_new ();
-  gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem7), menuitem7_menu);
-
-  about = gtk_menu_item_new_with_mnemonic ("_About");
-  gtk_widget_show (about);
-  gtk_container_add (GTK_CONTAINER (menuitem7_menu), about);
-
-  scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
-  gtk_widget_show (scrolledwindow);
-  gtk_box_pack_start (GTK_BOX (vbox), scrolledwindow, TRUE, TRUE, 0);
-
-  tasks = gtk_tree_view_new ();
-
-  curcol = gtk_tree_view_column_new ();
-  gtk_tree_view_column_set_title(curcol, "Status");
-  renderer = gtk_cell_renderer_text_new();
-  gtk_tree_view_column_pack_start(curcol, renderer, True);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(tasks), curcol);
-  gtk_tree_view_column_add_attribute(curcol, renderer, "text", 0);
-                                                                                                                             
-  curcol = gtk_tree_view_column_new ();
-  gtk_tree_view_column_set_title(curcol, "ID");
-  renderer = gtk_cell_renderer_text_new();
-  gtk_tree_view_column_pack_start(curcol, renderer, True);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(tasks), curcol);
-  gtk_tree_view_column_add_attribute(curcol, renderer, "text", 1);
-                                                                                                                             
-  curcol = gtk_tree_view_column_new ();
-  gtk_tree_view_column_set_title(curcol, "Day");
-  renderer = gtk_cell_renderer_text_new();
-  gtk_tree_view_column_pack_start(curcol, renderer, True);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(tasks), curcol);
-  gtk_tree_view_column_add_attribute(curcol, renderer, "text", 2);
-
-  curcol = gtk_tree_view_column_new ();
-  gtk_tree_view_column_set_title(curcol, "Time");
-  renderer = gtk_cell_renderer_text_new();
-  gtk_tree_view_column_pack_start(curcol, renderer, True);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(tasks), curcol);
-  gtk_tree_view_column_add_attribute(curcol, renderer, "text", 3);
-
-  curcol = gtk_tree_view_column_new ();
-  gtk_tree_view_column_set_title(curcol, "Command Line");
-  renderer = gtk_cell_renderer_text_new();
-  gtk_tree_view_column_pack_start(curcol, renderer, True);
-  gtk_tree_view_append_column(GTK_TREE_VIEW(tasks), curcol);
-  gtk_tree_view_column_add_attribute(curcol, renderer, "text", 4);
-
-  store_jobs = gtk_list_store_new(5, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_STRING);
-  gtk_tree_view_set_model(GTK_TREE_VIEW(tasks), GTK_TREE_MODEL(store_jobs));
-  g_object_unref(store_jobs);
-
-  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);
-
-  g_signal_connect ((gpointer) connect, "activate",
-                    G_CALLBACK (on_connect_activate),
-                    NULL);
-  g_signal_connect ((gpointer) quit, "activate",
-                    G_CALLBACK (on_quit_activate),
-                    NULL);
-  g_signal_connect ((gpointer) new, "activate",
-                    G_CALLBACK (on_new_activate),
-                    NULL);
-  g_signal_connect ((gpointer) delete, "activate",
-                    G_CALLBACK (on_delete_activate),
-                    NULL);
-  g_signal_connect ((gpointer) about, "activate",
-                    G_CALLBACK (on_about_activate),
-                    NULL);
-
-  gtk_window_add_accel_group (GTK_WINDOW (mainwindow), accel_group);
-  gtk_widget_set_sensitive(tasks, FALSE);
-
-  return mainwindow;
+       GtkWidget *mainwindow;
+       GtkWidget *vbox;
+       GtkWidget *menubar;
+       GtkWidget *menuitem4;
+       GtkWidget *menuitem4_menu;
+       GtkWidget *connect;
+       GtkWidget *separatormenuitem1;
+       GtkWidget *quit;
+       GtkWidget *task;
+       GtkWidget *task_menu;
+       GtkWidget *new;
+       GtkCellRenderer *renderer;
+       GtkTreeViewColumn *curcol;
+       GtkWidget *menuitem7;
+       GtkWidget *menuitem7_menu;
+       GtkWidget *about;
+       GtkWidget *scrolledwindow;
+       GtkWidget *statusbar;
+       GtkAccelGroup *accel_group;
+
+       accel_group = gtk_accel_group_new ();
+
+       mainwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+       gtk_window_set_default_size (GTK_WINDOW (mainwindow), 642, 562);
+       gtk_window_set_title (GTK_WINDOW (mainwindow), "Task Scheduler");
+
+       vbox = gtk_vbox_new (FALSE, 0);
+       gtk_widget_show (vbox);
+       gtk_container_add (GTK_CONTAINER (mainwindow), vbox);
+
+       menubar = gtk_menu_bar_new ();
+       gtk_widget_show (menubar);
+       gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, FALSE, 0);
+
+       menuitem4 = gtk_menu_item_new_with_mnemonic ("_File");
+       gtk_widget_show (menuitem4);
+       gtk_container_add (GTK_CONTAINER (menubar), menuitem4);
+
+       menuitem4_menu = gtk_menu_new ();
+       gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem4), menuitem4_menu);
+
+       connect = gtk_menu_item_new_with_mnemonic ("_Connect");
+       gtk_widget_show (connect);
+       gtk_container_add (GTK_CONTAINER (menuitem4_menu), connect);
+
+       separatormenuitem1 = gtk_separator_menu_item_new ();
+       gtk_widget_show (separatormenuitem1);
+       gtk_container_add (GTK_CONTAINER (menuitem4_menu), separatormenuitem1);
+       gtk_widget_set_sensitive (separatormenuitem1, FALSE);
+
+       quit = gtk_image_menu_item_new_from_stock ("gtk-quit", accel_group);
+       gtk_widget_show (quit);
+       gtk_container_add (GTK_CONTAINER (menuitem4_menu), quit);
+
+       task = gtk_menu_item_new_with_mnemonic ("_Task");
+       gtk_widget_show (task);
+       gtk_container_add (GTK_CONTAINER (menubar), task);
+
+       task_menu = gtk_menu_new ();
+       gtk_menu_item_set_submenu (GTK_MENU_ITEM (task), task_menu);
+
+       new = gtk_menu_item_new_with_mnemonic ("_New");
+       gtk_widget_show (new);
+       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);
+
+       menuitem7 = gtk_menu_item_new_with_mnemonic ("_Help");
+       gtk_widget_show (menuitem7);
+       gtk_container_add (GTK_CONTAINER (menubar), menuitem7);
+
+       menuitem7_menu = gtk_menu_new ();
+       gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem7), menuitem7_menu);
+
+       about = gtk_menu_item_new_with_mnemonic ("_About");
+       gtk_widget_show (about);
+       gtk_container_add (GTK_CONTAINER (menuitem7_menu), about);
+
+       scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
+       gtk_widget_show (scrolledwindow);
+       gtk_box_pack_start (GTK_BOX (vbox), scrolledwindow, TRUE, TRUE, 0);
+
+       tasks = gtk_tree_view_new ();
+
+       curcol = gtk_tree_view_column_new ();
+       gtk_tree_view_column_set_title(curcol, "Status");
+       renderer = gtk_cell_renderer_text_new();
+       gtk_tree_view_column_pack_start(curcol, renderer, True);
+       gtk_tree_view_append_column(GTK_TREE_VIEW(tasks), curcol);
+       gtk_tree_view_column_add_attribute(curcol, renderer, "text", 0);
+
+       curcol = gtk_tree_view_column_new ();
+       gtk_tree_view_column_set_title(curcol, "ID");
+       renderer = gtk_cell_renderer_text_new();
+       gtk_tree_view_column_pack_start(curcol, renderer, True);
+       gtk_tree_view_append_column(GTK_TREE_VIEW(tasks), curcol);
+       gtk_tree_view_column_add_attribute(curcol, renderer, "text", 1);
+
+       curcol = gtk_tree_view_column_new ();
+       gtk_tree_view_column_set_title(curcol, "Day");
+       renderer = gtk_cell_renderer_text_new();
+       gtk_tree_view_column_pack_start(curcol, renderer, True);
+       gtk_tree_view_append_column(GTK_TREE_VIEW(tasks), curcol);
+       gtk_tree_view_column_add_attribute(curcol, renderer, "text", 2);
+
+       curcol = gtk_tree_view_column_new ();
+       gtk_tree_view_column_set_title(curcol, "Time");
+       renderer = gtk_cell_renderer_text_new();
+       gtk_tree_view_column_pack_start(curcol, renderer, True);
+       gtk_tree_view_append_column(GTK_TREE_VIEW(tasks), curcol);
+       gtk_tree_view_column_add_attribute(curcol, renderer, "text", 3);
+
+       curcol = gtk_tree_view_column_new ();
+       gtk_tree_view_column_set_title(curcol, "Command Line");
+       renderer = gtk_cell_renderer_text_new();
+       gtk_tree_view_column_pack_start(curcol, renderer, True);
+       gtk_tree_view_append_column(GTK_TREE_VIEW(tasks), curcol);
+       gtk_tree_view_column_add_attribute(curcol, renderer, "text", 4);
+
+       store_jobs = gtk_list_store_new(5, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_STRING);
+       gtk_tree_view_set_model(GTK_TREE_VIEW(tasks), GTK_TREE_MODEL(store_jobs));
+       g_object_unref(store_jobs);
+
+       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);
+
+       g_signal_connect ((gpointer) connect, "activate",
+                                         G_CALLBACK (on_connect_activate),
+                                         NULL);
+       g_signal_connect ((gpointer) quit, "activate",
+                                         G_CALLBACK (on_quit_activate),
+                                         NULL);
+       g_signal_connect ((gpointer) new, "activate",
+                                         G_CALLBACK (on_new_activate),
+                                         NULL);
+       g_signal_connect ((gpointer) delete, "activate",
+                                         G_CALLBACK (on_delete_activate),
+                                         NULL);
+       g_signal_connect ((gpointer) about, "activate",
+                                         G_CALLBACK (on_about_activate),
+                                         NULL);
+
+       gtk_window_add_accel_group (GTK_WINDOW (mainwindow), accel_group);
+       gtk_widget_set_sensitive(tasks, FALSE);
+
+       return mainwindow;
 }
 
 void
 on_chk_weekly_toggled                  (GtkToggleButton *togglebutton,
-                                        gpointer         user_data)
+                                                                               gpointer         user_data)
 {
        gtk_widget_set_sensitive(entry_repeat_weekly, gtk_toggle_button_get_active(togglebutton));
 }
@@ -383,138 +383,138 @@ on_chk_monthly_toggled                 (GtkToggleButton *togglebutton,
 
 static GtkWidget*create_new_job_dialog (void)
 {
-  GtkWidget *new_job_dialog;
-  GtkWidget *dialog_vbox1;
-  GtkWidget *frame1;
-  GtkWidget *table1;
-  GtkWidget *label4;
-  GtkWidget *cal_day;
-  GtkWidget *label3;
-  GtkWidget *entry_time;
-  GtkWidget *chk_weekly;
-  GtkWidget *chk_monthly;
-  GtkWidget *label1;
-  GtkWidget *frame2;
-  GtkWidget *hbox1;
-  GtkWidget *label5;
-  GtkWidget *label2;
-  GtkWidget *dialog_action_area1;
-  GtkWidget *cancelbutton1;
-  GtkWidget *okbutton1;
-
-  new_job_dialog = gtk_dialog_new ();
-  gtk_window_set_title (GTK_WINDOW (new_job_dialog), "New job");
-
-  dialog_vbox1 = GTK_DIALOG (new_job_dialog)->vbox;
-  gtk_widget_show (dialog_vbox1);
-
-  frame1 = gtk_frame_new (NULL);
-  gtk_widget_show (frame1);
-  gtk_box_pack_start (GTK_BOX (dialog_vbox1), frame1, TRUE, TRUE, 0);
-
-  table1 = gtk_table_new (4, 2, FALSE);
-  gtk_widget_show (table1);
-  gtk_container_add (GTK_CONTAINER (frame1), table1);
-
-  label4 = gtk_label_new ("Time:");
-  gtk_widget_show (label4);
-  gtk_table_attach (GTK_TABLE (table1), label4, 0, 1, 1, 2,
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-  gtk_misc_set_alignment (GTK_MISC (label4), 0, 0.5);
-
-  cal_day = gtk_calendar_new ();
-  gtk_widget_show (cal_day);
-  gtk_table_attach (GTK_TABLE (table1), cal_day, 1, 2, 0, 1,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (GTK_FILL), 0, 0);
-  gtk_calendar_display_options (GTK_CALENDAR (cal_day),
-                                GTK_CALENDAR_SHOW_HEADING
-                                | GTK_CALENDAR_SHOW_DAY_NAMES);
-
-  label3 = gtk_label_new ("Date");
-  gtk_widget_show (label3);
-  gtk_table_attach (GTK_TABLE (table1), label3, 0, 1, 0, 1,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-  gtk_misc_set_alignment (GTK_MISC (label3), 0, 0.5);
-
-  entry_time = gtk_entry_new ();
-  gtk_widget_show (entry_time);
-  gtk_table_attach (GTK_TABLE (table1), entry_time, 1, 2, 1, 2,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-
-  chk_weekly = gtk_check_button_new_with_mnemonic ("Repeat weekly");
-  gtk_widget_show (chk_weekly);
-  gtk_table_attach (GTK_TABLE (table1), chk_weekly, 0, 1, 2, 3,
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-
-  entry_repeat_weekly = gtk_entry_new ();
-  gtk_widget_show (entry_repeat_weekly);
-  gtk_table_attach (GTK_TABLE (table1), entry_repeat_weekly, 1, 2, 2, 3,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-
-  chk_monthly = gtk_check_button_new_with_mnemonic ("Repeat monthly");
-  gtk_widget_show (chk_monthly);
-  gtk_table_attach (GTK_TABLE (table1), chk_monthly, 0, 1, 3, 4,
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-
-  entry_repeat_monthly = gtk_entry_new ();
-  gtk_widget_show (entry_repeat_monthly);
-  gtk_table_attach (GTK_TABLE (table1), entry_repeat_monthly, 1, 2, 3, 4,
-                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-
-  label1 = gtk_label_new ("Moment");
-  gtk_widget_show (label1);
-  gtk_frame_set_label_widget (GTK_FRAME (frame1), label1);
-
-  frame2 = gtk_frame_new (NULL);
-  gtk_widget_show (frame2);
-  gtk_box_pack_start (GTK_BOX (dialog_vbox1), frame2, TRUE, TRUE, 0);
-
-  hbox1 = gtk_hbox_new (FALSE, 0);
-  gtk_widget_show (hbox1);
-  gtk_container_add (GTK_CONTAINER (frame2), hbox1);
-
-  label5 = gtk_label_new ("Command to execute");
-  gtk_widget_show (label5);
-  gtk_box_pack_start (GTK_BOX (hbox1), label5, TRUE, TRUE, 0);
-
-  entry_cmd = gtk_entry_new ();
-  gtk_widget_show (entry_cmd);
-  gtk_box_pack_start (GTK_BOX (hbox1), entry_cmd, TRUE, TRUE, 0);
-
-  label2 = gtk_label_new ("Command");
-  gtk_widget_show (label2);
-  gtk_frame_set_label_widget (GTK_FRAME (frame2), label2);
-
-  dialog_action_area1 = GTK_DIALOG (new_job_dialog)->action_area;
-  gtk_widget_show (dialog_action_area1);
-  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
-
-  cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel");
-  gtk_widget_show (cancelbutton1);
-  gtk_dialog_add_action_widget (GTK_DIALOG (new_job_dialog), cancelbutton1, GTK_RESPONSE_CANCEL);
-  GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT);
-
-  okbutton1 = gtk_button_new_from_stock ("gtk-ok");
-  gtk_widget_show (okbutton1);
-  gtk_dialog_add_action_widget (GTK_DIALOG (new_job_dialog), okbutton1, GTK_RESPONSE_OK);
-  GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);
-
-  g_signal_connect ((gpointer) chk_weekly, "toggled",
-                    G_CALLBACK (on_chk_weekly_toggled),
-                    NULL);
-  g_signal_connect ((gpointer) chk_monthly, "toggled",
-                    G_CALLBACK (on_chk_monthly_toggled),
-                    NULL);
-
-  return new_job_dialog;
+       GtkWidget *new_job_dialog;
+       GtkWidget *dialog_vbox1;
+       GtkWidget *frame1;
+       GtkWidget *table1;
+       GtkWidget *label4;
+       GtkWidget *cal_day;
+       GtkWidget *label3;
+       GtkWidget *entry_time;
+       GtkWidget *chk_weekly;
+       GtkWidget *chk_monthly;
+       GtkWidget *label1;
+       GtkWidget *frame2;
+       GtkWidget *hbox1;
+       GtkWidget *label5;
+       GtkWidget *label2;
+       GtkWidget *dialog_action_area1;
+       GtkWidget *cancelbutton1;
+       GtkWidget *okbutton1;
+
+       new_job_dialog = gtk_dialog_new ();
+       gtk_window_set_title (GTK_WINDOW (new_job_dialog), "New job");
+
+       dialog_vbox1 = GTK_DIALOG (new_job_dialog)->vbox;
+       gtk_widget_show (dialog_vbox1);
+
+       frame1 = gtk_frame_new (NULL);
+       gtk_widget_show (frame1);
+       gtk_box_pack_start (GTK_BOX (dialog_vbox1), frame1, TRUE, TRUE, 0);
+
+       table1 = gtk_table_new (4, 2, FALSE);
+       gtk_widget_show (table1);
+       gtk_container_add (GTK_CONTAINER (frame1), table1);
+
+       label4 = gtk_label_new ("Time:");
+       gtk_widget_show (label4);
+       gtk_table_attach (GTK_TABLE (table1), label4, 0, 1, 1, 2,
+                                         (GtkAttachOptions) (GTK_FILL),
+                                         (GtkAttachOptions) (0), 0, 0);
+       gtk_misc_set_alignment (GTK_MISC (label4), 0, 0.5);
+
+       cal_day = gtk_calendar_new ();
+       gtk_widget_show (cal_day);
+       gtk_table_attach (GTK_TABLE (table1), cal_day, 1, 2, 0, 1,
+                                         (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                                         (GtkAttachOptions) (GTK_FILL), 0, 0);
+       gtk_calendar_display_options (GTK_CALENDAR (cal_day),
+                                                                 GTK_CALENDAR_SHOW_HEADING
+                                                                 | GTK_CALENDAR_SHOW_DAY_NAMES);
+
+       label3 = gtk_label_new ("Date");
+       gtk_widget_show (label3);
+       gtk_table_attach (GTK_TABLE (table1), label3, 0, 1, 0, 1,
+                                         (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                                         (GtkAttachOptions) (0), 0, 0);
+       gtk_misc_set_alignment (GTK_MISC (label3), 0, 0.5);
+
+       entry_time = gtk_entry_new ();
+       gtk_widget_show (entry_time);
+       gtk_table_attach (GTK_TABLE (table1), entry_time, 1, 2, 1, 2,
+                                         (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                                         (GtkAttachOptions) (0), 0, 0);
+
+       chk_weekly = gtk_check_button_new_with_mnemonic ("Repeat weekly");
+       gtk_widget_show (chk_weekly);
+       gtk_table_attach (GTK_TABLE (table1), chk_weekly, 0, 1, 2, 3,
+                                         (GtkAttachOptions) (GTK_FILL),
+                                         (GtkAttachOptions) (0), 0, 0);
+
+       entry_repeat_weekly = gtk_entry_new ();
+       gtk_widget_show (entry_repeat_weekly);
+       gtk_table_attach (GTK_TABLE (table1), entry_repeat_weekly, 1, 2, 2, 3,
+                                         (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                                         (GtkAttachOptions) (0), 0, 0);
+
+       chk_monthly = gtk_check_button_new_with_mnemonic ("Repeat monthly");
+       gtk_widget_show (chk_monthly);
+       gtk_table_attach (GTK_TABLE (table1), chk_monthly, 0, 1, 3, 4,
+                                         (GtkAttachOptions) (GTK_FILL),
+                                         (GtkAttachOptions) (0), 0, 0);
+
+       entry_repeat_monthly = gtk_entry_new ();
+       gtk_widget_show (entry_repeat_monthly);
+       gtk_table_attach (GTK_TABLE (table1), entry_repeat_monthly, 1, 2, 3, 4,
+                                         (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+                                         (GtkAttachOptions) (0), 0, 0);
+
+       label1 = gtk_label_new ("Moment");
+       gtk_widget_show (label1);
+       gtk_frame_set_label_widget (GTK_FRAME (frame1), label1);
+
+       frame2 = gtk_frame_new (NULL);
+       gtk_widget_show (frame2);
+       gtk_box_pack_start (GTK_BOX (dialog_vbox1), frame2, TRUE, TRUE, 0);
+
+       hbox1 = gtk_hbox_new (FALSE, 0);
+       gtk_widget_show (hbox1);
+       gtk_container_add (GTK_CONTAINER (frame2), hbox1);
+
+       label5 = gtk_label_new ("Command to execute");
+       gtk_widget_show (label5);
+       gtk_box_pack_start (GTK_BOX (hbox1), label5, TRUE, TRUE, 0);
+
+       entry_cmd = gtk_entry_new ();
+       gtk_widget_show (entry_cmd);
+       gtk_box_pack_start (GTK_BOX (hbox1), entry_cmd, TRUE, TRUE, 0);
+
+       label2 = gtk_label_new ("Command");
+       gtk_widget_show (label2);
+       gtk_frame_set_label_widget (GTK_FRAME (frame2), label2);
+
+       dialog_action_area1 = GTK_DIALOG (new_job_dialog)->action_area;
+       gtk_widget_show (dialog_action_area1);
+       gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
+
+       cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel");
+       gtk_widget_show (cancelbutton1);
+       gtk_dialog_add_action_widget (GTK_DIALOG (new_job_dialog), cancelbutton1, GTK_RESPONSE_CANCEL);
+       GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT);
+
+       okbutton1 = gtk_button_new_from_stock ("gtk-ok");
+       gtk_widget_show (okbutton1);
+       gtk_dialog_add_action_widget (GTK_DIALOG (new_job_dialog), okbutton1, GTK_RESPONSE_OK);
+       GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);
+
+       g_signal_connect ((gpointer) chk_weekly, "toggled",
+                                         G_CALLBACK (on_chk_weekly_toggled),
+                                         NULL);
+       g_signal_connect ((gpointer) chk_monthly, "toggled",
+                                         G_CALLBACK (on_chk_monthly_toggled),
+                                         NULL);
+
+       return new_job_dialog;
 }