From: <pa...@us...> - 2008-06-21 20:14:07
|
Revision: 480 http://osmo-pim.svn.sourceforge.net/osmo-pim/?rev=480&view=rev Author: pasp Date: 2008-06-20 16:11:05 -0700 (Fri, 20 Jun 2008) Log Message: ----------- * Added option for postpone date (reminder) Modified Paths: -------------- trunk/src/gui.h trunk/src/options_gui_tasks.c trunk/src/options_prefs.c trunk/src/options_prefs.h Modified: trunk/src/gui.h =================================================================== --- trunk/src/gui.h 2008-06-20 22:16:42 UTC (rev 479) +++ trunk/src/gui.h 2008-06-20 23:11:05 UTC (rev 480) @@ -606,6 +606,7 @@ GtkWidget *vc_category_checkbutton; GtkWidget *vc_priority_checkbutton; GtkWidget *postpone_time_spinbutton; + GtkWidget *postpone_date_spinbutton; /* contacts */ GtkWidget *contacts_vbox; Modified: trunk/src/options_gui_tasks.c =================================================================== --- trunk/src/options_gui_tasks.c 2008-06-20 22:16:42 UTC (rev 479) +++ trunk/src/options_gui_tasks.c 2008-06-20 23:11:05 UTC (rev 480) @@ -436,6 +436,19 @@ /*------------------------------------------------------------------------------*/ void +postpone_date_changed_cb (GtkSpinButton *spinbutton, gpointer user_data) { + + GUI *appGUI = (GUI *)user_data; + + if (!appGUI->opt->callback_active) return; + + config.postpone_date = (gint) gtk_spin_button_get_value (GTK_SPIN_BUTTON(appGUI->opt->postpone_date_spinbutton)); + +} + +/*------------------------------------------------------------------------------*/ + +void tsk_show_in_calendar_toggled (GtkCellRendererToggle *cell, gchar *path_str, gpointer data) { GtkTreePath *path; @@ -501,6 +514,7 @@ GtkTreeViewColumn *column; GdkColor color; GtkObject *postpone_time_spinbutton_adj; +GtkObject *postpone_date_spinbutton_adj; gchar tmpbuf[BUFFER_SIZE]; @@ -913,7 +927,7 @@ gtk_container_add (GTK_CONTAINER (frame), alignment); gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 12, 12, 0); - table = gtk_table_new (1, 4, FALSE); + table = gtk_table_new (2, 4, FALSE); gtk_widget_show (table); gtk_container_add (GTK_CONTAINER (alignment), table); gtk_container_set_border_width (GTK_CONTAINER (table), 4); @@ -946,6 +960,33 @@ (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + sprintf(tmpbuf, "%s:", _("Postpone date")); + label = gtk_label_new (tmpbuf); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + + postpone_date_spinbutton_adj = gtk_adjustment_new (1, 0, 31, 1, 10, 10); + appGUI->opt->postpone_date_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (postpone_date_spinbutton_adj), 1, 0); + g_signal_connect (G_OBJECT (appGUI->opt->postpone_date_spinbutton), "value-changed", + G_CALLBACK (postpone_date_changed_cb), appGUI); + gtk_widget_show (appGUI->opt->postpone_date_spinbutton); + gtk_table_attach (GTK_TABLE (table), appGUI->opt->postpone_date_spinbutton, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (appGUI->opt->postpone_date_spinbutton), TRUE); + + gtk_spin_button_set_value (GTK_SPIN_BUTTON(appGUI->opt->postpone_date_spinbutton), config.postpone_date); + + label = gtk_label_new (_("days (0 for disable)")); + gtk_widget_show (label); + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); } /*------------------------------------------------------------------------------*/ Modified: trunk/src/options_prefs.c =================================================================== --- trunk/src/options_prefs.c 2008-06-20 22:16:42 UTC (rev 479) +++ trunk/src/options_prefs.c 2008-06-20 23:11:05 UTC (rev 480) @@ -165,6 +165,7 @@ config.tasks_addedit_win_x = config.window_x-config.tasks_addedit_win_w/2; config.tasks_addedit_win_y = config.window_y+20; config.postpone_time = 10; + config.postpone_date = 1; g_strlcpy (config.due_today_color, "#00981E", MAXCOLORNAME); g_strlcpy (config.due_7days_color, "#0047B7", MAXCOLORNAME); g_strlcpy (config.past_due_color, "#CB362C", MAXCOLORNAME); @@ -850,6 +851,13 @@ xmlFree(key); } + if ((!xmlStrcmp(tasks_node->name, (const xmlChar *) "postpone_date"))) { + key = xmlNodeListGetString(doc, tasks_node->xmlChildrenNode, 1); + if (key != NULL) + sscanf((gchar *) key, "%d", &config.postpone_date); + xmlFree(key); + } + if ((!xmlStrcmp(tasks_node->name, (const xmlChar *)"due_today_color"))) { key = xmlNodeListGetString(doc, tasks_node->xmlChildrenNode, 1); if (key != NULL) @@ -1408,6 +1416,8 @@ xmlNewTextChild(tasks_node, NULL, (const xmlChar *) "tasks_addedit_win_h", (xmlChar *) tmpbuf); snprintf(tmpbuf, 32, "%d", config.postpone_time); xmlNewTextChild(tasks_node, NULL, (const xmlChar *) "postpone_time", (xmlChar *) tmpbuf); + snprintf(tmpbuf, 32, "%d", config.postpone_date); + xmlNewTextChild(tasks_node, NULL, (const xmlChar *) "postpone_date", (xmlChar *) tmpbuf); snprintf(tmpbuf, MAXCOLORNAME, "%s", config.due_today_color); xmlNewTextChild(tasks_node, NULL, (const xmlChar *) "due_today_color", (xmlChar *) tmpbuf); snprintf(tmpbuf, MAXCOLORNAME, "%s", config.due_7days_color); Modified: trunk/src/options_prefs.h =================================================================== --- trunk/src/options_prefs.h 2008-06-20 22:16:42 UTC (rev 479) +++ trunk/src/options_prefs.h 2008-06-20 23:11:05 UTC (rev 480) @@ -118,6 +118,7 @@ gint tasks_addedit_win_w; gint tasks_addedit_win_h; gint postpone_time; + gint postpone_date; gchar due_today_color[MAXCOLORNAME]; gchar due_7days_color[MAXCOLORNAME]; gchar past_due_color[MAXCOLORNAME]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |