aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorJason Tackaberry <tack@dok.org>1999-01-31 06:18:25 +0800
committerArturo Espinosa <unammx@src.gnome.org>1999-01-31 06:18:25 +0800
commit2d126d6634af26d7a4db216fe8c9922932b8f1f2 (patch)
tree31059fffe51ddcd309663a372c28650b1c625e61 /calendar
parentb1f6df5d5d869861e1fb3e38d6e665f2cf638709 (diff)
downloadgsoc2013-evolution-2d126d6634af26d7a4db216fe8c9922932b8f1f2.tar.gz
gsoc2013-evolution-2d126d6634af26d7a4db216fe8c9922932b8f1f2.tar.zst
gsoc2013-evolution-2d126d6634af26d7a4db216fe8c9922932b8f1f2.zip
if the user clicks on an event that is an occurance, the menu will allow
1999-01-29 Jason Tackaberry <tack@dok.org> * gncal-full-day.c (child_popup_menu): if the user clicks on an event that is an occurance, the menu will allow the user to delete all occurances of this event, or just the selected occurance. (delete_occurance): added. * eventedit.c (append_exception): force the clist to select the new exception. (fixes segfault) (delete_exception): if the last exception in the clist is deleted, move the selection index up. (fixes segfault) svn path=/trunk/; revision=636
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog12
-rw-r--r--calendar/eventedit.c7
-rw-r--r--calendar/gncal-full-day.c56
-rw-r--r--calendar/gui/eventedit.c7
-rw-r--r--calendar/gui/gncal-full-day.c56
5 files changed, 108 insertions, 30 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 289f66feec..78876acc1e 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,15 @@
+1999-01-29 Jason Tackaberry <tack@dok.org>
+
+ * gncal-full-day.c (child_popup_menu): if the user clicks on an
+ event that is an occurance, the menu will allow the user to delete
+ all occurances of this event, or just the selected occurance.
+ (delete_occurance): added.
+
+ * eventedit.c (append_exception): force the clist to select the
+ new exception. (fixes segfault)
+ (delete_exception): if the last exception in the clist is deleted,
+ move the selection index up. (fixes segfault)
+
1999-01-28 Miguel de Icaza <miguel@nuclecu.unam.mx>
* main.c (parse_an_arg): Add --hidden key to hide the calendar at
diff --git a/calendar/eventedit.c b/calendar/eventedit.c
index 0f94a87a5d..05b9f1e126 100644
--- a/calendar/eventedit.c
+++ b/calendar/eventedit.c
@@ -1287,6 +1287,7 @@ append_exception (EventEditor *ee, time_t t)
i = gtk_clist_append (GTK_CLIST (ee->recur_ex_clist), c);
gtk_clist_set_row_data (GTK_CLIST (ee->recur_ex_clist), i, tt);
+ gtk_clist_select_row (GTK_CLIST (ee->recur_ex_clist), i, 0);
gtk_widget_set_sensitive (ee->recur_ex_vbox, TRUE);
}
@@ -1329,7 +1330,7 @@ static void
delete_exception (GtkWidget *widget, EventEditor *ee)
{
GtkCList *clist;
- int sel;
+ int sel, length;
clist = GTK_CLIST (ee->recur_ex_clist);
sel = GPOINTER_TO_INT(clist->selection->data);
@@ -1337,6 +1338,10 @@ delete_exception (GtkWidget *widget, EventEditor *ee)
g_free (gtk_clist_get_row_data (clist, sel)); /* free the time_t stored there */
gtk_clist_remove (clist, sel);
+ length = g_list_length(clist->row_list);
+ if (sel >= length)
+ sel--;
+ gtk_clist_select_row (GTK_CLIST (ee->recur_ex_clist), sel, 0);
if (clist->rows == 0)
gtk_widget_set_sensitive (ee->recur_ex_vbox, FALSE);
diff --git a/calendar/gncal-full-day.c b/calendar/gncal-full-day.c
index fde5a2439e..fd1b06877b 100644
--- a/calendar/gncal-full-day.c
+++ b/calendar/gncal-full-day.c
@@ -426,6 +426,22 @@ edit_appointment (GtkWidget *widget, gpointer data)
}
static void
+delete_occurance (GtkWidget *widget, gpointer data)
+{
+ Child *child;
+ iCalObject *ical;
+ time_t *t;
+
+ child = data;
+ ical = child->ico;
+ t = g_new(time_t, 1);
+ *t = child->start;
+ ical->exdate = g_list_prepend(ical->exdate, t);
+ gnome_calendar_object_changed(GNCAL_FULL_DAY (child->widget->parent)->calendar, child->ico, CHANGE_DATES);
+
+}
+
+static void
delete_appointment (GtkWidget *widget, gpointer data)
{
Child *child;
@@ -465,35 +481,47 @@ unrecur_appointment (GtkWidget *widget, gpointer data)
static void
child_popup_menu (GncalFullDay *fullday, Child *child, GdkEventButton *event)
{
- int sensitive, idx, items;
+ int sensitive, items;
+ struct menu_item *context_menu;
static struct menu_item child_items[] = {
- { N_("Make this appointment movable"), (GtkSignalFunc) unrecur_appointment, NULL, TRUE },
{ N_("Edit this appointment..."), (GtkSignalFunc) edit_appointment, NULL, TRUE },
{ N_("Delete this appointment"), (GtkSignalFunc) delete_appointment, NULL, TRUE },
{ NULL, NULL, NULL, TRUE },
{ N_("New appointment..."), (GtkSignalFunc) new_appointment, NULL, TRUE }
};
- child_items[0].data = child;
- child_items[1].data = child;
- child_items[2].data = child;
- child_items[4].data = fullday;
+ static struct menu_item recur_child_items[] = {
+ { N_("Make this appointment movable"), (GtkSignalFunc) unrecur_appointment, NULL, TRUE },
+ { N_("Edit this appointment..."), (GtkSignalFunc) edit_appointment, NULL, TRUE },
+ { N_("Delete this occurance"), (GtkSignalFunc) delete_occurance, NULL, TRUE },
+ { N_("Delete all occurances"), (GtkSignalFunc) delete_appointment, NULL, TRUE },
+ { NULL, NULL, NULL, TRUE },
+ { N_("New appointment..."), (GtkSignalFunc) new_appointment, NULL, TRUE }
+ };
sensitive = (child->ico->user_data == NULL);
- child_items[0].sensitive = sensitive;
- child_items[1].sensitive = sensitive;
- child_items[2].sensitive = sensitive;
-
if (child->ico->recur){
- idx = 0;
- items = 5;
+ items = 6;
+ context_menu = &recur_child_items[0];
+ context_menu[2].data = child;
+ context_menu[3].data = child;
+ context_menu[4].data = fullday;
+ context_menu[3].sensitive = sensitive;
} else {
- idx = 1;
items = 4;
+ context_menu = &child_items[0];
+ context_menu[3].data = fullday;
}
- popup_menu (&child_items [idx], items, event);
+ /* These settings are common for each context sensitive menu */
+ context_menu[0].data = child;
+ context_menu[1].data = child;
+ context_menu[0].sensitive = sensitive;
+ context_menu[1].sensitive = sensitive;
+ context_menu[2].sensitive = sensitive;
+
+ popup_menu (context_menu, items, event);
}
static void
diff --git a/calendar/gui/eventedit.c b/calendar/gui/eventedit.c
index 0f94a87a5d..05b9f1e126 100644
--- a/calendar/gui/eventedit.c
+++ b/calendar/gui/eventedit.c
@@ -1287,6 +1287,7 @@ append_exception (EventEditor *ee, time_t t)
i = gtk_clist_append (GTK_CLIST (ee->recur_ex_clist), c);
gtk_clist_set_row_data (GTK_CLIST (ee->recur_ex_clist), i, tt);
+ gtk_clist_select_row (GTK_CLIST (ee->recur_ex_clist), i, 0);
gtk_widget_set_sensitive (ee->recur_ex_vbox, TRUE);
}
@@ -1329,7 +1330,7 @@ static void
delete_exception (GtkWidget *widget, EventEditor *ee)
{
GtkCList *clist;
- int sel;
+ int sel, length;
clist = GTK_CLIST (ee->recur_ex_clist);
sel = GPOINTER_TO_INT(clist->selection->data);
@@ -1337,6 +1338,10 @@ delete_exception (GtkWidget *widget, EventEditor *ee)
g_free (gtk_clist_get_row_data (clist, sel)); /* free the time_t stored there */
gtk_clist_remove (clist, sel);
+ length = g_list_length(clist->row_list);
+ if (sel >= length)
+ sel--;
+ gtk_clist_select_row (GTK_CLIST (ee->recur_ex_clist), sel, 0);
if (clist->rows == 0)
gtk_widget_set_sensitive (ee->recur_ex_vbox, FALSE);
diff --git a/calendar/gui/gncal-full-day.c b/calendar/gui/gncal-full-day.c
index fde5a2439e..fd1b06877b 100644
--- a/calendar/gui/gncal-full-day.c
+++ b/calendar/gui/gncal-full-day.c
@@ -426,6 +426,22 @@ edit_appointment (GtkWidget *widget, gpointer data)
}
static void
+delete_occurance (GtkWidget *widget, gpointer data)
+{
+ Child *child;
+ iCalObject *ical;
+ time_t *t;
+
+ child = data;
+ ical = child->ico;
+ t = g_new(time_t, 1);
+ *t = child->start;
+ ical->exdate = g_list_prepend(ical->exdate, t);
+ gnome_calendar_object_changed(GNCAL_FULL_DAY (child->widget->parent)->calendar, child->ico, CHANGE_DATES);
+
+}
+
+static void
delete_appointment (GtkWidget *widget, gpointer data)
{
Child *child;
@@ -465,35 +481,47 @@ unrecur_appointment (GtkWidget *widget, gpointer data)
static void
child_popup_menu (GncalFullDay *fullday, Child *child, GdkEventButton *event)
{
- int sensitive, idx, items;
+ int sensitive, items;
+ struct menu_item *context_menu;
static struct menu_item child_items[] = {
- { N_("Make this appointment movable"), (GtkSignalFunc) unrecur_appointment, NULL, TRUE },
{ N_("Edit this appointment..."), (GtkSignalFunc) edit_appointment, NULL, TRUE },
{ N_("Delete this appointment"), (GtkSignalFunc) delete_appointment, NULL, TRUE },
{ NULL, NULL, NULL, TRUE },
{ N_("New appointment..."), (GtkSignalFunc) new_appointment, NULL, TRUE }
};
- child_items[0].data = child;
- child_items[1].data = child;
- child_items[2].data = child;
- child_items[4].data = fullday;
+ static struct menu_item recur_child_items[] = {
+ { N_("Make this appointment movable"), (GtkSignalFunc) unrecur_appointment, NULL, TRUE },
+ { N_("Edit this appointment..."), (GtkSignalFunc) edit_appointment, NULL, TRUE },
+ { N_("Delete this occurance"), (GtkSignalFunc) delete_occurance, NULL, TRUE },
+ { N_("Delete all occurances"), (GtkSignalFunc) delete_appointment, NULL, TRUE },
+ { NULL, NULL, NULL, TRUE },
+ { N_("New appointment..."), (GtkSignalFunc) new_appointment, NULL, TRUE }
+ };
sensitive = (child->ico->user_data == NULL);
- child_items[0].sensitive = sensitive;
- child_items[1].sensitive = sensitive;
- child_items[2].sensitive = sensitive;
-
if (child->ico->recur){
- idx = 0;
- items = 5;
+ items = 6;
+ context_menu = &recur_child_items[0];
+ context_menu[2].data = child;
+ context_menu[3].data = child;
+ context_menu[4].data = fullday;
+ context_menu[3].sensitive = sensitive;
} else {
- idx = 1;
items = 4;
+ context_menu = &child_items[0];
+ context_menu[3].data = fullday;
}
- popup_menu (&child_items [idx], items, event);
+ /* These settings are common for each context sensitive menu */
+ context_menu[0].data = child;
+ context_menu[1].data = child;
+ context_menu[0].sensitive = sensitive;
+ context_menu[1].sensitive = sensitive;
+ context_menu[2].sensitive = sensitive;
+
+ popup_menu (context_menu, items, event);
}
static void
-14 23:32:59 +0800'>2007-01-141-0/+1 * Update to KDE 3.5.5 / KOffice 1.6.1lofi2006-12-204-6/+122 * KDE 3.5.4 / KOffice 1.5.2lofi2006-09-136-10/+12 * All dictionaries can be installed separately:thierry2006-07-154-7/+17 * Update to KDE 3.5.3lofi2006-06-064-22/+20 * Update to KOffice 1.5.1lofi2006-05-272-4/+4 * Update to KOffice 1.5.0lofi2006-04-293-22/+8 * Update to KDE 3.5.2lofi2006-03-314-128/+22 * Conversion to a single libtool environment.ade2006-02-231-1/+1 * Update to KDE 3.5.1.lofi2006-02-014-8/+18 * SHA256ifyedwin2006-01-224-0/+4 * Update to KDE 3.5.0lofi2006-01-094-74/+82 * - Add SHA256pav2005-11-251-0/+1 * Mass-conversion to the USE_AUTOTOOLS New World Order. The code presentade2005-11-151-1/+1 * Update to 0.101mnag2005-11-072-3/+3 * Update to KDE 3.4.3 / KOffice 1.4.2lofi2005-11-054-6/+34 * Remove all the secondary port of editors/ooodict-allmaho2005-11-012-20/+0 * Fix index build by moving openoffice.org-1.1 ports.maho2005-08-291-1/+1 * Update to KDE 3.4.2 / KOffice 1.4.1lofi2005-08-012-4/+4 * Update to KDE 3.4.1lofi2005-06-264-22/+30 * - Fix categoriespav2005-06-061-0/+1 * - Unbreak and general updatepav2005-06-062-0/+19 * change the libtool version to use from 1.3 to 1.5oliver2005-06-031-1/+1 * Update to KDE 3.4lofi2005-03-214-78/+34 * Add i18nized doc subdirs to kdehier and adjust i18n port plists accordingly.lofi2004-12-232-2/+0 * Fix kde3-i18n ports.lofi2004-12-162-4/+4 * Update to KDE 3.3.2lofi2004-12-148-12/+12