Use the same marshaller for both GConfPropertyEditor and CcSettingEditor
This commit is contained in:
parent
7ebaaf64c9
commit
b7972bc1cb
6 changed files with 54 additions and 35 deletions
|
@ -17,14 +17,14 @@ libgnome_control_center_include_HEADERS = \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
libgnome_control_center_la_SOURCES = \
|
libgnome_control_center_la_SOURCES = \
|
||||||
|
cc-marshal.c \
|
||||||
|
cc-marshal.h \
|
||||||
cc-panel.c \
|
cc-panel.c \
|
||||||
cc-panel.h \
|
cc-panel.h \
|
||||||
cc-setting-editor.c \
|
cc-setting-editor.c \
|
||||||
cc-setting-editor.h \
|
cc-setting-editor.h \
|
||||||
cc-shell.c \
|
cc-shell.c \
|
||||||
cc-shell.h \
|
cc-shell.h \
|
||||||
gconf-property-editor-marshal.c \
|
|
||||||
gconf-property-editor-marshal.h \
|
|
||||||
gconf-property-editor.c \
|
gconf-property-editor.c \
|
||||||
gconf-property-editor.h \
|
gconf-property-editor.h \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
#include "gconf-property-editor-marshal.h"
|
#include "cc-marshal.h"
|
||||||
|
|
||||||
/* VOID:STRING,POINTER (peditor-marshal.list:25) */
|
/* VOID:STRING,POINTER (peditor-marshal.list:25) */
|
||||||
void
|
void
|
||||||
gconf_property_editor_marshal_VOID__STRING_POINTER (GClosure *closure,
|
cc_marshal_VOID__STRING_POINTER (GClosure *closure,
|
||||||
GValue *return_value,
|
GValue *return_value,
|
||||||
guint n_param_values,
|
guint n_param_values,
|
||||||
const GValue *param_values,
|
const GValue *param_values,
|
||||||
gpointer invocation_hint,
|
gpointer invocation_hint,
|
||||||
gpointer marshal_data)
|
gpointer marshal_data)
|
||||||
{
|
{
|
||||||
typedef void (*GMarshalFunc_VOID__STRING_POINTER) (gpointer data1,
|
typedef void (*GMarshalFunc_VOID__STRING_POINTER) (gpointer data1,
|
||||||
gpointer arg_1,
|
gpointer arg_1,
|
15
libgnome-control-center/cc-marshal.h
Normal file
15
libgnome-control-center/cc-marshal.h
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
|
||||||
|
#include <gobject/gmarshal.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
/* VOID:STRING,POINTER (peditor-marshal.list:25) */
|
||||||
|
extern void cc_marshal_VOID__STRING_POINTER (GClosure *closure,
|
||||||
|
GValue *return_value,
|
||||||
|
guint n_param_values,
|
||||||
|
const GValue *param_values,
|
||||||
|
gpointer invocation_hint,
|
||||||
|
gpointer marshal_data);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
|
@ -20,12 +20,18 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "cc-setting-editor.h"
|
#include "cc-setting-editor.h"
|
||||||
|
#include "cc-marshal.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PIXBUF_COL,
|
PIXBUF_COL,
|
||||||
TEXT_COL,
|
TEXT_COL,
|
||||||
APP_INFO_COL,
|
APP_INFO_COL,
|
||||||
N_COLUMNS
|
N_COLUMNS
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
VALUE_CHANGED,
|
||||||
|
LAST_SIGNAL
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -43,6 +49,8 @@ struct _CcSettingEditorPrivate
|
||||||
GtkWidget *ui_control;
|
GtkWidget *ui_control;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static guint seditor_signals[LAST_SIGNAL] = { 0, };
|
||||||
|
|
||||||
G_DEFINE_TYPE(CcSettingEditor, cc_setting_editor, G_TYPE_OBJECT)
|
G_DEFINE_TYPE(CcSettingEditor, cc_setting_editor, G_TYPE_OBJECT)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -72,6 +80,14 @@ cc_setting_editor_class_init (CcSettingEditorClass *klass)
|
||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
object_class->finalize = cc_setting_editor_finalize;
|
object_class->finalize = cc_setting_editor_finalize;
|
||||||
|
|
||||||
|
/* Class signals */
|
||||||
|
seditor_signals[VALUE_CHANGED] = g_signal_new ("value-changed",
|
||||||
|
G_TYPE_FROM_CLASS (klass), 0,
|
||||||
|
G_STRUCT_OFFSET (CcSettingEditorClass, value_changed),
|
||||||
|
NULL, NULL,
|
||||||
|
(GSignalCMarshaller) cc_marshal_VOID__STRING_POINTER,
|
||||||
|
G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_POINTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -113,11 +129,13 @@ application_selection_changed_cb (GtkComboBox *combobox, CcSettingEditor *sedito
|
||||||
gtk_tree_model_get (gtk_combo_box_get_model (combobox), &selected_row,
|
gtk_tree_model_get (gtk_combo_box_get_model (combobox), &selected_row,
|
||||||
APP_INFO_COL, &app_info,
|
APP_INFO_COL, &app_info,
|
||||||
-1);
|
-1);
|
||||||
if (!g_app_info_set_as_default_for_type (app_info, seditor->priv->key, &error)) {
|
if (app_info != NULL) {
|
||||||
g_warning ("Could not set %s as default app for %s: %s",
|
if (!g_app_info_set_as_default_for_type (app_info, seditor->priv->key, &error)) {
|
||||||
g_app_info_get_display_name (app_info),
|
g_warning ("Could not set %s as default app for %s: %s",
|
||||||
seditor->priv->key,
|
g_app_info_get_display_name (app_info),
|
||||||
error->message);
|
seditor->priv->key,
|
||||||
|
error->message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,6 +164,7 @@ cc_setting_editor_new_application (const gchar *mime_type, GtkWidget *combobox)
|
||||||
mime_type,
|
mime_type,
|
||||||
combobox);
|
combobox);
|
||||||
|
|
||||||
|
/* Setup the combo box */
|
||||||
model = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_POINTER);
|
model = gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_POINTER);
|
||||||
|
|
||||||
renderer = gtk_cell_renderer_pixbuf_new ();
|
renderer = gtk_cell_renderer_pixbuf_new ();
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
|
|
||||||
#include <gobject/gmarshal.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
|
|
||||||
/* VOID:STRING,POINTER (peditor-marshal.list:25) */
|
|
||||||
extern void gconf_property_editor_marshal_VOID__STRING_POINTER (GClosure *closure,
|
|
||||||
GValue *return_value,
|
|
||||||
guint n_param_values,
|
|
||||||
const GValue *param_values,
|
|
||||||
gpointer invocation_hint,
|
|
||||||
gpointer marshal_data);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "gconf-property-editor.h"
|
#include "gconf-property-editor.h"
|
||||||
#include "gconf-property-editor-marshal.h"
|
#include "cc-marshal.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
VALUE_CHANGED,
|
VALUE_CHANGED,
|
||||||
|
@ -172,7 +172,7 @@ gconf_property_editor_class_init (GConfPropertyEditorClass *class)
|
||||||
G_TYPE_FROM_CLASS (object_class), 0,
|
G_TYPE_FROM_CLASS (object_class), 0,
|
||||||
G_STRUCT_OFFSET (GConfPropertyEditorClass, value_changed),
|
G_STRUCT_OFFSET (GConfPropertyEditorClass, value_changed),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
(GSignalCMarshaller) gconf_property_editor_marshal_VOID__STRING_POINTER,
|
(GSignalCMarshaller) cc_marshal_VOID__STRING_POINTER,
|
||||||
G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_POINTER);
|
G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_POINTER);
|
||||||
|
|
||||||
g_object_class_install_property
|
g_object_class_install_property
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue