[gnome-calendar] source-dialog: Rename to GcalCalendarManagementDialog



commit 4088b8b6bba3cb0bf56e4196b45bb59d533db788
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sat Jun 1 20:44:38 2019 -0300

    source-dialog: Rename to GcalCalendarManagementDialog

 data/calendar.gresource.xml                        |   2 +-
 data/meson.build                                   |   2 +-
 ...rce-dialog.ui => calendar-management-dialog.ui} |  44 ++--
 data/ui/window.ui                                  |   2 +-
 po/POTFILES.in                                     |   4 +-
 ...-dialog.c => gcal-calendar-management-dialog.c} | 283 +++++++++++----------
 .../gcal-calendar-management-dialog.h              |  63 +++++
 src/gui/calendar-management/gcal-source-dialog.h   |  63 -----
 src/gui/gcal-window.c                              |  15 +-
 src/meson.build                                    |   2 +-
 10 files changed, 241 insertions(+), 239 deletions(-)
---
diff --git a/data/calendar.gresource.xml b/data/calendar.gresource.xml
index 07b7c87a..aefd806b 100644
--- a/data/calendar.gresource.xml
+++ b/data/calendar.gresource.xml
@@ -2,6 +2,7 @@
 <gresources>
   <gresource prefix="/org/gnome/calendar">
     <file alias="alarm-row.ui" compressed="true">ui/alarm-row.ui</file>
+    <file alias="calendar-management-dialog.ui" compressed="true">ui/calendar-management-dialog.ui</file>
     <file alias="calendar-popover.ui" compressed="true">ui/calendar-popover.ui</file>
     <file alias="calendar-row.ui" compressed="true">ui/calendar-row.ui</file>
     <file alias="date-chooser.ui" compressed="true">ui/date-chooser.ui</file>
@@ -15,7 +16,6 @@
     <file alias="online-account-row.ui" compressed="true">ui/online-account-row.ui</file>
     <file alias="quick-add-popover.ui" compressed="true">ui/quick-add-popover.ui</file>
     <file alias="search-popover.ui" compressed="true">ui/search-popover.ui</file>
-    <file alias="source-dialog.ui" compressed="true">ui/source-dialog.ui</file>
     <file alias="time-selector.ui" compressed="true">ui/time-selector.ui</file>
     <file alias="weather-settings.ui" compressed="true">ui/weather-settings.ui</file>
     <file alias="week-header.ui" compressed="true">ui/week-header.ui</file>
