aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-01-03 00:07:59 +0800
committerMilan Crha <mcrha@redhat.com>2012-01-03 00:07:59 +0800
commit4dc5558f19f96858ec2a97d82b23b6401ed74a0b (patch)
tree461df0416fabcaf872539cd650b0b3e8b7366b3a
parent49ffbb973093f15e4d5e34f287445f66a8d64e6d (diff)
downloadgsoc2013-evolution-4dc5558f19f96858ec2a97d82b23b6401ed74a0b.tar.gz
gsoc2013-evolution-4dc5558f19f96858ec2a97d82b23b6401ed74a0b.tar.zst
gsoc2013-evolution-4dc5558f19f96858ec2a97d82b23b6401ed74a0b.zip
Bug #353743 - Add Print button to meeting notification dialog
-rw-r--r--calendar/Makefile.am2
-rw-r--r--calendar/alarm-notify/Makefile.am (renamed from calendar/gui/alarm-notify/Makefile.am)1
-rw-r--r--calendar/alarm-notify/alarm-notify-dialog.c (renamed from calendar/gui/alarm-notify/alarm-notify-dialog.c)25
-rw-r--r--calendar/alarm-notify/alarm-notify-dialog.h (renamed from calendar/gui/alarm-notify/alarm-notify-dialog.h)1
-rw-r--r--calendar/alarm-notify/alarm-notify.c (renamed from calendar/gui/alarm-notify/alarm-notify.c)0
-rw-r--r--calendar/alarm-notify/alarm-notify.h (renamed from calendar/gui/alarm-notify/alarm-notify.h)0
-rw-r--r--calendar/alarm-notify/alarm-notify.ui (renamed from calendar/gui/alarm-notify/alarm-notify.ui)17
-rw-r--r--calendar/alarm-notify/alarm-queue.c (renamed from calendar/gui/alarm-notify/alarm-queue.c)18
-rw-r--r--calendar/alarm-notify/alarm-queue.h (renamed from calendar/gui/alarm-notify/alarm-queue.h)0
-rw-r--r--calendar/alarm-notify/alarm.c (renamed from calendar/gui/alarm-notify/alarm.c)0
-rw-r--r--calendar/alarm-notify/alarm.h (renamed from calendar/gui/alarm-notify/alarm.h)0
-rw-r--r--calendar/alarm-notify/config-data.c (renamed from calendar/gui/alarm-notify/config-data.c)0
-rw-r--r--calendar/alarm-notify/config-data.h (renamed from calendar/gui/alarm-notify/config-data.h)0
-rw-r--r--calendar/alarm-notify/evolution-alarm-notify-icon.rc (renamed from calendar/gui/alarm-notify/evolution-alarm-notify-icon.rc)0
-rw-r--r--calendar/alarm-notify/evolution-alarm-notify.ico (renamed from calendar/gui/alarm-notify/evolution-alarm-notify.ico)bin17542 -> 17542 bytes
-rw-r--r--calendar/alarm-notify/notify-main.c (renamed from calendar/gui/alarm-notify/notify-main.c)0
-rw-r--r--calendar/alarm-notify/util.c (renamed from calendar/gui/alarm-notify/util.c)0
-rw-r--r--calendar/alarm-notify/util.h (renamed from calendar/gui/alarm-notify/util.h)0
-rw-r--r--calendar/gui/Makefile.am2
-rw-r--r--configure.ac2
-rw-r--r--po/POTFILES.in8
21 files changed, 67 insertions, 9 deletions
diff --git a/calendar/Makefile.am b/calendar/Makefile.am
index 76bc20338d..4fe6165577 100644
--- a/calendar/Makefile.am
+++ b/calendar/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = importers gui
+SUBDIRS = importers gui alarm-notify
error_DATA = calendar.error
errordir = $(privdatadir)/errors
diff --git a/calendar/gui/alarm-notify/Makefile.am b/calendar/alarm-notify/Makefile.am
index 82fdeeb77e..59c918251e 100644
--- a/calendar/gui/alarm-notify/Makefile.am
+++ b/calendar/alarm-notify/Makefile.am
@@ -44,6 +44,7 @@ evolution_alarm_notify_SOURCES = \
evolution_alarm_notify_LDADD = \
$(top_builddir)/e-util/libeutil.la \
$(top_builddir)/widgets/misc/libemiscwidgets.la \
+ $(top_builddir)/calendar/gui/libevolution-calendar.la \
$(EVOLUTION_DATA_SERVER_LIBS) \
$(GNOME_PLATFORM_LIBS) \
$(LIBNOTIFY_LIBS) \
diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.c b/calendar/alarm-notify/alarm-notify-dialog.c
index 48d14f1a0f..c9a264d880 100644
--- a/calendar/gui/alarm-notify/alarm-notify-dialog.c
+++ b/calendar/alarm-notify/alarm-notify-dialog.c
@@ -69,6 +69,7 @@ typedef struct {
GtkWidget *snooze_time_days;
GtkWidget *snooze_btn;
GtkWidget *edit_btn;
+ GtkWidget *print_btn;
GtkWidget *dismiss_btn;
GtkWidget *minutes_label;
GtkWidget *hrs_label;
@@ -185,6 +186,24 @@ edit_pressed_cb (GtkButton *button,
(* funcinfo->func) (ALARM_NOTIFY_EDIT, -1, funcinfo->func_data);
}
+static void
+print_pressed_cb (GtkButton *button,
+ gpointer user_data)
+{
+ AlarmNotify *an = user_data;
+ AlarmFuncInfo *funcinfo = NULL;
+ GtkTreeIter iter;
+ GtkTreeModel *model = NULL;
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (an->treeview));
+
+ if (gtk_tree_selection_get_selected (selection, &model, &iter))
+ gtk_tree_model_get (model, &iter, ALARM_FUNCINFO_COLUMN, &funcinfo, -1);
+
+ g_return_if_fail (funcinfo);
+
+ (* funcinfo->func) (ALARM_NOTIFY_PRINT, -1, funcinfo->func_data);
+}
+
#define DEFAULT_SNOOZE_MINS 5
static void
@@ -291,11 +310,12 @@ notified_alarms_dialog_new (void)
an->treeview = e_builder_get_widget (an->builder, "appointments-treeview");
an->snooze_btn = e_builder_get_widget (an->builder, "snooze-button");
an->edit_btn = e_builder_get_widget (an->builder, "edit-button");
+ an->print_btn = e_builder_get_widget (an->builder, "print-button");
an->dismiss_btn = e_builder_get_widget (an->builder, "dismiss-button");
if (!(an->dialog && an->treeview
&& an->snooze_time_min && an->snooze_time_hrs && an->snooze_time_days
- && an->description && an->location && an->edit_btn && an->snooze_btn && an->dismiss_btn)) {
+ && an->description && an->location && an->edit_btn && an->print_btn && an->snooze_btn && an->dismiss_btn)) {
g_warning ("alarm_notify_dialog(): Could not find all widgets in alarm-notify.ui file!");
g_object_unref (an->builder);
g_free (an);
@@ -336,6 +356,7 @@ notified_alarms_dialog_new (void)
GTK_IMAGE (image), "stock_alarm", GTK_ICON_SIZE_DIALOG);
g_signal_connect (an->edit_btn, "clicked", G_CALLBACK (edit_pressed_cb), an);
+ g_signal_connect (an->print_btn, "clicked", G_CALLBACK (print_pressed_cb), an);
g_signal_connect (an->snooze_btn, "clicked", G_CALLBACK (snooze_pressed_cb), an);
g_signal_connect (an->dismiss_btn, "clicked", G_CALLBACK (dismiss_pressed_cb), an);
g_signal_connect (
@@ -463,6 +484,7 @@ tree_selection_changed_cb (GtkTreeSelection *selection,
gtk_widget_set_sensitive (an->snooze_btn, TRUE);
gtk_widget_set_sensitive (an->edit_btn, TRUE);
+ gtk_widget_set_sensitive (an->print_btn, TRUE);
gtk_widget_set_sensitive (an->dismiss_btn, TRUE);
gtk_tree_model_get (model, &iter, ALARM_SUMMARY_COLUMN, &summary, -1);
gtk_tree_model_get (model, &iter, ALARM_DESCRIPTION_COLUMN, &description, -1);
@@ -475,6 +497,7 @@ tree_selection_changed_cb (GtkTreeSelection *selection,
} else {
gtk_widget_set_sensitive (an->snooze_btn, FALSE);
gtk_widget_set_sensitive (an->edit_btn, FALSE);
+ gtk_widget_set_sensitive (an->print_btn, FALSE);
gtk_widget_set_sensitive (an->dismiss_btn, FALSE);
fill_in_labels (an, "", "", "", -1, -1);
diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.h b/calendar/alarm-notify/alarm-notify-dialog.h
index ad7db99432..f61bdba9c8 100644
--- a/calendar/gui/alarm-notify/alarm-notify-dialog.h
+++ b/calendar/alarm-notify/alarm-notify-dialog.h
@@ -31,6 +31,7 @@ typedef enum {
ALARM_NOTIFY_CLOSE,
ALARM_NOTIFY_SNOOZE,
ALARM_NOTIFY_EDIT,
+ ALARM_NOTIFY_PRINT,
ALARM_NOTIFY_DISMISS
} AlarmNotifyResult;
diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/alarm-notify/alarm-notify.c
index eeca88e1b6..eeca88e1b6 100644
--- a/calendar/gui/alarm-notify/alarm-notify.c
+++ b/calendar/alarm-notify/alarm-notify.c
diff --git a/calendar/gui/alarm-notify/alarm-notify.h b/calendar/alarm-notify/alarm-notify.h
index b48cd5a602..b48cd5a602 100644
--- a/calendar/gui/alarm-notify/alarm-notify.h
+++ b/calendar/alarm-notify/alarm-notify.h
diff --git a/calendar/gui/alarm-notify/alarm-notify.ui b/calendar/alarm-notify/alarm-notify.ui
index bb418ab569..acfdf5cd64 100644
--- a/calendar/gui/alarm-notify/alarm-notify.ui
+++ b/calendar/alarm-notify/alarm-notify.ui
@@ -132,6 +132,21 @@
</packing>
</child>
<child>
+ <object class="GtkButton" id="print-button">
+ <property name="label">gtk-print</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkButton" id="dismiss-button">
<property name="label" translatable="yes">_Dismiss</property>
<property name="visible">True</property>
@@ -143,7 +158,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
</object>
diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/alarm-notify/alarm-queue.c
index 8a4ae2face..f7597338a7 100644
--- a/calendar/gui/alarm-notify/alarm-queue.c
+++ b/calendar/alarm-notify/alarm-queue.c
@@ -49,6 +49,8 @@
#include "config-data.h"
#include "util.h"
+#include "calendar/gui/print.h"
+
/* The dialog with alarm nofications */
static AlarmNotificationsDialog *alarm_notifications_dialog = NULL;
@@ -1050,6 +1052,17 @@ edit_component (ECalClient *cal_client,
g_free (command_line);
}
+static void
+print_component (ECalClient *cal_client,
+ ECalComponent *comp)
+{
+ print_comp (comp,
+ cal_client,
+ config_data_get_timezone (),
+ config_data_get_24_hour_format (),
+ GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG);
+}
+
typedef struct {
gchar *summary;
gchar *description;
@@ -1355,6 +1368,11 @@ notify_dialog_cb (AlarmNotifyResult result,
break;
+ case ALARM_NOTIFY_PRINT:
+ print_component (tray_data->cal_client, tray_data->comp);
+
+ break;
+
case ALARM_NOTIFY_DISMISS:
if (alarm_notifications_dialog) {
GtkTreeModel *model;
diff --git a/calendar/gui/alarm-notify/alarm-queue.h b/calendar/alarm-notify/alarm-queue.h
index e43027bd60..e43027bd60 100644
--- a/calendar/gui/alarm-notify/alarm-queue.h
+++ b/calendar/alarm-notify/alarm-queue.h
diff --git a/calendar/gui/alarm-notify/alarm.c b/calendar/alarm-notify/alarm.c
index 2797d44b0a..2797d44b0a 100644
--- a/calendar/gui/alarm-notify/alarm.c
+++ b/calendar/alarm-notify/alarm.c
diff --git a/calendar/gui/alarm-notify/alarm.h b/calendar/alarm-notify/alarm.h
index d6e9ff4a4e..d6e9ff4a4e 100644
--- a/calendar/gui/alarm-notify/alarm.h
+++ b/calendar/alarm-notify/alarm.h
diff --git a/calendar/gui/alarm-notify/config-data.c b/calendar/alarm-notify/config-data.c
index c8348f89fc..c8348f89fc 100644
--- a/calendar/gui/alarm-notify/config-data.c
+++ b/calendar/alarm-notify/config-data.c
diff --git a/calendar/gui/alarm-notify/config-data.h b/calendar/alarm-notify/config-data.h
index a7a0ca58e0..a7a0ca58e0 100644
--- a/calendar/gui/alarm-notify/config-data.h
+++ b/calendar/alarm-notify/config-data.h
diff --git a/calendar/gui/alarm-notify/evolution-alarm-notify-icon.rc b/calendar/alarm-notify/evolution-alarm-notify-icon.rc
index 1f9ef65874..1f9ef65874 100644
--- a/calendar/gui/alarm-notify/evolution-alarm-notify-icon.rc
+++ b/calendar/alarm-notify/evolution-alarm-notify-icon.rc
diff --git a/calendar/gui/alarm-notify/evolution-alarm-notify.ico b/calendar/alarm-notify/evolution-alarm-notify.ico
index 6585452256..6585452256 100644
--- a/calendar/gui/alarm-notify/evolution-alarm-notify.ico
+++ b/calendar/alarm-notify/evolution-alarm-notify.ico
Binary files differ
diff --git a/calendar/gui/alarm-notify/notify-main.c b/calendar/alarm-notify/notify-main.c
index a6d9d53fc5..a6d9d53fc5 100644
--- a/calendar/gui/alarm-notify/notify-main.c
+++ b/calendar/alarm-notify/notify-main.c
diff --git a/calendar/gui/alarm-notify/util.c b/calendar/alarm-notify/util.c
index 891ea131bc..891ea131bc 100644
--- a/calendar/gui/alarm-notify/util.c
+++ b/calendar/alarm-notify/util.c
diff --git a/calendar/gui/alarm-notify/util.h b/calendar/alarm-notify/util.h
index bb6935729a..bb6935729a 100644
--- a/calendar/gui/alarm-notify/util.h
+++ b/calendar/alarm-notify/util.h
diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am
index ce1f832ba3..a5f9a7013d 100644
--- a/calendar/gui/Makefile.am
+++ b/calendar/gui/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = alarm-notify dialogs
+SUBDIRS = dialogs
privsolib_LTLIBRARIES = libevolution-calendar.la
diff --git a/configure.ac b/configure.ac
index a0101c6410..ce88950d6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1636,9 +1636,9 @@ widgets/misc/Makefile
widgets/text/Makefile
widgets/table/Makefile
calendar/Makefile
+calendar/alarm-notify/Makefile
calendar/importers/Makefile
calendar/gui/Makefile
-calendar/gui/alarm-notify/Makefile
calendar/gui/dialogs/Makefile
composer/Makefile
m4/Makefile
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 36bf948e96..4ffe4684c9 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -36,11 +36,11 @@ addressbook/printing/test-print.c
addressbook/tools/evolution-addressbook-export.c
addressbook/tools/evolution-addressbook-export-list-cards.c
addressbook/tools/evolution-addressbook-export-list-folders.c
+calendar/alarm-notify/alarm-notify-dialog.c
+[type: gettext/glade]calendar/alarm-notify/alarm-notify.ui
+calendar/alarm-notify/alarm-queue.c
+calendar/alarm-notify/util.c
calendar/calendar.error.xml
-calendar/gui/alarm-notify/alarm-notify-dialog.c
-[type: gettext/glade]calendar/gui/alarm-notify/alarm-notify.ui
-calendar/gui/alarm-notify/alarm-queue.c
-calendar/gui/alarm-notify/util.c
calendar/gui/calendar-view-factory.c
calendar/gui/caltypes.xml
calendar/gui/dialogs/alarm-dialog.c