[gnome-calendar] source-dialog: add ::application property
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] source-dialog: add ::application property
- Date: Mon, 25 May 2015 17:00:13 +0000 (UTC)
commit ee7025ea99eb5e55756c6f3e688eeed9c6da07bf
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Apr 30 23:21:31 2015 -0300
source-dialog: add ::application property
src/gcal-source-dialog.c | 64 ++++++++++++++++++++++++++++++++++++++++++++-
src/gcal-source-dialog.h | 3 +-
2 files changed, 64 insertions(+), 3 deletions(-)
---
diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c
index 163c0cb..7c99184 100644
--- a/src/gcal-source-dialog.c
+++ b/src/gcal-source-dialog.c
@@ -16,8 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "gcal-application.h"
#include "gcal-source-dialog.h"
-
#include "gcal-utils.h"
#include <glib/gi18n.h>
@@ -89,6 +89,7 @@ typedef struct
GSimpleActionGroup *action_group;
/* manager */
+ GcalApplication *application;
GcalManager *manager;
} GcalSourceDialogPrivate;
@@ -100,6 +101,12 @@ struct _GcalSourceDialog
GcalSourceDialogPrivate *priv;
};
+enum {
+ PROP_0,
+ PROP_APPLICATION,
+ LAST_PROP
+};
+
#define ENTRY_PROGRESS_TIMEOUT 100
static void add_button_clicked (GtkWidget *button,
@@ -1771,7 +1778,7 @@ remove_button_clicked (GtkWidget *button,
gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (user_data), GCAL_SOURCE_DIALOG_MODE_NORMAL);
}
-GcalSourceDialog *
+GtkWidget*
gcal_source_dialog_new (void)
{
return g_object_new (GCAL_TYPE_SOURCE_DIALOG, NULL);
@@ -1818,6 +1825,44 @@ gcal_source_dialog_constructed (GObject *object)
}
static void
+gcal_source_dialog_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GcalSourceDialog *self = GCAL_SOURCE_DIALOG (object);
+
+ switch (prop_id)
+ {
+ case PROP_APPLICATION:
+ g_value_set_object (value, self->priv->application);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
+gcal_source_dialog_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GcalSourceDialog *self = GCAL_SOURCE_DIALOG (object);
+
+ switch (prop_id)
+ {
+ case PROP_APPLICATION:
+ self->priv->application = g_value_get_object (value);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
gcal_source_dialog_class_init (GcalSourceDialogClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -1831,9 +1876,24 @@ gcal_source_dialog_class_init (GcalSourceDialogClass *klass)
g_type_ensure (E_TYPE_SOURCE_LOCAL);
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;
widget_class = GTK_WIDGET_CLASS (klass);
+ /**
+ * GcalSourceDialog::application:
+ *
+ * The #GcalApplication of the dialog.
+ */
+ g_object_class_install_property (object_class,
+ PROP_APPLICATION,
+ g_param_spec_object ("application",
+ "Application of this dialog",
+ "The application that runs this dialog over",
+ GCAL_TYPE_APPLICATION,
+ G_PARAM_READWRITE));
+
/* bind things for/from the template class */
gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass),
"/org/gnome/calendar/source-dialog.ui");
diff --git a/src/gcal-source-dialog.h b/src/gcal-source-dialog.h
index f3b3840..274b0fa 100644
--- a/src/gcal-source-dialog.h
+++ b/src/gcal-source-dialog.h
@@ -21,6 +21,7 @@
#define GCAL_SOURCE_DIALOG_H
#include <glib-object.h>
+#include "gcal-application.h"
#include "gcal-manager.h"
#include <libecal/libecal.h>
@@ -47,7 +48,7 @@ typedef enum
GCAL_SOURCE_DIALOG_MODE_NORMAL
} GcalSourceDialogMode;
-GcalSourceDialog* gcal_source_dialog_new (void);
+GtkWidget* gcal_source_dialog_new (void);
void gcal_source_dialog_set_manager (GcalSourceDialog *dialog,
GcalManager *manager);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]