diff --git a/data/meson.build b/data/meson.build
index dca57d3c..aeb3506b 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -83,6 +83,7 @@ gresource = files('calendar.gresource.xml')
 resource_data = files(
   'theme/Adwaita.css',
   'ui/alarm-row.ui',
+  'ui/calendar-management-dialog.ui',
   'ui/calendar-row.ui',
   'ui/date-chooser.ui',
   'ui/date-selector.ui',
@@ -95,7 +96,6 @@ resource_data = files(
   'ui/multi-choice.ui',
   'ui/quick-add-popover.ui',
   'ui/search-popover.ui',
-  'ui/source-dialog.ui',
   'ui/time-selector.ui',
   'ui/weather-settings.ui',
   'ui/week-header.ui',
diff --git a/data/ui/source-dialog.ui b/data/ui/calendar-management-dialog.ui
similarity index 95%
rename from data/ui/source-dialog.ui
rename to data/ui/calendar-management-dialog.ui
index 53ceaac9..ee90d41b 100644
--- a/data/ui/source-dialog.ui
+++ b/data/ui/calendar-management-dialog.ui
@@ -2,7 +2,7 @@
 <!-- Generated with glade 3.18.1 -->
 <interface>
   <requires lib="gtk+" version="3.15"/>
-  <template class="GcalSourceDialog" parent="GtkDialog">
+  <template class="GcalCalendarManagementDialog" parent="GtkDialog">
     <property name="width_request">450</property>
     <property name="can_focus">False</property>
     <property name="border_width">0</property>
@@ -12,7 +12,7 @@
     <property name="modal">True</property>
     <property name="destroy_with_parent">True</property>
     <property name="modal">True</property>
-    <signal name="response" handler="response_signal" object="GcalSourceDialog" swapped="no"/>
+    <signal name="response" handler="response_signal" object="GcalCalendarManagementDialog" swapped="no"/>
     <child internal-child="vbox">
       <object class="GtkBox" id="vbox">
         <property name="orientation">vertical</property>
@@ -26,7 +26,7 @@
                 <property name="halign">center</property>
                 <property name="valign">start</property>
                 <property name="transition_duration">100</property>
-                <signal name="notify::child-revealed" handler="notification_child_revealed_changed" 
object="GcalSourceDialog" swapped="no"/>
+                <signal name="notify::child-revealed" handler="notification_child_revealed_changed" 
object="GcalCalendarManagementDialog" swapped="no"/>
                 <child>
                   <object class="GtkFrame">
                     <property name="visible">True</property>
@@ -55,7 +55,7 @@
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
                             <property name="no_show_all">True</property>
-                            <signal name="clicked" handler="undo_remove_action" object="GcalSourceDialog" 
swapped="no"/>
+                            <signal name="clicked" handler="undo_remove_action" 
object="GcalCalendarManagementDialog" swapped="no"/>
                             <style>
                               <class name="text-button"/>
                             </style>
@@ -72,7 +72,7 @@
                             <property name="receives_default">True</property>
                             <property name="relief">none</property>
                             <property name="focus_on_click">False</property>
-                            <signal name="clicked" handler="hide_notification" object="GcalSourceDialog" 
swapped="yes"/>
+                            <signal name="clicked" handler="hide_notification" 
object="GcalCalendarManagementDialog" swapped="yes"/>
                             <child>
                               <object class="GtkImage">
                                 <property name="visible">True</property>
@@ -105,7 +105,7 @@
                 <property name="vexpand">True</property>
                 <property name="vhomogeneous">False</property>
                 <property name="transition_type">crossfade</property>
-                <signal name="notify::visible-child-name" handler="stack_visible_child_name_changed" 
object="GcalSourceDialog" swapped="no"/>
+                <signal name="notify::visible-child-name" handler="stack_visible_child_name_changed" 
object="GcalCalendarManagementDialog" swapped="no"/>
                 <child>
                   <object class="GtkScrolledWindow" id="main_scrolledwindow">
                     <property name="visible">True</property>
@@ -150,7 +150,7 @@
                                       <object class="GtkListBox" id="calendars_listbox">
                                         <property name="visible">True</property>
                                         <property name="selection_mode">none</property>
-                                        <signal name="row-activated" 
handler="calendar_listbox_row_activated" object="GcalSourceDialog" swapped="no"/>
+                                        <signal name="row-activated" 
handler="calendar_listbox_row_activated" object="GcalCalendarManagementDialog" swapped="no"/>
                                         <style>
                                           <class name="calendars-list"/>
                                         </style>
@@ -223,7 +223,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="draw_indicator">True</property>
-                        <signal name="notify::active" handler="default_check_toggled" 
object="GcalSourceDialog" swapped="no"/>
+                        <signal name="notify::active" handler="default_check_toggled" 
object="GcalCalendarManagementDialog" swapped="no"/>
                         <child>
                           <object class="GtkLabel" id="default_check_label">
                             <property name="visible">True</property>
@@ -249,7 +249,7 @@
                         <property name="margin_top">6</property>
                         <property name="hexpand">True</property>
                         <property name="vexpand">True</property>
-                        <signal name="clicked" handler="remove_button_clicked" object="GcalSourceDialog" 
swapped="no"/>
+                        <signal name="clicked" handler="remove_button_clicked" 
object="GcalCalendarManagementDialog" swapped="no"/>
                         <style>
                           <class name="destructive-action"/>
                         </style>
@@ -265,7 +265,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="draw_indicator">True</property>
-                        <signal name="notify::active" handler="calendar_visible_check_toggled" 
object="GcalSourceDialog" swapped="no"/>
+                        <signal name="notify::active" handler="calendar_visible_check_toggled" 
object="GcalCalendarManagementDialog" swapped="no"/>
                         <child>
                           <object class="GtkLabel" id="display_calendar_check_label">
                             <property name="visible">True</property>
@@ -285,7 +285,7 @@
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
                         <property name="halign">start</property>
-                        <signal name="color-set" handler="color_set" object="GcalSourceDialog" swapped="no"/>
+                        <signal name="color-set" handler="color_set" object="GcalCalendarManagementDialog" 
swapped="no"/>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -297,7 +297,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="hexpand">True</property>
-                        <signal name="notify::text" handler="name_entry_text_changed" 
object="GcalSourceDialog" swapped="no"/>
+                        <signal name="notify::text" handler="name_entry_text_changed" 
object="GcalCalendarManagementDialog" swapped="no"/>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -377,7 +377,7 @@
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
-                            <signal name="clicked" handler="settings_button_clicked" 
object="GcalSourceDialog" swapped="no"/>
+                            <signal name="clicked" handler="settings_button_clicked" 
object="GcalCalendarManagementDialog" swapped="no"/>
                           </object>
                           <packing>
                             <property name="position">1</property>
@@ -421,7 +421,7 @@
                         <property name="use_markup">True</property>
                         <property name="wrap">True</property>
                         <property name="xalign">0</property>
-                        <signal name="activate-link" handler="description_label_link_activated" 
object="GcalSourceDialog" swapped="no"/>
+                        <signal name="activate-link" handler="description_label_link_activated" 
object="GcalCalendarManagementDialog" swapped="no"/>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -448,8 +448,8 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="hexpand">True</property>
-                        <signal name="notify::text" handler="url_entry_text_changed" 
object="GcalSourceDialog" swapped="no"/>
-                        <signal name="activate" handler="calendar_address_activated" 
object="GcalSourceDialog" swapped="no"/>
+                        <signal name="notify::text" handler="url_entry_text_changed" 
object="GcalCalendarManagementDialog" swapped="no"/>
+                        <signal name="activate" handler="calendar_address_activated" 
object="GcalCalendarManagementDialog" swapped="no"/>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -537,7 +537,7 @@
           <object class="GtkButton" id="back_button">
             <property name="can_focus">True</property>
             <property name="receives_default">True</property>
-            <signal name="clicked" handler="back_button_clicked" object="GcalSourceDialog" swapped="no"/>
+            <signal name="clicked" handler="back_button_clicked" object="GcalCalendarManagementDialog" 
swapped="no"/>
             <child>
               <object class="GtkImage" id="back_button_image">
                 <property name="visible">True</property>
@@ -551,7 +551,7 @@
             <property name="label" translatable="yes">Cancel</property>
             <property name="can_focus">True</property>
             <property name="receives_default">True</property>
-            <signal name="clicked" handler="cancel_button_clicked" object="GcalSourceDialog" swapped="no"/>
+            <signal name="clicked" handler="cancel_button_clicked" object="GcalCalendarManagementDialog" 
swapped="no"/>
           </object>
           <packing>
             <property name="position">2</property>
@@ -563,7 +563,7 @@
             <property name="sensitive">False</property>
             <property name="can_focus">True</property>
             <property name="receives_default">True</property>
-            <signal name="clicked" handler="add_button_clicked" object="GcalSourceDialog" swapped="no"/>
+            <signal name="clicked" handler="add_button_clicked" object="GcalCalendarManagementDialog" 
swapped="no"/>
             <style>
               <class name="suggested-action"/>
             </style>
@@ -578,7 +578,7 @@
   </template>
   <object class="GtkDialog" id="credentials_dialog">
     <property name="type_hint">dialog</property>
-    <property name="transient_for">GcalSourceDialog</property>
+    <property name="transient_for">GcalCalendarManagementDialog</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="credentials-dialog-vbox1">
         <property name="orientation">vertical</property>
@@ -659,7 +659,7 @@
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="receives_default">True</property>
-            <signal name="clicked" handler="credential_button_clicked" object="GcalSourceDialog" 
swapped="no"/>
+            <signal name="clicked" handler="credential_button_clicked" object="GcalCalendarManagementDialog" 
swapped="no"/>
           </object>
         </child>
         <child>
@@ -668,7 +668,7 @@
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="receives_default">True</property>
-            <signal name="clicked" handler="credential_button_clicked" object="GcalSourceDialog" 
swapped="no"/>
+            <signal name="clicked" handler="credential_button_clicked" object="GcalCalendarManagementDialog" 
swapped="no"/>
             <style>
               <class name="suggested-action"/>
             </style>
diff --git a/data/ui/window.ui b/data/ui/window.ui
index 1d726ebc..fec29b05 100644
--- a/data/ui/window.ui
+++ b/data/ui/window.ui
@@ -282,7 +282,7 @@
     <signal name="edit-event" handler="edit_event" object="GcalWindow" swapped="no"/>
     <signal name="closed" handler="close_new_event_widget" object="GcalWindow" swapped="no"/>
   </object>
-  <object class="GcalSourceDialog" id="source_dialog">
+  <object class="GcalCalendarManagementDialog" id="calendar_management_dialog">
     <property name="visible">False</property>
     <property name="transient_for">GcalWindow</property>
     <signal name="delete-event" handler="gtk_widget_hide_on_delete" object="GcalWindow" swapped="no" />
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4b1717d0..f9bf37c7 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -4,6 +4,7 @@ data/appdata/org.gnome.Calendar.appdata.xml.in
 data/org.gnome.Calendar.desktop.in
 data/org.gnome.calendar.gschema.xml.in
 data/ui/alarm-row.ui
+data/ui/calendar-management-dialog.ui
 data/ui/calendar-popover.ui
 data/ui/edit-dialog.ui
 data/ui/help-overlay.ui
@@ -12,7 +13,6 @@ data/ui/month-popover.ui
 data/ui/month-view.ui
 data/ui/quick-add-popover.ui
 data/ui/search-popover.ui
-data/ui/source-dialog.ui
 data/ui/time-selector.ui
 data/ui/weather-settings.ui
 data/ui/window.ui
@@ -20,7 +20,7 @@ data/ui/year-view.ui
 src/main.c
 src/core/gcal-event.c
 src/core/gcal-manager.c
-src/gui/calendar-management/gcal-source-dialog.c
+src/gui/calendar-management/gcal-calendar-management-dialog.c
 src/gui/gcal-application.c
 src/gui/gcal-date-selector.c
 src/gui/gcal-edit-dialog.c
diff --git a/src/gui/calendar-management/gcal-source-dialog.c 
b/src/gui/calendar-management/gcal-calendar-management-dialog.c
similarity index 84%
rename from src/gui/calendar-management/gcal-source-dialog.c
rename to src/gui/calendar-management/gcal-calendar-management-dialog.c
index 8fac4439..4bcde41e 100644
--- a/src/gui/calendar-management/gcal-source-dialog.c
+++ b/src/gui/calendar-management/gcal-calendar-management-dialog.c
@@ -1,4 +1,4 @@
-/* gcal-source-dialog.c
+/* gcal-calendar-management-dialog.c
  *
  * Copyright (C) 2015 Georges Basile Stavracas Neto <georges stavracas gmail com>
  *
@@ -16,11 +16,11 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define G_LOG_DOMAIN "GcalSourceDialog"
+#define G_LOG_DOMAIN "GcalCalendarManagementDialog"
 
 #include "gcal-context.h"
 #include "gcal-debug.h"
-#include "gcal-source-dialog.h"
+#include "gcal-calendar-management-dialog.h"
 #include "gcal-utils.h"
 
 #include <glib/gi18n.h>
@@ -29,19 +29,19 @@
 #include <libsoup/soup.h>
 
 /**
- * SECTION:gcal-source-dialog
+ * SECTION:gcal-calendar-management-dialog
  * @short_description: Dialog to manage calendars
- * @title:GcalSourceDialog
+ * @title:GcalCalendarManagementDialog
  * @stability:unstable
- * @image:gcal-source-dialog.png
+ * @image:gcal-calendar-management-dialog.png
  *
- * #GcalSourceDialog is the calendar management widget of GNOME
+ * #GcalCalendarManagementDialog is the calendar management widget of GNOME
  * Calendar. With it, users can create calendars from local files,
  * local calendars or even import calendars from the Web or their
  * online accounts.
  */
 
-struct _GcalSourceDialog
+struct _GcalCalendarManagementDialog
 {
   GtkDialog           parent;
 
@@ -93,7 +93,7 @@ struct _GcalSourceDialog
   GtkWidget          *calendars_listbox;
 
   /* flags */
-  GcalSourceDialogMode mode;
+  GcalCalendarManagementDialogMode mode;
   ESource            *source;
   GList              *remote_sources;
   GcalCalendar       *removed_calendar;
@@ -144,7 +144,7 @@ static void       calendar_visible_check_toggled        (GObject             *ob
 static void       cancel_button_clicked                 (GtkWidget            *button,
                                                          gpointer              user_data);
 
-static void       clear_pages                           (GcalSourceDialog     *dialog);
+static void       clear_pages                           (GcalCalendarManagementDialog     *dialog);
 
 static void       color_set                             (GtkColorButton       *button,
                                                          gpointer              user_data);
@@ -161,7 +161,7 @@ static void       display_header_func                   (GtkListBoxRow        *r
                                                          GtkListBoxRow        *before,
                                                          gpointer              user_data);
 
-static gboolean   is_goa_source                         (GcalSourceDialog     *dialog,
+static gboolean   is_goa_source                         (GcalCalendarManagementDialog     *dialog,
                                                          ESource              *source);
 
 static void       name_entry_text_changed               (GObject             *object,
@@ -191,15 +191,15 @@ static void       stack_visible_child_name_changed      (GObject             *ob
 static void       settings_button_clicked               (GtkWidget           *button,
                                                          gpointer             user_data);
 
-static gboolean   pulse_web_entry                       (GcalSourceDialog    *dialog);
+static gboolean   pulse_web_entry                       (GcalCalendarManagementDialog    *dialog);
 
 static void       url_entry_text_changed                (GObject             *object,
                                                          GParamSpec          *pspec,
                                                          gpointer             user_data);
 
-static gboolean   validate_url_cb                       (GcalSourceDialog    *dialog);
+static gboolean   validate_url_cb                       (GcalCalendarManagementDialog    *dialog);
 
-static gint       prompt_credentials                    (GcalSourceDialog    *dialog,
+static gint       prompt_credentials                    (GcalCalendarManagementDialog    *dialog,
                                                          gchar              **username,
                                                          gchar              **password);
 
@@ -207,7 +207,7 @@ static void       discover_sources_cb                   (GObject             *so
                                                          GAsyncResult        *result,
                                                          gpointer             user_data);
 
-G_DEFINE_TYPE (GcalSourceDialog, gcal_source_dialog, GTK_TYPE_DIALOG)
+G_DEFINE_TYPE (GcalCalendarManagementDialog, gcal_calendar_management_dialog, GTK_TYPE_DIALOG)
 
 enum
 {
@@ -237,7 +237,7 @@ static void
 add_button_clicked (GtkWidget *button,
                     gpointer   user_data)
 {
-  GcalSourceDialog *self = GCAL_SOURCE_DIALOG (user_data);
+  GcalCalendarManagementDialog *self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   GcalManager *manager;
 
   manager = gcal_context_get_manager (self->context);
@@ -249,7 +249,8 @@ add_button_clicked (GtkWidget *button,
 
       self->source = NULL;
 
-      gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (user_data), GCAL_SOURCE_DIALOG_MODE_NORMAL);
+      gcal_calendar_management_dialog_set_mode (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data),
+                                                GCAL_CALENDAR_MANAGEMENT_MODE_NORMAL);
     }
 
   if (self->remote_sources != NULL)
@@ -264,7 +265,8 @@ add_button_clicked (GtkWidget *button,
       self->remote_sources = NULL;
 
       /* Go back to overview */
-      gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (user_data), GCAL_SOURCE_DIALOG_MODE_NORMAL);
+      gcal_calendar_management_dialog_set_mode (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data),
+                                                GCAL_CALENDAR_MANAGEMENT_MODE_NORMAL);
     }
 }
 
@@ -283,7 +285,7 @@ source_color_changed (GcalCalendar *calendar,
 }
 
 static GtkWidget*
-make_calendar_row (GcalSourceDialog *dialog,
+make_calendar_row (GcalCalendarManagementDialog *dialog,
                    GcalCalendar     *calendar)
 {
   cairo_surface_t *surface;
@@ -339,7 +341,7 @@ make_calendar_row (GcalSourceDialog *dialog,
 static void
 add_calendar (GcalManager      *manager,
               GcalCalendar     *calendar,
-              GcalSourceDialog *self)
+              GcalCalendarManagementDialog *self)
 {
   GList *children, *l;
   gboolean contains_source;
@@ -387,7 +389,7 @@ static void
 action_widget_activated (GtkWidget *widget,
                          gpointer   user_data)
 {
-  GcalSourceDialog *self = GCAL_SOURCE_DIALOG (user_data);
+  GcalCalendarManagementDialog *self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   gint response = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (widget), "response"));
 
   self->old_default_source = NULL;
@@ -399,7 +401,7 @@ static void
 back_button_clicked (GtkButton *button,
                      gpointer   user_data)
 {
-  GcalSourceDialog *self = GCAL_SOURCE_DIALOG (user_data);
+  GcalCalendarManagementDialog *self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   GcalManager *manager;
 
   manager = gcal_context_get_manager (self->context);
@@ -413,7 +415,7 @@ back_button_clicked (GtkButton *button,
       g_clear_object (&self->source);
     }
 
-  gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (user_data), GCAL_SOURCE_DIALOG_MODE_NORMAL);
+  gcal_calendar_management_dialog_set_mode (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data), 
GCAL_CALENDAR_MANAGEMENT_MODE_NORMAL);
 }
 
 static gint
@@ -421,22 +423,22 @@ calendar_listbox_sort_func (GtkListBoxRow *row1,
                             GtkListBoxRow *row2,
                             gpointer       user_data)
 {
-  GcalSourceDialog *self;
+  GcalCalendarManagementDialog *self;
   GcalManager *manager;
   ESource *source1, *source2;
   gboolean is_goa1, is_goa2;
   gint retval;
 
-  self = GCAL_SOURCE_DIALOG (user_data);
+  self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   manager = gcal_context_get_manager (self->context);
 
   /* first source */
   source1 = g_object_get_data (G_OBJECT (row1), "source");
-  is_goa1 = is_goa_source (GCAL_SOURCE_DIALOG (user_data), source1);
+  is_goa1 = is_goa_source (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data), source1);
 
   /* second source */
   source2 = g_object_get_data (G_OBJECT (row2), "source");
-  is_goa2 = is_goa_source (GCAL_SOURCE_DIALOG (user_data), source2);
+  is_goa2 = is_goa_source (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data), source2);
 
   if (is_goa1 == is_goa2)
     {
@@ -470,7 +472,7 @@ calendar_visible_check_toggled (GObject    *object,
                                 GParamSpec *pspec,
                                 gpointer    user_data)
 {
-  GcalSourceDialog *self = GCAL_SOURCE_DIALOG (user_data);
+  GcalCalendarManagementDialog *self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   GcalCalendar *calendar;
   GcalManager *manager;
 
@@ -484,7 +486,7 @@ static void
 cancel_button_clicked (GtkWidget *button,
                        gpointer   user_data)
 {
-  GcalSourceDialog *self = GCAL_SOURCE_DIALOG (user_data);
+  GcalCalendarManagementDialog *self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
 
   /* Destroy the ongoing created source */
   g_clear_object (&self->source);
@@ -496,11 +498,11 @@ cancel_button_clicked (GtkWidget *button,
       self->remote_sources = NULL;
     }
 
-  gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (user_data), GCAL_SOURCE_DIALOG_MODE_NORMAL);
+  gcal_calendar_management_dialog_set_mode (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data), 
GCAL_CALENDAR_MANAGEMENT_MODE_NORMAL);
 }
 
 static void
-clear_pages (GcalSourceDialog *dialog)
+clear_pages (GcalCalendarManagementDialog *dialog)
 {
   GList *list;
 
@@ -519,11 +521,11 @@ static void
 color_set (GtkColorButton *button,
            gpointer        user_data)
 {
-  GcalSourceDialog *self;
+  GcalCalendarManagementDialog *self;
   ESourceSelectable *extension;
   GdkRGBA color;
 
-  self = GCAL_SOURCE_DIALOG (user_data);
+  self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color);
 
   extension = E_SOURCE_SELECTABLE (e_source_get_extension (self->source, E_SOURCE_EXTENSION_CALENDAR));
@@ -535,7 +537,7 @@ default_check_toggled (GObject    *object,
                        GParamSpec *pspec,
                        gpointer    user_data)
 {
-  GcalSourceDialog *self = GCAL_SOURCE_DIALOG (user_data);
+  GcalCalendarManagementDialog *self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   GcalManager *manager;
   ESource *new_default_source;
 
@@ -587,7 +589,7 @@ display_header_func (GtkListBoxRow *row,
 }
 
 static gboolean
-is_goa_source (GcalSourceDialog *dialog,
+is_goa_source (GcalCalendarManagementDialog *dialog,
                ESource          *source)
 {
   ESource *parent;
@@ -609,7 +611,7 @@ name_entry_text_changed (GObject    *object,
                          GParamSpec *pspec,
                          gpointer    user_data)
 {
-  GcalSourceDialog *self = GCAL_SOURCE_DIALOG (user_data);
+  GcalCalendarManagementDialog *self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   gboolean valid = gtk_entry_get_text_length (GTK_ENTRY (object)) > 0;
 
   /*
@@ -632,20 +634,20 @@ response_signal (GtkDialog *dialog,
                  gint       response_id,
                  gpointer   user_data)
 {
-  GcalSourceDialog *self = GCAL_SOURCE_DIALOG (dialog);
+  GcalCalendarManagementDialog *self = GCAL_CALENDAR_MANAGEMENT_DIALOG (dialog);
   GcalManager *manager;
 
   manager = gcal_context_get_manager (self->context);
 
   /* Save the source */
-  if (self->mode == GCAL_SOURCE_DIALOG_MODE_EDIT && self->source != NULL)
+  if (self->mode == GCAL_CALENDAR_MANAGEMENT_MODE_EDIT && self->source != NULL)
     {
       gcal_manager_save_source (manager, self->source);
       g_clear_object (&self->source);
     }
 
   /* Commit the new source; save the current page's source */
-  if (self->mode == GCAL_SOURCE_DIALOG_MODE_NORMAL && response_id == GTK_RESPONSE_APPLY && 
self->remote_sources != NULL)
+  if (self->mode == GCAL_CALENDAR_MANAGEMENT_MODE_NORMAL && response_id == GTK_RESPONSE_APPLY && 
self->remote_sources != NULL)
       {
         GList *l;
 
@@ -658,7 +660,7 @@ response_signal (GtkDialog *dialog,
       }
 
   /* Destroy the source when the operation is cancelled */
-  if (self->mode == GCAL_SOURCE_DIALOG_MODE_NORMAL && response_id == GTK_RESPONSE_CANCEL && 
self->remote_sources != NULL)
+  if (self->mode == GCAL_CALENDAR_MANAGEMENT_MODE_NORMAL && response_id == GTK_RESPONSE_CANCEL && 
self->remote_sources != NULL)
     {
       g_list_free_full (self->remote_sources, g_object_unref);
       self->remote_sources = NULL;
@@ -709,11 +711,11 @@ static void
 settings_button_clicked (GtkWidget *button,
                          gpointer   user_data)
 {
-  GcalSourceDialog *self;
+  GcalCalendarManagementDialog *self;
   GApplication *app;
   const gchar *account_id;
 
-  self = GCAL_SOURCE_DIALOG (user_data);
+  self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   /* Selects the account to open */
   account_id = g_object_get_data (G_OBJECT (self->account_label), "account-id");
 
@@ -728,12 +730,12 @@ stack_visible_child_name_changed (GObject    *object,
                                   GParamSpec *pspec,
                                   gpointer    user_data)
 {
-  GcalSourceDialog *self;
+  GcalCalendarManagementDialog *self;
   GcalCalendar *calendar;
   GcalManager *manager;
   GtkWidget *visible_child;
 
-  self = GCAL_SOURCE_DIALOG (user_data);
+  self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   manager = gcal_context_get_manager (self->context);
   calendar = gcal_manager_get_calendar_from_source (manager, self->source);
   visible_child = gtk_stack_get_visible_child (GTK_STACK (object));
@@ -752,7 +754,7 @@ stack_visible_child_name_changed (GObject    *object,
    * Update fields when it goes to the edit page.
    * Here, only widgets that depends on the current
    * source are updated, while indenpendent widgets
-   * are updated at #gcal_source_dialog_set_mode
+   * are updated at #gcal_calendar_management_dialog_set_mode
    */
   if (visible_child == self->edit_grid && self->source != NULL)
     {
@@ -763,9 +765,9 @@ stack_visible_child_name_changed (GObject    *object,
 
       default_calendar = gcal_manager_get_default_calendar (manager);
       default_source = gcal_calendar_get_source (default_calendar);
-      creation_mode = (self->mode == GCAL_SOURCE_DIALOG_MODE_CREATE ||
-                       self->mode == GCAL_SOURCE_DIALOG_MODE_CREATE_WEB);
-      is_goa = is_goa_source (GCAL_SOURCE_DIALOG (user_data), self->source);
+      creation_mode = (self->mode == GCAL_CALENDAR_MANAGEMENT_MODE_CREATE ||
+                       self->mode == GCAL_CALENDAR_MANAGEMENT_MODE_CREATE_WEB);
+      is_goa = is_goa_source (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data), self->source);
       is_file = e_source_has_extension (self->source, E_SOURCE_EXTENSION_LOCAL_BACKEND);
       is_remote = is_remote_source (self->source);
 
@@ -910,10 +912,10 @@ calendar_file_selected (GtkFileChooser *button,
   g_autofree gchar *display_name = NULL;
   g_autoptr (ESource) source = NULL;
   g_autoptr (GFile) file = NULL;
-  GcalSourceDialog *self;
+  GcalCalendarManagementDialog *self;
   ESourceExtension *ext;
 
-  self = GCAL_SOURCE_DIALOG (user_data);
+  self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (button));
 
   if (!file)
@@ -937,8 +939,8 @@ calendar_file_selected (GtkFileChooser *button,
   e_source_set_display_name (source, display_name);
 
   /* Jump to the edit page */
-  gcal_source_dialog_set_source (GCAL_SOURCE_DIALOG (user_data), source);
-  gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (user_data), GCAL_SOURCE_DIALOG_MODE_CREATE);
+  gcal_calendar_management_dialog_set_source (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data), source);
+  gcal_calendar_management_dialog_set_mode (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data), 
GCAL_CALENDAR_MANAGEMENT_MODE_CREATE);
 
   gtk_widget_set_sensitive (self->add_button, TRUE);
 }
@@ -948,7 +950,7 @@ calendar_listbox_row_activated (GtkListBox    *box,
                                 GtkListBoxRow *row,
                                 gpointer       user_data)
 {
-  GcalSourceDialog *self = GCAL_SOURCE_DIALOG (user_data);
+  GcalCalendarManagementDialog *self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
 
   g_assert (row != NULL);
 
@@ -960,13 +962,13 @@ calendar_listbox_row_activated (GtkListBox    *box,
     {
       ESource *source = g_object_get_data (G_OBJECT (row), "source");
 
-      gcal_source_dialog_set_source (GCAL_SOURCE_DIALOG (user_data), source);
-      gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (user_data), GCAL_SOURCE_DIALOG_MODE_EDIT);
+      gcal_calendar_management_dialog_set_source (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data), source);
+      gcal_calendar_management_dialog_set_mode (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data), 
GCAL_CALENDAR_MANAGEMENT_MODE_EDIT);
     }
 }
 
 static gboolean
-pulse_web_entry (GcalSourceDialog *dialog)
+pulse_web_entry (GcalCalendarManagementDialog *dialog)
 {
   gtk_entry_progress_pulse (GTK_ENTRY (dialog->calendar_address_entry));
 
@@ -980,10 +982,10 @@ url_entry_text_changed (GObject    *object,
                         GParamSpec *pspec,
                         gpointer    user_data)
 {
-  GcalSourceDialog *self;
+  GcalCalendarManagementDialog *self;
   const gchar* text;
 
-  self = GCAL_SOURCE_DIALOG (user_data);
+  self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   text = gtk_entry_get_text (GTK_ENTRY (self->calendar_address_entry));
 
   if (self->calendar_address_id != 0)
@@ -1060,11 +1062,11 @@ on_local_activated (GSimpleAction *action,
                     GVariant      *param,
                     gpointer       user_data)
 {
-  GcalSourceDialog *self;
+  GcalCalendarManagementDialog *self;
   ESourceExtension *ext;
   ESource *source;
 
-  self = GCAL_SOURCE_DIALOG (user_data);
+  self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   /**
    * Create the new source and add the needed
    * extensions.
@@ -1079,8 +1081,8 @@ on_local_activated (GSimpleAction *action,
   e_source_set_display_name (source, _("Unnamed Calendar"));
 
   /* Jump to the edit page */
-  gcal_source_dialog_set_source (GCAL_SOURCE_DIALOG (user_data), source);
-  gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (user_data), GCAL_SOURCE_DIALOG_MODE_CREATE);
+  gcal_calendar_management_dialog_set_source (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data), source);
+  gcal_calendar_management_dialog_set_mode (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data), 
GCAL_CALENDAR_MANAGEMENT_MODE_CREATE);
 
   gtk_widget_set_sensitive (self->add_button, TRUE);
 }
@@ -1090,20 +1092,20 @@ on_web_activated (GSimpleAction *action,
                   GVariant      *param,
                   gpointer       user_data)
 {
-  gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (user_data), GCAL_SOURCE_DIALOG_MODE_CREATE_WEB);
+  gcal_calendar_management_dialog_set_mode (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data), 
GCAL_CALENDAR_MANAGEMENT_MODE_CREATE_WEB);
 }
 
 static void
 calendar_address_activated (GtkEntry *entry,
                             gpointer  user_data)
 {
-  g_assert (GCAL_IS_SOURCE_DIALOG (user_data));
+  g_assert (GCAL_IS_CALENDAR_MANAGEMENT_DIALOG (user_data));
 
-  validate_url_cb (GCAL_SOURCE_DIALOG (user_data));
+  validate_url_cb (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data));
 }
 
 static gboolean
-validate_url_cb (GcalSourceDialog *dialog)
+validate_url_cb (GcalCalendarManagementDialog *dialog)
 {
   ESourceAuthentication *auth;
   ENamedParameters *credentials;
@@ -1254,7 +1256,7 @@ static void
 credential_button_clicked (GtkWidget *button,
                            gpointer   user_data)
 {
-  GcalSourceDialog *self = GCAL_SOURCE_DIALOG(user_data);
+  GcalCalendarManagementDialog *self = GCAL_CALENDAR_MANAGEMENT_DIALOG(user_data);
 
   if (button == self->credentials_cancel_button)
     gtk_dialog_response (GTK_DIALOG (self->credentials_dialog), GTK_RESPONSE_CANCEL);
@@ -1270,7 +1272,7 @@ credential_entry_activate (GtkEntry *entry,
 }
 
 static gint
-prompt_credentials (GcalSourceDialog  *dialog,
+prompt_credentials (GcalCalendarManagementDialog  *dialog,
                     gchar            **username,
                     gchar            **password)
 {
@@ -1354,12 +1356,11 @@ check_activated_cb (GtkWidget  *check,
                     GParamSpec *spec,
                     gpointer    user_data)
 {
-  GcalSourceDialog *self;
+  GcalCalendarManagementDialog *self;
   GtkWidget *row;
   ESource *source;
 
-  g_assert (user_data && GCAL_IS_SOURCE_DIALOG (user_data));
-  self = GCAL_SOURCE_DIALOG (user_data);
+  self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
 
   row = gtk_widget_get_parent (check);
   source = g_object_get_data (G_OBJECT (row), "source");
@@ -1377,11 +1378,11 @@ discover_sources_cb (GObject      *source,
                      GAsyncResult *result,
                      gpointer      user_data)
 {
-  GcalSourceDialog *self;
+  GcalCalendarManagementDialog *self;
   GSList *discovered_sources, *user_addresses, *aux;
   GError *error;
 
-  self = GCAL_SOURCE_DIALOG (user_data);
+  self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   error = NULL;
 
   /* Stop the pulsing entry */
@@ -1413,11 +1414,11 @@ discover_sources_cb (GObject      *source,
         {
           self->prompt_password = TRUE;
 
-          validate_url_cb (GCAL_SOURCE_DIALOG (user_data));
+          validate_url_cb (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data));
         }
       else
         {
-          g_debug ("[source-dialog] error: %s", error->message);
+          g_debug ("Error: %s", error->message);
         }
 
       g_error_free (error);
@@ -1498,7 +1499,7 @@ discover_sources_cb (GObject      *source,
 static void
 remove_calendar (GcalManager      *manager,
                  GcalCalendar     *calendar,
-                 GcalSourceDialog *self)
+                 GcalCalendarManagementDialog *self)
 {
   GList *children, *aux;
 
@@ -1531,7 +1532,7 @@ notification_child_revealed_changed (GtkWidget  *notification,
                                      GParamSpec *spec,
                                      gpointer    user_data)
 {
-  GcalSourceDialog *self = GCAL_SOURCE_DIALOG (user_data);
+  GcalCalendarManagementDialog *self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   GcalManager *manager;
 
   if (gtk_revealer_get_child_revealed (GTK_REVEALER (notification)))
@@ -1574,7 +1575,7 @@ static void
 undo_remove_action (GtkButton *button,
                     gpointer   user_data)
 {
-  GcalSourceDialog *self = GCAL_SOURCE_DIALOG (user_data);
+  GcalCalendarManagementDialog *self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   GcalManager *manager;
 
   manager = gcal_context_get_manager (self->context);
@@ -1606,7 +1607,7 @@ undo_remove_action (GtkButton *button,
  * Returns:
  */
 static void
-hide_notification (GcalSourceDialog *dialog,
+hide_notification (GcalCalendarManagementDialog *dialog,
                    GtkWidget        *button)
 {
   gtk_revealer_set_reveal_child (GTK_REVEALER (dialog->notification), FALSE);
@@ -1624,7 +1625,7 @@ hide_notification (GcalSourceDialog *dialog,
 static gboolean
 hide_notification_scheduled (gpointer dialog)
 {
-  hide_notification (GCAL_SOURCE_DIALOG (dialog), NULL);
+  hide_notification (GCAL_CALENDAR_MANAGEMENT_DIALOG (dialog), NULL);
   return FALSE;
 }
 
@@ -1640,7 +1641,7 @@ static void
 remove_button_clicked (GtkWidget *button,
                        gpointer   user_data)
 {
-  GcalSourceDialog *self = GCAL_SOURCE_DIALOG (user_data);
+  GcalCalendarManagementDialog *self = GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data);
   GcalManager *manager;
 
   manager = gcal_context_get_manager (self->context);
@@ -1684,7 +1685,7 @@ remove_button_clicked (GtkWidget *button,
       g_free (str);
     }
 
-  gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (user_data), GCAL_SOURCE_DIALOG_MODE_NORMAL);
+  gcal_calendar_management_dialog_set_mode (GCAL_CALENDAR_MANAGEMENT_DIALOG (user_data), 
GCAL_CALENDAR_MANAGEMENT_MODE_NORMAL);
 }
 
 /*
@@ -1692,7 +1693,7 @@ remove_button_clicked (GtkWidget *button,
  */
 
 static void
-setup_context (GcalSourceDialog *self)
+setup_context (GcalCalendarManagementDialog *self)
 {
   GList *accounts = NULL;
   GcalManager *manager;
@@ -1709,15 +1710,15 @@ setup_context (GcalSourceDialog *self)
 }
 
 static void
-gcal_source_dialog_constructed (GObject *object)
+gcal_calendar_management_dialog_constructed (GObject *object)
 {
-  GcalSourceDialog *self;
+  GcalCalendarManagementDialog *self;
   GtkBuilder *builder;
   GMenuModel *menu;
 
-  self = GCAL_SOURCE_DIALOG (object);
+  self = GCAL_CALENDAR_MANAGEMENT_DIALOG (object);
 
-  G_OBJECT_CLASS (gcal_source_dialog_parent_class)->constructed (object);
+  G_OBJECT_CLASS (gcal_calendar_management_dialog_parent_class)->constructed (object);
 
   /* widget responses */
   gtk_dialog_set_default_response (GTK_DIALOG (object), GTK_RESPONSE_CANCEL);
@@ -1748,12 +1749,12 @@ gcal_source_dialog_constructed (GObject *object)
 }
 
 static void
-gcal_source_dialog_get_property (GObject    *object,
+gcal_calendar_management_dialog_get_property (GObject    *object,
                                  guint       prop_id,
                                  GValue     *value,
                                  GParamSpec *pspec)
 {
-  GcalSourceDialog *self = (GcalSourceDialog *) object;
+  GcalCalendarManagementDialog *self = (GcalCalendarManagementDialog *) object;
 
   switch (prop_id)
     {
@@ -1766,12 +1767,12 @@ gcal_source_dialog_get_property (GObject    *object,
     }
 }
 static void
-gcal_source_dialog_set_property (GObject      *object,
+gcal_calendar_management_dialog_set_property (GObject      *object,
                                  guint         prop_id,
                                  const GValue *value,
                                  GParamSpec   *pspec)
 {
-  GcalSourceDialog *self = (GcalSourceDialog *) object;
+  GcalCalendarManagementDialog *self = (GcalCalendarManagementDialog *) object;
 
   switch (prop_id)
     {
@@ -1788,7 +1789,7 @@ gcal_source_dialog_set_property (GObject      *object,
 }
 
 static void
-gcal_source_dialog_class_init (GcalSourceDialogClass *klass)
+gcal_calendar_management_dialog_class_init (GcalCalendarManagementDialogClass *klass)
 {
   GObjectClass *object_class;
   GtkWidgetClass *widget_class;
@@ -1801,9 +1802,9 @@ gcal_source_dialog_class_init (GcalSourceDialogClass *klass)
   g_type_ensure (E_TYPE_SOURCE_LOCAL);
 
   object_class = G_OBJECT_CLASS (klass);
-  object_class->constructed = gcal_source_dialog_constructed;
-  object_class->get_property = gcal_source_dialog_get_property;
-  object_class->set_property = gcal_source_dialog_set_property;
+  object_class->constructed = gcal_calendar_management_dialog_constructed;
+  object_class->get_property = gcal_calendar_management_dialog_get_property;
+  object_class->set_property = gcal_calendar_management_dialog_set_property;
 
   properties[PROP_CONTEXT] = g_param_spec_object ("context",
                                                   "Context",
@@ -1816,38 +1817,38 @@ gcal_source_dialog_class_init (GcalSourceDialogClass *klass)
   widget_class = GTK_WIDGET_CLASS (klass);
 
   /* bind things for/from the template class */
-  gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), 
"/org/gnome/calendar/source-dialog.ui");
-
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, account_box);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, account_label);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, add_button);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, add_calendar_menu_button);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, back_button);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, calendar_address_entry);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, calendar_color_button);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, calendar_url_button);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, calendar_visible_check);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, calendars_listbox);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, cancel_button);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, credentials_cancel_button);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, credentials_connect_button);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, credentials_dialog);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, credentials_password_entry);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, credentials_user_entry);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, default_check);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, edit_grid);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, headerbar);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, location_dim_label);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, main_scrolledwindow);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, name_entry);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, notification);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, notification_label);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, remove_button);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, settings_button);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, stack);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, web_source_grid);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, web_sources_listbox);
-  gtk_widget_class_bind_template_child (widget_class, GcalSourceDialog, web_sources_revealer);
+  gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), 
"/org/gnome/calendar/calendar-management-dialog.ui");
+
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, account_box);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, account_label);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, add_button);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, 
add_calendar_menu_button);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, back_button);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, calendar_address_entry);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, calendar_color_button);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, calendar_url_button);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, calendar_visible_check);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, calendars_listbox);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, cancel_button);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, 
credentials_cancel_button);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, 
credentials_connect_button);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, credentials_dialog);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, 
credentials_password_entry);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, credentials_user_entry);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, default_check);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, edit_grid);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, headerbar);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, location_dim_label);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, main_scrolledwindow);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, name_entry);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, notification);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, notification_label);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, remove_button);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, settings_button);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, stack);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, web_source_grid);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, web_sources_listbox);
+  gtk_widget_class_bind_template_child (widget_class, GcalCalendarManagementDialog, web_sources_revealer);
 
   gtk_widget_class_bind_template_callback (widget_class, add_button_clicked);
   gtk_widget_class_bind_template_callback (widget_class, action_widget_activated);
