]> www.infradead.org Git - pidgin-chime.git/commitdiff
Make evo plugin work with new evo
authorDavid Woodhouse <dwmw@amazon.co.uk>
Sun, 24 Sep 2017 19:40:43 +0000 (20:40 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Sun, 24 Sep 2017 19:40:43 +0000 (20:40 +0100)
configure.ac
evolution-plugin/event-from-template.c

index e0d6dca855f36fb5fc901986efbcf43b8c02a12d..8e6a682288aab4c9c36408792f31d3be5263e23a 100644 (file)
@@ -70,6 +70,9 @@ fi
 build_evoplugin=
 PKG_CHECK_MODULES(EVOLUTION, [evolution-calendar-3.0 evolution-shell-3.0 evolution-data-server-1.2 libebook-1.2 libecal-1.2],
                  [build_evoplugin=yes
+                  if $PKG_CONFIG --atleast-version 3.20 evolution-shell-3.0; then
+                     AC_DEFINE(EVO_HAS_E_COMP_EDITOR, 1, [Since 3.20])
+                  fi
                   evomoddir="$($PKG_CONFIG --variable=moduledir evolution-shell-3.0)"
                   AC_SUBST(evomoddir, ${evomoddir})],
                  [:]);
index cf0072b3ed95e28c0c6f51f31c0335436f0849cb..9dfd94a58a6f1edcdaa5e10f9a16a2ac73747b08 100644 (file)
 #include <mail/message-list.h>
 
 #include <calendar/gui/calendar-config.h>
+
+#ifdef EVO_HAS_E_COMP_EDITOR
+#include <calendar/gui/e-comp-editor.h>
+
+static GtkWindow *
+get_component_editor (EShell *shell,
+                      ECalClient *client,
+                      ECalComponent *comp)
+{
+       ECompEditor *editor;
+       ECompEditorFlags flags = E_COMP_EDITOR_FLAG_IS_NEW| E_COMP_EDITOR_FLAG_WITH_ATTENDEES | E_COMP_EDITOR_FLAG_ORGANIZER_IS_USER;
+
+
+       editor = e_comp_editor_open_for_component(NULL, shell, e_client_get_source (E_CLIENT(client)),
+                                                 e_cal_component_get_icalcomponent(comp), flags);
+       if (editor)
+               e_comp_editor_set_changed (editor, TRUE);
+
+       return GTK_WINDOW(editor);
+}
+#else
 #include <calendar/gui/dialogs/comp-editor.h>
 #include <calendar/gui/dialogs/event-editor.h>
 
-static CompEditor *
+static GtkWindow *
 get_component_editor (EShell *shell,
                       ECalClient *client,
                       ECalComponent *comp)
@@ -80,9 +101,9 @@ get_component_editor (EShell *shell,
 
        e_cal_component_free_id (id);
 
-       return editor;
+       return GTK_WINDOW(editor);
 }
-
+#endif
 static void
 set_attendees (ECalComponent *comp,
                CamelInternetAddress *addresses)
@@ -176,11 +197,11 @@ static void got_client_cb(GObject *object, GAsyncResult *res, gpointer user_data
        }
 
 
-       CompEditor *editor = get_component_editor (e_shell_get_default(),
-                                                  E_CAL_CLIENT(client), data->comp);
+       GtkWindow *editor = get_component_editor (e_shell_get_default(),
+                                                 E_CAL_CLIENT(client), data->comp);
 
        if (editor)
-               gtk_window_present(GTK_WINDOW(editor));
+               gtk_window_present(editor);
        else
                report_error_idle (_("Cannot create calendar editor"), NULL);