aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2003-02-23 10:30:10 +0800
committerHans Petter <hansp@src.gnome.org>2003-02-23 10:30:10 +0800
commit1b3f0e9d8a9705ac4ce06171bb21ac68e6728351 (patch)
treed1f3d8c22f0236f0ae7054886996a404cc5614b9 /calendar
parent31c898ac0dfa84199024ec982b00b6bdbaafe10c (diff)
downloadgsoc2013-evolution-1b3f0e9d8a9705ac4ce06171bb21ac68e6728351.tar.gz
gsoc2013-evolution-1b3f0e9d8a9705ac4ce06171bb21ac68e6728351.tar.zst
gsoc2013-evolution-1b3f0e9d8a9705ac4ce06171bb21ac68e6728351.zip
Show the custom widgets, since libglade appears to not want to do that.
2003-02-22 Hans Petter Jansson <hpj@ximian.com> * gui/dialogs/task-details-page.c (get_widgets): Show the custom widgets, since libglade appears to not want to do that. * gui/dialogs/task-page.c (clear_widgets): Make the description field use a GtkTextView. (task_page_fill_widgets): Ditto. (task_page_fill_component): Ditto. (init_widgets): Ditto. (get_widgets): Show the custom widgets, since libglade doesn't do it. svn path=/trunk/; revision=20003
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog12
-rw-r--r--calendar/gui/dialogs/task-details-page.c4
-rw-r--r--calendar/gui/dialogs/task-page.c38
3 files changed, 44 insertions, 10 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 3f355cd8a4..66ac91aaa2 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,17 @@
2003-02-22 Hans Petter Jansson <hpj@ximian.com>
+ * gui/dialogs/task-details-page.c (get_widgets): Show the custom
+ widgets, since libglade appears to not want to do that.
+
+ * gui/dialogs/task-page.c (clear_widgets): Make the description
+ field use a GtkTextView.
+ (task_page_fill_widgets): Ditto.
+ (task_page_fill_component): Ditto.
+ (init_widgets): Ditto.
+ (get_widgets): Show the custom widgets, since libglade doesn't do it.
+
+2003-02-22 Hans Petter Jansson <hpj@ximian.com>
+
* pcs/cal-backend.c (cal_backend_unref_categories): Add an
iteration statement. Fixes hang in wombat.
diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c
index 5254e1b794..208dcb4270 100644
--- a/calendar/gui/dialogs/task-details-page.c
+++ b/calendar/gui/dialogs/task-details-page.c
@@ -467,8 +467,10 @@ get_widgets (TaskDetailsPage *tdpage)
priv->percent_complete = GW ("percent-complete");
priv->completed_date = GW ("completed-date");
+ gtk_widget_show (priv->completed_date);
priv->url_entry = GW ("url_entry");
+ gtk_widget_show (priv->url_entry);
priv->url = e_url_entry_get_entry (E_URL_ENTRY (priv->url_entry));
#undef GW
@@ -645,7 +647,7 @@ field_changed_cb (GtkWidget *widget, gpointer data)
tdpage = TASK_DETAILS_PAGE (data);
priv = tdpage->priv;
-
+
if (!priv->updating)
comp_editor_page_notify_changed (COMP_EDITOR_PAGE (tdpage));
}
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index c5ad9ab677..0e2ae28d5f 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -27,7 +27,7 @@
#include <string.h>
#include <gtk/gtksignal.h>
-#include <gtk/gtktext.h>
+#include <gtk/gtktextview.h>
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkspinbutton.h>
#include <gtk/gtkoptionmenu.h>
@@ -241,7 +241,7 @@ clear_widgets (TaskPage *tpage)
/* Summary, description */
e_dialog_editable_set (priv->summary, NULL);
- e_dialog_editable_set (priv->description, NULL);
+ gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), "", 0);
/* Start, due times */
e_date_edit_set_time (E_DATE_EDIT (priv->start_date), 0);
@@ -309,9 +309,11 @@ task_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
cal_component_get_description_list (comp, &l);
if (l) {
text = *(CalComponentText *)l->data;
- e_dialog_editable_set (priv->description, text.value);
+ gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)),
+ text.value, -1);
} else {
- e_dialog_editable_set (priv->description, NULL);
+ gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)),
+ "", 0);
}
cal_component_free_text_list (l);
@@ -465,9 +467,12 @@ task_page_fill_component (CompEditorPage *page, CalComponent *comp)
char *cat, *str;
gboolean date_set, time_set;
icaltimezone *zone;
+ GtkTextBuffer *text_buffer;
+ GtkTextIter text_iter_start, text_iter_end;
tpage = TASK_PAGE (page);
priv = tpage->priv;
+ text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description));
/* Summary. */
@@ -488,7 +493,10 @@ task_page_fill_component (CompEditorPage *page, CalComponent *comp)
/* Description */
- str = e_dialog_editable_get (priv->description);
+ gtk_text_buffer_get_start_iter (text_buffer, &text_iter_start);
+ gtk_text_buffer_get_end_iter (text_buffer, &text_iter_end);
+ str = gtk_text_buffer_get_text (text_buffer, &text_iter_start, &text_iter_end, FALSE);
+
if (!str || strlen (str) == 0)
cal_component_set_description_list (comp, NULL);
else {
@@ -645,8 +653,12 @@ get_widgets (TaskPage *tpage)
priv->summary = GW ("summary");
+ /* Glade's visibility flag doesn't seem to work for custom widgets */
priv->due_date = GW ("due-date");
+ gtk_widget_show (priv->due_date);
priv->start_date = GW ("start-date");
+ gtk_widget_show (priv->start_date);
+
priv->due_timezone = GW ("due-timezone");
priv->start_timezone = GW ("start-timezone");
@@ -828,6 +840,7 @@ static gboolean
init_widgets (TaskPage *tpage)
{
TaskPagePrivate *priv;
+ GtkTextBuffer *text_buffer;
char *location;
icaltimezone *zone;
@@ -846,10 +859,12 @@ init_widgets (TaskPage *tpage)
g_signal_connect((priv->summary), "changed",
G_CALLBACK (summary_changed_cb), tpage);
- /* Description - turn on word wrap. */
-#if 0
- gtk_text_set_word_wrap (GTK_TEXT (priv->description), TRUE);
-#endif
+ /* Description */
+ text_buffer = gtk_text_buffer_new (NULL);
+ gtk_text_view_set_buffer (GTK_TEXT_VIEW (priv->description), text_buffer);
+ g_object_unref (text_buffer);
+
+ gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (priv->description), GTK_WRAP_WORD);
/* Dates */
g_signal_connect((priv->start_date), "changed",
@@ -875,6 +890,11 @@ init_widgets (TaskPage *tpage)
/* Connect the default signal handler to use to make sure the "changed"
field gets set whenever a field is changed. */
+
+ /* Belongs to priv->description */
+ g_signal_connect ((text_buffer), "changed",
+ G_CALLBACK (field_changed_cb), tpage);
+
g_signal_connect((priv->description), "changed",
G_CALLBACK (field_changed_cb), tpage);
g_signal_connect((priv->categories), "changed",