@@ -1874,25 +1875,25 @@ gcal_source_dialog_class_init (GcalSourceDialogClass *klass)
 }
 
 static void
-gcal_source_dialog_init (GcalSourceDialog *self)
+gcal_calendar_management_dialog_init (GcalCalendarManagementDialog *self)
 {
   gtk_widget_init_template (GTK_WIDGET (self));
 }
 
 /**
- * gcal_source_dialog_set_mode:
- * @dialog: a #GcalSourceDialog
- * @mode: a #GcalSourceDialogMode
+ * gcal_calendar_management_dialog_set_mode:
+ * @dialog: a #GcalCalendarManagementDialog
+ * @mode: a #GcalCalendarManagementDialogMode
  *
  * Set the source dialog mode. Creation mode means that a new
  * calendar will be created, while edit mode means a calendar
  * will be edited.
  */
 void
-gcal_source_dialog_set_mode (GcalSourceDialog    *dialog,
-                             GcalSourceDialogMode mode)
+gcal_calendar_management_dialog_set_mode (GcalCalendarManagementDialog    *dialog,
+                             GcalCalendarManagementDialogMode mode)
 {
-  GcalSourceDialogMode previous_mode = dialog->mode;
+  GcalCalendarManagementDialogMode previous_mode = dialog->mode;
 
   dialog->mode = mode;
 
@@ -1901,13 +1902,13 @@ gcal_source_dialog_set_mode (GcalSourceDialog    *dialog,
 
   switch (mode)
     {
-    case GCAL_SOURCE_DIALOG_MODE_CREATE:
+    case GCAL_CALENDAR_MANAGEMENT_MODE_CREATE:
       gtk_header_bar_set_title (GTK_HEADER_BAR (dialog->headerbar), _("Add Calendar"));
       gtk_header_bar_set_subtitle (GTK_HEADER_BAR (dialog->headerbar), NULL);
       gtk_stack_set_visible_child (GTK_STACK (dialog->stack), dialog->edit_grid);
       break;
 
-    case GCAL_SOURCE_DIALOG_MODE_CREATE_WEB:
+    case GCAL_CALENDAR_MANAGEMENT_MODE_CREATE_WEB:
       gtk_header_bar_set_title (GTK_HEADER_BAR (dialog->headerbar), _("Add Calendar"));
       gtk_header_bar_set_subtitle (GTK_HEADER_BAR (dialog->headerbar), NULL);
       gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (dialog->headerbar), FALSE);
@@ -1916,7 +1917,7 @@ gcal_source_dialog_set_mode (GcalSourceDialog    *dialog,
       gtk_widget_set_visible (dialog->cancel_button, TRUE);
       break;
 
-    case GCAL_SOURCE_DIALOG_MODE_EDIT:
+    case GCAL_CALENDAR_MANAGEMENT_MODE_EDIT:
       /* Bind title */
       if (dialog->title_bind == NULL)
         {
@@ -1927,7 +1928,7 @@ gcal_source_dialog_set_mode (GcalSourceDialog    *dialog,
       gtk_stack_set_visible_child (GTK_STACK (dialog->stack), dialog->edit_grid);
       break;
 
-    case GCAL_SOURCE_DIALOG_MODE_NORMAL:
+    case GCAL_CALENDAR_MANAGEMENT_MODE_NORMAL:
       /* Free any bindings left behind */
       g_clear_pointer (&dialog->title_bind, g_binding_unbind);
 
@@ -1945,14 +1946,14 @@ gcal_source_dialog_set_mode (GcalSourceDialog    *dialog,
 }
 
 /**
- * gcal_source_dialog_set_source:
- * @dialog: a #GcalSourceDialog
+ * gcal_calendar_management_dialog_set_source:
+ * @dialog: a #GcalCalendarManagementDialog
  * @source: an #ESource
  *
  * Sets the source to be edited by the user.
  */
 void
-gcal_source_dialog_set_source (GcalSourceDialog *dialog,
+gcal_calendar_management_dialog_set_source (GcalCalendarManagementDialog *dialog,
                                ESource          *source)
 {
   g_return_if_fail (source && E_IS_SOURCE (source));
diff --git a/src/gui/calendar-management/gcal-calendar-management-dialog.h 
b/src/gui/calendar-management/gcal-calendar-management-dialog.h
new file mode 100644
index 00000000..1b2bb763
--- /dev/null
+++ b/src/gui/calendar-management/gcal-calendar-management-dialog.h
@@ -0,0 +1,63 @@
+/* gcal-source-manager.h
+ *
+ * Copyright (C) 2015 Georges Basile Stavracas Neto <georges stavracas gmail com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#pragma once
+
+#include <glib-object.h>
+#include "gcal-application.h"
+#include "gcal-manager.h"
+
+#include <libecal/libecal.h>
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define GCAL_RESPONSE_REMOVE_SOURCE   2
+
+#define GCAL_TYPE_CALENDAR_MANAGEMENT_DIALOG (gcal_calendar_management_dialog_get_type())
+
+G_DECLARE_FINAL_TYPE (GcalCalendarManagementDialog,
+                      gcal_calendar_management_dialog,
+                      GCAL, CALENDAR_MANAGEMENT_DIALOG,
+                      GtkDialog)
+
+/**
+ * GcalCalendarManagementDialogMode:
+ * @GCAL_CALENDAR_MANAGEMENT_MODE_CREATE: creating a new calendar
+ * @GCAL_CALENDAR_MANAGEMENT_MODE_CREATE_WEB: creating a new web-based calendar
+ * @GCAL_CALENDAR_MANAGEMENT_MODE_EDIT: editing an existing calendar
+ * @GCAL_CALENDAR_MANAGEMENT_MODE_NORMAL: showing the list of calendars and online accounts
+ *
+ * The current action of the #GcalCalendarManagementDialog
+ */
+typedef enum
+{
+  GCAL_CALENDAR_MANAGEMENT_MODE_CREATE,
+  GCAL_CALENDAR_MANAGEMENT_MODE_CREATE_WEB,
+  GCAL_CALENDAR_MANAGEMENT_MODE_EDIT,
+  GCAL_CALENDAR_MANAGEMENT_MODE_NORMAL
+} GcalCalendarManagementDialogMode;
+
+void                 gcal_calendar_management_dialog_set_mode    (GcalCalendarManagementDialog     *dialog,
+                                                                  GcalCalendarManagementDialogMode  mode);
+
+void                 gcal_calendar_management_dialog_set_source  (GcalCalendarManagementDialog     *dialog,
+                                                                  ESource                          *source);
+
+G_END_DECLS
diff --git a/src/gui/gcal-window.c b/src/gui/gcal-window.c
index 495986ee..d294a7dd 100644
--- a/src/gui/gcal-window.c
+++ b/src/gui/gcal-window.c
@@ -19,6 +19,7 @@
 
 #define G_LOG_DOMAIN "GcalWindow"
 
+#include "gcal-calendar-management-dialog.h"
 #include "gcal-calendar-popover.h"
 #include "gcal-debug.h"
 #include "gcal-edit-dialog.h"
@@ -28,7 +29,6 @@
 #include "gcal-month-view.h"
 #include "gcal-quick-add-popover.h"
 #include "gcal-search-button.h"
-#include "gcal-source-dialog.h"
 #include "gcal-view.h"
 #include "gcal-weather-settings.h"
 #include "gcal-week-view.h"
@@ -138,7 +138,7 @@ struct _GcalWindow
 
   /* calendar management */
   GtkWidget          *calendar_popover;
-  GtkWidget          *source_dialog;
+  GtkWidget          *calendar_management_dialog;
 
   gint                open_edit_dialog_timeout_id;
 
@@ -314,11 +314,12 @@ on_show_calendars_action_activated (GSimpleAction *action,
 {
   GcalWindow *window = GCAL_WINDOW (user_data);
 
-  gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (window->source_dialog), GCAL_SOURCE_DIALOG_MODE_NORMAL);
+  gcal_calendar_management_dialog_set_mode (GCAL_CALENDAR_MANAGEMENT_DIALOG 
(window->calendar_management_dialog),
+                                            GCAL_CALENDAR_MANAGEMENT_MODE_NORMAL);
 
   gtk_widget_hide (window->calendar_popover);
 
-  gtk_widget_show (window->source_dialog);
+  gtk_widget_show (window->calendar_management_dialog);
 }
 
 static void
@@ -874,7 +875,7 @@ gcal_window_constructed (GObject *object)
    */
   g_object_bind_property (self, "context", self->calendar_popover, "context", G_BINDING_DEFAULT);
   g_object_bind_property (self, "context", self->weather_settings, "context", G_BINDING_DEFAULT | 
G_BINDING_SYNC_CREATE);
-  g_object_bind_property (self, "context", self->source_dialog, "context", G_BINDING_DEFAULT);
+  g_object_bind_property (self, "context", self->calendar_management_dialog, "context", G_BINDING_DEFAULT);
   g_object_bind_property (self, "context", self->week_view, "context", G_BINDING_DEFAULT | 
G_BINDING_SYNC_CREATE);
   g_object_bind_property (self, "context", self->month_view, "context", G_BINDING_DEFAULT | 
G_BINDING_SYNC_CREATE);
   g_object_bind_property (self, "context", self->year_view, "context", G_BINDING_DEFAULT | 
G_BINDING_SYNC_CREATE);
@@ -990,13 +991,13 @@ gcal_window_class_init (GcalWindowClass *klass)
   GObjectClass *object_class;
   GtkWidgetClass *widget_class;
 
+  g_type_ensure (GCAL_TYPE_CALENDAR_MANAGEMENT_DIALOG);
   g_type_ensure (GCAL_TYPE_CALENDAR_POPOVER);
   g_type_ensure (GCAL_TYPE_EDIT_DIALOG);
   g_type_ensure (GCAL_TYPE_MANAGER);
   g_type_ensure (GCAL_TYPE_MONTH_VIEW);
   g_type_ensure (GCAL_TYPE_QUICK_ADD_POPOVER);
   g_type_ensure (GCAL_TYPE_SEARCH_BUTTON);
-  g_type_ensure (GCAL_TYPE_SOURCE_DIALOG);
   g_type_ensure (GCAL_TYPE_WEATHER_SETTINGS);
   g_type_ensure (GCAL_TYPE_WEEK_VIEW);
   g_type_ensure (GCAL_TYPE_YEAR_VIEW);
@@ -1052,7 +1053,7 @@ gcal_window_class_init (GcalWindowClass *klass)
   gtk_widget_class_bind_template_child (widget_class, GcalWindow, month_view);
   gtk_widget_class_bind_template_child (widget_class, GcalWindow, quick_add_popover);
   gtk_widget_class_bind_template_child (widget_class, GcalWindow, search_button);
-  gtk_widget_class_bind_template_child (widget_class, GcalWindow, source_dialog);
+  gtk_widget_class_bind_template_child (widget_class, GcalWindow, calendar_management_dialog);
   gtk_widget_class_bind_template_child (widget_class, GcalWindow, today_button);
   gtk_widget_class_bind_template_child (widget_class, GcalWindow, views_overlay);
   gtk_widget_class_bind_template_child (widget_class, GcalWindow, views_stack);
diff --git a/src/meson.build b/src/meson.build
index 1354094e..5333bcbc 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -102,7 +102,7 @@ sources = files(
   'core/gcal-shell-search-provider.c',
   'core/gcal-timer.c',
   'core/gcal-time-zone-monitor.c',
-  'gui/calendar-management/gcal-source-dialog.c',
+  'gui/calendar-management/gcal-calendar-management-dialog.c',
   'gui/gcal-application.c',
   'gui/gcal-calendar-popover.c',
   'gui/gcal-date-chooser.c',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]