aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-04-28 04:14:17 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-04-28 04:14:17 +0800
commitd06ca412e46d6b4fc2ecd3e1e956b1e8970c8867 (patch)
tree2eaedffbdd5111f8798e1c91d329a9df6deda4ed
parentf413877346367b10d2158e21c249b958d36b94f0 (diff)
downloadgsoc2013-evolution-d06ca412e46d6b4fc2ecd3e1e956b1e8970c8867.tar
gsoc2013-evolution-d06ca412e46d6b4fc2ecd3e1e956b1e8970c8867.tar.gz
gsoc2013-evolution-d06ca412e46d6b4fc2ecd3e1e956b1e8970c8867.tar.bz2
gsoc2013-evolution-d06ca412e46d6b4fc2ecd3e1e956b1e8970c8867.tar.lz
gsoc2013-evolution-d06ca412e46d6b4fc2ecd3e1e956b1e8970c8867.tar.xz
gsoc2013-evolution-d06ca412e46d6b4fc2ecd3e1e956b1e8970c8867.tar.zst
gsoc2013-evolution-d06ca412e46d6b4fc2ecd3e1e956b1e8970c8867.zip
remove hardcoded values (edit_attendee): ditto, and there are only 4 roles
2001-04-27 JP Rosevear <jpr@ximian.com> * gui/e-meeting-edit.c (put_property_in_list): remove hardcoded values (edit_attendee): ditto, and there are only 4 roles now * gui/e-meeting-dialog.glade: tweak * gui/itip-utils.c: There shouldn't be an "other" role svn path=/trunk/; revision=9616
-rw-r--r--calendar/ChangeLog10
-rw-r--r--calendar/gui/e-meeting-dialog.glade10
-rw-r--r--calendar/gui/e-meeting-edit.c42
-rw-r--r--calendar/gui/itip-utils.c3
4 files changed, 38 insertions, 27 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 03a6447978..2dd696c344 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,13 @@
+2001-04-27 JP Rosevear <jpr@ximian.com>
+
+ * gui/e-meeting-edit.c (put_property_in_list): remove hardcoded
+ values
+ (edit_attendee): ditto, and there are only 4 roles now
+
+ * gui/e-meeting-dialog.glade: tweak
+
+ * gui/itip-utils.c: There shouldn't be an "other" role
+
2001-04-26 JP Rosevear <jpr@ximian.com>
* gui/e-meeting-edit.c (edit_attendee): use enums not hard code
diff --git a/calendar/gui/e-meeting-dialog.glade b/calendar/gui/e-meeting-dialog.glade
index 5b9a057f46..3ec30d19e9 100644
--- a/calendar/gui/e-meeting-dialog.glade
+++ b/calendar/gui/e-meeting-dialog.glade
@@ -201,6 +201,7 @@ Time</label>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Add</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
@@ -209,6 +210,7 @@ Time</label>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Delete</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
@@ -217,6 +219,7 @@ Time</label>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Edit</label>
+ <relief>GTK_RELIEF_NORMAL</relief>
</widget>
</widget>
</widget>
@@ -438,8 +441,8 @@ Time</label>
<class>GtkCombo</class>
<name>role_combo</name>
<width>160</width>
- <value_in_list>False</value_in_list>
- <ok_if_empty>True</ok_if_empty>
+ <value_in_list>True</value_in_list>
+ <ok_if_empty>False</ok_if_empty>
<case_sensitive>False</case_sensitive>
<use_arrows>True</use_arrows>
<use_arrows_always>False</use_arrows_always>
@@ -447,7 +450,6 @@ Time</label>
Required Participant
Optional Participant
Non-Participant
-Other
</items>
@@ -465,7 +467,7 @@ Other
<editable>False</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
- <text>Required Participant</text>
+ <text>Chair</text>
</widget>
</widget>
diff --git a/calendar/gui/e-meeting-edit.c b/calendar/gui/e-meeting-edit.c
index 9aac1f6b83..4cf0296954 100644
--- a/calendar/gui/e-meeting-edit.c
+++ b/calendar/gui/e-meeting-edit.c
@@ -156,7 +156,8 @@ put_property_in_list (icalproperty *prop, gint rownum, gpointer data)
gchar *text, *new_text;
icalparameter *param;
icalvalue *value;
- gint enumval;
+ icalparameter_role role_val;
+ icalparameter_partstat part_val;
gint cntr;
EMeetingEditorPrivate *priv;
@@ -185,15 +186,14 @@ put_property_in_list (icalproperty *prop, gint rownum, gpointer data)
icalproperty_add_parameter (prop, param);
}
- enumval = icalparameter_get_role (param);
- if (enumval < 0 || enumval > 4)
- enumval = 4;
-
- row_text[ROLE_COL] = role_values [enumval];
+ role_val = icalparameter_get_role (param);
+ if (role_val < ICAL_ROLE_CHAIR || role_val > ICAL_ROLE_NONPARTICIPANT)
+ role_val = ICAL_ROLE_REQPARTICIPANT;
+ row_text[ROLE_COL] = role_values[role_val - ICAL_ROLE_CHAIR];
param = get_icalparam_by_type (prop, ICAL_RSVP_PARAMETER);
if (param == NULL) {
- param = icalparameter_new_rsvp (TRUE);
+ param = icalparameter_new_rsvp (ICAL_RSVP_TRUE);
icalproperty_add_parameter (prop, param);
}
@@ -208,12 +208,10 @@ put_property_in_list (icalproperty *prop, gint rownum, gpointer data)
icalproperty_add_parameter (prop, param);
}
- enumval = icalparameter_get_partstat (param);
- if (enumval < 0 || enumval > 7) {
- enumval = 7;
- }
-
- row_text[STATUS_COL] = partstat_values [enumval];
+ part_val = icalparameter_get_partstat (param);
+ if (part_val < ICAL_PARTSTAT_NEEDSACTION || part_val > ICAL_PARTSTAT_INPROCESS)
+ part_val = ICAL_PARTSTAT_NEEDSACTION;
+ row_text[STATUS_COL] = partstat_values [part_val - ICAL_PARTSTAT_NEEDSACTION];
if (rownum < 0) {
gtk_clist_append (GTK_CLIST (priv->attendee_list), row_text);
@@ -252,7 +250,7 @@ edit_attendee (icalproperty *prop, gpointer data)
icalvalue *value;
gchar buffer[200];
gint cntr;
- gint enumval;
+ icalparameter_role role_val;
gboolean retval;
priv = (EMeetingEditorPrivate *) ((EMeetingEditor *)data)->priv;
@@ -296,11 +294,11 @@ edit_attendee (icalproperty *prop, gpointer data)
param = get_icalparam_by_type (prop, ICAL_ROLE_PARAMETER);
- enumval = icalparameter_get_role (param);
- if (enumval < 0 || enumval > 4)
- enumval = 4;
+ role_val = icalparameter_get_role (param);
+ if (role_val < ICAL_ROLE_CHAIR || role_val > ICAL_ROLE_NONPARTICIPANT)
+ role_val = ICAL_ROLE_REQPARTICIPANT;
- text = role_values [enumval];
+ text = role_values [role_val - ICAL_ROLE_CHAIR];
gtk_entry_set_text (GTK_ENTRY (priv->role_entry), text);
param = get_icalparam_by_type (prop, ICAL_RSVP_PARAMETER);
@@ -325,7 +323,7 @@ edit_attendee (icalproperty *prop, gpointer data)
param = NULL;
text = gtk_entry_get_text (GTK_ENTRY(priv->role_entry));
- for (cntr = 0; cntr < 5; cntr++) {
+ for (cntr = 0; cntr < 4; cntr++) {
if (strncmp (text, role_values[cntr], 3) == 0) {
param = icalparameter_new_role (ICAL_ROLE_CHAIR + cntr);
break;
@@ -343,8 +341,10 @@ edit_attendee (icalproperty *prop, gpointer data)
/* Now the RSVP. */
icalproperty_remove_parameter (prop, ICAL_RSVP_PARAMETER);
- param = icalparameter_new_rsvp
- (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->rsvp_check)));
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->rsvp_check)))
+ param = icalparameter_new_rsvp (ICAL_RSVP_TRUE);
+ else
+ param = icalparameter_new_rsvp (ICAL_RSVP_FALSE);
icalproperty_add_parameter (prop, param);
retval = TRUE;
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index f090f051d6..5bf442dec9 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -25,8 +25,7 @@ gchar *role_values[] = {
"Chair",
"Required Participant",
"Optional Participant",
- "Non-Participant",
- "Other"
+ "Non-Participant"
};