[Xfce4-commits] [panel-plugins/xfce4-xkb-plugin] 11/17: Move dialog callbacks to xkb-plugin source

noreply at xfce.org noreply at xfce.org
Sat Jun 10 14:31:44 CEST 2017


This is an automated email from the git hooks/post-receive script.

n   i   n   e   t   l   s       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-xkb-plugin.

commit d124b618cd7eff9fcf7e3d8bbb1c20d31f311b43
Author: Viktor Odintsev <zakhams at gmail.com>
Date:   Wed Mar 29 13:59:50 2017 +0300

    Move dialog callbacks to xkb-plugin source
---
 panel-plugin/Makefile.am                           | 14 +++---
 .../{xkb-settings-dialog.c => xkb-dialog.c}        | 58 ++++++----------------
 .../{xkb-settings-dialog.h => xkb-dialog.h}        |  7 +--
 panel-plugin/xkb-plugin.c                          | 27 ++++++----
 panel-plugin/xkb-plugin.h                          |  2 -
 po/POTFILES.in                                     |  2 +-
 6 files changed, 44 insertions(+), 66 deletions(-)

diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 177c945..164a6c5 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -9,17 +9,17 @@ plugin_LTLIBRARIES = \
 libxkb_la_SOURCES = \
 	xkb-plugin.h \
 	xkb-plugin.c \
-	xkb-settings-dialog.h \
-	xkb-settings-dialog.c \
+	xkb-properties.h \
 	xkb-keyboard.h \
 	xkb-keyboard.c \
-	xkb-util.h \
-	xkb-util.c \
+	xkb-dialog.h \
+	xkb-dialog.c \
+	xkb-xfconf.h \
+	xkb-xfconf.c \
 	xkb-cairo.h \
 	xkb-cairo.c \
-	xkb-properties.h \
-	xkb-xfconf.h \
-	xkb-xfconf.c
+	xkb-util.h \
+	xkb-util.c
 
 libxkb_la_CPPFLAGS = \
 	-I$(top_srcdir) \
diff --git a/panel-plugin/xkb-settings-dialog.c b/panel-plugin/xkb-dialog.c
similarity index 88%
rename from panel-plugin/xkb-settings-dialog.c
rename to panel-plugin/xkb-dialog.c
index 4b2ca15..5d378ed 100644
--- a/panel-plugin/xkb-settings-dialog.c
+++ b/panel-plugin/xkb-dialog.c
@@ -1,5 +1,5 @@
 /* vim: set backspace=2 ts=4 softtabstop=4 sw=4 cinoptions=>4 expandtab autoindent smartindent: */
-/* xkb-settings-dialog.c
+/* xkb-dialog.c
  * Copyright (C) 2008 Alexander Iliev <sasoiliev at mamul.org>
  *
  * Parts of this program comes from the XfKC tool:
@@ -35,48 +35,19 @@
 #include <libxfce4ui/libxfce4ui.h>
 
 #include "xkb-plugin.h"
-#include "xkb-settings-dialog.h"
+#include "xkb-dialog.h"
 #include "xkb-util.h"
 
-GtkTreeIter current_iter;
-GtkWidget *settings_dialog;
-GtkWidget *default_layout_menu;
-
 typedef struct
 {
     XfcePanelPlugin *plugin;
     GtkWidget *display_scale_range;
 } DialogInstance;
 
-enum combo_enum
-{
-    DESC = 0,
-    NOM,
-    COMBO_NUM
-};
-
-enum tree_enum
-{
-    DEFAULT_LAYOUT = 0,
-    LAYOUTS,
-    VARIANTS,
-    TREE_NUM
-};
-
-enum enumeration
-{
-    AVAIL_LAYOUT_TREE_COL_DESCRIPTION = 0,
-    AVAIL_LAYOUT_TREE_COL_ID,
-    NUM
-};
-
-
-/**************************************************************/
-
 static void
