[gnome-calendar/calendar-editor] source-dialog: prototype impl of modes



commit 5ac7fc7a333dba32a1c07ba028fc077883adfece
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Feb 9 11:44:16 2015 -0200

    source-dialog: prototype impl of modes

 src/gcal-source-dialog.c |   20 ++++++++++++++++++++
 src/gcal-source-dialog.h |    9 +++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c
index 82d199d..3a35926 100644
--- a/src/gcal-source-dialog.c
+++ b/src/gcal-source-dialog.c
@@ -129,3 +129,23 @@ gcal_source_dialog_set_manager (GcalSourceDialog *dialog,
 
   /* TODO: connect ::source-added & ::source-removed signals */
 }
+
+/**
+ * gcal_source_dialog_set_mode:
+ *
+ * Set the source dialog mode. Creation
+ * mode means that a new calendar will
+ * be created, while edit mode means a
+ * calendar will be edited.
+ *
+ * Returns:
+ */
+gcal_source_dialog_set_mode (GcalSourceDialog    *dialog,
+                             GcalSourceDialogMode mode)
+{
+  GcalSourceDialogPrivate *priv = dialog->priv;
+
+  priv->mode = mode;
+
+  /* TODO: change UI */
+}
diff --git a/src/gcal-source-dialog.h b/src/gcal-source-dialog.h
index 4c8d58b..229ee18 100644
--- a/src/gcal-source-dialog.h
+++ b/src/gcal-source-dialog.h
@@ -36,11 +36,20 @@ struct _GcalSourceDialogClass
   GtkDialogClass parent;
 };
 
+typedef enum
+{
+  GCAL_SOURCE_DIALOG_MODE_EDIT,
+  GCAL_SOURCE_DIALOG_MODE_CREATE
+} GcalSourceDialogMode;
+
 GcalSourceDialog*   gcal_source_dialog_new                  (void);
 
 void                gcal_source_dialog_set_manager          (GcalSourceDialog   *dialog,
                                                              GcalManager        *manager);
 
+void                gcal_source_dialog_set_mode             (GcalSourceDialog     *dialog,
+                                                             GcalSourceDialogMode  mode);
+
 G_END_DECLS
 
 #endif /* GCAL_SOURCE_DIALOG_H */


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