evolution/calendar-sendbutton.patch

141 lines
5.6 KiB
Diff

=== modified file 'calendar/gui/dialogs/comp-editor.c'
--- calendar/gui/dialogs/comp-editor.c 2007-12-18 20:23:31 +0000
+++ calendar/gui/dialogs/comp-editor.c 2007-12-18 20:33:31 +0000
@@ -880,8 +880,8 @@
if (!save_comp (editor))
return FALSE;
- if ((delegate && !e_cal_get_save_schedules (priv->client)) || (send && send_component_dialog ((GtkWindow *) editor, priv->client, priv->comp, !priv->existing_org))) {
- if ((itip_organizer_is_user (priv->comp, priv->client) || itip_sentby_is_user (priv->comp))) {
+ if ((delegate && !e_cal_get_save_schedules (priv->client)) || send) {
+ if (itip_organizer_is_user (priv->comp, priv->client)) {
if (e_cal_component_get_vtype (priv->comp) == E_CAL_COMPONENT_JOURNAL)
return comp_editor_send_comp (editor, E_CAL_COMPONENT_METHOD_PUBLISH);
else
@@ -1476,6 +1476,7 @@
static BonoboUIVerb verbs [] = {
BONOBO_UI_VERB ("FileSave", menu_file_save_cb),
+ BONOBO_UI_VERB ("FileSend", menu_file_save_cb),
BONOBO_UI_VERB ("CalendarPrint", menu_file_print_cb),
BONOBO_UI_VERB ("CalendarPrintPreview", menu_file_print_preview_cb),
BONOBO_UI_VERB ("FileClose", menu_file_close_cb),
@@ -1503,6 +1504,7 @@
E_PIXMAP ("/Toolbar/FileSave", "document-save", E_ICON_SIZE_LARGE_TOOLBAR),
E_PIXMAP ("/Toolbar/FileClose", "window-close", E_ICON_SIZE_LARGE_TOOLBAR),
E_PIXMAP ("/Toolbar/InsertAttachments", "mail-attachment", E_ICON_SIZE_LARGE_TOOLBAR),
+ E_PIXMAP ("/Toolbar/FileSend", "stock_mail-send", E_ICON_SIZE_LARGE_TOOLBAR),
E_PIXMAP_END
};
@@ -1634,6 +1636,9 @@
bonobo_ui_component_thaw (editor->uic, NULL);
bonobo_ui_component_set_prop (editor->uic, "/commands/FileSave", "sensitive", "0", NULL);
+ bonobo_ui_component_set_prop (editor->uic, "/commands/FileSend", "sensitive", "0", NULL);
+
+ bonobo_ui_component_set_prop (editor->uic, "/commands/FileSend", "hidden", "1", NULL);
/* DND support */
gtk_drag_dest_set (GTK_WIDGET (editor), GTK_DEST_DEFAULT_ALL, drop_types, num_drop_types, GDK_ACTION_COPY|GDK_ACTION_ASK|GDK_ACTION_MOVE);
@@ -1859,9 +1864,10 @@
priv = editor->priv;
priv->changed = changed;
-
+ bonobo_ui_component_set_prop (editor->uic, "/commands/FileSend", "sensitive", changed ? "1" : "0"
+ , NULL);
bonobo_ui_component_set_prop (editor->uic, "/commands/FileSave", "sensitive", changed ? "1" : "0"
- , NULL);
+ , NULL);
}
/**
@@ -1927,6 +1933,11 @@
priv = editor->priv;
priv->needs_send = needs_send;
+ if (needs_send) {
+ bonobo_ui_component_set_prop (editor->uic, "/commands/FileSave", "hidden", "1", NULL);
+ bonobo_ui_component_set_prop (editor->uic, "/commands/FileSend", "hidden", "0", NULL);
+ }
+
}
/**
=== modified file 'calendar/gui/dialogs/comp-editor.h'
--- calendar/gui/dialogs/comp-editor.h 2007-12-18 20:23:31 +0000
+++ calendar/gui/dialogs/comp-editor.h 2007-12-18 20:33:31 +0000
@@ -53,9 +53,9 @@
BonoboWindowClass parent_class;
/* Virtual functions */
+ void (* object_created) (CompEditor *page);
void (* set_e_cal) (CompEditor *page, ECal *client);
void (* edit_comp) (CompEditor *page, ECalComponent *comp);
- void (* object_created) (CompEditor *page);
gboolean (* send_comp) (CompEditor *page, ECalComponentItipMethod method);
} CompEditorClass;
=== modified file 'calendar/gui/dialogs/event-editor.c'
--- calendar/gui/dialogs/event-editor.c 2007-12-18 20:23:31 +0000
+++ calendar/gui/dialogs/event-editor.c 2007-12-18 20:33:31 +0000
@@ -619,7 +619,8 @@
if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS))
event_page_show_options (priv->event_page);
-
+
+ comp_editor_set_needs_send (COMP_EDITOR (ee), TRUE);
comp_editor_set_group_item (COMP_EDITOR (ee), TRUE);
if (!((flags & COMP_EDITOR_USER_ORG) || (flags & COMP_EDITOR_DELEGATE)|| (flags & COMP_EDITOR_NEW_ITEM)))
bonobo_ui_component_set_prop (editor->uic, "/commands/ActionFreeBusy", "hidden", "1", NULL);
=== modified file 'calendar/gui/dialogs/task-editor.c'
--- calendar/gui/dialogs/task-editor.c 2007-12-18 20:23:31 +0000
+++ calendar/gui/dialogs/task-editor.c 2007-12-18 20:33:31 +0000
@@ -446,6 +446,9 @@
read_only = TRUE;
if (priv->is_assigned) {
+
+ comp_editor_set_needs_send (COMP_EDITOR (te), TRUE);
+
if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS))
task_page_show_options (priv->task_page);
=== modified file 'ui/evolution-editor.xml'
--- ui/evolution-editor.xml 2007-12-18 20:23:31 +0000
+++ ui/evolution-editor.xml 2007-12-18 20:33:31 +0000
@@ -1,6 +1,7 @@
<Root>
<commands>
<cmd name="FileSave" _tip="Click here to save the current window" accel="*Control*s" pixtype="pixbuf"/>
+ <cmd name="FileSend" _tip="Click here to send" accel="*Control*s" pixtype="pixbuf" />
<cmd name="FileClose" _tip="Click here to close the current window" accel="*Control*w" pixtype="pixbuf"/>
<cmd name="EditCut" _tip="Cut selected text to the clipboard" accel="*Control*x" pixtype="pixbuf"/>
@@ -18,6 +19,8 @@
<submenu name="File" _label="_File">
<placeholder name="FileOps">
<menuitem name="FileSave" verb="" _label="_Save"/>
+ <menuitem name="FileSend" verb="" _label="_Send"/>
+
</placeholder>
<placeholder name="FileWindow">
<menuitem name="FileClose" verb="" _label="_Close"/>
@@ -53,7 +56,8 @@
<dockitem name="Toolbar">
- <toolitem name="FileSave" verb="" _label="Save" pixtype="pixbuf"/>
+ <toolitem name="FileSave" verb="" _label="Save"/>
+ <toolitem name="FileSend" verb="" _label="Send" pixtype="pixbuf"/>
<toolitem name="FileClose" verb="" _label="Close" pixtype="pixbuf"/>
<separator f="" name="editor1"/>