-on_settings_close (GtkDialog *dialog,
-                   gint response,
-                   DialogInstance *instance)
+xkb_dialog_on_settings_close (GtkDialog *dialog,
+                              gint response,
+                              DialogInstance *instance)
 {
     xfce_panel_plugin_unblock_menu (instance->plugin);
     gtk_widget_destroy (GTK_WIDGET (dialog));
@@ -84,8 +55,8 @@ on_settings_close (GtkDialog *dialog,
 }
 
 static void
-on_display_type_changed (GtkComboBox *cb,
-                         DialogInstance *instance)
+xkb_dialog_on_display_type_changed (GtkComboBox *cb,
+                                    DialogInstance *instance)
 {
     gint active = gtk_combo_box_get_active (cb);
     gtk_widget_set_sensitive (instance->display_scale_range,
@@ -93,20 +64,19 @@ on_display_type_changed (GtkComboBox *cb,
 }
 
 void
-xkb_plugin_configure_plugin (XfcePanelPlugin *plugin)
+xkb_dialog_configure_plugin (XfcePanelPlugin *plugin,
+                             XkbXfconf *config)
 {
+    GtkWidget *settings_dialog;
     GtkWidget *display_type_combo;
     GtkWidget *display_scale_range;
     GtkWidget *display_tooltip_icon_switch;
     GtkWidget *group_policy_combo;
     GtkWidget *vbox, *frame, *bin, *grid, *label;
-    XkbXfconf *config;
     DialogInstance *instance;
 
     xfce_panel_plugin_block_menu (plugin);
 
-    config = xkb_plugin_get_config (XKB_PLUGIN (plugin));
-
     instance = g_new0 (DialogInstance, 1);
     instance->plugin = plugin;
 
@@ -191,12 +161,12 @@ xkb_plugin_configure_plugin (XfcePanelPlugin *plugin)
     gtk_widget_show_all (vbox);
 
     g_signal_connect ((gpointer) settings_dialog, "response",
-            G_CALLBACK (on_settings_close), instance);
+            G_CALLBACK (xkb_dialog_on_settings_close), instance);
 
     /* enable or disable display_scale_range depending on display type */
     g_signal_connect (display_type_combo, "changed",
-            G_CALLBACK (on_display_type_changed), instance);
-    on_display_type_changed (GTK_COMBO_BOX (display_type_combo), instance);
+            G_CALLBACK (xkb_dialog_on_display_type_changed), instance);
+    xkb_dialog_on_display_type_changed (GTK_COMBO_BOX (display_type_combo), instance);
 
     g_object_bind_property (G_OBJECT (config), DISPLAY_TYPE,
             G_OBJECT (display_type_combo),
@@ -218,7 +188,7 @@ xkb_plugin_configure_plugin (XfcePanelPlugin *plugin)
 }
 
 void
-xkb_plugin_show_about (XfcePanelPlugin *plugin)
+xkb_dialog_about_show (void)
 {
     GtkWidget *about;
     GdkPixbuf *icon;
diff --git a/panel-plugin/xkb-settings-dialog.h b/panel-plugin/xkb-dialog.h
similarity index 86%
rename from panel-plugin/xkb-settings-dialog.h
rename to panel-plugin/xkb-dialog.h
index ae810d4..1e2e848 100644
--- a/panel-plugin/xkb-settings-dialog.h
+++ b/panel-plugin/xkb-dialog.h
@@ -1,5 +1,5 @@
 /* vim: set backspace=2 ts=4 softtabstop=4 sw=4 cinoptions=>4 expandtab autoindent smartindent: */
-/* xkb-settings-dialog.h
+/* xkb-dialog.h
  * Copyright (C) 2008 Alexander Iliev <sasoiliev at mamul.org>
  *
  * Parts of this program comes from the XfKC tool:
@@ -26,8 +26,9 @@
 #ifndef __XKB_SETTINGS_DIALOG_H__
 #define __XKB_SETTINGS_DIALOG_H__
 
-void    xkb_plugin_configure_plugin    (XfcePanelPlugin *plugin);
-void    xkb_plugin_show_about          (XfcePanelPlugin *plugin);
+void    xkb_dialog_configure_plugin    (XfcePanelPlugin *plugin,
+                                        XkbXfconf *config);
+void    xkb_dialog_about_show          (void);
 
 #endif
 
diff --git a/panel-plugin/xkb-plugin.c b/panel-plugin/xkb-plugin.c
index 69b887b..2b316b0 100644
--- a/panel-plugin/xkb-plugin.c
+++ b/panel-plugin/xkb-plugin.c
@@ -36,7 +36,7 @@
 #include <garcon/garcon.h>
 
 #include "xkb-plugin.h"
-#include "xkb-settings-dialog.h"
+#include "xkb-dialog.h"
 #include "xkb-util.h"
 #include "xkb-cairo.h"
 #include "xkb-properties.h"
@@ -76,6 +76,8 @@ static void         xkb_plugin_orientation_changed      (XfcePanelPlugin *plugin
 static gboolean     xkb_plugin_size_changed             (XfcePanelPlugin *plugin,
                                                          gint size);
 static void         xkb_plugin_free_data                (XfcePanelPlugin *plugin);
+static void         xkb_plugin_about_show               (XfcePanelPlugin *plugin);
+static void         xkb_plugin_configure_plugin         (XfcePanelPlugin *plugin);
 
 /* ----------------------------------------------------------------- *
  *                           XKB Stuff                               *
@@ -148,7 +150,7 @@ xkb_plugin_class_init (XkbPluginClass *klass)
     plugin_class = XFCE_PANEL_PLUGIN_CLASS (klass);
     plugin_class->construct = xkb_plugin_construct;
     plugin_class->free_data = xkb_plugin_free_data;
-    plugin_class->about = xkb_plugin_show_about;
+    plugin_class->about = xkb_plugin_about_show;
     plugin_class->configure_plugin = xkb_plugin_configure_plugin;
     plugin_class->orientation_changed = xkb_plugin_orientation_changed;
     plugin_class->size_changed = xkb_plugin_size_changed;
@@ -276,6 +278,20 @@ xkb_plugin_free_data (XfcePanelPlugin *plugin)
     g_object_unref (G_OBJECT (xkb_plugin->config));
 }
 
+static void
+xkb_plugin_about_show (XfcePanelPlugin *plugin)
+{
+    xkb_dialog_about_show ();
+}
+
+static void
+xkb_plugin_configure_plugin (XfcePanelPlugin *plugin)
+{
+    XkbPlugin *xkb_plugin = XKB_PLUGIN (plugin);
+
+    xkb_dialog_configure_plugin (plugin, xkb_plugin->config);
+}
+
 /* ----------------- xkb plugin stuff -----------------------*/
 
 static void
@@ -684,10 +700,3 @@ xkb_plugin_group_policy_changed (XkbPlugin *plugin)
     xkb_keyboard_set_group_policy (plugin->keyboard,
             xkb_xfconf_get_group_policy (plugin->config));
 }
-
-XkbXfconf *
-xkb_plugin_get_config (XkbPlugin *plugin)
-{
-    g_return_val_if_fail (IS_XKB_PLUGIN (plugin), NULL);
-    return plugin->config;
-}
diff --git a/panel-plugin/xkb-plugin.h b/panel-plugin/xkb-plugin.h
index 71ca460..6505f8f 100644
--- a/panel-plugin/xkb-plugin.h
+++ b/panel-plugin/xkb-plugin.h
@@ -53,8 +53,6 @@ GType             xkb_plugin_get_type                     (void)
 
 void              xkb_plugin_register_type                (XfcePanelTypeModule   *type_module);
 
-XkbXfconf        *xkb_plugin_get_config                   (XkbPlugin             *plugin);
-
 G_END_DECLS
 
 #endif
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 20b1f0a..99f288f 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,6 @@
 # List of source files containing translatable strings.
 
-panel-plugin/xkb-settings-dialog.c
+panel-plugin/xkb-dialog.c
 panel-plugin/xkb-plugin.c
 
 # files added by intltool-prepare.

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list