aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs
diff options
context:
space:
mode:
authornobody <nobody@localhost>2003-04-02 01:15:53 +0800
committernobody <nobody@localhost>2003-04-02 01:15:53 +0800
commit2e5b2bbb530b642dda56b332cfd93810ac415098 (patch)
treee2b63c11a404a5dd99d407c989c8846fd0d5379d /calendar/gui/dialogs
parent5cda225087bfdc66e19edb703689e8af655e171c (diff)
downloadgsoc2013-evolution-2e5b2bbb530b642dda56b332cfd93810ac415098.tar
gsoc2013-evolution-2e5b2bbb530b642dda56b332cfd93810ac415098.tar.gz
gsoc2013-evolution-2e5b2bbb530b642dda56b332cfd93810ac415098.tar.bz2
gsoc2013-evolution-2e5b2bbb530b642dda56b332cfd93810ac415098.tar.lz
gsoc2013-evolution-2e5b2bbb530b642dda56b332cfd93810ac415098.tar.xz
gsoc2013-evolution-2e5b2bbb530b642dda56b332cfd93810ac415098.tar.zst
gsoc2013-evolution-2e5b2bbb530b642dda56b332cfd93810ac415098.zip
This commit was manufactured by cvs2svn to create tagEVOLUTION_1_2_4
'EVOLUTION_1_2_4'. svn path=/tags/EVOLUTION_1_2_4/; revision=20614
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r--calendar/gui/dialogs/Makefile.am26
-rw-r--r--calendar/gui/dialogs/alarm-options.c42
-rw-r--r--calendar/gui/dialogs/alarm-options.glade953
-rw-r--r--calendar/gui/dialogs/alarm-page.c373
-rw-r--r--calendar/gui/dialogs/alarm-page.glade827
-rw-r--r--calendar/gui/dialogs/cancel-comp.c14
-rw-r--r--calendar/gui/dialogs/comp-editor-util.c30
-rw-r--r--calendar/gui/dialogs/comp-editor.c178
-rw-r--r--calendar/gui/dialogs/event-editor.c101
-rw-r--r--calendar/gui/dialogs/event-page.c195
-rw-r--r--calendar/gui/dialogs/event-page.glade1187
-rw-r--r--calendar/gui/dialogs/meeting-page.c315
-rw-r--r--calendar/gui/dialogs/meeting-page.h12
-rw-r--r--calendar/gui/dialogs/recur-comp.c24
-rw-r--r--calendar/gui/dialogs/recurrence-page.c510
-rw-r--r--calendar/gui/dialogs/schedule-page.c63
-rw-r--r--calendar/gui/dialogs/send-comp.c14
-rw-r--r--calendar/gui/dialogs/task-details-page.c78
-rw-r--r--calendar/gui/dialogs/task-details-page.glade643
-rw-r--r--calendar/gui/dialogs/task-editor.c118
20 files changed, 2823 insertions, 2880 deletions
diff --git a/calendar/gui/dialogs/Makefile.am b/calendar/gui/dialogs/Makefile.am
index 53ea88a9dc..bcba6c22fe 100644
--- a/calendar/gui/dialogs/Makefile.am
+++ b/calendar/gui/dialogs/Makefile.am
@@ -1,12 +1,13 @@
IDLS = $(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
-IDL_GENERATED_H = \
- Evolution-Addressbook-SelectNames.h
-IDL_GENERATED = $(IDL_GENERATED_H)
+IDL_GENERATED = \
+ Evolution-Addressbook-SelectNames.h \
+ Evolution-Addressbook-SelectNames-common.c \
+ Evolution-Addressbook-SelectNames-skels.c \
+ Evolution-Addressbook-SelectNames-stubs.c
-$(IDL_GENERATED_H): $(IDLS)
- $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \
- --nostubs --noskels --nocommon \
+$(IDL_GENERATED): $(IDLS)
+ $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \
$(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
BUILT_SOURCES = $(IDL_GENERATED)
@@ -23,16 +24,17 @@ INCLUDES = \
-I$(top_srcdir)/shell \
-I$(top_srcdir)/addressbook/backend \
-I$(top_builddir)/addressbook/backend \
+ -I$(includedir) \
-DEVOLUTION_DATADIR=\""$(datadir)"\" \
-DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
- -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
+ -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \
-DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \
+ -DGNOMELOCALEDIR=\""$(localedir)"\" \
$(EVOLUTION_CALENDAR_CFLAGS)
-noinst_LTLIBRARIES = libcal-dialogs.la
+noinst_LIBRARIES = libcal-dialogs.a
-libcal_dialogs_la_SOURCES = \
+libcal_dialogs_a_SOURCES = \
$(IDL_GENERATED) \
alarm-options.c \
alarm-options.h \
@@ -77,6 +79,9 @@ libcal_dialogs_la_SOURCES = \
task-page.c \
task-page.h
+iconsdir = $(datadir)/images/evolution
+
+gladedir = $(datadir)/evolution/glade
glade_DATA = \
alarm-options.glade \
alarm-page.glade \
@@ -89,6 +94,7 @@ glade_DATA = \
task-details-page.glade \
task-page.glade
+etspecdir = $(datadir)/evolution/etspec/
etspec_DATA = meeting-page.etspec
CLEANFILES = $(BUILT_SOURCES)
diff --git a/calendar/gui/dialogs/alarm-options.c b/calendar/gui/dialogs/alarm-options.c
index 2261bb0bd7..cf64bff9a8 100644
--- a/calendar/gui/dialogs/alarm-options.c
+++ b/calendar/gui/dialogs/alarm-options.c
@@ -24,12 +24,14 @@
#include <string.h>
#include <glib.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkcheckbutton.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkwindow.h>
#include <gtk/gtkhbox.h>
+#include <liboaf/liboaf.h>
#include <bonobo/bonobo-control.h>
#include <bonobo/bonobo-exception.h>
#include <bonobo/bonobo-widget.h>
@@ -166,7 +168,7 @@ setup_select_names (Dialog *dialog)
CORBA_exception_init (&ev);
- dialog->corba_select_names = bonobo_activation_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
+ dialog->corba_select_names = oaf_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
if (BONOBO_EX (&ev))
return FALSE;
@@ -256,19 +258,19 @@ init_widgets (Dialog *dialog)
dialog->canceled = TRUE;
- g_signal_connect((dialog->toplevel), "delete_event",
- G_CALLBACK (toplevel_delete_event_cb), dialog);
+ gtk_signal_connect (GTK_OBJECT (dialog->toplevel), "delete_event",
+ GTK_SIGNAL_FUNC (toplevel_delete_event_cb), dialog);
- g_signal_connect((dialog->button_ok), "clicked",
- G_CALLBACK (button_ok_clicked_cb), dialog);
+ gtk_signal_connect (GTK_OBJECT (dialog->button_ok), "clicked",
+ GTK_SIGNAL_FUNC (button_ok_clicked_cb), dialog);
- g_signal_connect((dialog->button_cancel), "clicked",
- G_CALLBACK (button_cancel_clicked_cb), dialog);
+ gtk_signal_connect (GTK_OBJECT (dialog->button_cancel), "clicked",
+ GTK_SIGNAL_FUNC (button_cancel_clicked_cb), dialog);
/* Alarm repeat */
- g_signal_connect((dialog->repeat_toggle), "toggled",
- G_CALLBACK (repeat_toggle_toggled_cb), dialog);
+ gtk_signal_connect (GTK_OBJECT (dialog->repeat_toggle), "toggled",
+ GTK_SIGNAL_FUNC (repeat_toggle_toggled_cb), dialog);
}
/* Fills the audio alarm widgets with the values from the alarm component */
@@ -350,7 +352,7 @@ alarm_to_malarm_widgets (Dialog *dialog, CalComponentAlarm *alarm)
"destinations", e_destination_exportv (destv), NULL);
for (i = 0; i < len; i++)
- g_object_unref (GTK_OBJECT (destv[i]));
+ gtk_object_unref (GTK_OBJECT (destv[i]));
g_free (destv);
cal_component_free_attendee_list (attendee_list);
@@ -616,7 +618,7 @@ malarm_widgets_to_alarm (Dialog *dialog, CalComponentAlarm *alarm)
/* Attendees */
bonobo_widget_get_property (BONOBO_WIDGET (dialog->malarm_addresses), "destinations",
- TC_CORBA_string, &str, NULL);
+ &str, NULL);
destv = e_destination_importv (str);
g_free (str);
@@ -761,23 +763,23 @@ alarm_options_dialog_run (CalComponentAlarm *alarm, const char *email, gboolean
g_return_val_if_fail (alarm != NULL, FALSE);
- dialog.repeat = repeat;
- dialog.email = email;
- dialog.xml = glade_xml_new (EVOLUTION_GLADEDIR "/alarm-options.glade", NULL, NULL);
+ dialog.repeat = repeat;
+ dialog.email = email;
+ dialog.xml = glade_xml_new (EVOLUTION_GLADEDIR "/alarm-options.glade", NULL);
if (!dialog.xml) {
g_message ("alarm_options_dialog_new(): Could not load the Glade XML file!");
return FALSE;
}
if (!get_widgets (&dialog)) {
- g_object_unref(dialog.xml);
+ gtk_object_unref (GTK_OBJECT (dialog.xml));
return FALSE;
}
-
+
if (!setup_select_names (&dialog)) {
- g_object_unref (dialog.xml);
- return FALSE;
- }
+ gtk_object_unref (GTK_OBJECT (dialog.xml));
+ return FALSE;
+ }
init_widgets (&dialog);
@@ -790,7 +792,7 @@ alarm_options_dialog_run (CalComponentAlarm *alarm, const char *email, gboolean
dialog_to_alarm (&dialog, alarm);
gtk_widget_destroy (dialog.toplevel);
- g_object_unref(dialog.xml);
+ gtk_object_unref (GTK_OBJECT (dialog.xml));
return TRUE;
}
diff --git a/calendar/gui/dialogs/alarm-options.glade b/calendar/gui/dialogs/alarm-options.glade
index 83f0af1f80..ef36167157 100644
--- a/calendar/gui/dialogs/alarm-options.glade
+++ b/calendar/gui/dialogs/alarm-options.glade
@@ -1,556 +1,463 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-<requires lib="gnome"/>
-
-<widget class="GtkWindow" id="alarm-options-toplevel">
- <property name="title" translatable="yes"></property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">True</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
+<?xml version="1.0"?>
+<GTK-Interface>
+
+<project>
+ <name>Dialogs</name>
+ <program_name>dialogs</program_name>
+ <directory></directory>
+ <source_directory>src</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+</project>
+
+<widget>
+ <class>GtkWindow</class>
+ <name>alarm-options-toplevel</name>
+ <visible>False</visible>
+ <title></title>
+ <type>GTK_WINDOW_DIALOG</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>True</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>True</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox1</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame1</name>
+ <label>Alarm Repeat</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
- <widget class="GtkFrame" id="frame1">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkCheckButton" id="repeat-toggle">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="label" translatable="yes">Repeat the alarm</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="repeat-group">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkSpinButton" id="repeat-quantity">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 1 999 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">extra times every</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="repeat-value">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 999 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="repeat-unit">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">minutes</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">hours</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">days</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox1</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkCheckButton</class>
+ <name>repeat-toggle</name>
+ <can_focus>True</can_focus>
+ <has_focus>True</has_focus>
+ <label>Repeat the alarm</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
<child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Alarm Repeat</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="dalarm-group">
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
+ <widget>
+ <class>GtkHBox</class>
+ <name>repeat-group</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Message to Display</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="dalarm-description">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>repeat-quantity</name>
+ <can_focus>True</can_focus>
+ <climb_rate>1</climb_rate>
+ <digits>0</digits>
+ <numeric>False</numeric>
+ <update_policy>GTK_UPDATE_ALWAYS</update_policy>
+ <snap>False</snap>
+ <wrap>False</wrap>
+ <value>1</value>
+ <lower>1</lower>
+ <upper>999</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label1</name>
+ <label>extra times every</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>repeat-value</name>
+ <can_focus>True</can_focus>
+ <climb_rate>1</climb_rate>
+ <digits>0</digits>
+ <numeric>False</numeric>
+ <update_policy>GTK_UPDATE_ALWAYS</update_policy>
+ <snap>False</snap>
+ <wrap>False</wrap>
+ <value>1</value>
+ <lower>0</lower>
+ <upper>999</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>repeat-unit</name>
+ <can_focus>True</can_focus>
+ <items>minutes
+hours
+days
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkVBox</class>
+ <name>dalarm-group</name>
+ <visible>False</visible>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkHBox" id="aalarm-group">
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Play sound:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GnomeFileEntry" id="file-entry1">
- <property name="visible">True</property>
- <property name="max_saved">10</property>
- <property name="directory_entry">False</property>
- <property name="modal">False</property>
-
- <child internal-child="entry">
- <widget class="GtkEntry" id="aalarm-attach">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label2</name>
+ <label>Message to Display</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow1</name>
+ <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
+ <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+ <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkText</class>
+ <name>dalarm-description</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text></text>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkHBox</class>
+ <name>aalarm-group</name>
+ <visible>False</visible>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkVBox" id="malarm-group">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkHBox" id="malarm-address-group">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkButton" id="malarm-addressbook">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Send To:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Message to Send</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="malarm-description">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label3</name>
+ <label>Play sound:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GnomeFileEntry</class>
+ <name>file-entry1</name>
+ <max_saved>10</max_saved>
+ <directory>False</directory>
+ <modal>False</modal>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <child_name>GnomeEntry:entry</child_name>
+ <name>aalarm-attach</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkVBox</class>
+ <name>malarm-group</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkHBox" id="palarm-group">
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Run program:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="palarm-program">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow2</name>
+ <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
+ <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+ <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+
+ <widget>
+ <class>GtkText</class>
+ <name>malarm-description</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text></text>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label7</name>
+ <label>Message to Send</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ <pack>GTK_PACK_END</pack>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>malarm-address-group</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>malarm-addressbook</name>
+ <can_focus>True</can_focus>
+ <label>Send To:</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
<child>
- <widget class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">With these arguments:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+ </widget>
- <child>
- <widget class="GtkEntry" id="palarm-args">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>Placeholder</class>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkHBox</class>
+ <name>palarm-group</name>
+ <visible>False</visible>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
- <property name="spacing">30</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
- <child>
- <widget class="GtkButton" id="button-ok">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label5</name>
+ <label>Run program:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>palarm-program</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>GtkLabel</class>
+ <name>label6</name>
+ <label>With these arguments:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>palarm-args</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>
- <child>
- <widget class="GtkButton" id="button-cancel">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
+ <widget>
+ <class>GtkHButtonBox</class>
+ <name>hbuttonbox1</name>
+ <layout_style>GTK_BUTTONBOX_END</layout_style>
+ <spacing>30</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
</child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button-ok</name>
+ <can_default>True</can_default>
+ <has_default>True</has_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button-cancel</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/calendar/gui/dialogs/alarm-page.c b/calendar/gui/dialogs/alarm-page.c
index 2008881ff3..78322eaf52 100644
--- a/calendar/gui/dialogs/alarm-page.c
+++ b/calendar/gui/dialogs/alarm-page.c
@@ -1,14 +1,12 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* Evolution calendar - Alarm page of the calendar component dialogs
*
- * Copyright (C) 2001-2003 Ximian, Inc.
+ * Copyright (C) 2001 Ximian, Inc.
*
* Authors: Federico Mena-Quintero <federico@ximian.com>
* Miguel de Icaza <miguel@ximian.com>
* Seth Alves <alves@hungry.com>
* JP Rosevear <jpr@ximian.com>
- * Hans Petter Jansson <hpj@ximian.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@ -29,11 +27,8 @@
#endif
#include <string.h>
-#include <gtk/gtkcellrenderertext.h>
#include <gtk/gtksignal.h>
-#include <gtk/gtktreeview.h>
-#include <gtk/gtktreeselection.h>
-#include <gtk/gtkoptionmenu.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
#include <gal/widgets/e-unicode.h>
@@ -44,7 +39,6 @@
#include "../calendar-config.h"
#include "comp-editor-util.h"
#include "alarm-options.h"
-#include "../e-alarm-list.h"
#include "alarm-page.h"
@@ -76,9 +70,6 @@ struct _AlarmPagePrivate {
/* Alarm options dialog and the alarm we maintain */
CalComponentAlarm *alarm;
- /* Alarm store for the GtkTreeView list widget */
- EAlarmList *list_store;
-
gboolean updating;
};
@@ -134,7 +125,7 @@ static const int time_map[] = {
static void alarm_page_class_init (AlarmPageClass *class);
static void alarm_page_init (AlarmPage *apage);
-static void alarm_page_finalize (GObject *object);
+static void alarm_page_destroy (GtkObject *object);
static GtkWidget *alarm_page_get_widget (CompEditorPage *page);
static void alarm_page_focus_main_widget (CompEditorPage *page);
@@ -155,21 +146,41 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #AlarmPage class.
**/
+GtkType
+alarm_page_get_type (void)
+{
+ static GtkType alarm_page_type;
+
+ if (!alarm_page_type) {
+ static const GtkTypeInfo alarm_page_info = {
+ "AlarmPage",
+ sizeof (AlarmPage),
+ sizeof (AlarmPageClass),
+ (GtkClassInitFunc) alarm_page_class_init,
+ (GtkObjectInitFunc) alarm_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ alarm_page_type = gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &alarm_page_info);
+ }
-E_MAKE_TYPE (alarm_page, "AlarmPage", AlarmPage, alarm_page_class_init,
- alarm_page_init, TYPE_COMP_EDITOR_PAGE);
+ return alarm_page_type;
+}
/* Class initialization function for the alarm page */
static void
alarm_page_class_init (AlarmPageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *gobject_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- gobject_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = alarm_page_get_widget;
editor_page_class->focus_main_widget = alarm_page_focus_main_widget;
@@ -178,7 +189,7 @@ alarm_page_class_init (AlarmPageClass *class)
editor_page_class->set_summary = alarm_page_set_summary;
editor_page_class->set_dates = alarm_page_set_dates;
- gobject_class->finalize = alarm_page_finalize;
+ object_class->destroy = alarm_page_destroy;
}
/* Object initialization function for the alarm page */
@@ -209,7 +220,7 @@ alarm_page_init (AlarmPage *apage)
/* create the default alarm, which will contain the
* X-EVOLUTION-NEEDS-DESCRIPTION property, so that we
- * set a correct description if none is set */
+ * set a correct description if none is ser */
priv->alarm = cal_component_alarm_new ();
icalcomp = cal_component_alarm_get_icalcomponent (priv->alarm);
@@ -222,7 +233,7 @@ alarm_page_init (AlarmPage *apage)
/* Destroy handler for the alarm page */
static void
-alarm_page_finalize (GObject *object)
+alarm_page_destroy (GtkObject *object)
{
AlarmPage *apage;
AlarmPagePrivate *priv;
@@ -234,7 +245,7 @@ alarm_page_finalize (GObject *object)
priv = apage->priv;
if (priv->xml) {
- g_object_unref (priv->xml);
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
@@ -243,16 +254,11 @@ alarm_page_finalize (GObject *object)
priv->alarm = NULL;
}
- if (priv->list_store) {
- g_object_unref (priv->list_store);
- priv->list_store = NULL;
- }
-
g_free (priv);
apage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -305,7 +311,174 @@ clear_widgets (AlarmPage *apage)
e_dialog_option_menu_set (priv->time, CAL_ALARM_TRIGGER_RELATIVE_START, time_map);
/* List data */
- e_alarm_list_clear (priv->list_store);
+ gtk_clist_clear (GTK_CLIST (priv->list));
+}
+
+/* Builds a string for the duration of the alarm. If the duration is zero, returns NULL. */
+static char *
+get_alarm_duration_string (struct icaldurationtype *duration)
+{
+ GString *string = g_string_new (NULL);
+ char *ret;
+ gboolean have_something;
+
+ have_something = FALSE;
+
+ if (duration->days > 1) {
+ g_string_sprintf (string, _("%d days"), duration->days);
+ have_something = TRUE;
+ } else if (duration->days == 1) {
+ g_string_append (string, _("1 day"));
+ have_something = TRUE;
+ }
+
+ if (duration->weeks > 1) {
+ g_string_sprintf (string, _("%d weeks"), duration->weeks);
+ have_something = TRUE;
+ } else if (duration->weeks == 1) {
+ g_string_append (string, _("1 week"));
+ have_something = TRUE;
+ }
+
+ if (duration->hours > 1) {
+ g_string_sprintf (string, _("%d hours"), duration->hours);
+ have_something = TRUE;
+ } else if (duration->hours == 1) {
+ g_string_append (string, _("1 hour"));
+ have_something = TRUE;
+ }
+
+ if (duration->minutes > 1) {
+ g_string_sprintf (string, _("%d minutes"), duration->minutes);
+ have_something = TRUE;
+ } else if (duration->minutes == 1) {
+ g_string_append (string, _("1 minute"));
+ have_something = TRUE;
+ }
+
+ if (duration->seconds > 1) {
+ g_string_sprintf (string, _("%d seconds"), duration->seconds);
+ have_something = TRUE;
+ } else if (duration->seconds == 1) {
+ g_string_append (string, _("1 second"));
+ have_something = TRUE;
+ }
+
+ if (have_something) {
+ ret = string->str;
+ g_string_free (string, FALSE);
+ return ret;
+ } else {
+ g_string_free (string, TRUE);
+ return NULL;
+ }
+}
+
+static char *
+get_alarm_string (CalComponentAlarm *alarm)
+{
+ CalAlarmAction action;
+ CalAlarmTrigger trigger;
+ char string[256];
+ char *base, *str = NULL, *dur;
+
+ string [0] = '\0';
+
+ cal_component_alarm_get_action (alarm, &action);
+ cal_component_alarm_get_trigger (alarm, &trigger);
+
+ switch (action) {
+ case CAL_ALARM_AUDIO:
+ base = _("Play a sound");
+ break;
+
+ case CAL_ALARM_DISPLAY:
+ base = _("Display a message");
+ break;
+
+ case CAL_ALARM_EMAIL:
+ base = _("Send an email");
+ break;
+
+ case CAL_ALARM_PROCEDURE:
+ base = _("Run a program");
+ break;
+
+ case CAL_ALARM_NONE:
+ case CAL_ALARM_UNKNOWN:
+ default:
+ base = _("Unknown action to be performed");
+ break;
+ }
+
+ /* FIXME: This does not look like it will localize correctly. */
+
+ switch (trigger.type) {
+ case CAL_ALARM_TRIGGER_RELATIVE_START:
+ dur = get_alarm_duration_string (&trigger.u.rel_duration);
+
+ if (dur) {
+ if (trigger.u.rel_duration.is_neg)
+ str = g_strdup_printf (_("%s %s before the start of the appointment"),
+ base, dur);
+ else
+ str = g_strdup_printf (_("%s %s after the start of the appointment"),
+ base, dur);
+
+ g_free (dur);
+ } else
+ str = g_strdup_printf (_("%s at the start of the appointment"), base);
+
+ break;
+
+ case CAL_ALARM_TRIGGER_RELATIVE_END:
+ dur = get_alarm_duration_string (&trigger.u.rel_duration);
+
+ if (dur) {
+ if (trigger.u.rel_duration.is_neg)
+ str = g_strdup_printf (_("%s %s before the end of the appointment"),
+ base, dur);
+ else
+ str = g_strdup_printf (_("%s %s after the end of the appointment"),
+ base, dur);
+
+ g_free (dur);
+ } else
+ str = g_strdup_printf (_("%s at the end of the appointment"), base);
+
+ break;
+
+ case CAL_ALARM_TRIGGER_ABSOLUTE: {
+ struct icaltimetype itt;
+ icaltimezone *utc_zone, *current_zone;
+ char *location;
+ struct tm tm;
+ char buf[256];
+
+ /* Absolute triggers come in UTC, so convert them to the local timezone */
+
+ itt = trigger.u.abs_time;
+
+ utc_zone = icaltimezone_get_utc_timezone ();
+ location = calendar_config_get_timezone ();
+ current_zone = icaltimezone_get_builtin_timezone (location);
+
+ tm = icaltimetype_to_tm_with_zone (&itt, utc_zone, current_zone);
+
+ e_time_format_date_and_time (&tm, calendar_config_get_24_hour_format (),
+ FALSE, FALSE, buf, sizeof (buf));
+
+ str = g_strdup_printf (_("%s at %s"), base, buf);
+
+ break; }
+
+ case CAL_ALARM_TRIGGER_NONE:
+ default:
+ str = g_strdup_printf (_("%s for an unknown trigger type"), base);
+ break;
+ }
+
+ return str;
}
static void
@@ -313,19 +486,15 @@ sensitize_buttons (AlarmPage *apage)
{
AlarmPagePrivate *priv;
CalClient *client;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- gboolean have_selected;
-
+ GtkCList *clist;
+
priv = apage->priv;
-
+
client = COMP_EDITOR_PAGE (apage)->client;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list));
- have_selected = gtk_tree_selection_get_selected (selection, NULL, &iter);
+ clist = GTK_CLIST (priv->list);
- gtk_widget_set_sensitive (priv->add,
- cal_client_get_one_alarm_only (client) && have_selected ? FALSE : TRUE);
- gtk_widget_set_sensitive (priv->delete, have_selected);
+ gtk_widget_set_sensitive (priv->add, cal_client_get_one_alarm_only (client) && clist->rows > 0 ? FALSE : TRUE);
+ gtk_widget_set_sensitive (priv->delete, clist->rows > 0 ? TRUE : FALSE);
}
/* Appends an alarm to the list */
@@ -333,14 +502,20 @@ static void
append_reminder (AlarmPage *apage, CalComponentAlarm *alarm)
{
AlarmPagePrivate *priv;
- GtkTreeView *view;
- GtkTreeIter iter;
+ GtkCList *clist;
+ char *c[1];
+ int i;
priv = apage->priv;
- view = GTK_TREE_VIEW (priv->list);
- e_alarm_list_append (priv->list_store, &iter, alarm);
- gtk_tree_selection_select_iter (gtk_tree_view_get_selection (view), &iter);
+ clist = GTK_CLIST (priv->list);
+
+ c[0] = get_alarm_string (alarm);
+ i = gtk_clist_append (clist, c);
+
+ gtk_clist_set_row_data_full (clist, i, alarm, (GtkDestroyNotify) cal_component_alarm_free);
+ gtk_clist_select_row (clist, i, 0);
+ g_free (c[0]);
sensitize_buttons (apage);
}
@@ -351,9 +526,10 @@ alarm_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
{
AlarmPage *apage;
AlarmPagePrivate *priv;
- GtkWidget *menu;
CalComponentText text;
GList *alarms, *l;
+ GtkCList *clist;
+ GtkWidget *menu;
CompEditorPageDates dates;
int i;
@@ -381,6 +557,7 @@ alarm_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
alarms = cal_component_get_alarm_uids (comp);
+ clist = GTK_CLIST (priv->list);
for (l = alarms; l != NULL; l = l->next) {
CalComponentAlarm *ca, *ca_copy;
const char *auid;
@@ -417,11 +594,9 @@ alarm_page_fill_component (CompEditorPage *page, CalComponent *comp)
{
AlarmPage *apage;
AlarmPagePrivate *priv;
- GtkTreeView *view;
- GtkTreeModel *model;
- GtkTreeIter iter;
- gboolean valid_iter;
GList *list, *l;
+ GtkCList *clist;
+ int i;
apage = ALARM_PAGE (page);
priv = apage->priv;
@@ -439,16 +614,13 @@ alarm_page_fill_component (CompEditorPage *page, CalComponent *comp)
/* Add the new alarms */
- view = GTK_TREE_VIEW (priv->list);
- model = GTK_TREE_MODEL (priv->list_store);
-
- for (valid_iter = gtk_tree_model_get_iter_first (model, &iter); valid_iter;
- valid_iter = gtk_tree_model_iter_next (model, &iter)) {
+ clist = GTK_CLIST (priv->list);
+ for (i = 0; i < clist->rows; i++) {
CalComponentAlarm *alarm, *alarm_copy;
icalcomponent *icalcomp;
icalproperty *icalprop;
- alarm = (CalComponentAlarm *) e_alarm_list_get_alarm (priv->list_store, &iter);
+ alarm = gtk_clist_get_row_data (clist, i);
g_assert (alarm != NULL);
/* We set the description of the alarm if it's got
@@ -490,11 +662,14 @@ alarm_page_set_summary (CompEditorPage *page, const char *summary)
{
AlarmPage *apage;
AlarmPagePrivate *priv;
+ gchar *s;
apage = ALARM_PAGE (page);
priv = apage->priv;
- gtk_label_set_text (GTK_LABEL (priv->summary), summary);
+ s = e_utf8_to_gtk_string (priv->summary, summary);
+ gtk_label_set_text (GTK_LABEL (priv->summary), s);
+ g_free (s);
}
/* set_dates handler for the alarm page */
@@ -512,7 +687,7 @@ alarm_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates)
-/* Gets the widgets from the XML file and returns TRUE if they are all available. */
+/* Gets the widgets from the XML file and returns if they are all available. */
static gboolean
get_widgets (AlarmPage *apage)
{
@@ -532,14 +707,14 @@ get_widgets (AlarmPage *apage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
priv->summary = GW ("summary");
priv->date_time = GW ("date-time");
@@ -656,36 +831,23 @@ delete_clicked_cb (GtkButton *button, gpointer data)
{
AlarmPage *apage;
AlarmPagePrivate *priv;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- GtkTreePath *path;
- gboolean valid_iter;
+ GtkCList *clist;
+ int sel;
apage = ALARM_PAGE (data);
priv = apage->priv;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list));
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- g_warning ("Could not get a selection to delete.");
+ clist = GTK_CLIST (priv->list);
+ if (!clist->selection)
return;
- }
-
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->list_store), &iter);
- e_alarm_list_remove (priv->list_store, &iter);
- /* Select closest item after removal */
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->list_store), &iter, path);
- if (!valid_iter) {
- gtk_tree_path_prev (path);
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->list_store), &iter, path);
- }
+ sel = GPOINTER_TO_INT (clist->selection->data);
- if (valid_iter)
- gtk_tree_selection_select_iter (selection, &iter);
+ gtk_clist_remove (clist, sel);
+ if (sel >= clist->rows)
+ sel--;
sensitize_buttons (apage);
-
- gtk_tree_path_free (path);
}
/* Callback used when the alarm options button is clicked */
@@ -714,51 +876,26 @@ static void
init_widgets (AlarmPage *apage)
{
AlarmPagePrivate *priv;
- GtkTreeViewColumn *column;
- GtkCellRenderer *cell_renderer;
priv = apage->priv;
/* Reminder buttons */
- g_signal_connect ((priv->add), "clicked",
- G_CALLBACK (add_clicked_cb), apage);
- g_signal_connect ((priv->delete), "clicked",
- G_CALLBACK (delete_clicked_cb), apage);
+ gtk_signal_connect (GTK_OBJECT (priv->add), "clicked",
+ GTK_SIGNAL_FUNC (add_clicked_cb), apage);
+ gtk_signal_connect (GTK_OBJECT (priv->delete), "clicked",
+ GTK_SIGNAL_FUNC (delete_clicked_cb), apage);
/* Connect the default signal handler to use to make sure we notify
* upstream of changes to the widget values.
*/
- g_signal_connect ((priv->add), "clicked",
- G_CALLBACK (field_changed_cb), apage);
- g_signal_connect ((priv->delete), "clicked",
- G_CALLBACK (field_changed_cb), apage);
+ gtk_signal_connect (GTK_OBJECT (priv->add), "clicked",
+ GTK_SIGNAL_FUNC (field_changed_cb), apage);
+ gtk_signal_connect (GTK_OBJECT (priv->delete), "clicked",
+ GTK_SIGNAL_FUNC (field_changed_cb), apage);
/* Options button */
- g_signal_connect ((priv->button_options), "clicked",
- G_CALLBACK (button_options_clicked_cb), apage);
-
- /* Alarm list */
-
- /* Model */
- priv->list_store = e_alarm_list_new ();
- gtk_tree_view_set_model (GTK_TREE_VIEW (priv->list),
- GTK_TREE_MODEL (priv->list_store));
-
- /* View */
- column = gtk_tree_view_column_new ();
- gtk_tree_view_column_set_title (column, "Action/Trigger"); /* Not shown */
- cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ());
- gtk_tree_view_column_pack_start (column, cell_renderer, TRUE);
- gtk_tree_view_column_add_attribute (column, cell_renderer, "text", E_ALARM_LIST_COLUMN_DESCRIPTION);
- gtk_tree_view_append_column (GTK_TREE_VIEW (priv->list), column);
-
- sensitize_buttons (apage);
-#if 0
- /* If we want the alarm setup widgets to reflect the currently selected alarm, we
- * need to do something like this */
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list)), "changed",
- G_CALLBACK (alarm_selection_changed_cb), apage);
-#endif
+ gtk_signal_connect (GTK_OBJECT (priv->button_options), "clicked",
+ GTK_SIGNAL_FUNC (button_options_clicked_cb), apage);
}
@@ -780,7 +917,7 @@ alarm_page_construct (AlarmPage *apage)
priv = apage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR "/alarm-page.glade",
- NULL, NULL);
+ NULL);
if (!priv->xml) {
g_message ("alarm_page_construct(): "
"Could not load the Glade XML file!");
@@ -811,9 +948,9 @@ alarm_page_new (void)
{
AlarmPage *apage;
- apage = g_object_new (TYPE_ALARM_PAGE, NULL);
+ apage = gtk_type_new (TYPE_ALARM_PAGE);
if (!alarm_page_construct (apage)) {
- g_object_unref ((apage));
+ gtk_object_unref (GTK_OBJECT (apage));
return NULL;
}
diff --git a/calendar/gui/dialogs/alarm-page.glade b/calendar/gui/dialogs/alarm-page.glade
index cb4509abe2..494b5edd64 100644
--- a/calendar/gui/dialogs/alarm-page.glade
+++ b/calendar/gui/dialogs/alarm-page.glade
@@ -1,490 +1,385 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="alarm-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="alarm-page">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
+<?xml version="1.0"?>
+<GTK-Interface>
+
+<project>
+ <name>alarm-page</name>
+ <program_name>alarm-page</program_name>
+ <directory></directory>
+ <source_directory>.</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+ <output_main_file>False</output_main_file>
+ <output_support_files>False</output_support_files>
+ <output_build_files>False</output_build_files>
+</project>
+
+<widget>
+ <class>GtkWindow</class>
+ <name>alarm-toplevel</name>
+ <visible>False</visible>
+ <title>window1</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>alarm-page</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame33</name>
+ <label>Basics</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
- <widget class="GtkFrame" id="frame33">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+ <widget>
+ <class>GtkTable</class>
+ <name>table13</name>
+ <border_width>4</border_width>
+ <rows>2</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>2</row_spacing>
+ <column_spacing>2</column_spacing>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label62</name>
+ <label>Summary:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkTable" id="table13">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">2</property>
- <property name="column_spacing">2</property>
-
- <child>
- <widget class="GtkLabel" id="label62">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Summary:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label63">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Date/Time:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="summary">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label63</name>
+ <label>Date/Time:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="date-time">
- <property name="visible">True</property>
- <property name="label" translatable="yes"></property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>summary</name>
+ <width>10</width>
+ <label></label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>4</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>date-time</name>
+ <width>10</width>
+ <label></label>
+ <justify>GTK_JUSTIFY_LEFT</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>4</xpad>
+ <ypad>0</ypad>
<child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Basics</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame34</name>
+ <label>Reminders</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
- <widget class="GtkFrame" id="frame34">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox53</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox54</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
<child>
- <widget class="GtkVBox" id="vbox53">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkHBox" id="hbox54">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkOptionMenu" id="action">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Display a message</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Play a sound</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Run a program</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="send_an_email1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Send an Email</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="interval-value">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 999 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="value-units">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget5">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">minute(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget7">
- <property name="visible">True</property>
- <property name="label" translatable="yes">hour(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget8">
- <property name="visible">True</property>
- <property name="label" translatable="yes">day(s)</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="relative">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget9">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">before</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">after</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="time">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget12">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget13">
- <property name="visible">True</property>
- <property name="label" translatable="yes">start of appointment</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget14">
- <property name="visible">True</property>
- <property name="label" translatable="yes">end of appointment</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="button-options">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Options...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox55">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow13">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="list">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">True</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkVButtonBox" id="vbuttonbox2">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_START</property>
- <property name="spacing">10</property>
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>action</name>
+ <can_focus>True</can_focus>
+ <items>Display a message
+Play a sound
+Run a program
+Send an Email
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>interval-value</name>
+ <can_focus>True</can_focus>
+ <climb_rate>1</climb_rate>
+ <digits>0</digits>
+ <numeric>True</numeric>
+ <update_policy>GTK_UPDATE_ALWAYS</update_policy>
+ <snap>False</snap>
+ <wrap>False</wrap>
+ <value>1</value>
+ <lower>0</lower>
+ <upper>999</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>value-units</name>
+ <can_focus>True</can_focus>
+ <items>minute(s)
+hour(s)
+day(s)
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>relative</name>
+ <can_focus>True</can_focus>
+ <items>before
+after
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>time</name>
+ <can_focus>True</can_focus>
+ <items>start of appointment
+end of appointment
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>button-options</name>
+ <can_focus>True</can_focus>
+ <label>_Options...</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+ </widget>
- <child>
- <widget class="GtkButton" id="add">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Add</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox55</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkButton" id="delete">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Delete</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow13</name>
+ <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
+ <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+ <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkCList</class>
+ <name>list</name>
+ <can_focus>True</can_focus>
+ <columns>1</columns>
+ <column_widths>80</column_widths>
+ <selection_mode>GTK_SELECTION_BROWSE</selection_mode>
+ <show_titles>False</show_titles>
+ <shadow_type>GTK_SHADOW_IN</shadow_type>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>CList:title</child_name>
+ <name>label64</name>
+ <label>label55</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkVButtonBox</class>
+ <name>vbuttonbox2</name>
+ <layout_style>GTK_BUTTONBOX_START</layout_style>
+ <spacing>10</spacing>
+ <child_min_width>85</child_min_width>
+ <child_min_height>27</child_min_height>
+ <child_ipad_x>7</child_ipad_x>
+ <child_ipad_y>0</child_ipad_y>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>add</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Add</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
</widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label64">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Reminders</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
+ <widget>
+ <class>GtkButton</class>
+ <name>delete</name>
+ <can_default>True</can_default>
+ <can_focus>True</can_focus>
+ <label>_Delete</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
</widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/calendar/gui/dialogs/cancel-comp.c b/calendar/gui/dialogs/cancel-comp.c
index 0e48dd3763..19d593182c 100644
--- a/calendar/gui/dialogs/cancel-comp.c
+++ b/calendar/gui/dialogs/cancel-comp.c
@@ -23,8 +23,10 @@
#endif
#include <glib.h>
-#include <gtk/gtkmessagedialog.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
+#include <libgnomeui/gnome-dialog.h>
+#include <libgnomeui/gnome-dialog-util.h>
#include <libgnomeui/gnome-uidefs.h>
#include <gal/widgets/e-unicode.h>
#include "cancel-comp.h"
@@ -45,7 +47,6 @@ cancel_component_dialog (CalClient *client, CalComponent *comp, gboolean deletin
GtkWidget *dialog;
CalComponentVType vtype;
char *str;
- gint response;
if (deleting && cal_client_get_save_schedules (client))
return TRUE;
@@ -86,14 +87,9 @@ cancel_component_dialog (CalClient *client, CalComponent *comp, gboolean deletin
return FALSE;
}
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO, str);
+ dialog = gnome_question_dialog_modal (str, NULL, NULL);
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_YES)
+ if (gnome_dialog_run (GNOME_DIALOG (dialog)) == GNOME_YES)
return TRUE;
else
return FALSE;
diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c
index 2df5f94fa7..35910eeb24 100644
--- a/calendar/gui/dialogs/comp-editor-util.c
+++ b/calendar/gui/dialogs/comp-editor-util.c
@@ -26,11 +26,12 @@
#include <string.h>
#include <ical.h>
#include <glib.h>
-#include <gtk/gtklabel.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
-#include <bonobo-activation/bonobo-activation.h>
+#include <liboaf/liboaf.h>
#include <bonobo/bonobo-control.h>
#include <bonobo/bonobo-widget.h>
+#include <gal/unicode/gunicode.h>
#include <ebook/e-destination.h>
#include <e-util/e-time-utils.h>
#include <cal-util/timeutil.h>
@@ -282,11 +283,11 @@ comp_editor_create_contacts_component (void)
CORBA_Environment ev;
CORBA_exception_init (&ev);
- corba_select_names = bonobo_activation_activate_from_id (SELECT_NAMES_OAFID, 0,
- NULL, &ev);
+ corba_select_names = oaf_activate_from_id (SELECT_NAMES_OAFID, 0,
+ NULL, &ev);
/* OAF seems to be broken -- it can return a CORBA_OBJECT_NIL without
- raising an exception in `ev'. Is this true with BonoboActivation? */
+ raising an exception in `ev'. */
if (ev._major != CORBA_NO_EXCEPTION
|| corba_select_names == CORBA_OBJECT_NIL) {
g_warning ("Cannot activate -- %s", SELECT_NAMES_OAFID);
@@ -337,7 +338,7 @@ comp_editor_create_contacts_control (GNOME_Evolution_Addressbook_SelectNames cor
}
-void
+Bonobo_EventSource_ListenerId
comp_editor_connect_contacts_changed (GtkWidget *contacts_entry,
BonoboListenerCallbackFn changed_cb,
gpointer changed_cb_data)
@@ -348,7 +349,7 @@ comp_editor_connect_contacts_changed (GtkWidget *contacts_entry,
cf = bonobo_widget_get_control_frame (BONOBO_WIDGET (contacts_entry));
pb = bonobo_control_frame_get_control_property_bag (cf, NULL);
- bonobo_event_source_client_add_listener (
+ return bonobo_event_source_client_add_listener (
pb, changed_cb,
"Bonobo/Property:change:entry_changed",
NULL, changed_cb_data);
@@ -380,8 +381,8 @@ parse_contact_string (const char *value, char **name, char **email)
return;
}
- lbracket = g_utf8_strchr (value, g_utf8_strlen (value, 0), '<');
- rbracket = g_utf8_strchr (value, g_utf8_strlen (value, 0), '>');
+ lbracket = g_utf8_strchr (value, '<');
+ rbracket = g_utf8_strchr (value, '>');
if (!lbracket || !rbracket || rbracket < lbracket) {
*name = g_strdup (value);
@@ -421,9 +422,6 @@ comp_editor_contacts_to_widget (GtkWidget *contacts_entry,
int i;
cal_component_get_contact_list (comp, &contact_list);
- if (!contact_list)
- return;
-
dest_array = g_ptr_array_new ();
for (elem = contact_list; elem; elem = elem->next) {
CalComponentText *t = elem->data;
@@ -449,14 +447,14 @@ comp_editor_contacts_to_widget (GtkWidget *contacts_entry,
#endif
bonobo_widget_set_property (BONOBO_WIDGET (contacts_entry),
- "destinations", TC_CORBA_string, contacts_string, NULL);
+ "destinations", contacts_string, NULL);
g_free (contacts_string);
/* We free all dest_array except the last NULL we added. */
for (i = 0; i < dest_array->len - 1; i++) {
dest = g_ptr_array_index (dest_array, i);
- g_object_unref((dest));
+ gtk_object_unref (GTK_OBJECT (dest));
}
g_ptr_array_free (dest_array, TRUE);
}
@@ -474,7 +472,7 @@ comp_editor_contacts_to_component (GtkWidget *contacts_entry,
int i;
bonobo_widget_get_property (BONOBO_WIDGET (contacts_entry),
- "destinations", TC_CORBA_string, &contacts_string, NULL);
+ "destinations", &contacts_string, NULL);
#if 0
g_print ("Contacts string: %s\n", contacts_string ? contacts_string : "");
#endif
@@ -506,7 +504,7 @@ comp_editor_contacts_to_component (GtkWidget *contacts_entry,
contact_list = g_slist_prepend (contact_list, t);
- g_object_unref((contact_destv[i]));
+ gtk_object_unref (GTK_OBJECT (contact_destv[i]));
}
}
g_free (contact_destv);
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index c8d89eae7e..13d582e757 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -28,16 +28,18 @@
#include <unistd.h>
#include <glib.h>
#include <gdk/gdkkeysyms.h>
-#include <gtk/gtkstock.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libgnomeui/gnome-dialog.h>
#include <libgnomeui/gnome-dialog-util.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-window-icon.h>
#include <libgnomeui/gnome-messagebox.h>
#include <bonobo/bonobo-ui-container.h>
#include <bonobo/bonobo-ui-util.h>
#include <gal/widgets/e-unicode.h>
+#include <gal/widgets/e-gui-utils.h>
#include <e-util/e-dialog-utils.h>
#include <evolution-shell-component-utils.h>
#include "../print.h"
@@ -88,7 +90,7 @@ struct _CompEditorPrivate {
static void comp_editor_class_init (CompEditorClass *class);
static void comp_editor_init (CompEditor *editor);
static gint comp_editor_key_press_event (GtkWidget *d, GdkEventKey *e);
-static void comp_editor_finalize (GObject *object);
+static void comp_editor_destroy (GtkObject *object);
static void real_set_cal_client (CompEditor *editor, CalClient *client);
static void real_edit_comp (CompEditor *editor, CalComponent *comp);
@@ -150,27 +152,48 @@ static GtkObjectClass *parent_class;
-E_MAKE_TYPE (comp_editor, "CompEditor", CompEditor, comp_editor_class_init, comp_editor_init,
- BONOBO_TYPE_WINDOW);
+GtkType
+comp_editor_get_type (void)
+{
+ static GtkType comp_editor_type = 0;
+
+ if (!comp_editor_type) {
+ static const GtkTypeInfo comp_editor_info = {
+ "CompEditor",
+ sizeof (CompEditor),
+ sizeof (CompEditorClass),
+ (GtkClassInitFunc) comp_editor_class_init,
+ (GtkObjectInitFunc) comp_editor_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ comp_editor_type = gtk_type_unique (BONOBO_TYPE_WINDOW,
+ &comp_editor_info);
+ }
+
+ return comp_editor_type;
+}
/* Class initialization function for the calendar component editor */
static void
comp_editor_class_init (CompEditorClass *klass)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
- object_class = G_OBJECT_CLASS (klass);
+ object_class = GTK_OBJECT_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass);
- parent_class = g_type_class_ref(BONOBO_TYPE_WINDOW);
+ parent_class = gtk_type_class (BONOBO_TYPE_WINDOW);
klass->set_cal_client = real_set_cal_client;
klass->edit_comp = real_edit_comp;
klass->send_comp = real_send_comp;
widget_class->key_press_event = comp_editor_key_press_event;
- object_class->finalize = comp_editor_finalize;
+ object_class->destroy = comp_editor_destroy;
}
/* Creates the basic in the editor */
@@ -184,23 +207,22 @@ setup_widgets (CompEditor *editor)
priv = editor->priv;
/* Window and basic vbox */
- container = bonobo_ui_container_new ();
- editor = (CompEditor *) bonobo_window_construct (BONOBO_WINDOW (editor), container,
- "event-editor", "iCalendar Editor");
- g_signal_connect((editor), "delete_event",
- G_CALLBACK (delete_event_cb), editor);
+ bonobo_window_construct (BONOBO_WINDOW (editor),
+ "event-editor", "iCalendar Editor");
+ gtk_signal_connect (GTK_OBJECT (editor), "delete_event",
+ GTK_SIGNAL_FUNC (delete_event_cb), editor);
priv->uic = bonobo_ui_component_new_default ();
- bonobo_ui_component_set_container (priv->uic,
- bonobo_object_corba_objref (BONOBO_OBJECT (container)),
- NULL);
+ container = bonobo_ui_container_new ();
+ bonobo_ui_container_set_win (container, BONOBO_WINDOW (editor));
+ bonobo_ui_component_set_container (priv->uic, BONOBO_OBJREF (container));
bonobo_ui_engine_config_set_path (bonobo_window_get_ui_engine (BONOBO_WINDOW (editor)),
"/evolution/UIConf/kvps");
bonobo_ui_component_add_verb_list_with_data (priv->uic, verbs, editor);
bonobo_ui_util_set_ui (priv->uic, EVOLUTION_DATADIR,
- EVOLUTION_UIDIR "/evolution-comp-editor.xml",
- "evolution-calendar", NULL);
+ "evolution-comp-editor.xml",
+ "evolution-calendar");
e_pixmaps_update (priv->uic, pixmaps);
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
@@ -253,7 +275,7 @@ comp_editor_key_press_event (GtkWidget *d, GdkEventKey *e)
/* Destroy handler for the calendar component editor */
static void
-comp_editor_finalize (GObject *object)
+comp_editor_destroy (GtkObject *object)
{
CompEditor *editor;
CompEditorPrivate *priv;
@@ -262,24 +284,24 @@ comp_editor_finalize (GObject *object)
editor = COMP_EDITOR (object);
priv = editor->priv;
- g_signal_handlers_disconnect_matched (priv->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), editor);
/* We want to destroy the pages after the widgets get destroyed,
since they have lots of signal handlers connected to the widgets
with the pages as the data. */
for (l = priv->pages; l != NULL; l = l->next)
- g_object_unref((l->data));
+ gtk_object_unref (GTK_OBJECT (l->data));
if (priv->comp) {
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = NULL;
}
g_free (priv);
editor->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static gboolean
@@ -298,7 +320,7 @@ save_comp (CompEditor *editor)
clone = cal_component_clone (priv->comp);
for (l = priv->pages; l != NULL; l = l->next) {
if (!comp_editor_page_fill_component (l->data, clone)) {
- g_object_unref((clone));
+ gtk_object_unref (GTK_OBJECT (clone));
comp_editor_show_page (editor, COMP_EDITOR_PAGE (l->data));
return FALSE;
}
@@ -310,7 +332,7 @@ save_comp (CompEditor *editor)
else
cal_component_abort_sequence (clone);
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = clone;
priv->updating = TRUE;
@@ -401,7 +423,7 @@ prompt_to_save_changes (CompEditor *editor, gboolean send)
return TRUE;
switch (save_component_dialog (GTK_WINDOW (editor))) {
- case GTK_RESPONSE_YES: /* Save */
+ case 0: /* Save */
if (cal_component_is_instance (priv->comp))
if (!recur_component_dialog (priv->comp, &priv->mod, GTK_WINDOW (editor)))
return FALSE;
@@ -412,9 +434,9 @@ prompt_to_save_changes (CompEditor *editor, gboolean send)
return TRUE;
else
return FALSE;
- case GTK_RESPONSE_NO: /* Discard */
+ case 1: /* Discard */
return TRUE;
- case GTK_RESPONSE_CANCEL: /* Cancel */
+ case 2: /* Cancel */
default:
return FALSE;
}
@@ -441,7 +463,7 @@ close_dialog (CompEditor *editor)
priv = editor->priv;
- gtk_widget_destroy (GTK_WIDGET (editor));
+ gtk_object_destroy (GTK_OBJECT (editor));
}
@@ -627,7 +649,7 @@ comp_editor_append_page (CompEditor *editor,
priv = editor->priv;
- g_object_ref((page));
+ gtk_object_ref (GTK_OBJECT (page));
/* If we are editing something, fill the widgets with current info */
if (priv->comp != NULL) {
@@ -635,7 +657,7 @@ comp_editor_append_page (CompEditor *editor,
comp = comp_editor_get_current_comp (editor);
comp_editor_page_fill_widgets (page, comp);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
}
page_widget = comp_editor_page_get_widget (page);
@@ -649,19 +671,19 @@ comp_editor_append_page (CompEditor *editor,
gtk_notebook_append_page (priv->notebook, page_widget, label_widget);
/* Listen for things happening on the page */
- g_signal_connect(page, "changed",
- G_CALLBACK (page_changed_cb), editor);
- g_signal_connect(page, "summary_changed",
- G_CALLBACK (page_summary_changed_cb), editor);
- g_signal_connect(page, "dates_changed",
- G_CALLBACK (page_dates_changed_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (page), "changed",
+ GTK_SIGNAL_FUNC (page_changed_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (page), "summary_changed",
+ GTK_SIGNAL_FUNC (page_summary_changed_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (page), "dates_changed",
+ GTK_SIGNAL_FUNC (page_dates_changed_cb), editor);
/* Listen for when the page is mapped/unmapped so we can
install/uninstall the appropriate GtkAccelGroup. */
- g_signal_connect((page_widget), "map",
- G_CALLBACK (page_mapped_cb), page);
- g_signal_connect((page_widget), "unmap",
- G_CALLBACK (page_unmapped_cb), page);
+ gtk_signal_connect (GTK_OBJECT (page_widget), "map",
+ GTK_SIGNAL_FUNC (page_mapped_cb), page);
+ gtk_signal_connect (GTK_OBJECT (page_widget), "unmap",
+ GTK_SIGNAL_FUNC (page_unmapped_cb), page);
/* The first page is the main page of the editor, so we ask it to focus
* its main widget.
@@ -697,13 +719,13 @@ comp_editor_remove_page (CompEditor *editor, CompEditorPage *page)
return;
/* Disconnect all the signals added in append_page(). */
- g_signal_handlers_disconnect_matched (page, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor);
- g_signal_handlers_disconnect_matched (page_widget, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (page), editor);
+ gtk_signal_disconnect_by_data (GTK_OBJECT (page_widget), page);
gtk_notebook_remove_page (priv->notebook, page_num);
priv->pages = g_list_remove (priv->pages, page);
- g_object_unref((page));
+ gtk_object_unref (GTK_OBJECT (page));
}
/**
@@ -747,7 +769,7 @@ comp_editor_set_cal_client (CompEditor *editor, CalClient *client)
g_return_if_fail (editor != NULL);
g_return_if_fail (IS_COMP_EDITOR (editor));
- klass = COMP_EDITOR_CLASS (G_OBJECT_GET_CLASS (editor));
+ klass = COMP_EDITOR_CLASS (GTK_OBJECT (editor)->klass);
if (klass->set_cal_client)
klass->set_cal_client (editor, client);
@@ -778,7 +800,7 @@ comp_editor_get_cal_client (CompEditor *editor)
static char *
make_title_from_comp (CalComponent *comp)
{
- char *title, *title_utf8;
+ char *title;
const char *type_string;
CalComponentVType type;
CalComponentText text;
@@ -804,15 +826,14 @@ make_title_from_comp (CalComponent *comp)
cal_component_get_summary (comp, &text);
if (text.value) {
- title = g_strdup_printf (type_string, text.value);
- } else {
+ char *summary;
+ summary = e_utf8_to_locale_string (text.value);
+ title = g_strdup_printf (type_string, summary);
+ g_free (summary);
+ } else
title = g_strdup_printf (type_string, _("No summary"));
- }
-
- title_utf8 = g_locale_to_utf8 (title, -1, NULL, NULL, NULL);
- g_free (title);
- return title_utf8;
+ return title;
}
static const char *
@@ -821,18 +842,18 @@ make_icon_from_comp (CalComponent *comp)
CalComponentVType type;
if (!comp)
- return EVOLUTION_IMAGESDIR "/evolution-calendar-mini.png";
+ return EVOLUTION_ICONSDIR "/evolution-calendar-mini.png";
type = cal_component_get_vtype (comp);
switch (type) {
case CAL_COMPONENT_EVENT:
- return EVOLUTION_IMAGESDIR "/buttons/new_appointment.png";
+ return EVOLUTION_ICONSDIR "/buttons/new_appointment.png";
break;
case CAL_COMPONENT_TODO:
- return EVOLUTION_IMAGESDIR "/buttons/new_task.png";
+ return EVOLUTION_ICONSDIR "/buttons/new_task.png";
break;
default:
- return EVOLUTION_IMAGESDIR "/evolution-calendar-mini.png";
+ return EVOLUTION_ICONSDIR "/evolution-calendar-mini.png";
}
}
@@ -890,13 +911,13 @@ real_set_cal_client (CompEditor *editor, CalClient *client)
g_return_if_fail (IS_CAL_CLIENT (client));
g_return_if_fail (cal_client_get_load_state (client) ==
CAL_CLIENT_LOAD_LOADED);
- g_object_ref((client));
+ gtk_object_ref (GTK_OBJECT (client));
}
if (priv->client) {
gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client),
editor);
- g_object_unref((priv->client));
+ gtk_object_unref (GTK_OBJECT (priv->client));
}
priv->client = client;
@@ -905,11 +926,11 @@ real_set_cal_client (CompEditor *editor, CalClient *client)
for (elem = priv->pages; elem; elem = elem->next)
comp_editor_page_set_cal_client (elem->data, client);
- g_signal_connect((priv->client), "obj_updated",
- G_CALLBACK (obj_updated_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "obj_updated",
+ GTK_SIGNAL_FUNC (obj_updated_cb), editor);
- g_signal_connect((priv->client), "obj_removed",
- G_CALLBACK (obj_removed_cb), editor);
+ gtk_signal_connect (GTK_OBJECT (priv->client), "obj_removed",
+ GTK_SIGNAL_FUNC (obj_removed_cb), editor);
}
static void
@@ -923,7 +944,7 @@ real_edit_comp (CompEditor *editor, CalComponent *comp)
priv = editor->priv;
if (priv->comp) {
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = NULL;
}
@@ -953,9 +974,9 @@ real_send_comp (CompEditor *editor, CalComponentItipMethod method)
if (itip_send_comp (method, priv->comp, priv->client, NULL)) {
tmp_comp = priv->comp;
- g_object_ref((tmp_comp));
+ gtk_object_ref (GTK_OBJECT (tmp_comp));
comp_editor_edit_comp (editor, tmp_comp);
- g_object_unref((tmp_comp));
+ gtk_object_unref (GTK_OBJECT (tmp_comp));
comp_editor_set_changed (editor, TRUE);
save_comp (editor);
@@ -986,7 +1007,7 @@ comp_editor_edit_comp (CompEditor *editor, CalComponent *comp)
g_return_if_fail (comp != NULL);
g_return_if_fail (IS_CAL_COMPONENT (comp));
- klass = COMP_EDITOR_CLASS (G_OBJECT_GET_CLASS (editor));
+ klass = COMP_EDITOR_CLASS (GTK_OBJECT (editor)->klass);
if (klass->edit_comp)
klass->edit_comp (editor, comp);
@@ -1065,7 +1086,7 @@ comp_editor_send_comp (CompEditor *editor, CalComponentItipMethod method)
g_return_val_if_fail (editor != NULL, FALSE);
g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE);
- klass = COMP_EDITOR_CLASS (G_OBJECT_GET_CLASS (editor));
+ klass = COMP_EDITOR_CLASS (GTK_OBJECT (editor)->klass);
if (klass->send_comp)
return klass->send_comp (editor, method);
@@ -1105,20 +1126,15 @@ comp_editor_merge_ui (CompEditor *editor,
EPixmap *component_pixmaps)
{
CompEditorPrivate *priv;
- char *path;
g_return_if_fail (editor != NULL);
g_return_if_fail (IS_COMP_EDITOR (editor));
priv = editor->priv;
- path = g_strconcat (EVOLUTION_UIDIR "/", filename, NULL);
-
- bonobo_ui_util_set_ui (priv->uic, EVOLUTION_DATADIR, path, "evolution-calendar", NULL);
+ bonobo_ui_util_set_ui (priv->uic, EVOLUTION_DATADIR, filename, "evolution-calendar");
bonobo_ui_component_add_verb_list_with_data (priv->uic, verbs, editor);
- g_free (path);
-
if (component_pixmaps != NULL)
e_pixmaps_update (priv->uic, component_pixmaps);
}
@@ -1278,7 +1294,7 @@ print_cmd (GtkWidget *widget, gpointer data)
comp = comp_editor_get_current_comp (editor);
print_comp (comp, editor->priv->client, FALSE);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
}
static void
@@ -1291,7 +1307,7 @@ print_preview_cmd (GtkWidget *widget, gpointer data)
comp = comp_editor_get_current_comp (editor);
print_comp (comp, editor->priv->client, TRUE);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
}
static void
@@ -1327,7 +1343,7 @@ page_changed_cb (GtkObject *obj, gpointer data)
priv->changed = TRUE;
if (!priv->warned && priv->existing_org && !priv->user_org) {
- e_notice (editor, GTK_MESSAGE_INFO,
+ e_notice (NULL, GNOME_MESSAGE_BOX_INFO,
_("Changes made to this item may be discarded if an update arrives"));
priv->warned = TRUE;
}
@@ -1351,7 +1367,7 @@ page_summary_changed_cb (GtkObject *obj, const char *summary, gpointer data)
priv->changed = TRUE;
if (!priv->warned && priv->existing_org && !priv->user_org) {
- e_notice (editor, GTK_MESSAGE_INFO,
+ e_notice (NULL, GNOME_MESSAGE_BOX_INFO,
_("Changes made to this item may be discarded if an update arrives"));
priv->warned = TRUE;
}
@@ -1375,7 +1391,7 @@ page_dates_changed_cb (GtkObject *obj,
priv->changed = TRUE;
if (!priv->warned && priv->existing_org && !priv->user_org) {
- e_notice (editor, GTK_MESSAGE_INFO,
+ e_notice (NULL, GNOME_MESSAGE_BOX_INFO,
_("Changes made to this item may be discarded if an update arrives"));
priv->warned = TRUE;
}
@@ -1399,7 +1415,7 @@ obj_updated_cb (CalClient *client, const char *uid, gpointer data)
status = cal_client_get_object (priv->client, uid, &comp);
if (status == CAL_CLIENT_GET_SUCCESS) {
comp_editor_edit_comp (editor, comp);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
} else {
GtkWidget *dlg;
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
index 9004d96e89..9bef6c6c13 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -58,7 +58,7 @@ static void event_editor_init (EventEditor *ee);
static void event_editor_set_cal_client (CompEditor *editor, CalClient *client);
static void event_editor_edit_comp (CompEditor *editor, CalComponent *comp);
static gboolean event_editor_send_comp (CompEditor *editor, CalComponentItipMethod method);
-static void event_editor_finalize (GObject *object);
+static void event_editor_destroy (GtkObject *object);
static void schedule_meeting_cmd (GtkWidget *widget, gpointer data);
static void refresh_meeting_cmd (GtkWidget *widget, gpointer data);
@@ -94,27 +94,47 @@ static CompEditorClass *parent_class;
*
* Return value: The type ID of the #EventEditor class.
**/
+GtkType
+event_editor_get_type (void)
+{
+ static GtkType event_editor_type = 0;
+
+ if (!event_editor_type) {
+ static const GtkTypeInfo event_editor_info = {
+ "EventEditor",
+ sizeof (EventEditor),
+ sizeof (EventEditorClass),
+ (GtkClassInitFunc) event_editor_class_init,
+ (GtkObjectInitFunc) event_editor_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ event_editor_type = gtk_type_unique (TYPE_COMP_EDITOR,
+ &event_editor_info);
+ }
-E_MAKE_TYPE (event_editor, "EventEditor", EventEditor, event_editor_class_init,
- event_editor_init, TYPE_COMP_EDITOR);
+ return event_editor_type;
+}
/* Class initialization function for the event editor */
static void
event_editor_class_init (EventEditorClass *klass)
{
- GObjectClass *gobject_class;
+ GtkObjectClass *object_class;
CompEditorClass *editor_class;
- gobject_class = (GObjectClass *) klass;
+ object_class = (GtkObjectClass *) klass;
editor_class = (CompEditorClass *) klass;
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR);
editor_class->set_cal_client = event_editor_set_cal_client;
editor_class->edit_comp = event_editor_edit_comp;
editor_class->send_comp = event_editor_send_comp;
- gobject_class->finalize = event_editor_finalize;
+ object_class->destroy = event_editor_destroy;
}
static void
@@ -162,12 +182,12 @@ init_widgets (EventEditor *ee)
priv = ee->priv;
- g_signal_connect((priv->model), "model_row_changed",
- G_CALLBACK (model_row_changed_cb), ee);
- g_signal_connect((priv->model), "model_rows_inserted",
- G_CALLBACK (row_count_changed_cb), ee);
- g_signal_connect((priv->model), "model_rows_deleted",
- G_CALLBACK (row_count_changed_cb), ee);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_row_changed",
+ GTK_SIGNAL_FUNC (model_row_changed_cb), ee);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_rows_inserted",
+ GTK_SIGNAL_FUNC (row_count_changed_cb), ee);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_rows_deleted",
+ GTK_SIGNAL_FUNC (row_count_changed_cb), ee);
}
/* Object initialization function for the event editor */
@@ -192,36 +212,26 @@ event_editor_construct (EventEditor *ee, CalClient *client)
priv = ee->priv;
priv->event_page = event_page_new ();
- g_object_ref (priv->event_page);
- gtk_object_sink (GTK_OBJECT (priv->event_page));
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->event_page),
_("Appointment"));
priv->alarm_page = alarm_page_new ();
- g_object_ref (priv->alarm_page);
- gtk_object_sink (GTK_OBJECT (priv->alarm_page));
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->alarm_page),
_("Reminder"));
priv->recur_page = recurrence_page_new ();
- g_object_ref (priv->recur_page);
- gtk_object_sink (GTK_OBJECT (priv->recur_page));
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->recur_page),
_("Recurrence"));
priv->sched_page = schedule_page_new (priv->model);
- g_object_ref (priv->sched_page);
- gtk_object_sink (GTK_OBJECT (priv->sched_page));
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->sched_page),
_("Scheduling"));
priv->meet_page = meeting_page_new (priv->model, client);
- g_object_ref (priv->meet_page);
- gtk_object_sink (GTK_OBJECT (priv->meet_page));
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->meet_page),
_("Meeting"));
@@ -284,6 +294,7 @@ event_editor_edit_comp (CompEditor *editor, CalComponent *comp)
priv->meeting_shown = FALSE;
} else {
GSList *l;
+ GList *addresses, *ll;
int row;
if (!priv->meeting_shown) {
@@ -303,27 +314,22 @@ event_editor_edit_comp (CompEditor *editor, CalComponent *comp)
if (!comp_editor_get_user_org (editor))
e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
e_meeting_model_add_attendee (priv->model, ia);
-
- g_object_unref(ia);
+
+ gtk_object_unref (GTK_OBJECT (ia));
}
/* If we aren't the organizer we can still change our own status */
if (!comp_editor_get_user_org (editor)) {
- EAccountList *accounts;
- EAccount *account;
- EIterator *it;
-
- accounts = itip_addresses_get ();
- for (it = e_list_get_iterator((EList *)accounts);e_iterator_is_valid(it);e_iterator_next(it)) {
+ addresses = itip_addresses_get ();
+ for (ll = addresses; ll != NULL; ll = ll->next) {
EMeetingAttendee *ia;
-
- account = (EAccount*)e_iterator_get(it);
-
- ia = e_meeting_model_find_attendee (priv->model, account->id->address, &row);
+ ItipAddress *a = ll->data;
+
+ ia = e_meeting_model_find_attendee (priv->model, a->address, &row);
if (ia != NULL)
e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
}
- g_object_unref(it);
+ itip_addresses_free (addresses);
} else if (cal_client_get_organizer_must_attend (client)) {
EMeetingAttendee *ia;
@@ -363,7 +369,7 @@ event_editor_send_comp (CompEditor *editor, CalComponentItipMethod method)
client = e_meeting_model_get_cal_client (priv->model);
result = itip_send_comp (CAL_COMPONENT_METHOD_CANCEL, comp, client, NULL);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
if (!result)
return FALSE;
@@ -378,7 +384,7 @@ event_editor_send_comp (CompEditor *editor, CalComponentItipMethod method)
/* Destroy handler for the event editor */
static void
-event_editor_finalize (GObject *object)
+event_editor_destroy (GtkObject *object)
{
EventEditor *ee;
EventEditorPrivate *priv;
@@ -389,18 +395,19 @@ event_editor_finalize (GObject *object)
ee = EVENT_EDITOR (object);
priv = ee->priv;
- g_object_unref((priv->event_page));
- g_object_unref((priv->alarm_page));
- g_object_unref((priv->recur_page));
- g_object_unref((priv->meet_page));
- g_object_unref((priv->sched_page));
+ gtk_object_unref (GTK_OBJECT (priv->event_page));
+ gtk_object_unref (GTK_OBJECT (priv->alarm_page));
+ gtk_object_unref (GTK_OBJECT (priv->recur_page));
+ gtk_object_unref (GTK_OBJECT (priv->meet_page));
+ gtk_object_unref (GTK_OBJECT (priv->sched_page));
- g_object_unref((priv->model));
+ gtk_object_destroy (GTK_OBJECT (priv->model));
+ gtk_object_unref (GTK_OBJECT (priv->model));
g_free (priv);
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
/**
@@ -417,7 +424,7 @@ event_editor_new (CalClient *client)
{
EventEditor *ee;
- ee = EVENT_EDITOR (g_object_new (TYPE_EVENT_EDITOR, NULL));
+ ee = EVENT_EDITOR (gtk_type_new (TYPE_EVENT_EDITOR));
return event_editor_construct (ee, client);
}
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 384a39c419..c7ed201e1f 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -25,10 +25,9 @@
#include <config.h>
#endif
-#include <string.h>
#include <gtk/gtksignal.h>
-#include <gtk/gtktextview.h>
#include <gtk/gtktogglebutton.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
#include <gal/widgets/e-unicode.h>
@@ -95,7 +94,7 @@ struct _EventPagePrivate {
static void event_page_class_init (EventPageClass *class);
static void event_page_init (EventPage *epage);
-static void event_page_finalize (GObject *object);
+static void event_page_destroy (GtkObject *object);
static GtkWidget *event_page_get_widget (CompEditorPage *page);
static void event_page_focus_main_widget (CompEditorPage *page);
@@ -116,21 +115,41 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #EventPage class.
**/
+GtkType
+event_page_get_type (void)
+{
+ static GtkType event_page_type;
+
+ if (!event_page_type) {
+ static const GtkTypeInfo event_page_info = {
+ "EventPage",
+ sizeof (EventPage),
+ sizeof (EventPageClass),
+ (GtkClassInitFunc) event_page_class_init,
+ (GtkObjectInitFunc) event_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ event_page_type = gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &event_page_info);
+ }
-E_MAKE_TYPE (event_page, "EventPage", EventPage, event_page_class_init, event_page_init,
- TYPE_COMP_EDITOR_PAGE);
+ return event_page_type;
+}
/* Class initialization function for the event page */
static void
event_page_class_init (EventPageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = event_page_get_widget;
editor_page_class->focus_main_widget = event_page_focus_main_widget;
@@ -139,7 +158,7 @@ event_page_class_init (EventPageClass *class)
editor_page_class->set_summary = event_page_set_summary;
editor_page_class->set_dates = event_page_set_dates;
- object_class->finalize = event_page_finalize;
+ object_class->destroy = event_page_destroy;
}
/* Object initialization function for the event page */
@@ -182,7 +201,7 @@ event_page_init (EventPage *epage)
/* Destroy handler for the event page */
static void
-event_page_finalize (GObject *object)
+event_page_destroy (GtkObject *object)
{
EventPage *epage;
EventPagePrivate *priv;
@@ -202,15 +221,15 @@ event_page_finalize (GObject *object)
}
if (priv->xml) {
- g_object_unref((priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
g_free (priv);
epage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -349,7 +368,7 @@ update_time (EventPage *epage, CalComponentDateTime *start_date, CalComponentDat
gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time),
epage);
- g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_time), epage);
e_date_edit_set_date (E_DATE_EDIT (priv->start_time), start_tt->year,
start_tt->month, start_tt->day);
@@ -370,7 +389,7 @@ update_time (EventPage *epage, CalComponentDateTime *start_date, CalComponentDat
are the same. */
gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_timezone),
epage);
- g_signal_handlers_block_matched (priv->end_timezone, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_timezone), epage);
e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->start_timezone),
start_zone);
@@ -397,12 +416,12 @@ clear_widgets (EventPage *epage)
/* Summary, description */
e_dialog_editable_set (priv->summary, NULL);
e_dialog_editable_set (priv->location, NULL);
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), "", 0);
+ e_dialog_editable_set (priv->description, NULL);
/* Start and end times */
gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time),
epage);
- g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_time), epage);
e_date_edit_set_time (E_DATE_EDIT (priv->start_time), 0);
e_date_edit_set_time (E_DATE_EDIT (priv->end_time), 0);
@@ -429,8 +448,8 @@ clear_widgets (EventPage *epage)
static void
contacts_changed_cb (BonoboListener *listener,
- const char *event_name,
- const CORBA_any *arg,
+ char *event_name,
+ CORBA_any *arg,
CORBA_Environment *ev,
gpointer data)
{
@@ -485,8 +504,7 @@ event_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
cal_component_get_description_list (comp, &l);
if (l) {
text = *(CalComponentText *)l->data;
- gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)),
- text.value, -1);
+ e_dialog_editable_set (priv->description, text.value);
}
cal_component_free_text_list (l);
@@ -582,12 +600,9 @@ event_page_fill_component (CompEditorPage *page, CalComponent *comp)
char *cat, *str;
CalComponentClassification classif;
CalComponentTransparency transparency;
- GtkTextBuffer *text_buffer;
- GtkTextIter text_iter_start, text_iter_end;
epage = EVENT_PAGE (page);
priv = epage->priv;
- text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description));
/* Summary */
@@ -619,10 +634,7 @@ event_page_fill_component (CompEditorPage *page, CalComponent *comp)
/* 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);
-
+ str = e_dialog_editable_get (priv->description);
if (!str || strlen (str) == 0)
cal_component_set_description_list (comp, NULL);
else {
@@ -773,24 +785,20 @@ get_widgets (EventPage *epage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
priv->summary = GW ("general-summary");
priv->location = GW ("location");
- /* Glade's visibility flag doesn't seem to work for custom widgets */
priv->start_time = GW ("start-time");
- gtk_widget_show (priv->start_time);
priv->end_time = GW ("end-time");
- gtk_widget_show (priv->end_time);
-
priv->start_timezone = GW ("start-timezone");
priv->end_timezone = GW ("end-timezone");
priv->all_day_event = GW ("all-day-event");
@@ -1015,22 +1023,22 @@ times_updated (EventPage *epage, gboolean adjust_end_time)
if (set_start_date) {
- g_signal_handlers_block_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->start_time), epage);
e_date_edit_set_date (E_DATE_EDIT (priv->start_time),
start_tt.year, start_tt.month,
start_tt.day);
e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_time),
start_tt.hour, start_tt.minute);
- g_signal_handlers_unblock_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->start_time), epage);
}
if (set_end_date) {
- g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->end_time), epage);
e_date_edit_set_date (E_DATE_EDIT (priv->end_time),
end_tt.year, end_tt.month, end_tt.day);
e_date_edit_set_time_of_day (E_DATE_EDIT (priv->end_time),
end_tt.hour, end_tt.minute);
- g_signal_handlers_unblock_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->end_time), epage);
}
/* Notify upstream */
@@ -1279,7 +1287,6 @@ static gboolean
init_widgets (EventPage *epage)
{
EventPagePrivate *priv;
- GtkTextBuffer *text_buffer;
char *location;
icaltimezone *zone;
@@ -1295,77 +1302,71 @@ init_widgets (EventPage *epage)
epage, NULL);
/* Summary */
- g_signal_connect((priv->summary), "changed",
- G_CALLBACK (summary_changed_cb), epage);
-
- /* 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_signal_connect (GTK_OBJECT (priv->summary), "changed",
+ GTK_SIGNAL_FUNC (summary_changed_cb), epage);
- gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (priv->description), GTK_WRAP_WORD);
+ /* Description - turn on word wrap. */
+ gtk_text_set_word_wrap (GTK_TEXT (priv->description), TRUE);
/* Start and end times */
- g_signal_connect((priv->start_time), "changed",
- G_CALLBACK (date_changed_cb), epage);
- g_signal_connect((priv->end_time), "changed",
- G_CALLBACK (date_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->start_time), "changed",
+ GTK_SIGNAL_FUNC (date_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->end_time), "changed",
+ GTK_SIGNAL_FUNC (date_changed_cb), epage);
- g_signal_connect((priv->start_timezone), "changed",
- G_CALLBACK (start_timezone_changed_cb), epage);
- g_signal_connect((priv->end_timezone), "changed",
- G_CALLBACK (end_timezone_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->start_timezone), "changed",
+ GTK_SIGNAL_FUNC (start_timezone_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->end_timezone), "changed",
+ GTK_SIGNAL_FUNC (end_timezone_changed_cb), epage);
- g_signal_connect((priv->all_day_event), "toggled",
- G_CALLBACK (all_day_event_toggled_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->all_day_event), "toggled",
+ GTK_SIGNAL_FUNC (all_day_event_toggled_cb), epage);
/* Contacts button */
- g_signal_connect((priv->contacts_btn), "clicked",
- G_CALLBACK (contacts_clicked_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->contacts_btn), "clicked",
+ GTK_SIGNAL_FUNC (contacts_clicked_cb), epage);
/* Categories button */
- g_signal_connect((priv->categories_btn), "clicked",
- G_CALLBACK (categories_clicked_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->categories_btn), "clicked",
+ GTK_SIGNAL_FUNC (categories_clicked_cb), epage);
/* Connect the default signal handler to use to make sure we notify
* upstream of changes to the widget values.
*/
- /* Belongs to priv->description */
- g_signal_connect((text_buffer), "changed",
- G_CALLBACK (field_changed_cb), epage);
-
- g_signal_connect((priv->summary), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->location), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->start_time), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->end_time), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->start_timezone), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->end_timezone), "changed",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->all_day_event), "toggled",
- G_CALLBACK (field_changed_cb), epage);
- g_signal_connect((priv->classification_public),
- "toggled", G_CALLBACK (field_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (priv->summary), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->location), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->start_time), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->end_time), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->start_timezone), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->end_timezone), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->all_day_event), "toggled",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->description), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->classification_public),
+ "toggled", GTK_SIGNAL_FUNC (field_changed_cb),
epage);
- g_signal_connect((priv->classification_private),
- "toggled", G_CALLBACK (field_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (priv->classification_private),
+ "toggled", GTK_SIGNAL_FUNC (field_changed_cb),
epage);
- g_signal_connect((priv->classification_confidential),
- "toggled", G_CALLBACK (field_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (priv->classification_confidential),
+ "toggled", GTK_SIGNAL_FUNC (field_changed_cb),
epage);
- g_signal_connect((priv->show_time_as_free),
- "toggled", G_CALLBACK (field_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (priv->show_time_as_free),
+ "toggled", GTK_SIGNAL_FUNC (field_changed_cb),
epage);
- g_signal_connect((priv->show_time_as_busy),
- "toggled", G_CALLBACK (field_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (priv->show_time_as_busy),
+ "toggled", GTK_SIGNAL_FUNC (field_changed_cb),
epage);
- g_signal_connect((priv->categories), "changed",
- G_CALLBACK (field_changed_cb), epage);
+ gtk_signal_connect (GTK_OBJECT (priv->categories), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), epage);
/* Create the contacts entry, a corba control from the address book. */
priv->corba_select_names = comp_editor_create_contacts_component ();
@@ -1407,7 +1408,7 @@ event_page_construct (EventPage *epage)
priv = epage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR "/event-page.glade",
- NULL, NULL);
+ NULL);
if (!priv->xml) {
g_message ("event_page_construct(): "
"Could not load the Glade XML file!");
@@ -1442,9 +1443,9 @@ event_page_new (void)
{
EventPage *epage;
- epage = g_object_new (TYPE_EVENT_PAGE, NULL);
+ epage = gtk_type_new (TYPE_EVENT_PAGE);
if (!event_page_construct (epage)) {
- g_object_unref ((epage));
+ gtk_object_unref (GTK_OBJECT (epage));
return NULL;
}
@@ -1464,9 +1465,5 @@ GtkWidget *make_timezone_entry (void);
GtkWidget *
make_timezone_entry (void)
{
- GtkWidget *w;
-
- w = e_timezone_entry_new ();
- gtk_widget_show (w);
- return w;
+ return e_timezone_entry_new ();
}
diff --git a/calendar/gui/dialogs/event-page.glade b/calendar/gui/dialogs/event-page.glade
index 6693c8af65..5f6fbfe14c 100644
--- a/calendar/gui/dialogs/event-page.glade
+++ b/calendar/gui/dialogs/event-page.glade
@@ -1,662 +1,601 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkWindow" id="event-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
-
- <child>
- <widget class="GtkVBox" id="event-page">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
+<?xml version="1.0"?>
+<GTK-Interface>
+
+<project>
+ <name>event-page</name>
+ <program_name>event-page</program_name>
+ <directory></directory>
+ <source_directory>.</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+ <output_main_file>False</output_main_file>
+ <output_support_files>False</output_support_files>
+ <output_build_files>False</output_build_files>
+</project>
+
+<widget>
+ <class>GtkWindow</class>
+ <name>event-toplevel</name>
+ <visible>False</visible>
+ <title>window1</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>event-page</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>6</spacing>
+
+ <widget>
+ <class>GtkTable</class>
+ <name>table11</name>
+ <rows>2</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>4</row_spacing>
+ <column_spacing>4</column_spacing>
<child>
- <widget class="GtkTable" id="table11">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">4</property>
- <property name="column_spacing">4</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkLabel" id="label56">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Su_mmary:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">general-summary</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label56</name>
+ <label>Su_mmary:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>general-summary</default_focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>general-summary</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label61</name>
+ <label>L_ocation:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>7.45058e-09</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>location</default_focus_target>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkEntry</class>
+ <name>location</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+ </widget>
- <child>
- <widget class="GtkEntry" id="general-summary">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame31</name>
+ <label>Date &amp; Time</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ <widget>
+ <class>GtkTable</class>
+ <name>table12</name>
+ <border_width>4</border_width>
+ <rows>2</rows>
+ <columns>4</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>4</row_spacing>
+ <column_spacing>4</column_spacing>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label57</name>
+ <label>_Start time:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>start-time</focus_target>
<child>
- <widget class="GtkLabel" id="label61">
- <property name="visible">True</property>
- <property name="label" translatable="yes">L_ocation:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">7.45058e-09</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">location</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
</child>
+ </widget>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label58</name>
+ <label>_End time:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <focus_target>end-time</focus_target>
<child>
- <widget class="GtkEntry" id="location">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFrame" id="frame31">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+ <widget>
+ <class>Custom</class>
+ <name>start-time</name>
+ <can_focus>True</can_focus>
+ <creation_function>make_date_edit</creation_function>
+ <string1></string1>
+ <string2></string2>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Tue, 16 May 2000 19:11:05 GMT</last_modification_time>
<child>
- <widget class="GtkTable" id="table12">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">4</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">4</property>
- <property name="column_spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label57">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Start time:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">start-time</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label58">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_End time:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">end-time</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="start-time">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="creation_function">make_date_edit</property>
- <property name="string1"></property>
- <property name="string2"></property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 May 2000 19:11:05 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="end-time">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="creation_function">make_date_edit</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Tue, 16 May 2000 19:11:10 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="end-timezone">
- <property name="visible">True</property>
- <property name="creation_function">make_timezone_entry</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Mon, 18 Jun 2001 23:51:40 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="Custom" id="start-timezone">
- <property name="visible">True</property>
- <property name="creation_function">make_timezone_entry</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Mon, 18 Jun 2001 23:51:34 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="yalign">7.45058e-09</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
-
- <child>
- <widget class="GtkCheckButton" id="all-day-event">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">A_ll day event</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">3</property>
- <property name="right_attach">4</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>True</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>False</xfill>
+ <yfill>True</yfill>
</child>
+ </widget>
+ <widget>
+ <class>Custom</class>
+ <name>end-time</name>
+ <can_focus>True</can_focus>
+ <creation_function>make_date_edit</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Tue, 16 May 2000 19:11:10 GMT</last_modification_time>
<child>
- <widget class="GtkLabel" id="label62">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Date &amp; Time</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>True</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>False</xfill>
+ <yfill>True</yfill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow12">
- <property name="visible">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+ <widget>
+ <class>Custom</class>
+ <name>end-timezone</name>
+ <creation_function>make_timezone_entry</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Mon, 18 Jun 2001 23:51:40 GMT</last_modification_time>
<child>
- <widget class="GtkTextView" id="description">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">True</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
+ <left_attach>2</left_attach>
+ <right_attach>3</right_attach>
+ <top_attach>1</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>False</xfill>
+ <yfill>True</yfill>
</child>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox54">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
+ <widget>
+ <class>Custom</class>
+ <name>start-timezone</name>
+ <creation_function>make_timezone_entry</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Mon, 18 Jun 2001 23:51:34 GMT</last_modification_time>
<child>
- <widget class="GtkFrame" id="frame32">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox52">
- <property name="border_width">2</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkRadioButton" id="classification-public">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Pu_blic</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">True</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="classification-private">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Pri_vate</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">classification-public</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="classification-confidential">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Con_fidential</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">classification-public</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label63">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Classification</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
+ <left_attach>2</left_attach>
+ <right_attach>3</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
</child>
+ </widget>
+ <widget>
+ <class>GtkAlignment</class>
+ <name>alignment1</name>
+ <xalign>1</xalign>
+ <yalign>7.45058e-09</yalign>
+ <xscale>0</xscale>
+ <yscale>0</yscale>
<child>
- <widget class="GtkFrame" id="show-time-frame">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkHBox" id="hbox55">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkRadioButton" id="show-time-as-free">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">F_ree</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="show-time-as-busy">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">B_usy</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">show-time-as-free</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label64">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Show Time As</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
+ <left_attach>3</left_attach>
+ <right_attach>4</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>2</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
</child>
+
+ <widget>
+ <class>GtkCheckButton</class>
+ <name>all-day-event</name>
+ <can_focus>True</can_focus>
+ <label>A_ll day event</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow12</name>
+ <hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
+ <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+ <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
<child>
- <widget class="GtkHBox" id="hbox53">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkButton" id="contacts-button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Contacts...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkLabel" id="label59">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Contacts...</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkEventBox" id="contacts-box">
- <property name="visible">True</property>
-
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkText</class>
+ <name>description</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text></text>
+ </widget>
+ </widget>
- <child>
- <widget class="GtkButton" id="categories-button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ca_tegories...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
-
- <child>
- <widget class="GtkLabel" id="label60">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Ca_tegories...</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">4</property>
- <property name="ypad">0</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox54</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
- <child>
- <widget class="GtkEntry" id="categories">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">0</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char" translatable="yes">*</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame32</name>
+ <label>Classification</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox52</name>
+ <border_width>2</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>classification-public</name>
+ <can_focus>True</can_focus>
+ <label>Pu_blic</label>
+ <active>True</active>
+ <draw_indicator>True</draw_indicator>
+ <group>classification_radio_group</group>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>classification-private</name>
+ <can_focus>True</can_focus>
+ <label>Pri_vate</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <group>classification_radio_group</group>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>classification-confidential</name>
+ <can_focus>True</can_focus>
+ <label>Con_fidential</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <group>classification_radio_group</group>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
+ </widget>
+
+ <widget>
+ <class>GtkFrame</class>
+ <name>show-time-frame</name>
+ <label>Show Time As</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox55</name>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>show-time-as-free</name>
+ <can_focus>True</can_focus>
+ <label>F_ree</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <group>show_time_as_radio_group</group>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GtkRadioButton</class>
+ <name>show-time-as-busy</name>
+ <can_focus>True</can_focus>
+ <label>B_usy</label>
+ <active>False</active>
+ <draw_indicator>True</draw_indicator>
+ <group>show_time_as_radio_group</group>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox53</name>
+ <homogeneous>False</homogeneous>
+ <spacing>2</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
</child>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>contacts-button</name>
+ <can_focus>True</can_focus>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label59</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>GtkEventBox</class>
+ <name>contacts-box</name>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>Placeholder</class>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkButton</class>
+ <name>categories-button</name>
+ <can_focus>True</can_focus>
+ <relief>GTK_RELIEF_NORMAL</relief>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label60</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>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c
index c4f1ec84cb..f337390429 100644
--- a/calendar/gui/dialogs/meeting-page.c
+++ b/calendar/gui/dialogs/meeting-page.c
@@ -31,9 +31,10 @@
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtkwindow.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
-#include <libgnomeui/gnome-stock-icons.h>
+#include <libgnomeui/gnome-stock.h>
#include <gal/e-table/e-cell-combo.h>
#include <gal/e-table/e-cell-text.h>
#include <gal/e-table/e-table-simple.h>
@@ -42,10 +43,8 @@
#include <gal/widgets/e-popup-menu.h>
#include <gal/widgets/e-gui-utils.h>
#include <widgets/misc/e-dateedit.h>
-#include <e-util/e-dialog-utils.h>
#include <e-util/e-dialog-widgets.h>
-
-#include "../calendar-component.h"
+#include "../component-factory.h"
#include "../e-meeting-attendee.h"
#include "../e-meeting-model.h"
#include "../itip-utils.h"
@@ -78,9 +77,9 @@ struct _MeetingPagePrivate {
CalComponent *comp;
/* List of identities */
- EAccountList *accounts;
- EMeetingAttendee *ia;
- char *default_address;
+ GList *addresses;
+ GList *address_strings;
+ gchar *default_address;
/* Glade XML data */
GladeXML *xml;
@@ -109,7 +108,7 @@ struct _MeetingPagePrivate {
static void meeting_page_class_init (MeetingPageClass *class);
static void meeting_page_init (MeetingPage *mpage);
-static void meeting_page_finalize (GObject *object);
+static void meeting_page_destroy (GtkObject *object);
static GtkWidget *meeting_page_get_widget (CompEditorPage *page);
static void meeting_page_focus_main_widget (CompEditorPage *page);
@@ -130,21 +129,42 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #MeetingPage class.
**/
+GtkType
+meeting_page_get_type (void)
+{
+ static GtkType meeting_page_type;
+
+ if (!meeting_page_type) {
+ static const GtkTypeInfo meeting_page_info = {
+ "MeetingPage",
+ sizeof (MeetingPage),
+ sizeof (MeetingPageClass),
+ (GtkClassInitFunc) meeting_page_class_init,
+ (GtkObjectInitFunc) meeting_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ meeting_page_type =
+ gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &meeting_page_info);
+ }
-E_MAKE_TYPE (meeting_page, "MeetingPage", MeetingPage, meeting_page_class_init, meeting_page_init,
- TYPE_COMP_EDITOR_PAGE);
+ return meeting_page_type;
+}
/* Class initialization function for the task page */
static void
meeting_page_class_init (MeetingPageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = meeting_page_get_widget;
editor_page_class->focus_main_widget = meeting_page_focus_main_widget;
@@ -153,7 +173,7 @@ meeting_page_class_init (MeetingPageClass *class)
editor_page_class->set_summary = NULL;
editor_page_class->set_dates = NULL;
- object_class->finalize = meeting_page_finalize;
+ object_class->destroy = meeting_page_destroy;
}
/* Object initialization function for the task page */
@@ -169,9 +189,8 @@ meeting_page_init (MeetingPage *mpage)
priv->comp = NULL;
- priv->accounts = NULL;
- priv->ia = NULL;
- priv->default_address = NULL;
+ priv->addresses = NULL;
+ priv->address_strings = NULL;
priv->xml = NULL;
priv->main = NULL;
@@ -183,37 +202,6 @@ meeting_page_init (MeetingPage *mpage)
priv->updating = FALSE;
}
-static EAccount *
-get_current_account (MeetingPage *mpage)
-{
- MeetingPagePrivate *priv;
- EIterator *it;
- const char *str;
-
- priv = mpage->priv;
-
- str = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry));
- if (!str)
- return NULL;
-
- for (it = e_list_get_iterator((EList *)priv->accounts); e_iterator_is_valid(it); e_iterator_next(it)) {
- EAccount *a = (EAccount *)e_iterator_get(it);
- char *full = g_strdup_printf("%s <%s>", a->id->name, a->id->address);
-
- if (!strcmp (full, str)) {
- g_free (full);
- g_object_unref (it);
-
- return a;
- }
-
- g_free (full);
- }
- g_object_unref (it);
-
- return NULL;
-}
-
static void
set_attendees (CalComponent *comp, const GPtrArray *attendees)
{
@@ -243,12 +231,12 @@ cleanup_attendees (GPtrArray *attendees)
int i;
for (i = 0; i < attendees->len; i++)
- g_object_unref((g_ptr_array_index (attendees, i)));
+ gtk_object_unref (GTK_OBJECT (g_ptr_array_index (attendees, i)));
}
/* Destroy handler for the task page */
static void
-meeting_page_finalize (GObject *object)
+meeting_page_destroy (GtkObject *object)
{
MeetingPage *mpage;
MeetingPagePrivate *priv;
@@ -260,26 +248,25 @@ meeting_page_finalize (GObject *object)
priv = mpage->priv;
if (priv->comp != NULL)
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
cleanup_attendees (priv->deleted_attendees);
g_ptr_array_free (priv->deleted_attendees, TRUE);
-
- if (priv->ia != NULL)
- g_object_unref (priv->ia);
- g_object_unref((priv->model));
+ itip_addresses_free (priv->addresses);
+
+ gtk_object_unref (GTK_OBJECT (priv->model));
if (priv->xml) {
- g_object_unref((priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
g_free (priv);
mpage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -318,7 +305,7 @@ clear_widgets (MeetingPage *mpage)
priv = mpage->priv;
- gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), priv->default_address);
+ gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), "");
gtk_label_set_text (GTK_LABEL (priv->existing_organizer), _("None"));
gtk_widget_show (priv->organizer_table);
@@ -342,7 +329,7 @@ meeting_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
/* Clean out old data */
if (priv->comp != NULL)
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = NULL;
cleanup_attendees (priv->deleted_attendees);
@@ -354,12 +341,15 @@ meeting_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
/* Component for cancellation */
priv->comp = cal_component_clone (comp);
+ /* List the user identities for default organizers */
+ gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), priv->address_strings);
+
/* If there is an existing organizer show it properly */
if (cal_component_has_organizer (comp)) {
cal_component_get_organizer (comp, &organizer);
if (organizer.value != NULL) {
const gchar *strip = itip_strip_mailto (organizer.value);
- gchar *string;
+ gchar *s, *string;
gtk_widget_hide (priv->organizer_table);
gtk_widget_show (priv->existing_organizer_table);
@@ -379,23 +369,15 @@ meeting_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
string = g_strdup_printf ("%s <%s>", organizer.cn, strip);
else
string = g_strdup (strip);
- gtk_label_set_text (GTK_LABEL (priv->existing_organizer), string);
+ s = e_utf8_to_gtk_string (priv->existing_organizer, string);
+ gtk_label_set_text (GTK_LABEL (priv->existing_organizer), s);
+ g_free (s);
g_free (string);
priv->existing = TRUE;
}
} else {
- EAccount *a;
-
- a = get_current_account (mpage);
- if (a != NULL) {
- priv->ia = e_meeting_model_add_attendee_with_defaults (priv->model);
- g_object_ref (priv->ia);
-
- e_meeting_attendee_set_address (priv->ia, g_strdup_printf ("MAILTO:%s", a->id->address));
- e_meeting_attendee_set_cn (priv->ia, g_strdup (a->id->name));
- e_meeting_attendee_set_status (priv->ia, ICAL_PARTSTAT_ACCEPTED);
- }
+ e_dialog_editable_set (GTK_COMBO (priv->organizer)->entry, priv->default_address);
}
priv->updating = FALSE;
@@ -413,36 +395,50 @@ meeting_page_fill_component (CompEditorPage *page, CalComponent *comp)
priv = mpage->priv;
if (!priv->existing) {
- EAccount *a;
- gchar *addr = NULL;
+ gchar *addr = NULL, *cn = NULL, *sentby = NULL, *str;
+ GList *l;
- /* Find the identity for the organizer or sentby field */
- a = get_current_account (mpage);
+ str = e_dialog_editable_get (GTK_COMBO (priv->organizer)->entry);
- /* Sanity Check */
- if (a == NULL) {
- e_notice (page, GTK_MESSAGE_ERROR,
- _("The organizer selected no longer has an account."));
- return FALSE;
+ /* Find the identity for the organizer or sentby field */
+ for (l = priv->addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+
+ if (!strcmp (a->full, str)) {
+ addr = g_strdup (a->address);
+ cn = g_strdup (a->name);
+ }
}
+
+ g_free (str);
- if (a->id->address == NULL || strlen (a->id->address) == 0) {
- e_notice (page, GTK_MESSAGE_ERROR,
+ /* Sanity Check */
+ if (addr == NULL || strlen (addr) == 0) {
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("An organizer is required."));
+ g_free (addr);
+ g_free (cn);
return FALSE;
- }
-
- addr = g_strdup_printf ("MAILTO:%s", a->id->address);
+ } else {
+ gchar *tmp;
+
+ tmp = addr;
+ addr = g_strdup_printf ("MAILTO:%s", addr);
+ g_free (tmp);
+ }
organizer.value = addr;
- organizer.cn = a->id->name;
+ organizer.cn = cn;
+ organizer.sentby = sentby;
cal_component_set_organizer (comp, &organizer);
g_free (addr);
+ g_free (cn);
+ g_free (sentby);
}
if (e_meeting_model_count_actual_attendees (priv->model) < 1) {
- e_notice (page, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("At least one attendee is required."));
return FALSE;
}
@@ -473,14 +469,14 @@ get_widgets (MeetingPage *mpage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
/* For making the user the organizer */
priv->organizer_table = GW ("organizer-table");
@@ -503,34 +499,18 @@ get_widgets (MeetingPage *mpage)
&& priv->existing_organizer_btn);
}
+/* This is called when any field is changed; it notifies upstream. */
static void
-org_changed_cb (GtkWidget *widget, gpointer data)
+field_changed_cb (GtkWidget *widget, gpointer data)
{
MeetingPage *mpage;
MeetingPagePrivate *priv;
mpage = MEETING_PAGE (data);
priv = mpage->priv;
-
- if (priv->updating)
- return;
- if (!priv->existing && priv->ia != NULL) {
- EAccount *a;
-
- a = get_current_account (mpage);
- if (a != NULL) {
- e_meeting_attendee_set_address (priv->ia, g_strdup_printf ("MAILTO:%s", a->id->address));
- e_meeting_attendee_set_cn (priv->ia, g_strdup (a->id->name));
-
- if (!e_meeting_model_find_attendee (priv->model, e_meeting_attendee_get_address (priv->ia), NULL))
- e_meeting_model_add_attendee (priv->model, priv->ia);
- } else {
- e_meeting_model_remove_attendee (priv->model, priv->ia);
- }
- }
-
- comp_editor_page_notify_changed (COMP_EDITOR_PAGE (mpage));
+ if (!priv->updating)
+ comp_editor_page_notify_changed (COMP_EDITOR_PAGE (mpage));
}
/* Function called to change the organizer */
@@ -548,6 +528,7 @@ change_clicked_cb (GtkWidget *widget, gpointer data)
gtk_widget_show (priv->invite);
e_meeting_model_etable_click_to_add (priv->model, TRUE);
+ e_dialog_editable_set (GTK_COMBO (priv->organizer)->entry, priv->default_address);
comp_editor_page_notify_needs_send (COMP_EDITOR_PAGE (mpage));
priv->existing = FALSE;
@@ -575,17 +556,18 @@ init_widgets (MeetingPage *mpage)
priv = mpage->priv;
/* Organizer */
- g_signal_connect((GTK_COMBO (priv->organizer)->entry), "changed",
- G_CALLBACK (org_changed_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (GTK_COMBO (priv->organizer)->entry), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), mpage);
- g_signal_connect((priv->existing_organizer_btn), "clicked",
- G_CALLBACK (change_clicked_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (priv->existing_organizer_btn), "clicked",
+ GTK_SIGNAL_FUNC (change_clicked_cb), mpage);
/* Invite button */
- g_signal_connect((priv->invite), "clicked",
- G_CALLBACK (invite_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (priv->invite), "clicked",
+ GTK_SIGNAL_FUNC (invite_cb), mpage);
}
+#if 0
static void
popup_delegate_cb (GtkWidget *widget, gpointer data)
{
@@ -604,7 +586,7 @@ popup_delegate_cb (GtkWidget *widget, gpointer data)
edd = e_delegate_dialog_new (NULL, itip_strip_mailto (e_meeting_attendee_get_delto (ia)));
dialog = e_delegate_dialog_get_toplevel (edd);
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK){
+ if (gnome_dialog_run_and_close (GNOME_DIALOG (dialog)) == 0){
EMeetingAttendee *ic;
name = e_delegate_dialog_get_delegate_name (edd);
@@ -612,7 +594,7 @@ popup_delegate_cb (GtkWidget *widget, gpointer data)
/* Make sure we can add the new delegatee person */
if (e_meeting_model_find_attendee (priv->model, address, NULL) != NULL) {
- e_notice (mpage, GTK_MESSAGE_ERROR,
+ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR,
_("That person is already attending the meeting!"));
goto cleanup;
}
@@ -623,7 +605,7 @@ popup_delegate_cb (GtkWidget *widget, gpointer data)
ib = e_meeting_model_find_attendee (priv->model, itip_strip_mailto (e_meeting_attendee_get_delto (ia)), NULL);
if (ib != NULL) {
- g_object_ref((ib));
+ gtk_object_ref (GTK_OBJECT (ib));
g_ptr_array_add (priv->deleted_attendees, ib);
e_meeting_model_remove_attendee (priv->model, ib);
@@ -642,8 +624,9 @@ popup_delegate_cb (GtkWidget *widget, gpointer data)
cleanup:
g_free (name);
g_free (address);
- g_object_unref((edd));
+ gtk_object_unref (GTK_OBJECT (edd));
}
+#endif
static void
popup_delete_cb (GtkWidget *widget, gpointer data)
@@ -657,13 +640,6 @@ popup_delete_cb (GtkWidget *widget, gpointer data)
ia = e_meeting_model_find_attendee_at_row (priv->model, priv->row);
- /* If the user deletes the attendee explicitly, assume they no
- longer want the organizer showing up */
- if (ia == priv->ia) {
- g_object_unref (priv->ia);
- priv->ia = NULL;
- }
-
/* If this was a delegatee, no longer delegate */
if (e_meeting_attendee_is_set_delfrom (ia)) {
EMeetingAttendee *ib;
@@ -677,7 +653,7 @@ popup_delete_cb (GtkWidget *widget, gpointer data)
while (ia != NULL) {
EMeetingAttendee *ib = NULL;
- g_object_ref((ia));
+ gtk_object_ref (GTK_OBJECT (ia));
g_ptr_array_add (priv->deleted_attendees, ia);
e_meeting_model_remove_attendee (priv->model, ia);
@@ -693,11 +669,13 @@ enum {
};
static EPopupMenu context_menu[] = {
- E_POPUP_ITEM (N_("_Delegate To..."), G_CALLBACK (popup_delegate_cb), CAN_DELEGATE),
+#if 0
+ E_POPUP_ITEM (N_("_Delegate To..."), GTK_SIGNAL_FUNC (popup_delegate_cb), CAN_DELEGATE),
E_POPUP_SEPARATOR,
+#endif
- E_POPUP_ITEM (N_("_Delete"), G_CALLBACK (popup_delete_cb), CAN_DELETE),
+ E_POPUP_ITEM (N_("_Delete"), GTK_SIGNAL_FUNC (popup_delete_cb), CAN_DELETE),
E_POPUP_TERMINATOR
};
@@ -717,18 +695,15 @@ right_click_cb (ETable *etable, gint row, gint col, GdkEvent *event, gpointer da
view_row = e_table_model_to_view_row (etable, row);
priv->row = e_meeting_model_etable_view_to_model_row (etable, priv->model, view_row);
- ia = e_meeting_model_find_attendee_at_row (priv->model, priv->row);
- if (e_meeting_attendee_get_edit_level (ia) != E_MEETING_ATTENDEE_EDIT_FULL)
- disable_mask = CAN_DELETE;
-
- /* FIXME: if you enable Delegate, then change index to '1'.
- * (This has now been enabled). */
- /* context_menu[1].pixmap_widget = gnome_stock_new_with_icon (GNOME_STOCK_MENU_TRASH); */
- context_menu[1].pixmap_widget =
- gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_MENU);
+ ia = e_meeting_model_find_attendee_at_row (priv->model, priv->row);
+ if (e_meeting_attendee_get_edit_level (ia) != E_MEETING_ATTENDEE_EDIT_FULL)
+ disable_mask = CAN_DELETE;
+ /* FIXME: if you enable Delegate, then change index to '1' */
+ context_menu[0].pixmap_widget = gnome_stock_new_with_icon (GNOME_STOCK_MENU_TRASH);
+
menu = e_popup_menu_create (context_menu, disable_mask, hide_mask, data);
- e_auto_kill_popup_menu_on_selection_done (menu);
+ e_auto_kill_popup_menu_on_hide (menu);
gtk_menu_popup (menu, NULL, NULL, NULL, NULL,
event->button.button, event->button.time);
@@ -774,14 +749,12 @@ meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm,
ETable *real_table;
gchar *filename;
const char *backend_address;
- EIterator *it;
- EAccount *def_account;
- GList *address_strings = NULL, *l;
+ GList *l;
priv = mpage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/meeting-page.glade", NULL, NULL);
+ "/meeting-page.glade", NULL);
if (!priv->xml) {
g_message ("meeting_page_construct(): "
"Could not load the Glade XML file!");
@@ -797,43 +770,25 @@ meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm,
/* Address information */
backend_address = cal_client_get_cal_address (client);
- priv->accounts = itip_addresses_get ();
- def_account = itip_addresses_get_default();
- for (it = e_list_get_iterator((EList *)priv->accounts);
- e_iterator_is_valid(it);
- e_iterator_next(it)) {
- EAccount *a = (EAccount *)e_iterator_get(it);
- char *full;
+ priv->addresses = itip_addresses_get ();
+ for (l = priv->addresses; l != NULL; l = l->next) {
+ ItipAddress *a = l->data;
+ char *s;
- full = g_strdup_printf("%s <%s>", a->id->name, a->id->address);
-
- address_strings = g_list_append(address_strings, full);
+ s = e_utf8_to_gtk_string (GTK_COMBO (priv->organizer)->entry, a->full);
+ priv->address_strings = g_list_append (priv->address_strings, s);
/* Note that the address specified by the backend gets
* precedence over the default mail address.
*/
- if (backend_address && !strcmp (backend_address, a->id->address)) {
- if (priv->default_address)
- g_free (priv->default_address);
-
- priv->default_address = g_strdup (full);
- } else if (a == def_account && !priv->default_address) {
- priv->default_address = g_strdup (full);
- }
+ if (backend_address && !strcmp (backend_address, a->address))
+ priv->default_address = a->full;
+ else if (a->default_address && !priv->default_address)
+ priv->default_address = a->full;
}
- g_object_unref(it);
-
- if (address_strings)
- gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), address_strings);
- else
- g_warning ("No potential organizers!");
-
- for (l = address_strings; l != NULL; l = l->next)
- g_free (l->data);
- g_list_free (address_strings);
/* The etable displaying attendees and their status */
- g_object_ref((emm));
+ gtk_object_ref (GTK_OBJECT (emm));
priv->model = emm;
filename = g_strdup_printf ("%s/config/et-header-meeting-page", evolution_dir);
@@ -843,11 +798,11 @@ meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm,
g_free (filename);
real_table = e_table_scrolled_get_table (priv->etable);
- g_signal_connect((real_table),
- "right_click", G_CALLBACK (right_click_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (real_table),
+ "right_click", GTK_SIGNAL_FUNC (right_click_cb), mpage);
- g_signal_connect((real_table->table_canvas), "focus_out_event",
- G_CALLBACK (table_canvas_focus_out_cb), mpage);
+ gtk_signal_connect (GTK_OBJECT (real_table->table_canvas), "focus_out_event",
+ GTK_SIGNAL_FUNC (table_canvas_focus_out_cb), mpage);
gtk_widget_show (GTK_WIDGET (priv->etable));
gtk_box_pack_start (GTK_BOX (priv->main), GTK_WIDGET (priv->etable), TRUE, TRUE, 2);
@@ -871,9 +826,9 @@ meeting_page_new (EMeetingModel *emm, CalClient *client)
{
MeetingPage *mpage;
- mpage = g_object_new (TYPE_MEETING_PAGE, NULL);
+ mpage = gtk_type_new (TYPE_MEETING_PAGE);
if (!meeting_page_construct (mpage, emm, client)) {
- g_object_unref((mpage));
+ gtk_object_unref (GTK_OBJECT (mpage));
return NULL;
}
diff --git a/calendar/gui/dialogs/meeting-page.h b/calendar/gui/dialogs/meeting-page.h
index 2a209b586b..8d25dd1806 100644
--- a/calendar/gui/dialogs/meeting-page.h
+++ b/calendar/gui/dialogs/meeting-page.h
@@ -28,15 +28,15 @@
#include "../itip-utils.h"
#include "comp-editor-page.h"
-G_BEGIN_DECLS
+BEGIN_GNOME_DECLS
#define TYPE_MEETING_PAGE (meeting_page_get_type ())
-#define MEETING_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MEETING_PAGE, MeetingPage))
-#define MEETING_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MEETING_PAGE, MeetingPageClass))
-#define IS_MEETING_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MEETING_PAGE))
-#define IS_MEETING_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TYPE_MEETING_PAGE))
+#define MEETING_PAGE(obj) (GTK_CHECK_CAST ((obj), TYPE_MEETING_PAGE, MeetingPage))
+#define MEETING_PAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_MEETING_PAGE, MeetingPageClass))
+#define IS_MEETING_PAGE(obj) (GTK_CHECK_TYPE ((obj), TYPE_MEETING_PAGE))
+#define IS_MEETING_PAGE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), TYPE_MEETING_PAGE))
typedef struct _MeetingPagePrivate MeetingPagePrivate;
@@ -62,6 +62,6 @@ CalComponent *meeting_page_get_cancel_comp (MeetingPage *mpage);
-G_END_DECLS
+END_GNOME_DECLS
#endif
diff --git a/calendar/gui/dialogs/recur-comp.c b/calendar/gui/dialogs/recur-comp.c
index 81db34733c..3c9152ccc5 100644
--- a/calendar/gui/dialogs/recur-comp.c
+++ b/calendar/gui/dialogs/recur-comp.c
@@ -24,9 +24,11 @@
#include <glib.h>
#include <gtk/gtk.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-uidefs.h>
+#include <libgnomeui/gnome-stock.h>
#include <gal/widgets/e-unicode.h>
+#include "widgets/misc/e-messagebox.h"
#include "recur-comp.h"
@@ -39,7 +41,7 @@ recur_component_dialog (CalComponent *comp,
char *str;
GtkWidget *dialog, *rb1, *rb2, *rb3, *hbox;
CalComponentVType vtype;
- gboolean ret;
+ int btn;
g_return_val_if_fail (IS_CAL_COMPONENT (comp), CALOBJ_MOD_THIS);
@@ -63,12 +65,15 @@ recur_component_dialog (CalComponent *comp,
return CALOBJ_MOD_THIS;
}
+ dialog = e_message_box_new (str, E_MESSAGE_BOX_QUESTION,
+ GNOME_STOCK_BUTTON_OK,
+ GNOME_STOCK_BUTTON_CANCEL,
+ NULL);
- dialog = gtk_message_dialog_new(parent, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, "%s", str);
g_free (str);
hbox = gtk_hbox_new (FALSE, 2);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox);
+ gtk_container_add (GTK_CONTAINER (GNOME_DIALOG (dialog)->vbox), hbox);
rb1 = gtk_radio_button_new_with_label (NULL, _("This Instance Only"));
gtk_container_add (GTK_CONTAINER (hbox), rb1);
@@ -78,8 +83,13 @@ recur_component_dialog (CalComponent *comp,
gtk_container_add (GTK_CONTAINER (hbox), rb3);
gtk_widget_show_all (hbox);
-
- ret = gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK;
+
+ gtk_widget_hide (e_message_box_get_checkbox (E_MESSAGE_BOX (dialog)));
+ gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE);
+ if (parent != NULL)
+ gnome_dialog_set_parent (GNOME_DIALOG (dialog), parent);
+
+ btn = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rb1)))
*mod = CALOBJ_MOD_THIS;
@@ -90,5 +100,5 @@ recur_component_dialog (CalComponent *comp,
gtk_widget_destroy (dialog);
- return ret;
+ return btn == 0 ? TRUE : FALSE;
}
diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c
index aa77ee3990..ff31bb3878 100644
--- a/calendar/gui/dialogs/recurrence-page.c
+++ b/calendar/gui/dialogs/recurrence-page.c
@@ -1,14 +1,11 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
/* Evolution calendar - Recurrence page of the calendar component dialogs
*
- * Copyright (C) 2001-2003 Ximian, Inc.
+ * Copyright (C) 2001 Ximian, Inc.
*
* Authors: Federico Mena-Quintero <federico@ximian.com>
* Miguel de Icaza <miguel@ximian.com>
* Seth Alves <alves@hungry.com>
* JP Rosevear <jpr@ximian.com>
- * Hans Petter Jansson <hpj@ximiman.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@ -28,27 +25,21 @@
#include <config.h>
#endif
-#include <gtk/gtkcellrenderertext.h>
-#include <gtk/gtkmenuitem.h>
#include <gtk/gtkoptionmenu.h>
-#include <gtk/gtktogglebutton.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkspinbutton.h>
-#include <gtk/gtktreeview.h>
-#include <gtk/gtktreeselection.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
#include <gal/widgets/e-unicode.h>
#include <e-util/e-dialog-widgets.h>
#include <e-util/e-time-utils.h>
#include <widgets/misc/e-dateedit.h>
-#include <cal-util/cal-recur.h>
#include <cal-util/timeutil.h>
#include "../calendar-config.h"
#include "../tag-calendar.h"
#include "../weekday-picker.h"
#include "comp-editor-util.h"
-#include "../e-date-time-list.h"
#include "recurrence-page.h"
@@ -131,6 +122,40 @@ static const int ending_types_map[] = {
-1
};
+static const char *date_suffix[] = {
+ N_("st"),
+ N_("nd"),
+ N_("rd"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("st"),
+ N_("nd"),
+ N_("rd"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("th"),
+ N_("st")
+};
+
/* Private part of the RecurrencePage structure */
struct _RecurrencePagePrivate {
/* Component we use to expand the recurrence rules for the preview */
@@ -140,6 +165,7 @@ struct _RecurrencePagePrivate {
GladeXML *xml;
/* Widgets from the Glade file */
+
GtkWidget *main;
GtkWidget *summary;
@@ -180,17 +206,15 @@ struct _RecurrencePagePrivate {
int ending_count;
/* More widgets from the Glade file */
+
GtkWidget *exception_date;
- GtkWidget *exception_list; /* This is a GtkTreeView now */
+ GtkWidget *exception_list;
GtkWidget *exception_add;
GtkWidget *exception_modify;
GtkWidget *exception_delete;
GtkWidget *preview_bin;
- /* Store for exception_list */
- EDateTimeList *exception_list_store;
-
/* For the recurrence preview, the actual widget */
GtkWidget *preview_calendar;
@@ -201,7 +225,7 @@ struct _RecurrencePagePrivate {
static void recurrence_page_class_init (RecurrencePageClass *class);
static void recurrence_page_init (RecurrencePage *rpage);
-static void recurrence_page_finalize (GObject *object);
+static void recurrence_page_destroy (GtkObject *object);
static GtkWidget *recurrence_page_get_widget (CompEditorPage *page);
static void recurrence_page_focus_main_widget (CompEditorPage *page);
@@ -224,21 +248,41 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #RecurrencePage class.
**/
+GtkType
+recurrence_page_get_type (void)
+{
+ static GtkType recurrence_page_type;
+
+ if (!recurrence_page_type) {
+ static const GtkTypeInfo recurrence_page_info = {
+ "RecurrencePage",
+ sizeof (RecurrencePage),
+ sizeof (RecurrencePageClass),
+ (GtkClassInitFunc) recurrence_page_class_init,
+ (GtkObjectInitFunc) recurrence_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ recurrence_page_type = gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &recurrence_page_info);
+ }
-E_MAKE_TYPE (recurrence_page, "RecurrencePage", RecurrencePage, recurrence_page_class_init,
- recurrence_page_init, TYPE_COMP_EDITOR_PAGE);
+ return recurrence_page_type;
+}
/* Class initialization function for the recurrence page */
static void
recurrence_page_class_init (RecurrencePageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = recurrence_page_get_widget;
editor_page_class->focus_main_widget = recurrence_page_focus_main_widget;
@@ -247,7 +291,7 @@ recurrence_page_class_init (RecurrencePageClass *class)
editor_page_class->set_summary = recurrence_page_set_summary;
editor_page_class->set_dates = recurrence_page_set_dates;
- object_class->finalize = recurrence_page_finalize;
+ object_class->destroy = recurrence_page_destroy;
}
/* Object initialization function for the recurrence page */
@@ -290,9 +334,18 @@ recurrence_page_init (RecurrencePage *rpage)
priv->comp = NULL;
}
+/* Frees the CalComponentDateTime stored in the GtkCList */
+static void
+free_exception_date_time (CalComponentDateTime *dt)
+{
+ g_free (dt->value);
+ g_free ((char*)dt->tzid);
+ g_free (dt);
+}
+
/* Destroy handler for the recurrence page */
static void
-recurrence_page_finalize (GObject *object)
+recurrence_page_destroy (GtkObject *object)
{
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
@@ -304,25 +357,20 @@ recurrence_page_finalize (GObject *object)
priv = rpage->priv;
if (priv->xml) {
- g_object_unref((priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
if (priv->comp) {
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = NULL;
}
- if (priv->exception_list_store) {
- g_object_unref (priv->exception_list_store);
- priv->exception_list_store = NULL;
- }
-
g_free (priv);
rpage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -376,38 +424,62 @@ clear_widgets (RecurrencePage *rpage)
priv->month_num = MONTH_NUM_DAY;
priv->month_day = MONTH_DAY_NTH;
- g_signal_handlers_block_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->custom), rpage);
e_dialog_radio_set (priv->none, RECUR_NONE, type_map);
- g_signal_handlers_unblock_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->custom), rpage);
adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->interval_value));
- g_signal_handlers_block_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (adj), rpage);
e_dialog_spin_set (priv->interval_value, 1);
- g_signal_handlers_unblock_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (adj), rpage);
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->interval_unit,
ICAL_DAILY_RECURRENCE,
freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
priv->ending_date_tt = icaltime_today ();
priv->ending_count = 1;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->ending_menu,
ENDING_FOREVER,
ending_types_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
/* Exceptions list */
- e_date_time_list_clear (priv->exception_list_store);
+ gtk_clist_clear (GTK_CLIST (priv->exception_list));
+}
+
+/* Builds a static string out of an exception date */
+static char *
+get_exception_string (CalComponentDateTime *dt)
+{
+ static char buf[256];
+ struct tm tmp_tm;
+
+ tmp_tm.tm_year = dt->value->year - 1900;
+ tmp_tm.tm_mon = dt->value->month - 1;
+ tmp_tm.tm_mday = dt->value->day;
+ tmp_tm.tm_hour = dt->value->hour;
+ tmp_tm.tm_min = dt->value->minute;
+ tmp_tm.tm_sec = dt->value->second;
+ tmp_tm.tm_isdst = -1;
+
+ tmp_tm.tm_wday = time_day_of_week (dt->value->day,
+ dt->value->month - 1,
+ dt->value->year);
+
+ e_time_format_date_and_time (&tmp_tm, calendar_config_get_24_hour_format(), FALSE, FALSE, buf, sizeof (buf));
+
+ return buf;
}
/* Appends an exception date to the list */
@@ -415,14 +487,39 @@ static void
append_exception (RecurrencePage *rpage, CalComponentDateTime *datetime)
{
RecurrencePagePrivate *priv;
- GtkTreeView *view;
- GtkTreeIter iter;
+ CalComponentDateTime *dt;
+ char *c[1];
+ int i;
+ GtkCList *clist;
+ struct icaltimetype *tt;
priv = rpage->priv;
- view = GTK_TREE_VIEW (priv->exception_list);
- e_date_time_list_append (priv->exception_list_store, &iter, datetime);
- gtk_tree_selection_select_iter (gtk_tree_view_get_selection (view), &iter);
+ dt = g_new (CalComponentDateTime, 1);
+ dt->value = g_new (struct icaltimetype, 1);
+ *dt->value = *datetime->value;
+ dt->tzid = g_strdup (datetime->tzid);
+
+ clist = GTK_CLIST (priv->exception_list);
+
+ gtk_signal_handler_block_by_data (GTK_OBJECT (clist), rpage);
+
+ c[0] = get_exception_string (dt);
+ i = gtk_clist_append (clist, c);
+
+ gtk_clist_set_row_data_full (clist, i, dt, (GtkDestroyNotify) free_exception_date_time);
+
+ gtk_clist_select_row (clist, i, 0);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (clist), rpage);
+
+ tt = dt->value;
+ e_date_edit_set_date (E_DATE_EDIT (priv->exception_date),
+ tt->year, tt->month, tt->day);
+ e_date_edit_set_time_of_day (E_DATE_EDIT (priv->exception_date),
+ tt->hour, tt->minute);
+
+ gtk_widget_set_sensitive (priv->exception_modify, TRUE);
+ gtk_widget_set_sensitive (priv->exception_delete, TRUE);
}
/* Fills in the exception widgets with the data from the calendar component */
@@ -431,11 +528,14 @@ fill_exception_widgets (RecurrencePage *rpage, CalComponent *comp)
{
RecurrencePagePrivate *priv;
GSList *list, *l;
- gboolean added = FALSE;
+ gboolean added;
priv = rpage->priv;
+
cal_component_get_exdate_list (comp, &list);
+ added = FALSE;
+
for (l = list; l; l = l->next) {
CalComponentDateTime *cdt;
@@ -446,6 +546,9 @@ fill_exception_widgets (RecurrencePage *rpage, CalComponent *comp)
}
cal_component_free_exdate_list (list);
+
+ if (added)
+ gtk_clist_select_row (GTK_CLIST (priv->exception_list), 0, 0);
}
/* Computes a weekday mask for the start day of a calendar component,
@@ -755,13 +858,11 @@ fill_component (RecurrencePage *rpage, CalComponent *comp)
{
RecurrencePagePrivate *priv;
enum recur_type recur_type;
- GtkTreeModel *model;
- GtkTreeIter iter;
- gboolean valid_iter;
+ GtkCList *exception_list;
GSList *list;
+ int i;
priv = rpage->priv;
- model = GTK_TREE_MODEL (priv->exception_list_store);
recur_type = e_dialog_radio_get (priv->none, type_map);
@@ -789,18 +890,15 @@ fill_component (RecurrencePage *rpage, CalComponent *comp)
/* Set exceptions */
list = NULL;
-
- for (valid_iter = gtk_tree_model_get_iter_first (model, &iter); valid_iter;
- valid_iter = gtk_tree_model_iter_next (model, &iter)) {
- const CalComponentDateTime *dt;
- CalComponentDateTime *cdt;
+ exception_list = GTK_CLIST (priv->exception_list);
+ for (i = 0; i < exception_list->rows; i++) {
+ CalComponentDateTime *cdt, *dt;
cdt = g_new (CalComponentDateTime, 1);
cdt->value = g_new (struct icaltimetype, 1);
- dt = e_date_time_list_get_date_time (E_DATE_TIME_LIST (model), &iter);
+ dt = gtk_clist_get_row_data (exception_list, i);
g_assert (dt != NULL);
-
if (!icaltime_is_valid_time (*dt->value)) {
comp_editor_page_display_validation_error (COMP_EDITOR_PAGE (rpage),
_("Recurrence date is invalid"),
@@ -811,6 +909,10 @@ fill_component (RecurrencePage *rpage, CalComponent *comp)
*cdt->value = *dt->value;
cdt->tzid = g_strdup (dt->tzid);
+#if 0
+ g_print ("Adding exception is_date: %i\n", cdt->value->is_date);
+#endif
+
list = g_slist_prepend (list, cdt);
}
@@ -879,7 +981,7 @@ preview_recur (RecurrencePage *rpage)
tag_calendar_by_comp (E_CALENDAR (priv->preview_calendar), comp,
COMP_EDITOR_PAGE (rpage)->client, zone, TRUE, FALSE);
- g_object_unref(comp);
+ gtk_object_unref (GTK_OBJECT (comp));
}
/* Callback used when the recurrence weekday picker changes */
@@ -929,8 +1031,8 @@ make_weekly_special (RecurrencePage *rpage)
weekday_picker_set_days (wp, priv->weekday_day_mask);
weekday_picker_set_blocked_days (wp, priv->weekday_blocked_day_mask);
- g_signal_connect((wp), "changed",
- G_CALLBACK (weekday_picker_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (wp), "changed",
+ GTK_SIGNAL_FUNC (weekday_picker_changed_cb),
rpage);
}
@@ -942,7 +1044,7 @@ month_num_submenu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
int month_index;
item = gtk_menu_get_active (GTK_MENU (menu_shell));
- item = gtk_menu_get_active (GTK_MENU (gtk_menu_item_get_submenu (GTK_MENU_ITEM (item))));
+ item = gtk_menu_get_active (GTK_MENU (GTK_MENU_ITEM (item)->submenu));
month_index = GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (item)));
gtk_object_set_user_data (GTK_OBJECT (data), GINT_TO_POINTER (month_index));
@@ -957,8 +1059,12 @@ make_recur_month_num_submenu (const char *title, int start, int end)
submenu = gtk_menu_new ();
for (i = start; i < end; i++) {
- item = gtk_menu_item_new_with_label (_(cal_recur_nth[i]));
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
+ char *date;
+
+ date = g_strdup_printf ("%d%s", i + 1, _(date_suffix[i]));
+ item = gtk_menu_item_new_with_label (date);
+ g_free (date);
+ gtk_menu_append (GTK_MENU (submenu), item);
gtk_object_set_user_data (GTK_OBJECT (item), GINT_TO_POINTER (i + 1));
gtk_widget_show (item);
}
@@ -983,6 +1089,7 @@ make_recur_month_num_menu (int month_index)
GtkWidget *menu, *submenu, *item, *submenu_item;
GtkWidget *omenu;
+ char *date;
int i;
menu = gtk_menu_new ();
@@ -990,32 +1097,34 @@ make_recur_month_num_menu (int month_index)
/* Relation */
for (i = 0; i < sizeof (options) / sizeof (options[0]); i++) {
item = gtk_menu_item_new_with_label (_(options[i]));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ gtk_menu_append (GTK_MENU (menu), item);
gtk_widget_show (item);
}
/* Current date */
- item = gtk_menu_item_new_with_label (_(cal_recur_nth[month_index - 1]));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ date = g_strdup_printf ("%d%s", month_index, _(date_suffix[month_index - 1]));
+ item = gtk_menu_item_new_with_label (date);
+ g_free (date);
+ gtk_menu_append (GTK_MENU (menu), item);
gtk_widget_show (item);
/* Other Submenu */
submenu = gtk_menu_new ();
submenu_item = gtk_menu_item_new_with_label (_("Other Date"));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), submenu_item);
+ gtk_menu_append (GTK_MENU (menu), submenu_item);
gtk_widget_show (submenu_item);
item = make_recur_month_num_submenu ("1st to 10th", 0, 10);
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
+ gtk_menu_append (GTK_MENU (submenu), item);
item = make_recur_month_num_submenu ("11th to 20th", 10, 20);
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
+ gtk_menu_append (GTK_MENU (submenu), item);
item = make_recur_month_num_submenu ("21st to 31st", 20, 31);
- gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item);
+ gtk_menu_append (GTK_MENU (submenu), item);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (submenu_item), submenu);
gtk_object_set_user_data (GTK_OBJECT (submenu_item), GINT_TO_POINTER (month_index));
- g_signal_connect((submenu), "selection_done",
- G_CALLBACK (month_num_submenu_selection_done_cb),
+ gtk_signal_connect (GTK_OBJECT (submenu), "selection_done",
+ GTK_SIGNAL_FUNC (month_num_submenu_selection_done_cb),
submenu_item);
omenu = gtk_option_menu_new ();
@@ -1049,7 +1158,7 @@ make_recur_month_menu (void)
GtkWidget *item;
item = gtk_menu_item_new_with_label (_(options[i]));
- gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+ gtk_menu_append (GTK_MENU (menu), item);
gtk_widget_show (item);
}
@@ -1077,6 +1186,7 @@ month_num_menu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
if (month_num == MONTH_NUM_OTHER) {
GtkWidget *label, *item;
+ char *date;
item = gtk_menu_get_active (GTK_MENU (menu_shell));
priv->month_index = GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (item)));
@@ -1085,7 +1195,9 @@ month_num_menu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data)
e_dialog_option_menu_set (priv->month_num_menu, month_num, month_num_options_map);
label = GTK_BIN (priv->month_num_menu)->child;
- gtk_label_set_text (GTK_LABEL (label), _(cal_recur_nth[priv->month_index - 1]));
+ date = g_strdup_printf ("%d%s", priv->month_index, _(date_suffix[priv->month_index - 1]));
+ gtk_label_set_text (GTK_LABEL (label), date);
+ g_free (date);
e_dialog_option_menu_set (priv->month_num_menu, 0, month_num_options_map);
e_dialog_option_menu_set (priv->month_num_menu, month_num, month_num_options_map);
@@ -1189,16 +1301,16 @@ make_monthly_special (RecurrencePage *rpage)
priv->month_day,
month_day_options_map);
- g_signal_connect((adj), "value_changed", G_CALLBACK (month_index_value_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (adj), "value_changed", GTK_SIGNAL_FUNC (month_index_value_changed_cb),
rpage);
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->month_num_menu));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (month_num_menu_selection_done_cb),
+ gtk_signal_connect (GTK_OBJECT (menu), "selection_done",
+ GTK_SIGNAL_FUNC (month_num_menu_selection_done_cb),
rpage);
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->month_day_menu));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (month_day_menu_selection_done_cb),
+ gtk_signal_connect (GTK_OBJECT (menu), "selection_done",
+ GTK_SIGNAL_FUNC (month_day_menu_selection_done_cb),
rpage);
}
@@ -1217,16 +1329,16 @@ make_recurrence_special (RecurrencePage *rpage)
priv = rpage->priv;
- if (priv->month_num_menu != NULL) {
- gtk_widget_destroy (priv->month_num_menu);
- priv->month_num_menu = NULL;
- }
if (GTK_BIN (priv->special)->child != NULL) {
gtk_widget_destroy (GTK_BIN (priv->special)->child);
priv->weekday_picker = NULL;
priv->month_day_menu = NULL;
}
+ if (priv->month_num_menu != NULL) {
+ gtk_widget_destroy (priv->month_num_menu);
+ priv->month_num_menu = NULL;
+ }
frequency = e_dialog_option_menu_get (priv->interval_unit, freq_map);
@@ -1306,8 +1418,8 @@ make_ending_until_special (RecurrencePage *rpage)
priv->ending_date_tt.month,
priv->ending_date_tt.day);
- g_signal_connect((de), "changed",
- G_CALLBACK (ending_until_changed_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (de), "changed",
+ GTK_SIGNAL_FUNC (ending_until_changed_cb), rpage);
/* Make sure the EDateEdit widget uses our timezones to get the
current time. */
@@ -1360,8 +1472,8 @@ make_ending_count_special (RecurrencePage *rpage)
e_dialog_spin_set (priv->ending_count_spin, priv->ending_count);
- g_signal_connect((adj), "value_changed",
- G_CALLBACK (ending_count_value_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
+ GTK_SIGNAL_FUNC (ending_count_value_changed_cb),
rpage);
}
@@ -1421,7 +1533,7 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r)
priv = rpage->priv;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
if (r->count == 0) {
if (r->until.year == 0) {
@@ -1471,7 +1583,7 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r)
ending_types_map);
}
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
make_ending_special (rpage);
}
@@ -1505,7 +1617,7 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
*/
if (priv->comp)
- g_object_unref((priv->comp));
+ gtk_object_unref (GTK_OBJECT (priv->comp));
priv->comp = cal_component_clone (comp);
@@ -1613,11 +1725,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
goto custom;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->interval_unit,
ICAL_DAILY_RECURRENCE,
freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
break;
case ICAL_WEEKLY_RECURRENCE: {
@@ -1680,11 +1792,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
priv->weekday_day_mask = day_mask;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->interval_unit,
ICAL_WEEKLY_RECURRENCE,
freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
break;
}
@@ -1779,11 +1891,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
goto custom;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->interval_unit,
ICAL_MONTHLY_RECURRENCE,
freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
break;
case ICAL_YEARLY_RECURRENCE:
@@ -1796,11 +1908,11 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
goto custom;
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (menu), rpage);
e_dialog_option_menu_set (priv->interval_unit,
ICAL_YEARLY_RECURRENCE,
freq_map);
- g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (menu), rpage);
break;
default:
@@ -1809,13 +1921,13 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
/* If we got here it means it is a simple recurrence */
- g_signal_handlers_block_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->custom), rpage);
e_dialog_radio_set (priv->simple, RECUR_SIMPLE, type_map);
- g_signal_handlers_unblock_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->custom), rpage);
gtk_widget_set_sensitive (priv->custom, FALSE);
@@ -1823,9 +1935,9 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
make_recurrence_special (rpage);
adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->interval_value));
- g_signal_handlers_block_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (adj), rpage);
e_dialog_spin_set (priv->interval_value, r->interval);
- g_signal_handlers_unblock_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (adj), rpage);
fill_ending_date (rpage, r);
@@ -1833,13 +1945,13 @@ recurrence_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
custom:
- g_signal_handlers_block_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_block_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_block_by_data (GTK_OBJECT (priv->custom), rpage);
e_dialog_radio_set (priv->custom, RECUR_CUSTOM, type_map);
- g_signal_handlers_unblock_matched (priv->none, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->simple, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
- g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->none), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->simple), rpage);
+ gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->custom), rpage);
gtk_widget_set_sensitive (priv->custom, TRUE);
sensitize_recur_widgets (rpage);
@@ -1868,11 +1980,14 @@ recurrence_page_set_summary (CompEditorPage *page, const char *summary)
{
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
+ gchar *s;
rpage = RECURRENCE_PAGE (page);
priv = rpage->priv;
- gtk_label_set_text (GTK_LABEL (priv->summary), summary);
+ s = e_utf8_to_gtk_string (priv->summary, summary);
+ gtk_label_set_text (GTK_LABEL (priv->summary), s);
+ g_free (s);
}
/* set_dates handler for the recurrence page */
@@ -1949,14 +2064,14 @@ get_widgets (RecurrencePage *rpage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
priv->summary = GW ("summary");
priv->date_time = GW ("date-time");
@@ -1974,7 +2089,6 @@ get_widgets (RecurrencePage *rpage)
priv->custom_warning_bin = GW ("custom-warning-bin");
priv->exception_date = GW ("exception-date");
- gtk_widget_show (priv->exception_date);
priv->exception_list = GW ("exception-list");
priv->exception_add = GW ("exception-add");
priv->exception_modify = GW ("exception-modify");
@@ -2113,24 +2227,24 @@ exception_modify_cb (GtkWidget *widget, gpointer data)
{
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
- GtkTreeSelection *selection;
- CalComponentDateTime dt;
- struct icaltimetype icaltime = icaltime_null_time ();
+ GtkCList *clist;
+ CalComponentDateTime *dt;
struct icaltimetype *tt;
- GtkTreeIter iter;
+ int sel;
rpage = RECURRENCE_PAGE (data);
priv = rpage->priv;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list));
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- g_warning ("Could not get a selection to modify.");
+ clist = GTK_CLIST (priv->exception_list);
+ if (!clist->selection)
return;
- }
+
field_changed (rpage);
- dt.value = &icaltime;
- tt = dt.value;
+ sel = GPOINTER_TO_INT (clist->selection->data);
+
+ dt = gtk_clist_get_row_data (clist, sel);
+ tt = dt->value;
e_date_edit_get_date (E_DATE_EDIT (priv->exception_date),
&tt->year, &tt->month, &tt->day);
tt->hour = 0;
@@ -2138,10 +2252,12 @@ exception_modify_cb (GtkWidget *widget, gpointer data)
tt->second = 0;
tt->is_date = 1;
- /* No TZID, since we are using a DATE value now. */
- dt.tzid = NULL;
+ /* We get rid of any old TZID, since we are using a DATE value now. */
+ g_free ((char*)dt->tzid);
+ dt->tzid = NULL;
+
+ gtk_clist_set_text (clist, sel, 0, get_exception_string (dt));
- e_date_time_list_set_date_time (priv->exception_list_store, &iter, &dt);
preview_recur (rpage);
}
@@ -2151,36 +2267,31 @@ exception_delete_cb (GtkWidget *widget, gpointer data)
{
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- GtkTreePath *path;
- gboolean valid_iter;
+ GtkCList *clist;
+ int sel;
rpage = RECURRENCE_PAGE (data);
priv = rpage->priv;
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list));
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- g_warning ("Could not get a selection to delete.");
+ clist = GTK_CLIST (priv->exception_list);
+ if (!clist->selection)
return;
- }
field_changed (rpage);
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->exception_list_store), &iter);
- e_date_time_list_remove (priv->exception_list_store, &iter);
+ sel = GPOINTER_TO_INT (clist->selection->data);
- /* Select closest item after removal */
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->exception_list_store), &iter, path);
- if (!valid_iter) {
- gtk_tree_path_prev (path);
- valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->exception_list_store), &iter, path);
- }
+ gtk_clist_remove (clist, sel);
+ if (sel >= clist->rows)
+ sel--;
- if (valid_iter)
- gtk_tree_selection_select_iter (selection, &iter);
+ if (clist->rows > 0)
+ gtk_clist_select_row (clist, sel, 0);
+ else {
+ gtk_widget_set_sensitive (priv->exception_modify, FALSE);
+ gtk_widget_set_sensitive (priv->exception_delete, FALSE);
+ }
- gtk_tree_path_free (path);
preview_recur (rpage);
}
@@ -2189,27 +2300,24 @@ exception_delete_cb (GtkWidget *widget, gpointer data)
* exception's value.
*/
static void
-exception_selection_changed_cb (GtkTreeSelection *selection, gpointer data)
+exception_select_row_cb (GtkCList *clist, gint row, gint col,
+ GdkEvent *event, gpointer data)
{
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
- const CalComponentDateTime *dt;
+ CalComponentDateTime *dt;
struct icaltimetype *t;
- GtkTreeIter iter;
rpage = RECURRENCE_PAGE (data);
priv = rpage->priv;
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- gtk_widget_set_sensitive (priv->exception_modify, FALSE);
- gtk_widget_set_sensitive (priv->exception_delete, FALSE);
+ /* Sometimes GtkCList emits a 'row-selected' signal for row 0 when
+ there are 0 rows in the list (after you delete the last row).
+ So we check that the row is valid here. */
+ if (row >= clist->rows)
return;
- }
- gtk_widget_set_sensitive (priv->exception_modify, TRUE);
- gtk_widget_set_sensitive (priv->exception_delete, TRUE);
-
- dt = e_date_time_list_get_date_time (priv->exception_list_store, &iter);
+ dt = gtk_clist_get_row_data (clist, row);
g_assert (dt != NULL);
t = dt->value;
@@ -2240,8 +2348,6 @@ init_widgets (RecurrencePage *rpage)
ECalendar *ecal;
GtkAdjustment *adj;
GtkWidget *menu;
- GtkTreeViewColumn *column;
- GtkCellRenderer *cell_renderer;
priv = rpage->priv;
@@ -2249,8 +2355,8 @@ init_widgets (RecurrencePage *rpage)
priv->preview_calendar = e_calendar_new ();
ecal = E_CALENDAR (priv->preview_calendar);
- g_signal_connect((ecal->calitem), "date_range_changed",
- G_CALLBACK (preview_date_range_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (ecal->calitem), "date_range_changed",
+ GTK_SIGNAL_FUNC (preview_date_range_changed_cb),
rpage);
calendar_config_configure_e_calendar (ecal);
e_calendar_item_set_max_days_sel (ecal->calitem, 0);
@@ -2270,62 +2376,46 @@ init_widgets (RecurrencePage *rpage)
/* Recurrence types */
- g_signal_connect((priv->none), "toggled",
- G_CALLBACK (type_toggled_cb), rpage);
- g_signal_connect((priv->simple), "toggled",
- G_CALLBACK (type_toggled_cb), rpage);
- g_signal_connect((priv->custom), "toggled",
- G_CALLBACK (type_toggled_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->none), "toggled",
+ GTK_SIGNAL_FUNC (type_toggled_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->simple), "toggled",
+ GTK_SIGNAL_FUNC (type_toggled_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->custom), "toggled",
+ GTK_SIGNAL_FUNC (type_toggled_cb), rpage);
/* Recurrence interval */
adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->interval_value));
- g_signal_connect((adj), "value_changed",
- G_CALLBACK (interval_value_changed_cb),
+ gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
+ GTK_SIGNAL_FUNC (interval_value_changed_cb),
rpage);
/* Recurrence units */
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->interval_unit));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (interval_selection_done_cb),
+ gtk_signal_connect (GTK_OBJECT (menu), "selection_done",
+ GTK_SIGNAL_FUNC (interval_selection_done_cb),
rpage);
/* Recurrence ending */
menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu));
- g_signal_connect((menu), "selection_done",
- G_CALLBACK (ending_selection_done_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (menu), "selection_done",
+ GTK_SIGNAL_FUNC (ending_selection_done_cb), rpage);
/* Exception buttons */
- g_signal_connect((priv->exception_add), "clicked",
- G_CALLBACK (exception_add_cb), rpage);
- g_signal_connect((priv->exception_modify), "clicked",
- G_CALLBACK (exception_modify_cb), rpage);
- g_signal_connect((priv->exception_delete), "clicked",
- G_CALLBACK (exception_delete_cb), rpage);
-
- gtk_widget_set_sensitive (priv->exception_modify, FALSE);
- gtk_widget_set_sensitive (priv->exception_delete, FALSE);
-
- /* Exception list */
-
- /* Model */
- priv->exception_list_store = e_date_time_list_new ();
- gtk_tree_view_set_model (GTK_TREE_VIEW (priv->exception_list),
- GTK_TREE_MODEL (priv->exception_list_store));
-
- /* View */
- column = gtk_tree_view_column_new ();
- gtk_tree_view_column_set_title (column, "Date/Time");
- cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ());
- gtk_tree_view_column_pack_start (column, cell_renderer, TRUE);
- gtk_tree_view_column_add_attribute (column, cell_renderer, "text", E_DATE_TIME_LIST_COLUMN_DESCRIPTION);
- gtk_tree_view_append_column (GTK_TREE_VIEW (priv->exception_list), column);
-
- g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list)), "changed",
- G_CALLBACK (exception_selection_changed_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->exception_add), "clicked",
+ GTK_SIGNAL_FUNC (exception_add_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->exception_modify), "clicked",
+ GTK_SIGNAL_FUNC (exception_modify_cb), rpage);
+ gtk_signal_connect (GTK_OBJECT (priv->exception_delete), "clicked",
+ GTK_SIGNAL_FUNC (exception_delete_cb), rpage);
+
+ /* Selections in the exceptions list */
+
+ gtk_signal_connect (GTK_OBJECT (priv->exception_list), "select_row",
+ GTK_SIGNAL_FUNC (exception_select_row_cb), rpage);
}
@@ -2347,7 +2437,7 @@ recurrence_page_construct (RecurrencePage *rpage)
priv = rpage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/recurrence-page.glade", NULL, NULL);
+ "/recurrence-page.glade", NULL);
if (!priv->xml) {
g_message ("recurrence_page_construct(): "
"Could not load the Glade XML file!");
@@ -2378,9 +2468,9 @@ recurrence_page_new (void)
{
RecurrencePage *rpage;
- rpage = g_object_new (TYPE_RECURRENCE_PAGE, NULL);
+ rpage = gtk_type_new (TYPE_RECURRENCE_PAGE);
if (!recurrence_page_construct (rpage)) {
- g_object_unref((rpage));
+ gtk_object_unref (GTK_OBJECT (rpage));
return NULL;
}
diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c
index 97029704a2..c0a3f5f8f9 100644
--- a/calendar/gui/dialogs/schedule-page.c
+++ b/calendar/gui/dialogs/schedule-page.c
@@ -30,7 +30,9 @@
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtkwindow.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
+#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-dialog-util.h>
#include <glade/glade.h>
#include <gal/e-table/e-cell-combo.h>
@@ -77,7 +79,7 @@ struct _SchedulePagePrivate {
static void schedule_page_class_init (SchedulePageClass *class);
static void schedule_page_init (SchedulePage *spage);
-static void schedule_page_finalize (GObject *object);
+static void schedule_page_destroy (GtkObject *object);
static GtkWidget *schedule_page_get_widget (CompEditorPage *page);
static void schedule_page_focus_main_widget (CompEditorPage *page);
@@ -99,21 +101,42 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #SchedulePage class.
**/
+GtkType
+schedule_page_get_type (void)
+{
+ static GtkType schedule_page_type;
+
+ if (!schedule_page_type) {
+ static const GtkTypeInfo schedule_page_info = {
+ "SchedulePage",
+ sizeof (SchedulePage),
+ sizeof (SchedulePageClass),
+ (GtkClassInitFunc) schedule_page_class_init,
+ (GtkObjectInitFunc) schedule_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ schedule_page_type =
+ gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &schedule_page_info);
+ }
-E_MAKE_TYPE (schedule_page, "SchedulePage", SchedulePage, schedule_page_class_init,
- schedule_page_init, TYPE_COMP_EDITOR_PAGE);
+ return schedule_page_type;
+}
/* Class initialization function for the schedule page */
static void
schedule_page_class_init (SchedulePageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref (TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = schedule_page_get_widget;
editor_page_class->focus_main_widget = schedule_page_focus_main_widget;
@@ -122,7 +145,7 @@ schedule_page_class_init (SchedulePageClass *class)
editor_page_class->set_summary = NULL;
editor_page_class->set_dates = schedule_page_set_dates;
- object_class->finalize = schedule_page_finalize;
+ object_class->destroy = schedule_page_destroy;
}
/* Object initialization function for the schedule page */
@@ -145,7 +168,7 @@ schedule_page_init (SchedulePage *spage)
/* Destroy handler for the schedule page */
static void
-schedule_page_finalize (GObject *object)
+schedule_page_destroy (GtkObject *object)
{
SchedulePage *spage;
SchedulePagePrivate *priv;
@@ -157,17 +180,17 @@ schedule_page_finalize (GObject *object)
priv = spage->priv;
if (priv->xml) {
- g_object_unref((priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
- g_object_unref((priv->model));
+ gtk_object_unref (GTK_OBJECT (priv->model));
g_free (priv);
spage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -362,14 +385,14 @@ get_widgets (SchedulePage *spage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
#undef GW
@@ -383,8 +406,8 @@ init_widgets (SchedulePage *spage)
priv = spage->priv;
- g_signal_connect((priv->sel),
- "changed", G_CALLBACK (times_changed_cb), spage);
+ gtk_signal_connect (GTK_OBJECT (priv->sel),
+ "changed", times_changed_cb, spage);
return TRUE;
@@ -409,7 +432,7 @@ schedule_page_construct (SchedulePage *spage, EMeetingModel *emm)
priv = spage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/schedule-page.glade", NULL, NULL);
+ "/schedule-page.glade", NULL);
if (!priv->xml) {
g_message ("schedule_page_construct(): "
"Could not load the Glade XML file!");
@@ -423,7 +446,7 @@ schedule_page_construct (SchedulePage *spage, EMeetingModel *emm)
}
/* Model */
- g_object_ref((emm));
+ gtk_object_ref (GTK_OBJECT (emm));
priv->model = emm;
/* Selector */
@@ -458,9 +481,9 @@ schedule_page_new (EMeetingModel *emm)
{
SchedulePage *spage;
- spage = g_object_new (TYPE_SCHEDULE_PAGE, NULL);
+ spage = gtk_type_new (TYPE_SCHEDULE_PAGE);
if (!schedule_page_construct (spage, emm)) {
- g_object_unref((spage));
+ gtk_object_unref (GTK_OBJECT (spage));
return NULL;
}
diff --git a/calendar/gui/dialogs/send-comp.c b/calendar/gui/dialogs/send-comp.c
index de89d607c2..7d9875133c 100644
--- a/calendar/gui/dialogs/send-comp.c
+++ b/calendar/gui/dialogs/send-comp.c
@@ -23,8 +23,10 @@
#endif
#include <glib.h>
-#include <gtk/gtkmessagedialog.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
+#include <libgnomeui/gnome-dialog.h>
+#include <libgnomeui/gnome-dialog-util.h>
#include <libgnomeui/gnome-uidefs.h>
#include <gal/widgets/e-unicode.h>
#include "send-comp.h"
@@ -45,7 +47,6 @@ send_component_dialog (CalClient *client, CalComponent *comp, gboolean new)
GtkWidget *dialog;
CalComponentVType vtype;
char *str;
- gint response;
if (cal_client_get_save_schedules (client))
return FALSE;
@@ -80,14 +81,9 @@ send_component_dialog (CalClient *client, CalComponent *comp, gboolean new)
return FALSE;
}
- dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_YES_NO, str);
+ dialog = gnome_question_dialog_modal (str, NULL, NULL);
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (response == GTK_RESPONSE_YES)
+ if (gnome_dialog_run (GNOME_DIALOG (dialog)) == GNOME_YES)
return TRUE;
else
return FALSE;
diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c
index 629443dba2..66cfc35c2c 100644
--- a/calendar/gui/dialogs/task-details-page.c
+++ b/calendar/gui/dialogs/task-details-page.c
@@ -27,6 +27,7 @@
#include <gtk/gtksignal.h>
#include <gtk/gtktogglebutton.h>
+#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <glade/glade.h>
#include <gal/widgets/e-unicode.h>
@@ -88,7 +89,7 @@ static const int priority_map[] = {
static void task_details_page_class_init (TaskDetailsPageClass *class);
static void task_details_page_init (TaskDetailsPage *tdpage);
-static void task_details_page_finalize (GObject *object);
+static void task_details_page_destroy (GtkObject *object);
static GtkWidget *task_details_page_get_widget (CompEditorPage *page);
static void task_details_page_focus_main_widget (CompEditorPage *page);
@@ -107,28 +108,49 @@ static CompEditorPageClass *parent_class = NULL;
*
* Return value: The type ID of the #TaskDetailsPage class.
**/
+GtkType
+task_details_page_get_type (void)
+{
+ static GtkType task_details_page_type;
+
+ if (!task_details_page_type) {
+ static const GtkTypeInfo task_details_page_info = {
+ "TaskDetailsPage",
+ sizeof (TaskDetailsPage),
+ sizeof (TaskDetailsPageClass),
+ (GtkClassInitFunc) task_details_page_class_init,
+ (GtkObjectInitFunc) task_details_page_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ task_details_page_type =
+ gtk_type_unique (TYPE_COMP_EDITOR_PAGE,
+ &task_details_page_info);
+ }
-E_MAKE_TYPE (task_details_page, "TaskDetailsPage", TaskDetailsPage, task_details_page_class_init,
- task_details_page_init, TYPE_COMP_EDITOR_PAGE);
+ return task_details_page_type;
+}
/* Class initialization function for the task page */
static void
task_details_page_class_init (TaskDetailsPageClass *class)
{
CompEditorPageClass *editor_page_class;
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
editor_page_class = (CompEditorPageClass *) class;
- object_class = (GObjectClass *) class;
+ object_class = (GtkObjectClass *) class;
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR_PAGE);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR_PAGE);
editor_page_class->get_widget = task_details_page_get_widget;
editor_page_class->focus_main_widget = task_details_page_focus_main_widget;
editor_page_class->fill_widgets = task_details_page_fill_widgets;
editor_page_class->fill_component = task_details_page_fill_component;
- object_class->finalize = task_details_page_finalize;
+ object_class->destroy = task_details_page_destroy;
}
/* Object initialization function for the task page */
@@ -158,7 +180,7 @@ task_details_page_init (TaskDetailsPage *tdpage)
/* Destroy handler for the task page */
static void
-task_details_page_finalize (GObject *object)
+task_details_page_destroy (GtkObject *object)
{
TaskDetailsPage *tdpage;
TaskDetailsPagePrivate *priv;
@@ -170,15 +192,15 @@ task_details_page_finalize (GObject *object)
priv = tdpage->priv;
if (priv->xml) {
- g_object_unref((priv->xml));
+ gtk_object_unref (GTK_OBJECT (priv->xml));
priv->xml = NULL;
}
g_free (priv);
tdpage->priv = NULL;
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
@@ -452,24 +474,22 @@ get_widgets (TaskDetailsPage *tdpage)
/* Get the GtkAccelGroup from the toplevel window, so we can install
it when the notebook page is mapped. */
toplevel = gtk_widget_get_toplevel (priv->main);
- accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel));
+ accel_groups = gtk_accel_groups_from_object (GTK_OBJECT (toplevel));
if (accel_groups) {
page->accel_group = accel_groups->data;
gtk_accel_group_ref (page->accel_group);
}
gtk_widget_ref (priv->main);
- gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main);
+ gtk_widget_unparent (priv->main);
priv->status = GW ("status");
priv->priority = GW ("priority");
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
@@ -643,7 +663,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));
}
@@ -665,26 +685,26 @@ init_widgets (TaskDetailsPage *tdpage)
/* Connect signals. The Status, Percent Complete & Date Completed
properties are closely related so whenever one changes we may need
to update the other 2. */
- g_signal_connect((GTK_OPTION_MENU (priv->status)->menu),
+ gtk_signal_connect (GTK_OBJECT (GTK_OPTION_MENU (priv->status)->menu),
"deactivate",
- G_CALLBACK (status_changed), tdpage);
+ GTK_SIGNAL_FUNC (status_changed), tdpage);
- g_signal_connect((GTK_SPIN_BUTTON (priv->percent_complete)->adjustment),
+ gtk_signal_connect (GTK_OBJECT (GTK_SPIN_BUTTON (priv->percent_complete)->adjustment),
"value_changed",
- G_CALLBACK (percent_complete_changed), tdpage);
+ GTK_SIGNAL_FUNC (percent_complete_changed), tdpage);
/* Priority */
- g_signal_connect((GTK_OPTION_MENU (priv->priority)->menu),
+ gtk_signal_connect (GTK_OBJECT (GTK_OPTION_MENU (priv->priority)->menu),
"deactivate",
- G_CALLBACK (field_changed_cb), tdpage);
+ GTK_SIGNAL_FUNC (field_changed_cb), tdpage);
/* Completed Date */
- g_signal_connect((priv->completed_date), "changed",
- G_CALLBACK (date_changed_cb), tdpage);
+ gtk_signal_connect (GTK_OBJECT (priv->completed_date), "changed",
+ GTK_SIGNAL_FUNC (date_changed_cb), tdpage);
/* URL */
- g_signal_connect((priv->url), "changed",
- G_CALLBACK (field_changed_cb), tdpage);
+ gtk_signal_connect (GTK_OBJECT (priv->url), "changed",
+ GTK_SIGNAL_FUNC (field_changed_cb), tdpage);
}
@@ -706,7 +726,7 @@ task_details_page_construct (TaskDetailsPage *tdpage)
priv = tdpage->priv;
priv->xml = glade_xml_new (EVOLUTION_GLADEDIR
- "/task-details-page.glade", NULL, NULL);
+ "/task-details-page.glade", NULL);
if (!priv->xml) {
g_message ("task_details_page_construct(): "
"Could not load the Glade XML file!");
@@ -737,9 +757,9 @@ task_details_page_new (void)
{
TaskDetailsPage *tdpage;
- tdpage = g_object_new (TYPE_TASK_DETAILS_PAGE, NULL);
+ tdpage = gtk_type_new (TYPE_TASK_DETAILS_PAGE);
if (!task_details_page_construct (tdpage)) {
- g_object_unref ((tdpage));
+ gtk_object_unref (GTK_OBJECT (tdpage));
return NULL;
}
diff --git a/calendar/gui/dialogs/task-details-page.glade b/calendar/gui/dialogs/task-details-page.glade
index fba510499d..28bf6a3bcc 100644
--- a/calendar/gui/dialogs/task-details-page.glade
+++ b/calendar/gui/dialogs/task-details-page.glade
@@ -1,382 +1,309 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+<?xml version="1.0"?>
+<GTK-Interface>
-<glade-interface>
+<project>
+ <name>task-details-page</name>
+ <program_name>task-details-page</program_name>
+ <directory></directory>
+ <source_directory>src</source_directory>
+ <pixmaps_directory>pixmaps</pixmaps_directory>
+ <language>C</language>
+ <gnome_support>True</gnome_support>
+ <gettext_support>True</gettext_support>
+</project>
-<widget class="GtkWindow" id="task-details-toplevel">
- <property name="title" translatable="yes">window1</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="resizable">True</property>
- <property name="destroy_with_parent">False</property>
+<widget>
+ <class>GtkWindow</class>
+ <name>task-details-toplevel</name>
+ <visible>False</visible>
+ <title>window1</title>
+ <type>GTK_WINDOW_TOPLEVEL</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
- <child>
- <widget class="GtkVBox" id="task-details-page">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
+ <widget>
+ <class>GtkVBox</class>
+ <name>task-details-page</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+ <widget>
+ <class>GtkFrame</class>
+ <name>frame2</name>
+ <label>Progress</label>
+ <label_xalign>0</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
- <widget class="GtkFrame" id="frame2">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <property name="label_yalign">0.5</property>
- <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">4</property>
-
- <child>
- <widget class="GtkLabel" id="label17">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Status:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">status</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="status">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget1">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Not Started</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">In Progress</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Completed</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Cancelled</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label18">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Priority:</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">priority</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkOptionMenu" id="priority">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="history">0</property>
-
- <child internal-child="menu">
- <widget class="GtkMenu" id="convertwidget7">
- <property name="visible">True</property>
-
- <child>
- <widget class="GtkMenuItem" id="convertwidget8">
- <property name="visible">True</property>
- <property name="label" translatable="yes">High</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
- <child>
- <widget class="GtkMenuItem" id="convertwidget9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Normal</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox1</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
- <child>
- <widget class="GtkMenuItem" id="convertwidget10">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Low</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox1</name>
+ <border_width>4</border_width>
+ <homogeneous>False</homogeneous>
+ <spacing>4</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkMenuItem" id="convertwidget11">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Undefined</property>
- <property name="use_underline">True</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label17</name>
+ <label>_Status:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>status</default_focus_target>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="label19">
- <property name="visible">True</property>
- <property name="label" translatable="yes">% Complete</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>status</name>
+ <can_focus>True</can_focus>
+ <items>Not Started
+In Progress
+Completed
+Cancelled
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkSpinButton" id="percent-complete">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">False</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label18</name>
+ <label>_Priority:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <default_focus_target>priority</default_focus_target>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkTable" id="table1">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">2</property>
- <property name="column_spacing">4</property>
+ <widget>
+ <class>GtkOptionMenu</class>
+ <name>priority</name>
+ <can_focus>True</can_focus>
+ <items>High
+Normal
+Low
+Undefined
+</items>
+ <initial_choice>0</initial_choice>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Date Completed:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label19</name>
+ <label>% Complete</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
- <child>
- <widget class="Custom" id="completed-date">
- <property name="visible">True</property>
- <property name="creation_function">task_details_page_create_date_edit</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 01 Jun 2001 18:58:51 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
+ <widget>
+ <class>GtkSpinButton</class>
+ <name>percent-complete</name>
+ <can_focus>True</can_focus>
+ <climb_rate>1</climb_rate>
+ <digits>0</digits>
+ <numeric>False</numeric>
+ <update_policy>GTK_UPDATE_ALWAYS</update_policy>
+ <snap>False</snap>
+ <wrap>False</wrap>
+ <value>1</value>
+ <lower>0</lower>
+ <upper>100</upper>
+ <step>1</step>
+ <page>10</page>
+ <page_size>10</page_size>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkTable</class>
+ <name>table1</name>
+ <border_width>4</border_width>
+ <rows>1</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>2</row_spacing>
+ <column_spacing>4</column_spacing>
<child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Progress</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
</child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>label12</name>
+ <label>Date Completed:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>Custom</class>
+ <name>completed-date</name>
+ <creation_function>task_details_page_create_date_edit</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Fri, 01 Jun 2001 18:58:51 GMT</last_modification_time>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
</widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
+ </widget>
+ </widget>
+ <widget>
+ <class>GtkTable</class>
+ <name>table2</name>
+ <border_width>4</border_width>
+ <rows>1</rows>
+ <columns>2</columns>
+ <homogeneous>False</homogeneous>
+ <row_spacing>2</row_spacing>
+ <column_spacing>4</column_spacing>
<child>
- <widget class="GtkTable" id="table2">
- <property name="border_width">4</property>
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">2</property>
- <property name="column_spacing">4</property>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
- <child>
- <widget class="GtkLabel" id="label14">
- <property name="visible">True</property>
- <property name="label" translatable="yes">URL:</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_CENTER</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
+ <widget>
+ <class>GtkLabel</class>
+ <name>label14</name>
+ <label>URL:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <child>
+ <left_attach>0</left_attach>
+ <right_attach>1</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>False</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>False</yfill>
+ </child>
+ </widget>
- <child>
- <widget class="Custom" id="url_entry">
- <property name="visible">True</property>
- <property name="creation_function">e_url_entry_new</property>
- <property name="int1">0</property>
- <property name="int2">0</property>
- <property name="last_modification_time">Fri, 08 Feb 2002 21:02:37 GMT</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
+ <widget>
+ <class>Custom</class>
+ <name>url_entry</name>
+ <creation_function>e_url_entry_new</creation_function>
+ <int1>0</int1>
+ <int2>0</int2>
+ <last_modification_time>Fri, 08 Feb 2002 21:02:37 GMT</last_modification_time>
+ <child>
+ <left_attach>1</left_attach>
+ <right_attach>2</right_attach>
+ <top_attach>0</top_attach>
+ <bottom_attach>1</bottom_attach>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ <xexpand>True</xexpand>
+ <yexpand>False</yexpand>
+ <xshrink>False</xshrink>
+ <yshrink>False</yshrink>
+ <xfill>True</xfill>
+ <yfill>True</yfill>
+ </child>
+ </widget>
</widget>
- </child>
+ </widget>
</widget>
-</glade-interface>
+</GTK-Interface>
diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c
index 0b2aee9827..051fe1c9b7 100644
--- a/calendar/gui/dialogs/task-editor.c
+++ b/calendar/gui/dialogs/task-editor.c
@@ -52,7 +52,7 @@ static void task_editor_class_init (TaskEditorClass *class);
static void task_editor_init (TaskEditor *te);
static void task_editor_edit_comp (CompEditor *editor, CalComponent *comp);
static gboolean task_editor_send_comp (CompEditor *editor, CalComponentItipMethod method);
-static void task_editor_finalize (GObject *object);
+static void task_editor_destroy (GtkObject *object);
static void assign_task_cmd (GtkWidget *widget, gpointer data);
static void refresh_task_cmd (GtkWidget *widget, gpointer data);
@@ -83,26 +83,46 @@ static CompEditorClass *parent_class;
*
* Return value: The type ID of the #TaskEditor class.
**/
+GtkType
+task_editor_get_type (void)
+{
+ static GtkType task_editor_type = 0;
+
+ if (!task_editor_type) {
+ static const GtkTypeInfo task_editor_info = {
+ "TaskEditor",
+ sizeof (TaskEditor),
+ sizeof (TaskEditorClass),
+ (GtkClassInitFunc) task_editor_class_init,
+ (GtkObjectInitFunc) task_editor_init,
+ NULL, /* reserved_1 */
+ NULL, /* reserved_2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ task_editor_type = gtk_type_unique (TYPE_COMP_EDITOR,
+ &task_editor_info);
+ }
-E_MAKE_TYPE (task_editor, "TaskEditor", TaskEditor, task_editor_class_init, task_editor_init,
- TYPE_COMP_EDITOR);
+ return task_editor_type;
+}
/* Class initialization function for the event editor */
static void
task_editor_class_init (TaskEditorClass *klass)
{
- GObjectClass *object_class;
+ GtkObjectClass *object_class;
CompEditorClass *editor_class;
- object_class = (GObjectClass *) klass;
+ object_class = (GtkObjectClass *) klass;
editor_class = (CompEditorClass *) klass;
- parent_class = g_type_class_ref(TYPE_COMP_EDITOR);
+ parent_class = gtk_type_class (TYPE_COMP_EDITOR);
editor_class->edit_comp = task_editor_edit_comp;
editor_class->send_comp = task_editor_send_comp;
- object_class->finalize = task_editor_finalize;
+ object_class->destroy = task_editor_destroy;
}
static void
@@ -151,12 +171,12 @@ init_widgets (TaskEditor *te)
priv = te->priv;
- g_signal_connect((priv->model), "model_row_changed",
- G_CALLBACK (model_row_changed_cb), te);
- g_signal_connect((priv->model), "model_rows_inserted",
- G_CALLBACK (row_count_changed_cb), te);
- g_signal_connect((priv->model), "model_rows_deleted",
- G_CALLBACK (row_count_changed_cb), te);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_row_changed",
+ GTK_SIGNAL_FUNC (model_row_changed_cb), te);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_rows_inserted",
+ GTK_SIGNAL_FUNC (row_count_changed_cb), te);
+ gtk_signal_connect (GTK_OBJECT (priv->model), "model_rows_deleted",
+ GTK_SIGNAL_FUNC (row_count_changed_cb), te);
}
/* Object initialization function for the task editor */
@@ -182,22 +202,16 @@ task_editor_construct (TaskEditor *te, CalClient *client)
priv = te->priv;
priv->task_page = task_page_new ();
- g_object_ref (priv->task_page);
- gtk_object_sink (GTK_OBJECT (priv->task_page));
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->task_page),
_("Basic"));
priv->task_details_page = task_details_page_new ();
- g_object_ref (priv->task_details_page);
- gtk_object_sink (GTK_OBJECT (priv->task_details_page));
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->task_details_page),
_("Details"));
priv->meet_page = meeting_page_new (priv->model, client);
- g_object_ref (priv->meet_page);
- gtk_object_sink (GTK_OBJECT (priv->meet_page));
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->meet_page),
_("Assignment"));
@@ -243,42 +257,50 @@ task_editor_edit_comp (CompEditor *editor, CalComponent *comp)
priv->assignment_shown = FALSE;
} else {
GSList *l;
+ GList *addresses, *ll;
int row;
-
- if (!priv->assignment_shown)
+
+ if (!priv->assignment_shown) {
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->meet_page),
_("Assignment"));
-
+ }
+
for (l = attendees; l != NULL; l = l->next) {
CalComponentAttendee *ca = l->data;
EMeetingAttendee *ia;
ia = E_MEETING_ATTENDEE (e_meeting_attendee_new_from_cal_component_attendee (ca));
- if (!comp_editor_get_user_org (editor))
- e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
- e_meeting_model_add_attendee (priv->model, ia);
+ if (!comp_editor_get_user_org (editor))
+ e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
+ e_meeting_model_add_attendee (priv->model, ia);
+
+ gtk_object_unref (GTK_OBJECT (ia));
+ }
- g_object_unref(ia);
+ addresses = itip_addresses_get ();
+ for (ll = addresses; ll != NULL; ll = ll->next) {
+ EMeetingAttendee *ia;
+ ItipAddress *a = ll->data;
+
+ ia = e_meeting_model_find_attendee (priv->model, a->address, &row);
+ if (ia != NULL)
+ e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
}
+ itip_addresses_free (addresses);
/* If we aren't the organizer we can still change our own status */
if (!comp_editor_get_user_org (editor)) {
- EAccountList *accounts;
- EAccount *account;
- EIterator *it;
-
- accounts = itip_addresses_get ();
- for (it = e_list_get_iterator((EList *)accounts);e_iterator_is_valid(it);e_iterator_next(it)) {
+ addresses = itip_addresses_get ();
+ for (ll = addresses; ll != NULL; ll = ll->next) {
EMeetingAttendee *ia;
-
- account = (EAccount*)e_iterator_get(it);
-
- ia = e_meeting_model_find_attendee (priv->model, account->id->address, &row);
+ ItipAddress *a = ll->data;
+
+ ia = e_meeting_model_find_attendee (priv->model, a->address, &row);
if (ia != NULL)
e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
}
- g_object_unref(it);
+ itip_addresses_free (addresses);
} else if (cal_client_get_organizer_must_attend (client)) {
EMeetingAttendee *ia;
@@ -286,8 +308,8 @@ task_editor_edit_comp (CompEditor *editor, CalComponent *comp)
if (ia != NULL)
e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
}
-
- priv->assignment_shown = TRUE;
+
+ priv->assignment_shown = TRUE;
}
cal_component_free_attendee_list (attendees);
@@ -318,7 +340,7 @@ task_editor_send_comp (CompEditor *editor, CalComponentItipMethod method)
client = e_meeting_model_get_cal_client (priv->model);
result = itip_send_comp (CAL_COMPONENT_METHOD_CANCEL, comp, client, NULL);
- g_object_unref((comp));
+ gtk_object_unref (GTK_OBJECT (comp));
if (!result)
return FALSE;
@@ -333,7 +355,7 @@ task_editor_send_comp (CompEditor *editor, CalComponentItipMethod method)
/* Destroy handler for the event editor */
static void
-task_editor_finalize (GObject *object)
+task_editor_destroy (GtkObject *object)
{
TaskEditor *te;
TaskEditorPrivate *priv;
@@ -344,14 +366,14 @@ task_editor_finalize (GObject *object)
te = TASK_EDITOR (object);
priv = te->priv;
- g_object_unref((priv->task_page));
- g_object_unref((priv->task_details_page));
- g_object_unref((priv->meet_page));
+ gtk_object_unref (GTK_OBJECT (priv->task_page));
+ gtk_object_unref (GTK_OBJECT (priv->task_details_page));
+ gtk_object_unref (GTK_OBJECT (priv->meet_page));
- g_object_unref((priv->model));
+ gtk_object_unref (GTK_OBJECT (priv->model));
- if (G_OBJECT_CLASS (parent_class)->finalize)
- (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
/**
@@ -368,7 +390,7 @@ task_editor_new (CalClient *client)
{
TaskEditor *te;
- te = g_object_new (TYPE_TASK_EDITOR, NULL);
+ te = TASK_EDITOR (gtk_type_new (TYPE_TASK_EDITOR));
return task_editor_construct (te, client);
}