aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/menus
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-12-01 10:53:20 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-02-20 23:04:25 +0800
commit23f5773903d64a554d977ae7d0ebbaca73528f1f (patch)
tree104e1a59da8bf96b004bce204b79f47bbe0a6d13 /widgets/menus
parent49bc4c2d765ee1780c23fdc9f42152850dabb220 (diff)
downloadgsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.gz
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.tar.zst
gsoc2013-evolution-23f5773903d64a554d977ae7d0ebbaca73528f1f.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'widgets/menus')
-rw-r--r--widgets/menus/gal-define-views-dialog.c17
-rw-r--r--widgets/menus/gal-define-views-model.c12
-rw-r--r--widgets/menus/gal-view-collection.c38
-rw-r--r--widgets/menus/gal-view-etable.c23
-rw-r--r--widgets/menus/gal-view-factory-etable.c12
-rw-r--r--widgets/menus/gal-view-instance-save-as-dialog.c16
-rw-r--r--widgets/menus/gal-view-instance.c25
-rw-r--r--widgets/menus/gal-view-new-dialog.c224
8 files changed, 191 insertions, 176 deletions
diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c
index 1c4ff5172e..fb0d852a24 100644
--- a/widgets/menus/gal-define-views-dialog.c
+++ b/widgets/menus/gal-define-views-dialog.c
@@ -61,11 +61,11 @@ typedef struct {
G_DEFINE_TYPE (GalDefineViewsDialog, gal_define_views_dialog, GTK_TYPE_DIALOG)
static void
-gal_define_views_dialog_class_init (GalDefineViewsDialogClass *klass)
+gal_define_views_dialog_class_init (GalDefineViewsDialogClass *class)
{
GObjectClass *object_class;
- object_class = (GObjectClass *) klass;
+ object_class = (GObjectClass *) class;
object_class->set_property = gal_define_views_dialog_set_property;
object_class->get_property = gal_define_views_dialog_get_property;
@@ -130,8 +130,9 @@ gdvd_button_new_callback (GtkWidget *widget,
{
GtkWidget *view_new_dialog = gal_view_new_dialog_new (dialog->collection);
gtk_window_set_transient_for (GTK_WINDOW (view_new_dialog), GTK_WINDOW (dialog));
- g_signal_connect (view_new_dialog, "response",
- G_CALLBACK (gdvd_button_new_dialog_callback), dialog);
+ g_signal_connect (
+ view_new_dialog, "response",
+ G_CALLBACK (gdvd_button_new_dialog_callback), dialog);
gtk_widget_show (view_new_dialog);
}
@@ -280,10 +281,14 @@ gal_define_views_dialog_init (GalDefineViewsDialog *dialog)
gdvd_connect_signal (dialog, "button-new", "clicked", G_CALLBACK (gdvd_button_new_callback));
gdvd_connect_signal (dialog, "button-modify", "clicked", G_CALLBACK (gdvd_button_modify_callback));
gdvd_connect_signal (dialog, "button-delete", "clicked", G_CALLBACK (gdvd_button_delete_callback));
- g_signal_connect (dialog, "response", G_CALLBACK (dialog_response), NULL);
+ g_signal_connect (
+ dialog, "response",
+ G_CALLBACK (dialog_response), NULL);
selection = gtk_tree_view_get_selection (dialog->treeview);
- g_signal_connect (selection, "changed", G_CALLBACK (gdvd_selection_changed_callback), dialog);
+ g_signal_connect (
+ selection, "changed",
+ G_CALLBACK (gdvd_selection_changed_callback), dialog);
gdvd_selection_changed_callback (selection, dialog);
gtk_widget_show (GTK_WIDGET (dialog));
diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c
index 7c69bce720..bdfd970761 100644
--- a/widgets/menus/gal-define-views-model.c
+++ b/widgets/menus/gal-define-views-model.c
@@ -131,11 +131,13 @@ gdvm_value_at (ETableModel *etc,
gint row)
{
GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc);
+ GalView *view;
const gchar *value;
- value = gal_view_get_title (gal_view_collection_get_view (views->collection, row));
+ view = gal_view_collection_get_view (views->collection, row);
+ value = gal_view_get_title (view);
- return (gpointer)(value ? value : "");
+ return (gpointer) ((value != NULL) ? value : "");
}
/* This function sets the value at a particular point in our ETableModel. */
@@ -234,10 +236,10 @@ gal_define_views_model_append (GalDefineViewsModel *model,
}
static void
-gal_define_views_model_class_init (GalDefineViewsModelClass *klass)
+gal_define_views_model_class_init (GalDefineViewsModelClass *class)
{
- ETableModelClass *model_class = E_TABLE_MODEL_CLASS (klass);
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ ETableModelClass *model_class = E_TABLE_MODEL_CLASS (class);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->dispose = gdvm_dispose;
object_class->set_property = gal_define_views_model_set_property;
diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c
index 1d565d7c21..2cd26c96c5 100644
--- a/widgets/menus/gal-view-collection.c
+++ b/widgets/menus/gal-view-collection.c
@@ -190,9 +190,9 @@ gal_view_collection_dispose (GObject *object)
}
static void
-gal_view_collection_class_init (GalViewCollectionClass *klass)
+gal_view_collection_class_init (GalViewCollectionClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->dispose = gal_view_collection_dispose;
@@ -214,8 +214,8 @@ gal_view_collection_class_init (GalViewCollectionClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- klass->display_view = NULL;
- klass->changed = NULL;
+ class->display_view = NULL;
+ class->changed = NULL;
}
static void
@@ -376,9 +376,9 @@ load_single_file (GalViewCollection *collection,
item->view = gal_view_collection_real_load_view_from_file (collection, item->type, item->title, dir, fullpath);
g_free (fullpath);
if (item->view) {
- item->view_changed_id =
- g_signal_connect (item->view, "changed",
- G_CALLBACK (view_changed), item);
+ item->view_changed_id = g_signal_connect (
+ item->view, "changed",
+ G_CALLBACK (view_changed), item);
}
}
return item;
@@ -654,9 +654,9 @@ gal_view_collection_append (GalViewCollection *collection,
item->collection = collection;
g_object_ref (view);
- item->view_changed_id =
- g_signal_connect (item->view, "changed",
- G_CALLBACK (view_changed), item);
+ item->view_changed_id = g_signal_connect (
+ item->view, "changed",
+ G_CALLBACK (view_changed), item);
collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1);
collection->view_data[collection->view_count] = item;
@@ -714,9 +714,9 @@ gal_view_collection_copy_view (GalViewCollection *collection,
item->view = gal_view_clone (view);
item->collection = collection;
- item->view_changed_id =
- g_signal_connect (item->view, "changed",
- G_CALLBACK (view_changed), item);
+ item->view_changed_id = g_signal_connect (
+ item->view, "changed",
+ G_CALLBACK (view_changed), item);
collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1);
collection->view_data[collection->view_count] = item;
@@ -757,9 +757,9 @@ gal_view_collection_append_with_title (GalViewCollection *collection,
item->collection = collection;
g_object_ref (view);
- item->view_changed_id =
- g_signal_connect (item->view, "changed",
- G_CALLBACK (view_changed), item);
+ item->view_changed_id = g_signal_connect (
+ item->view, "changed",
+ G_CALLBACK (view_changed), item);
collection->view_data = g_renew (GalViewCollectionItem *, collection->view_data, collection->view_count + 1);
collection->view_data[collection->view_count] = item;
@@ -798,9 +798,9 @@ gal_view_collection_set_nth_view (GalViewCollection *collection,
item->changed = TRUE;
item->type = g_strdup (gal_view_get_type_code (view));
- item->view_changed_id =
- g_signal_connect (item->view, "changed",
- G_CALLBACK (view_changed), item);
+ item->view_changed_id = g_signal_connect (
+ item->view, "changed",
+ G_CALLBACK (view_changed), item);
gal_view_collection_changed (collection);
return item->id;
diff --git a/widgets/menus/gal-view-etable.c b/widgets/menus/gal-view-etable.c
index a16c72bcc0..c097db0ded 100644
--- a/widgets/menus/gal-view-etable.c
+++ b/widgets/menus/gal-view-etable.c
@@ -86,8 +86,9 @@ gal_view_etable_edit (GalView *view,
etable_view->state,
parent);
- g_signal_connect (config, "changed",
- G_CALLBACK (config_changed), view);
+ g_signal_connect (
+ config, "changed",
+ G_CALLBACK (config_changed), view);
}
static void
@@ -165,10 +166,10 @@ gal_view_etable_dispose (GObject *object)
}
static void
-gal_view_etable_class_init (GalViewEtableClass *klass)
+gal_view_etable_class_init (GalViewEtableClass *class)
{
- GalViewClass *gal_view_class = GAL_VIEW_CLASS (klass);
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GalViewClass *gal_view_class = GAL_VIEW_CLASS (class);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
gal_view_class->edit = gal_view_etable_edit;
gal_view_class->load = gal_view_etable_load;
@@ -297,9 +298,9 @@ gal_view_etable_attach_table (GalViewEtable *view,
e_table_set_state_object (view->table, view->state);
g_object_ref (view->table);
- view->table_state_changed_id =
- g_signal_connect (view->table, "state_change",
- G_CALLBACK (table_state_changed), view);
+ view->table_state_changed_id = g_signal_connect (
+ view->table, "state_change",
+ G_CALLBACK (table_state_changed), view);
}
void
@@ -315,9 +316,9 @@ gal_view_etable_attach_tree (GalViewEtable *view,
e_tree_set_state_object (view->tree, view->state);
g_object_ref (view->tree);
- view->tree_state_changed_id =
- g_signal_connect (view->tree, "state_change",
- G_CALLBACK (tree_state_changed), view);
+ view->tree_state_changed_id = g_signal_connect (
+ view->tree, "state_change",
+ G_CALLBACK (tree_state_changed), view);
}
void
diff --git a/widgets/menus/gal-view-factory-etable.c b/widgets/menus/gal-view-factory-etable.c
index 3d5d0d23c3..8570d3c98c 100644
--- a/widgets/menus/gal-view-factory-etable.c
+++ b/widgets/menus/gal-view-factory-etable.c
@@ -31,6 +31,10 @@
#include "gal-view-etable.h"
#include "gal-view-factory-etable.h"
+#define GAL_VIEW_FACTORY_ETABLE_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), GAL_TYPE_VIEW_FACTORY_ETABLE, GalViewFactoryEtablePrivate))
+
struct _GalViewFactoryEtablePrivate {
ETableSpecification *specification;
};
@@ -94,7 +98,7 @@ view_factory_etable_dispose (GObject *object)
{
GalViewFactoryEtablePrivate *priv;
- priv = GAL_VIEW_FACTORY_ETABLE (object)->priv;
+ priv = GAL_VIEW_FACTORY_ETABLE_GET_PRIVATE (object);
if (priv->specification != NULL) {
g_object_unref (priv->specification);
@@ -123,7 +127,7 @@ view_factory_etable_new_view (GalViewFactory *factory,
{
GalViewFactoryEtablePrivate *priv;
- priv = GAL_VIEW_FACTORY_ETABLE (factory)->priv;
+ priv = GAL_VIEW_FACTORY_ETABLE_GET_PRIVATE (factory);
return gal_view_etable_new (priv->specification, name);
}
@@ -161,9 +165,7 @@ gal_view_factory_etable_class_init (GalViewFactoryEtableClass *class)
static void
gal_view_factory_etable_init (GalViewFactoryEtable *factory)
{
- factory->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- factory, GAL_TYPE_VIEW_FACTORY_ETABLE,
- GalViewFactoryEtablePrivate);
+ factory->priv = GAL_VIEW_FACTORY_ETABLE_GET_PRIVATE (factory);
}
/**
diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c
index a098e094b8..414a287f45 100644
--- a/widgets/menus/gal-view-instance-save-as-dialog.c
+++ b/widgets/menus/gal-view-instance-save-as-dialog.c
@@ -218,11 +218,11 @@ gal_view_instance_save_as_dialog_dispose (GObject *object)
/* Init functions */
static void
-gal_view_instance_save_as_dialog_class_init (GalViewInstanceSaveAsDialogClass *klass)
+gal_view_instance_save_as_dialog_class_init (GalViewInstanceSaveAsDialogClass *class)
{
GObjectClass *object_class;
- object_class = (GObjectClass *) klass;
+ object_class = (GObjectClass *) class;
object_class->set_property = gal_view_instance_save_as_dialog_set_property;
object_class->get_property = gal_view_instance_save_as_dialog_get_property;
@@ -273,9 +273,15 @@ gal_view_instance_save_as_dialog_init (GalViewInstanceSaveAsDialog *dialog)
gtk_tree_view_set_reorderable (GTK_TREE_VIEW (dialog->treeview), FALSE);
gtk_tree_view_set_headers_visible (dialog->treeview, FALSE);
- g_signal_connect (dialog->radiobutton_replace, "toggled", G_CALLBACK (gvisad_radio_toggled), dialog);
- g_signal_connect (dialog->radiobutton_create, "toggled", G_CALLBACK (gvisad_radio_toggled), dialog);
- g_signal_connect (dialog->entry_create, "changed", G_CALLBACK (gvisad_entry_changed), dialog);
+ g_signal_connect (
+ dialog->radiobutton_replace, "toggled",
+ G_CALLBACK (gvisad_radio_toggled), dialog);
+ g_signal_connect (
+ dialog->radiobutton_create, "toggled",
+ G_CALLBACK (gvisad_radio_toggled), dialog);
+ g_signal_connect (
+ dialog->entry_create, "changed",
+ G_CALLBACK (gvisad_entry_changed), dialog);
gvisad_setup_radio_buttons (dialog);
gvisad_setup_validate_button (dialog);
diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c
index f127868ab3..84e4872955 100644
--- a/widgets/menus/gal-view-instance.c
+++ b/widgets/menus/gal-view-instance.c
@@ -144,9 +144,9 @@ connect_view (GalViewInstance *instance,
instance->current_title = g_strdup (gal_view_get_title (view));
instance->current_type = g_strdup (gal_view_get_type_code (view));
- instance->view_changed_id =
- g_signal_connect (instance->current_view, "changed",
- G_CALLBACK (view_changed), instance);
+ instance->view_changed_id = g_signal_connect (
+ instance->current_view, "changed",
+ G_CALLBACK (view_changed), instance);
gal_view_instance_display_view (instance, instance->current_view);
}
@@ -178,9 +178,9 @@ gal_view_instance_dispose (GObject *object)
}
static void
-gal_view_instance_class_init (GalViewInstanceClass *klass)
+gal_view_instance_class_init (GalViewInstanceClass *class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->dispose = gal_view_instance_dispose;
@@ -211,8 +211,8 @@ gal_view_instance_class_init (GalViewInstanceClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- klass->display_view = NULL;
- klass->changed = NULL;
+ class->display_view = NULL;
+ class->changed = NULL;
}
static void
@@ -345,9 +345,9 @@ gal_view_instance_construct (GalViewInstance *instance,
instance->collection = collection;
if (collection)
g_object_ref (collection);
- instance->collection_changed_id =
- g_signal_connect (collection, "changed",
- G_CALLBACK (collection_changed), instance);
+ instance->collection_changed_id = g_signal_connect (
+ collection, "changed",
+ G_CALLBACK (collection_changed), instance);
if (instance_id)
instance->instance_id = g_strdup (instance_id);
@@ -448,8 +448,9 @@ gal_view_instance_save_as (GalViewInstance *instance)
g_return_if_fail (instance != NULL);
dialog = gal_view_instance_save_as_dialog_new (instance);
- g_signal_connect (dialog, "response",
- G_CALLBACK (dialog_response), instance);
+ g_signal_connect (
+ dialog, "response",
+ G_CALLBACK (dialog_response), instance);
gtk_widget_show (dialog);
}
diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c
index c26619f2bd..36d742963a 100644
--- a/widgets/menus/gal-view-new-dialog.c
+++ b/widgets/menus/gal-view-new-dialog.c
@@ -33,11 +33,6 @@
#include "gal-define-views-model.h"
#include "gal-view-new-dialog.h"
-static void gal_view_new_dialog_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
-static void gal_view_new_dialog_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
-static void gal_view_new_dialog_dispose (GObject *object);
-
-/* The arguments we take */
enum {
PROP_0,
PROP_NAME,
@@ -47,29 +42,98 @@ enum {
G_DEFINE_TYPE (GalViewNewDialog, gal_view_new_dialog, GTK_TYPE_DIALOG)
static void
-gal_view_new_dialog_class_init (GalViewNewDialogClass *klass)
+gal_view_new_dialog_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- GObjectClass *object_class;
+ GalViewNewDialog *dialog;
+ GtkWidget *entry;
+
+ dialog = GAL_VIEW_NEW_DIALOG (object);
+
+ switch (property_id) {
+ case PROP_NAME:
+ entry = e_builder_get_widget(dialog->builder, "entry-name");
+ if (entry && GTK_IS_ENTRY (entry)) {
+ gtk_entry_set_text (GTK_ENTRY (entry), g_value_get_string (value));
+ }
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ return;
+ }
+}
+
+static void
+gal_view_new_dialog_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GalViewNewDialog *dialog;
+ GtkWidget *entry;
+
+ dialog = GAL_VIEW_NEW_DIALOG (object);
+
+ switch (property_id) {
+ case PROP_NAME:
+ entry = e_builder_get_widget(dialog->builder, "entry-name");
+ if (entry && GTK_IS_ENTRY (entry)) {
+ g_value_set_string (value, gtk_entry_get_text (GTK_ENTRY (entry)));
+ }
+ break;
+ case PROP_FACTORY:
+ g_value_set_object (value, dialog->selected_factory);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
- object_class = (GObjectClass *) klass;
+static void
+gal_view_new_dialog_dispose (GObject *object)
+{
+ GalViewNewDialog *gal_view_new_dialog = GAL_VIEW_NEW_DIALOG (object);
+
+ if (gal_view_new_dialog->builder)
+ g_object_unref (gal_view_new_dialog->builder);
+ gal_view_new_dialog->builder = NULL;
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (gal_view_new_dialog_parent_class)->dispose (object);
+}
+
+static void
+gal_view_new_dialog_class_init (GalViewNewDialogClass *class)
+{
+ GObjectClass *object_class;
+ object_class = G_OBJECT_CLASS (class);
object_class->set_property = gal_view_new_dialog_set_property;
object_class->get_property = gal_view_new_dialog_get_property;
- object_class->dispose = gal_view_new_dialog_dispose;
-
- g_object_class_install_property (object_class, PROP_NAME,
- g_param_spec_string ("name",
- "Name",
- NULL,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FACTORY,
- g_param_spec_object ("factory",
- "Factory",
- NULL,
- GAL_TYPE_VIEW_FACTORY,
- G_PARAM_READWRITE));
+ object_class->dispose = gal_view_new_dialog_dispose;
+
+ g_object_class_install_property (
+ object_class,
+ PROP_NAME,
+ g_param_spec_string (
+ "name",
+ "Name",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_FACTORY,
+ g_param_spec_object (
+ "factory",
+ "Factory",
+ NULL,
+ GAL_TYPE_VIEW_FACTORY,
+ G_PARAM_READWRITE));
}
static void
@@ -111,19 +175,6 @@ gal_view_new_dialog_init (GalViewNewDialog *dialog)
dialog->selected_factory = NULL;
}
-static void
-gal_view_new_dialog_dispose (GObject *object)
-{
- GalViewNewDialog *gal_view_new_dialog = GAL_VIEW_NEW_DIALOG (object);
-
- if (gal_view_new_dialog->builder)
- g_object_unref (gal_view_new_dialog->builder);
- gal_view_new_dialog->builder = NULL;
-
- /* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (gal_view_new_dialog_parent_class)->dispose (object);
-}
-
GtkWidget *
gal_view_new_dialog_new (GalViewCollection *collection)
{
@@ -162,16 +213,10 @@ selection_func (GtkTreeSelection *selection,
if (path_currently_selected)
return TRUE;
- gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->list_store),
- &iter,
- (GtkTreePath *) path);
+ model = GTK_TREE_MODEL (dialog->list_store);
- gtk_tree_model_get (GTK_TREE_MODEL (dialog->list_store),
- &iter,
- 1, &dialog->selected_factory,
- -1);
-
- printf ("%s factory selected\n", gal_view_factory_get_title(dialog->selected_factory));
+ gtk_tree_model_get_iter (model, &iter, path);
+ gtk_tree_model_get (model, &iter, 1, &dialog->selected_factory, -1);
sensitize_ok_response (dialog);
@@ -199,15 +244,13 @@ gal_view_new_dialog_construct (GalViewNewDialog *dialog,
dialog->collection = collection;
dialog->list = e_builder_get_widget(dialog->builder,"list-type-list");
dialog->entry = e_builder_get_widget(dialog->builder, "entry-name");
- dialog->list_store = gtk_list_store_new (2,
- G_TYPE_STRING,
- G_TYPE_POINTER);
+
+ dialog->list_store = gtk_list_store_new (
+ 2, G_TYPE_STRING, G_TYPE_POINTER);
rend = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes ("factory title",
- rend,
- "text", 0,
- NULL);
+ column = gtk_tree_view_column_new_with_attributes (
+ "factory title", rend, "text", 0, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->list), column);
@@ -217,75 +260,30 @@ gal_view_new_dialog_construct (GalViewNewDialog *dialog,
GtkTreeIter iter;
g_object_ref (factory);
- gtk_list_store_append (dialog->list_store,
- &iter);
- gtk_list_store_set (dialog->list_store,
- &iter,
- 0, gal_view_factory_get_title (factory),
- 1, factory,
- -1);
+ gtk_list_store_append (
+ dialog->list_store, &iter);
+ gtk_list_store_set (
+ dialog->list_store, &iter,
+ 0, gal_view_factory_get_title (factory),
+ 1, factory,
+ -1);
}
- gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->list), GTK_TREE_MODEL (dialog->list_store));
+ gtk_tree_view_set_model (
+ GTK_TREE_VIEW (dialog->list),
+ GTK_TREE_MODEL (dialog->list_store));
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->list));
- gtk_tree_selection_set_select_function (selection, selection_func, dialog, NULL);
- g_signal_connect (dialog->entry, "changed",
- G_CALLBACK (entry_changed), dialog);
+ gtk_tree_selection_set_select_function (
+ selection, selection_func, dialog, NULL);
+
+ g_signal_connect (
+ dialog->entry, "changed",
+ G_CALLBACK (entry_changed), dialog);
sensitize_ok_response (dialog);
return GTK_WIDGET (dialog);
}
-static void
-gal_view_new_dialog_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GalViewNewDialog *dialog;
- GtkWidget *entry;
-
- dialog = GAL_VIEW_NEW_DIALOG (object);
-
- switch (property_id) {
- case PROP_NAME:
- entry = e_builder_get_widget(dialog->builder, "entry-name");
- if (entry && GTK_IS_ENTRY (entry)) {
- gtk_entry_set_text (GTK_ENTRY (entry), g_value_get_string (value));
- }
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- return;
- }
-}
-
-static void
-gal_view_new_dialog_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GalViewNewDialog *dialog;
- GtkWidget *entry;
-
- dialog = GAL_VIEW_NEW_DIALOG (object);
-
- switch (property_id) {
- case PROP_NAME:
- entry = e_builder_get_widget(dialog->builder, "entry-name");
- if (entry && GTK_IS_ENTRY (entry)) {
- g_value_set_string (value, gtk_entry_get_text (GTK_ENTRY (entry)));
- }
- break;
- case PROP_FACTORY:
- g_value_set_object (value, dialog->selected_factory);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
- break;
- }
-}