aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorJP Rosevear <jpr@helixcode.com>2001-01-06 03:01:25 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-01-06 03:01:25 +0800
commit9177914543e3bd828cb6e88ec035a5f7648bcebe (patch)
tree0f6774e70e487e777ea9eec74f26047b257c057a /calendar/gui
parent3b1cd946dfefa0b86331583076936ce7f89c4e26 (diff)
downloadgsoc2013-evolution-9177914543e3bd828cb6e88ec035a5f7648bcebe.tar
gsoc2013-evolution-9177914543e3bd828cb6e88ec035a5f7648bcebe.tar.gz
gsoc2013-evolution-9177914543e3bd828cb6e88ec035a5f7648bcebe.tar.bz2
gsoc2013-evolution-9177914543e3bd828cb6e88ec035a5f7648bcebe.tar.lz
gsoc2013-evolution-9177914543e3bd828cb6e88ec035a5f7648bcebe.tar.xz
gsoc2013-evolution-9177914543e3bd828cb6e88ec035a5f7648bcebe.tar.zst
gsoc2013-evolution-9177914543e3bd828cb6e88ec035a5f7648bcebe.zip
get categories button (init_widgets): listen for button click
2001-01-05 JP Rosevear <jpr@helixcode.com> * gui/event-editor.c (get_widgets): get categories button (init_widgets): listen for button click (fill_widgets): fill in the categories area (dialog_to_comp_object): set the cal component categories (categories_clicked): throw up the categories dialog and update when ok is clicked * gui/event-editor-dialog.glade: Add categories and contacts buttons and fields * gui/dialogs/task-editor-dialog.glade: Rename button svn path=/trunk/; revision=7270
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/dialogs/task-editor-dialog.glade2
-rw-r--r--calendar/gui/dialogs/task-page.glade2
-rw-r--r--calendar/gui/event-editor-dialog.glade91
-rw-r--r--calendar/gui/event-editor-dialog.glade.h76
-rw-r--r--calendar/gui/event-editor.c54
5 files changed, 184 insertions, 41 deletions
diff --git a/calendar/gui/dialogs/task-editor-dialog.glade b/calendar/gui/dialogs/task-editor-dialog.glade
index e205b4c10d..272fa48e55 100644
--- a/calendar/gui/dialogs/task-editor-dialog.glade
+++ b/calendar/gui/dialogs/task-editor-dialog.glade
@@ -482,7 +482,7 @@ Confidential
<widget>
<class>GtkButton</class>
- <name>button3</name>
+ <name>contacts-button</name>
<can_focus>True</can_focus>
<child>
<padding>0</padding>
diff --git a/calendar/gui/dialogs/task-page.glade b/calendar/gui/dialogs/task-page.glade
index e205b4c10d..272fa48e55 100644
--- a/calendar/gui/dialogs/task-page.glade
+++ b/calendar/gui/dialogs/task-page.glade
@@ -482,7 +482,7 @@ Confidential
<widget>
<class>GtkButton</class>
- <name>button3</name>
+ <name>contacts-button</name>
<can_focus>True</can_focus>
<child>
<padding>0</padding>
diff --git a/calendar/gui/event-editor-dialog.glade b/calendar/gui/event-editor-dialog.glade
index dea912be28..9304d425b1 100644
--- a/calendar/gui/event-editor-dialog.glade
+++ b/calendar/gui/event-editor-dialog.glade
@@ -362,6 +362,94 @@
</widget>
</widget>
</widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox49</name>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>categories-button</name>
+ <can_focus>True</can_focus>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label51</name>
+ <label>_Contacts</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>4</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>contacts</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>categories-button</name>
+ <can_focus>True</can_focus>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label52</name>
+ <label>Ca_tegories...</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>4</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>categories</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+ </widget>
</widget>
<widget>
@@ -1258,7 +1346,6 @@ forever
<name>recurrence-exception-add</name>
<can_focus>True</can_focus>
<label>Add</label>
- <relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
@@ -1271,7 +1358,6 @@ forever
<name>recurrence-exception-modify</name>
<can_focus>True</can_focus>
<label>Modify</label>
- <relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
@@ -1284,7 +1370,6 @@ forever
<name>recurrence-exception-delete</name>
<can_focus>True</can_focus>
<label>Delete</label>
- <relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
diff --git a/calendar/gui/event-editor-dialog.glade.h b/calendar/gui/event-editor-dialog.glade.h
index f255687a6d..57c95fa0f6 100644
--- a/calendar/gui/event-editor-dialog.glade.h
+++ b/calendar/gui/event-editor-dialog.glade.h
@@ -1,52 +1,62 @@
/*
- * Translatable strings file generated by extract-ui.
- * Add this file to your project's POTFILES.in
+ * Translatable strings file generated by Glade.
+ * Add this file to your project's POTFILES.in.
* DO NOT compile it as part of your application.
*/
+gchar *s = N_("event-editor-dialog");
+gchar *s = N_("Su_mmary:");
+gchar *s = N_("Time");
+gchar *s = N_("_Start time:");
+gchar *s = N_("_End time:");
gchar *s = N_("A_ll day event");
-gchar *s = N_("Add");
-gchar *s = N_("Appointment Basics");
gchar *s = N_("Classification");
-gchar *s = N_("Custom recurrence");
-gchar *s = N_("Delete");
-gchar *s = N_("Every");
-gchar *s = N_("Exceptions");
-gchar *s = N_("General");
-gchar *s = N_("Mail _to:");
-gchar *s = N_("Modify");
-gchar *s = N_("No recurrence");
-gchar *s = N_("Pri_vate");
gchar *s = N_("Pu_blic");
-gchar *s = N_("Recur on the");
-gchar *s = N_("Recurrence");
-gchar *s = N_("Recurrence Rule");
-gchar *s = N_("Reminder");
-gchar *s = N_("Simple recurrence");
-gchar *s = N_("Su_mmary:");
-gchar *s = N_("This appointment has custom recurrence rules that cannot be edited by Evolution.");
- "");
- "However, the appointment will recur at the appropriate time and will be displayed properly in the calendar views.");
-gchar *s = N_("Time");
-gchar *s = N_("_Audio");
+gchar *s = N_("Pri_vate");
gchar *s = N_("_Confidential");
+gchar *s = N_("_Contacts");
+gchar *s = N_("Ca_tegories...");
+gchar *s = N_("General");
+gchar *s = N_("Minutes\n"
+ "Hours\n"
+ "Days\n"
+ "");
+gchar *s = N_("Minutes\n"
+ "Hours\n"
+ "Days\n"
+ "");
+gchar *s = N_("Minutes\n"
+ "Hours\n"
+ "Days\n"
+ "");
+gchar *s = N_("Minutes\n"
+ "Hours\n"
+ "Days\n"
+ "");
gchar *s = N_("_Display");
-gchar *s = N_("_End time:");
-gchar *s = N_("_Mail");
gchar *s = N_("_Program");
+gchar *s = N_("_Mail");
+gchar *s = N_("Mail _to:");
gchar *s = N_("_Run program:");
gchar *s = N_("_Audio");
gchar *s = N_("Reminder");
gchar *s = N_("Appointment Basics");
gchar *s = N_("Su_mmary:");
gchar *s = N_("_Starting date:");
-gchar *s = N_("event-editor-dialog");
-gchar *s = N_("label21");
-gchar *s = N_("month(s)");
-gchar *s = N_("year(s)");
-gchar *s = N_("for");
-gchar *s = N_("until");
-gchar *s = N_("forever");
+gchar *s = N_("Recurrence Rule");
+gchar *s = N_("No recurrence");
+gchar *s = N_("Simple recurrence");
+gchar *s = N_("Custom recurrence");
+gchar *s = N_("Every");
+gchar *s = N_("day(s)\n"
+ "week(s)\n"
+ "month(s)\n"
+ "year(s)\n"
+ "");
+gchar *s = N_("for\n"
+ "until\n"
+ "forever\n"
+ "");
gchar *s = N_("Exceptions");
gchar *s = N_("Add");
gchar *s = N_("Modify");
diff --git a/calendar/gui/event-editor.c b/calendar/gui/event-editor.c
index ea2f78ae10..f3adb24c91 100644
--- a/calendar/gui/event-editor.c
+++ b/calendar/gui/event-editor.c
@@ -29,6 +29,7 @@
#include <e-util/e-dialog-widgets.h>
#include <widgets/misc/e-dateedit.h>
#include <gal/widgets/e-unicode.h>
+#include <gal/widgets/e-categories.h>
#include <cal-util/timeutil.h>
#include "dialogs/delete-comp.h"
#include "calendar-config.h"
@@ -110,6 +111,9 @@ struct _EventEditorPrivate {
GtkWidget *classification_private;
GtkWidget *classification_confidential;
+ GtkWidget *categories;
+ GtkWidget *categories_btn;
+
GtkWidget *recurrence_summary;
GtkWidget *recurrence_starting_date;
@@ -188,6 +192,7 @@ static void field_changed (GtkWidget *widget,
static void event_editor_set_changed (EventEditor *ee,
gboolean changed);
static gboolean prompt_to_save_changes (EventEditor *ee);
+static void categories_clicked (GtkWidget *button, EventEditor *ee);
@@ -941,6 +946,9 @@ get_widgets (EventEditor *ee)
priv->classification_private = GW ("classification-private");
priv->classification_confidential = GW ("classification-confidential");
+ priv->categories = GW ("categories");
+ priv->categories_btn = GW ("categories-button");
+
priv->recurrence_summary = GW ("recurrence-summary");
priv->recurrence_starting_date = GW ("recurrence-starting-date");
@@ -1091,6 +1099,10 @@ init_widgets (EventEditor *ee)
gtk_signal_connect (GTK_OBJECT (priv->recurrence_summary), "changed",
GTK_SIGNAL_FUNC (summary_changed_cb), priv->general_summary);
+ /* Categories button */
+ gtk_signal_connect (GTK_OBJECT (priv->categories_btn), "clicked",
+ GTK_SIGNAL_FUNC (categories_clicked), ee);
+
/* Start dates in the main and recurrence pages */
gtk_signal_connect (GTK_OBJECT (priv->start_time), "changed",
@@ -1860,7 +1872,8 @@ fill_widgets (EventEditor *ee)
CalComponentDateTime d;
GSList *l;
time_t dtstart, dtend;
-
+ const char *categories;
+
priv = ee->priv;
clear_widgets (ee);
@@ -1960,6 +1973,10 @@ fill_widgets (EventEditor *ee)
*/
}
+ /* Categories */
+ cal_component_get_categories (priv->comp, &categories);
+ e_dialog_editable_set (priv->categories, categories);
+
/* Recurrences */
fill_recurrence_widgets (ee);
@@ -2235,7 +2252,7 @@ dialog_to_comp_object (EventEditor *ee, CalComponent *comp)
CalComponentDateTime date;
time_t t;
gboolean all_day_event;
- char *str;
+ char *cat, *str;
priv = ee->priv;
@@ -2302,9 +2319,15 @@ dialog_to_comp_object (EventEditor *ee, CalComponent *comp)
} else {
/* FIXME: What do we do here? */
}
-
g_free (date.value);
+ /* Categories */
+ cat = e_dialog_editable_get (priv->categories);
+ cal_component_set_categories (comp, cat);
+
+ if (cat)
+ g_free (cat);
+
#if 0
ico->dalarm.enabled = e_dialog_toggle_get (priv->alarm_display);
ico->aalarm.enabled = e_dialog_toggle_get (priv->alarm_program);
@@ -3271,3 +3294,28 @@ prompt_to_save_changes (EventEditor *ee)
break;
}
}
+
+static void
+categories_clicked (GtkWidget *button, EventEditor *ee)
+{
+ char *categories;
+ GnomeDialog *dialog;
+ int result;
+ GtkWidget *entry;
+
+ entry = ee->priv->categories;
+ categories = e_utf8_gtk_entry_get_text (GTK_ENTRY (entry));
+
+ dialog = GNOME_DIALOG (e_categories_new (categories));
+ result = gnome_dialog_run (dialog);
+ g_free (categories);
+
+ if (result == 0) {
+ gtk_object_get (GTK_OBJECT (dialog),
+ "categories", &categories,
+ NULL);
+ e_utf8_gtk_entry_set_text (GTK_ENTRY (entry), categories);
+ g_free (categories);
+ }
+ gtk_object_destroy (GTK_OBJECT (dialog));
+}