aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/task-editor.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-08-10 07:08:33 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-08-10 07:08:33 +0800
commit8ff06a283d19aa223c2d0bc0d55335eb221f7ff1 (patch)
treee8c5f4287cc15fe3c6f4fc8085e956feab645266 /calendar/gui/dialogs/task-editor.c
parenta1dbf7e2b8b79455eedec53cc9f2221e97215a9f (diff)
downloadgsoc2013-evolution-8ff06a283d19aa223c2d0bc0d55335eb221f7ff1.tar
gsoc2013-evolution-8ff06a283d19aa223c2d0bc0d55335eb221f7ff1.tar.gz
gsoc2013-evolution-8ff06a283d19aa223c2d0bc0d55335eb221f7ff1.tar.bz2
gsoc2013-evolution-8ff06a283d19aa223c2d0bc0d55335eb221f7ff1.tar.lz
gsoc2013-evolution-8ff06a283d19aa223c2d0bc0d55335eb221f7ff1.tar.xz
gsoc2013-evolution-8ff06a283d19aa223c2d0bc0d55335eb221f7ff1.tar.zst
gsoc2013-evolution-8ff06a283d19aa223c2d0bc0d55335eb221f7ff1.zip
Remove progress frame
2001-08-09 JP Rosevear <jpr@ximian.com> * gui/dialogs/task-page.*: Remove progress frame * gui/dialogs/task-details-page.*: Put in progress frame, remove basics frame * gui/dialogs/task-editor.c (set_menu_sens): util function to set menu sensitivity based on state (task_editor_init): add meeting page (task_editor_edit_comp): show page if necessary (task_editor_destroy): unref meeting page (assign_task_cmd): bring up meeting page (refresh_task_cmd): save before sending (forward_cmd): ditto * gui/dialogs/comp-editor.c (save_cmd): implement new save command svn path=/trunk/; revision=11846
Diffstat (limited to 'calendar/gui/dialogs/task-editor.c')
-rw-r--r--calendar/gui/dialogs/task-editor.c68
1 files changed, 55 insertions, 13 deletions
diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c
index 6e5a6f689e..22b89e5ce5 100644
--- a/calendar/gui/dialogs/task-editor.c
+++ b/calendar/gui/dialogs/task-editor.c
@@ -32,13 +32,16 @@
#include "task-page.h"
#include "task-details-page.h"
-#include "recurrence-page.h"
+#include "meeting-page.h"
#include "cancel-comp.h"
#include "task-editor.h"
struct _TaskEditorPrivate {
TaskPage *task_page;
TaskDetailsPage *task_details_page;
+ MeetingPage *meet_page;
+
+ gboolean meeting_shown;
};
@@ -48,13 +51,13 @@ static void task_editor_init (TaskEditor *te);
static void task_editor_edit_comp (CompEditor *editor, CalComponent *comp);
static void task_editor_destroy (GtkObject *object);
-static void delegate_task_cmd (GtkWidget *widget, gpointer data);
+static void assign_task_cmd (GtkWidget *widget, gpointer data);
static void refresh_task_cmd (GtkWidget *widget, gpointer data);
static void cancel_task_cmd (GtkWidget *widget, gpointer data);
static void forward_cmd (GtkWidget *widget, gpointer data);
static BonoboUIVerb verbs [] = {
- BONOBO_UI_UNSAFE_VERB ("ActionDelegateTask", delegate_task_cmd),
+ BONOBO_UI_UNSAFE_VERB ("ActionAssignTask", assign_task_cmd),
BONOBO_UI_UNSAFE_VERB ("ActionRefreshTask", refresh_task_cmd),
BONOBO_UI_UNSAFE_VERB ("ActionCancelTask", cancel_task_cmd),
BONOBO_UI_UNSAFE_VERB ("ActionForward", forward_cmd),
@@ -115,6 +118,24 @@ task_editor_class_init (TaskEditorClass *klass)
object_class->destroy = task_editor_destroy;
}
+static void
+set_menu_sens (TaskEditor *te)
+{
+ TaskEditorPrivate *priv;
+
+ priv = te->priv;
+
+ comp_editor_set_ui_prop (COMP_EDITOR (te),
+ "/commands/ActionAssignTask",
+ "sensitive", priv->meeting_shown ? "0" : "1");
+ comp_editor_set_ui_prop (COMP_EDITOR (te),
+ "/commands/ActionRefreshTask",
+ "sensitive", priv->meeting_shown ? "1" : "0");
+ comp_editor_set_ui_prop (COMP_EDITOR (te),
+ "/commands/ActionCancelTask",
+ "sensitive", priv->meeting_shown ? "1" : "0");
+}
+
/* Object initialization function for the event editor */
static void
task_editor_init (TaskEditor *te)
@@ -127,16 +148,24 @@ task_editor_init (TaskEditor *te)
priv->task_page = task_page_new ();
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->task_page),
- _("Task"));
+ _("Basic"));
priv->task_details_page = task_details_page_new ();
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->task_details_page),
_("Details"));
+ priv->meet_page = meeting_page_new ();
+ comp_editor_append_page (COMP_EDITOR (te),
+ COMP_EDITOR_PAGE (priv->meet_page),
+ _("Assignment"));
+
comp_editor_merge_ui (COMP_EDITOR (te), EVOLUTION_DATADIR
"/gnome/ui/evolution-task-editor.xml",
verbs);
+
+ priv->meeting_shown = TRUE;
+ set_menu_sens (te);
}
static void
@@ -148,12 +177,13 @@ task_editor_edit_comp (CompEditor *editor, CalComponent *comp)
te = TASK_EDITOR (editor);
priv = te->priv;
-
+
cal_component_get_attendee_list (comp, &attendees);
- if (attendees == NULL)
- task_details_page_show_delegation (priv->task_details_page, FALSE);
- else
- task_details_page_show_delegation (priv->task_details_page, TRUE);
+ if (attendees == NULL) {
+ comp_editor_remove_page (editor, COMP_EDITOR_PAGE (priv->meet_page));
+ priv->meeting_shown = FALSE;
+ set_menu_sens (te);
+ }
cal_component_free_attendee_list (attendees);
if (parent_class->edit_comp)
@@ -175,6 +205,7 @@ task_editor_destroy (GtkObject *object)
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));
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
@@ -195,23 +226,31 @@ task_editor_new (void)
}
static void
-delegate_task_cmd (GtkWidget *widget, gpointer data)
+assign_task_cmd (GtkWidget *widget, gpointer data)
{
TaskEditor *te = TASK_EDITOR (data);
TaskEditorPrivate *priv;
priv = te->priv;
- task_details_page_show_delegation (priv->task_details_page, TRUE);
+ if (!priv->meeting_shown) {
+ comp_editor_append_page (COMP_EDITOR (te),
+ COMP_EDITOR_PAGE (priv->meet_page),
+ _("Assignment"));
+ priv->meeting_shown = TRUE;
+ set_menu_sens (te);
+ }
+
comp_editor_show_page (COMP_EDITOR (te),
- COMP_EDITOR_PAGE (priv->task_details_page));
+ COMP_EDITOR_PAGE (priv->meet_page));
}
static void
refresh_task_cmd (GtkWidget *widget, gpointer data)
{
TaskEditor *te = TASK_EDITOR (data);
-
+
+ comp_editor_save_comp (COMP_EDITOR (te));
comp_editor_send_comp (COMP_EDITOR (te), CAL_COMPONENT_METHOD_REFRESH);
}
@@ -233,5 +272,8 @@ forward_cmd (GtkWidget *widget, gpointer data)
{
TaskEditor *te = TASK_EDITOR (data);
+ comp_editor_save_comp (COMP_EDITOR (te));
comp_editor_send_comp (COMP_EDITOR (te), CAL_COMPONENT_METHOD_PUBLISH);
}
+
+