[aisleriot] debug: Remove property editor
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aisleriot] debug: Remove property editor
- Date: Sat, 16 Aug 2014 16:45:40 +0000 (UTC)
commit 3dd95eea8d515da481d130e212f29c28f364dba7
Author: Christian Persch <chpe gnome org>
Date: Sat Aug 16 18:44:48 2014 +0200
debug: Remove property editor
Just use the gtk+ inspector.
src/Makefile.am | 14 -
src/aisleriot-debug-ui.xml | 5 -
src/board-noclutter.c | 25 +-
src/prop-editor.c | 1456 --------------------------------------------
src/prop-editor.h | 30 -
src/window.c | 85 ---
6 files changed, 23 insertions(+), 1592 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 7a62493..9d2a210 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -40,13 +40,6 @@ sol_SOURCES = \
window.h \
$(NULL)
-if ENABLE_DEBUG_UI
-sol_SOURCES += \
- prop-editor.c \
- prop-editor.h \
- $(NULL)
-endif
-
sol_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/src/lib \
@@ -115,13 +108,6 @@ sol_clutter_SOURCES = \
window.h \
$(NULL)
-if ENABLE_DEBUG_UI
-sol_clutter_SOURCES += \
- prop-editor.c \
- prop-editor.h \
- $(NULL)
-endif
-
sol_clutter_CPPFLAGS = $(sol_CPPFLAGS) -DHAVE_CLUTTER
sol_clutter_CFLAGS = $(sol_CFLAGS) $(CLUTTER_GTK_CFLAGS) $(CLUTTER_CFLAGS)
sol_clutter_LDFLAGS = $(sol_LDFLAGS)
diff --git a/src/aisleriot-debug-ui.xml b/src/aisleriot-debug-ui.xml
index 972cd4b..3b0e0f4 100644
--- a/src/aisleriot-debug-ui.xml
+++ b/src/aisleriot-debug-ui.xml
@@ -1,12 +1,7 @@
<ui>
<menubar name="MainMenu">
<menu action="DebugMenu">
- <menuitem action="DebugTweakStyle"/>
- <menuitem action="DebugTweakSettings"/>
- <separator/>
<menuitem action="DebugChooseSeed"/>
- <menuitem action="DebugMoveNextScreen"/>
- <menuitem action="DebugDelayedMoveNextScreen"/>
<menuitem action="DebugException"/>
<separator/>
<menuitem action="DebugCycle"/>
diff --git a/src/board-noclutter.c b/src/board-noclutter.c
index 0f2ac4c..e604728 100644
--- a/src/board-noclutter.c
+++ b/src/board-noclutter.c
@@ -3246,6 +3246,26 @@ aisleriot_board_finalize (GObject *object)
}
static void
+aisleriot_board_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ AisleriotBoard *board = AISLERIOT_BOARD (object);
+ AisleriotBoardPrivate *priv = board->priv;
+
+ switch (prop_id) {
+ case PROP_GAME:
+ g_value_set_object (value, priv->game);
+ break;
+
+ case PROP_STYLE:
+ g_value_set_object (value, priv->style);
+ break;
+ }
+}
+
+static void
aisleriot_board_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -3293,6 +3313,7 @@ aisleriot_board_class_init (AisleriotBoardClass *klass)
gobject_class->dispose = aisleriot_board_dispose;
gobject_class->finalize = aisleriot_board_finalize;
+ gobject_class->get_property = aisleriot_board_get_property;
gobject_class->set_property = aisleriot_board_set_property;
widget_class->realize = aisleriot_board_realize;
@@ -3389,7 +3410,7 @@ aisleriot_board_class_init (AisleriotBoardClass *klass)
PROP_GAME,
g_param_spec_object ("game", NULL, NULL,
AISLERIOT_TYPE_GAME,
- G_PARAM_WRITABLE |
+ G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
@@ -3398,7 +3419,7 @@ aisleriot_board_class_init (AisleriotBoardClass *klass)
PROP_STYLE,
g_param_spec_object ("style", NULL, NULL,
AR_TYPE_STYLE,
- G_PARAM_WRITABLE |
+ G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
diff --git a/src/window.c b/src/window.c
index c8266fd..7e34853 100644
--- a/src/window.c
+++ b/src/window.c
@@ -58,10 +58,6 @@
#include "window.h"
-#ifdef ENABLE_DEBUG_UI
-#include "prop-editor.h"
-#endif
-
#define AISLERIOT_WINDOW_GET_PRIVATE(window)(G_TYPE_INSTANCE_GET_PRIVATE ((window), AISLERIOT_TYPE_WINDOW,
AisleriotWindowPrivate))
#define MIN_WIDTH 800
@@ -548,42 +544,6 @@ install_themes_cb (GtkAction *action,
#ifdef ENABLE_DEBUG_UI
static void
-move_to_next_screen_cb (GtkAction *action,
- GtkWidget *widget)
-{
- GdkScreen *screen;
- GdkDisplay *display;
- int number_of_screens, screen_num;
-
- screen = gtk_widget_get_screen (widget);
- display = gdk_screen_get_display (screen);
- screen_num = gdk_screen_get_number (screen);
- number_of_screens = gdk_display_get_n_screens (display);
-
- if ((screen_num + 1) < number_of_screens) {
- screen = gdk_display_get_screen (display, screen_num + 1);
- } else {
- screen = gdk_display_get_screen (display, 0);
- }
-
- gtk_window_set_screen (GTK_WINDOW (widget), screen);
-}
-
-static gboolean
-delayed_move_to_next_screen_timeout_cb (GtkWidget *widget)
-{
- move_to_next_screen_cb (NULL, widget);
- return FALSE;
-}
-
-static void
-delayed_move_to_next_screen_cb (GtkAction *action,
- GtkWidget *widget)
-{
- g_timeout_add_seconds (10, (GSourceFunc) delayed_move_to_next_screen_timeout_cb, widget);
-}
-
-static void
debug_exception_cb (GtkAction *action,
AisleriotWindow *window)
{
@@ -803,43 +763,6 @@ debug_choose_seed_cb (GtkAction *action,
gtk_window_present (GTK_WINDOW (dialog));
}
-static void
-debug_tweak_style_cb (GtkAction *action,
- AisleriotWindow *window)
-{
- AisleriotWindowPrivate *priv = window->priv;
- GObject *object;
- GType type;
- GtkWidget *prop_editor;
-
- object = G_OBJECT (priv->board_style);
- type = G_OBJECT_TYPE (object);
-
- g_assert (object != NULL);
-
- prop_editor = create_prop_editor (object, type);
- gtk_window_set_transient_for (GTK_WINDOW (prop_editor), GTK_WINDOW (window));
- gtk_window_present (GTK_WINDOW (prop_editor));
-}
-
-static void
-debug_tweak_settings_cb (GtkAction *action,
- AisleriotWindow *window)
-{
- GObject *object;
- GType type;
- GtkWidget *prop_editor;
-
- object = G_OBJECT (gtk_widget_get_settings (GTK_WIDGET (window)));
- type = G_OBJECT_TYPE (object);
-
- g_assert (object != NULL);
-
- prop_editor = create_prop_editor (object, type);
- gtk_window_set_transient_for (GTK_WINDOW (prop_editor), GTK_WINDOW (window));
- gtk_window_present (GTK_WINDOW (prop_editor));
-}
-
#endif /* ENABLE_DEBUG_UI */
static void
@@ -2033,10 +1956,6 @@ aisleriot_window_init (AisleriotWindow *window)
{ "DebugMenu", NULL, "_Debug" },
{ "DebugChooseSeed", NULL, "_Choose seed", NULL, NULL,
G_CALLBACK (debug_choose_seed_cb) },
- { "DebugMoveNextScreen", NULL, "_Move to next screen", NULL, NULL,
- G_CALLBACK (move_to_next_screen_cb) },
- { "DebugDelayedMoveNextScreen", NULL, "_Delayed move to next screen", NULL, NULL,
- G_CALLBACK (delayed_move_to_next_screen_cb) },
{ "DebugException", NULL, "Generate E_xception", NULL, NULL,
G_CALLBACK (debug_exception_cb) },
{ "DebugCycle", NULL, "Cycle through _all games", NULL, NULL,
@@ -2049,10 +1968,6 @@ aisleriot_window_init (AisleriotWindow *window)
G_CALLBACK (debug_game_next) },
{ "DebugGamePrev", GTK_STOCK_GO_BACK, NULL, NULL, NULL,
G_CALLBACK (debug_game_prev) },
- { "DebugTweakStyle", NULL, "_Tweak Style", NULL, NULL,
- G_CALLBACK (debug_tweak_style_cb) },
- { "DebugTweakSettings", NULL, "_Tweak GtkSettings", NULL, NULL,
- G_CALLBACK (debug_tweak_settings_cb) },
#endif /* ENABLE_DEBUG_UI */
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]