[Xfce4-commits] r30270 - xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings
Nick Schermer
nick at xfce.org
Sat Jul 11 11:42:25 CEST 2009
Author: nick
Date: 2009-07-11 09:42:25 +0000 (Sat, 11 Jul 2009)
New Revision: 30270
Modified:
xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/Makefile.am
xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/command-dialog.c
xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/command-dialog.h
xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/keyboard-dialog.glade
xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/main.c
xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/xfce-keyboard-settings.c
xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/xfce-keyboard-settings.h
Log:
Port keybaord dialgo to Gtkbuilder and 4ui.
Modified: xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/Makefile.am
===================================================================
--- xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/Makefile.am 2009-07-11 08:52:34 UTC (rev 30269)
+++ xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/Makefile.am 2009-07-11 09:42:25 UTC (rev 30270)
@@ -22,12 +22,9 @@
xfce4_keyboard_settings_CFLAGS = \
$(GTK_CFLAGS) \
- $(GLIB_CFLAGS) \
- $(GLADE_CFLAGS) \
- $(DBUS_GLIB_CFLAGS) \
$(LIBXKLAVIER_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
- $(LIBXFCEGUI4_CFLAGS) \
+ $(LIBXFCE4UI_CFLAGS) \
$(LIBXFCE4KBD_PRIVATE_CFLAGS) \
$(EXO_CFLAGS) \
$(XFCONF_CFLAGS)
@@ -38,12 +35,9 @@
xfce4_keyboard_settings_LDADD = \
$(GTK_LIBS) \
- $(GLIB_LIBS) \
- $(GLADE_LIBS) \
- $(DBUS_GLIB_LIBS) \
$(LIBXKLAVIER_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
- $(LIBXFCEGUI4_LIBS) \
+ $(LIBXFCE4UI_LIBS) \
$(LIBXFCE4KBD_PRIVATE_LIBS) \
$(EXO_LIBS) \
$(XFCONF_LIBS)
Modified: xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/command-dialog.c
===================================================================
--- xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/command-dialog.c 2009-07-11 08:52:34 UTC (rev 30269)
+++ xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/command-dialog.c 2009-07-11 09:42:25 UTC (rev 30270)
@@ -3,19 +3,19 @@
/*-
* Copyright (c) 2008 Jannis Pohlmann <jannis at xfce.org>.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
@@ -26,7 +26,7 @@
#include <gtk/gtk.h>
#include <libxfce4util/libxfce4util.h>
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
#include "command-dialog.h"
@@ -102,7 +102,7 @@
const gchar *action)
{
CommandDialog *dialog;
-
+
dialog = COMMAND_DIALOG (g_object_new (TYPE_COMMAND_DIALOG, NULL));
command_dialog_create_contents (dialog, shortcut, action);
@@ -112,7 +112,7 @@
-static void
+static void
command_dialog_create_contents (CommandDialog *dialog,
const gchar *shortcut,
const gchar *action)
@@ -161,7 +161,7 @@
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (label);
-
+
hbox = gtk_hbox_new (FALSE, 6);
gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
gtk_widget_show (hbox);
@@ -204,12 +204,12 @@
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
- do
+ do
{
response = gtk_dialog_run (GTK_DIALOG (dialog));
if (G_UNLIKELY (response != GTK_RESPONSE_CANCEL && g_utf8_strlen (command_dialog_get_command (dialog), -1) == 0))
- xfce_err (_("The command may not be empty."));
+ xfce_dialog_show_error (GTK_WINDOW (dialog), NULL, _("The command may not be empty."));
else
finished = TRUE;
}
@@ -220,7 +220,7 @@
-static void
+static void
command_dialog_button_clicked (CommandDialog *dialog)
{
GtkWidget *chooser;
@@ -229,9 +229,9 @@
g_return_if_fail (IS_COMMAND_DIALOG (dialog));
- chooser = gtk_file_chooser_dialog_new (_("Select command"),
- GTK_WINDOW (dialog),
- GTK_FILE_CHOOSER_ACTION_OPEN,
+ chooser = gtk_file_chooser_dialog_new (_("Select command"),
+ GTK_WINDOW (dialog),
+ GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK, NULL);
Modified: xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/command-dialog.h
===================================================================
--- xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/command-dialog.h 2009-07-11 08:52:34 UTC (rev 30269)
+++ xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/command-dialog.h 2009-07-11 09:42:25 UTC (rev 30270)
@@ -3,19 +3,19 @@
/*-
* Copyright (c) 2008 Jannis Pohlmann <jannis at xfce.org>.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
Modified: xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/keyboard-dialog.glade
===================================================================
--- xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/keyboard-dialog.glade 2009-07-11 08:52:34 UTC (rev 30269)
+++ xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/keyboard-dialog.glade 2009-07-11 09:42:25 UTC (rev 30270)
@@ -1,112 +1,144 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Sun Nov 16 15:59:31 2008 -->
-<glade-interface>
- <requires lib="xfce4"/>
- <widget class="XfceTitledDialog" id="keyboard-settings-dialog">
+<?xml version="1.0"?>
+<interface>
+ <!-- interface-requires gtk+ 2.12 -->
+ <!-- interface-requires libxfce4ui 4.5 -->
+ <!-- interface-naming-policy toplevel-contextual -->
+ <object class="GtkAdjustment" id="xkb_key_repeat_delay">
+ <property name="value">500</property>
+ <property name="lower">10</property>
+ <property name="upper">1000</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ <property name="page_size">1</property>
+ </object>
+ <object class="GtkAdjustment" id="xkb_key_repeat_rate">
+ <property name="value">20</property>
+ <property name="lower">1</property>
+ <property name="upper">250</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ <property name="page_size">1</property>
+ </object>
+ <object class="GtkAdjustment" id="net_cursor_blink_time">
+ <property name="value">1000</property>
+ <property name="lower">100</property>
+ <property name="upper">2000</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ <property name="page_size">1</property>
+ </object>
+ <object class="XfceTitledDialog" id="keyboard-settings-dialog">
<property name="title" translatable="yes">Keyboard</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="window_position">center-on-parent</property>
<property name="default_width">400</property>
<property name="icon_name">preferences-desktop-keyboard</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<property name="subtitle" translatable="yes">Edit keyboard settings and application shortcuts</property>
<child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
+ <object class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
- <widget class="GtkVBox" id="plug-child">
+ <object class="GtkVBox" id="plug-child">
<property name="visible">True</property>
<property name="border_width">6</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkNotebook" id="notebook1">
+ <object class="GtkNotebook" id="notebook1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
- <widget class="GtkVBox" id="vbox2">
+ <object class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="border_width">12</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkVBox" id="vbox3">
+ <object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkFrame" id="frame2">
+ <object class="GtkFrame" id="frame2">
<property name="visible">True</property>
<property name="label_xalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">none</property>
<child>
- <widget class="GtkAlignment" id="alignment2">
+ <object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="bottom_padding">6</property>
<property name="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox3">
+ <object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="border_width">6</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkCheckButton" id="xkb_key_repeat_check">
+ <object class="GtkCheckButton" id="xkb_key_repeat_check">
+ <property name="label" translatable="yes">_Enable key repeat</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">When selected, pressing and holding down a key emits the same character over and over again</property>
- <property name="label" translatable="yes">_Enable key repeat</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">When selected, pressing and holding down a key emits the same character over and over again</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkAlignment" id="xkb_key_repeat_box">
+ <object class="GtkAlignment" id="xkb_key_repeat_box">
<property name="visible">True</property>
- <property name="left_padding">12</property>
+ <property name="left_padding">18</property>
<child>
- <widget class="GtkVBox" id="vbox6">
+ <object class="GtkVBox" id="vbox6">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label7">
+ <object class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Repeat delay:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">xkb_key_repeat_delay_scale</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkHScale" id="xkb_key_repeat_delay_scale">
+ <object class="GtkHScale" id="xkb_key_repeat_delay_scale">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">The time, in milliseconds, before a pressed key begins repeating</property>
- <property name="update_policy">GTK_UPDATE_DELAYED</property>
- <property name="adjustment">500 10 1000 1 10 1</property>
+ <property name="tooltip_text" translatable="yes">The time, in milliseconds, before a pressed key begins repeating</property>
+ <property name="update_policy">delayed</property>
+ <property name="adjustment">xkb_key_repeat_delay</property>
<property name="digits">0</property>
- <property name="value_pos">GTK_POS_RIGHT</property>
- </widget>
+ <property name="value_pos">right</property>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label10">
+ <object class="GtkLabel" id="label10">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Repeat _speed:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">xkb_key_repeat_rate_scale</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
@@ -114,144 +146,150 @@
</packing>
</child>
<child>
- <widget class="GtkHScale" id="xkb_key_repeat_rate_scale">
+ <object class="GtkHScale" id="xkb_key_repeat_rate_scale">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">The rate at which keystrokes are generated while a key is pressed</property>
- <property name="update_policy">GTK_UPDATE_DELAYED</property>
- <property name="adjustment">20 1 250 1 10 1</property>
+ <property name="tooltip_text" translatable="yes">The rate at which keystrokes are generated while a key is pressed</property>
+ <property name="update_policy">delayed</property>
+ <property name="adjustment">xkb_key_repeat_rate</property>
<property name="digits">0</property>
- <property name="value_pos">GTK_POS_RIGHT</property>
- </widget>
+ <property name="value_pos">right</property>
+ </object>
<packing>
<property name="position">3</property>
</packing>
</child>
- </widget>
+ </object>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
</child>
- </widget>
+ </object>
</child>
- <child>
- <widget class="GtkLabel" id="label5">
+ <child type="label">
+ <object class="GtkLabel" id="label5">
<property name="visible">True</property>
- <property name="label" translatable="yes"><b>Typing Settings</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <property name="label" translatable="yes">Typing Settings</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
</child>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkFrame" id="frame3">
+ <object class="GtkFrame" id="frame3">
<property name="visible">True</property>
<property name="label_xalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">none</property>
<child>
- <widget class="GtkAlignment" id="alignment3">
+ <object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="left_padding">12</property>
<child>
- <widget class="GtkVBox" id="vbox4">
+ <object class="GtkVBox" id="vbox4">
<property name="visible">True</property>
<property name="border_width">6</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkCheckButton" id="net_cursor_blink_check">
+ <object class="GtkCheckButton" id="net_cursor_blink_check">
+ <property name="label" translatable="yes">Show _blinking</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Specify whether or not the text cursor blinks</property>
- <property name="label" translatable="yes">Show _blinking</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Specify whether or not the text cursor blinks</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkAlignment" id="net_cursor_blink_box">
+ <object class="GtkAlignment" id="net_cursor_blink_box">
<property name="visible">True</property>
<property name="sensitive">False</property>
- <property name="left_padding">12</property>
+ <property name="left_padding">18</property>
<child>
- <widget class="GtkVBox" id="vbox7">
+ <object class="GtkVBox" id="vbox7">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label13">
+ <object class="GtkLabel" id="label13">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Blink _delay:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">net_cursor_blink_time_scale</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkHScale" id="net_cursor_blink_time_scale">
+ <object class="GtkHScale" id="net_cursor_blink_time_scale">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">The delay, in milliseconds, between successive blinks of the cursor</property>
- <property name="update_policy">GTK_UPDATE_DELAYED</property>
- <property name="adjustment">1000 100 2000 1 10 1</property>
+ <property name="tooltip_text" translatable="yes">The delay, in milliseconds, between successive blinks of the cursor</property>
+ <property name="update_policy">delayed</property>
+ <property name="adjustment">net_cursor_blink_time</property>
<property name="digits">0</property>
- <property name="value_pos">GTK_POS_RIGHT</property>
- </widget>
+ <property name="value_pos">right</property>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
</child>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
</child>
- </widget>
+ </object>
</child>
- <child>
- <widget class="GtkLabel" id="label6">
+ <child type="label">
+ <object class="GtkLabel" id="label6">
<property name="visible">True</property>
- <property name="label" translatable="yes"><b>Cursor</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <property name="label" translatable="yes">Cursor</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <widget class="GtkHSeparator" id="hseparator1">
+ <object class="GtkHSeparator" id="hseparator1">
<property name="visible">True</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="padding">6</property>
@@ -259,15 +297,15 @@
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label1">
+ <object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="yalign">1</property>
<property name="label" translatable="yes">Use this area to _test the settings above:</property>
<property name="use_underline">True</property>
- <property name="wrap_mode">PANGO_WRAP_WORD_CHAR</property>
+ <property name="wrap_mode">word-char</property>
<property name="mnemonic_widget">entry1</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
@@ -275,415 +313,437 @@
</packing>
</child>
<child>
- <widget class="GtkEntry" id="entry1">
+ <object class="GtkEntry" id="entry1">
<property name="visible">True</property>
<property name="can_focus">True</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
- </widget>
+ </object>
</child>
- <child>
- <widget class="GtkLabel" id="label2">
+ <child type="tab">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="label" translatable="yes">Be_havior</property>
<property name="use_underline">True</property>
- </widget>
+ </object>
<packing>
- <property name="type">tab</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
- <widget class="GtkVBox" id="vbox5">
+ <object class="GtkVBox" id="vbox5">
<property name="visible">True</property>
<property name="border_width">12</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel" id="label16">
+ <object class="GtkLabel" id="label16">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Define _shortcuts for launching applications:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">kbd_shortcuts_view</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkScrolledWindow" id="scrolledwindow2">
+ <object class="GtkScrolledWindow" id="scrolledwindow2">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
<child>
- <widget class="GtkTreeView" id="kbd_shortcuts_view">
+ <object class="GtkTreeView" id="kbd_shortcuts_view">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="search_column">0</property>
- </widget>
+ </object>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkHButtonBox" id="hbuttonbox1">
+ <object class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
<property name="border_width">2</property>
- <property name="spacing">12</property>
- <property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
+ <property name="spacing">6</property>
+ <property name="layout_style">spread</property>
<child>
- <widget class="GtkButton" id="add_shortcut_button">
+ <object class="GtkButton" id="add_shortcut_button">
+ <property name="label">gtk-add</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label">gtk-add</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
- </widget>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <widget class="GtkButton" id="delete_shortcut_button">
+ <object class="GtkButton" id="delete_shortcut_button">
+ <property name="label">gtk-remove</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label">gtk-remove</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
- </widget>
+ </object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="reset_shortcuts_button">
+ <object class="GtkButton" id="reset_shortcuts_button">
+ <property name="label" translatable="yes">_Reset to Defaults</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label" translatable="yes">_Reset to Defaults</property>
+ <property name="image">image1</property>
<property name="use_underline">True</property>
- <property name="response_id">0</property>
- </widget>
+ </object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- <child>
- <widget class="GtkLabel" id="label3">
+ <child type="tab">
+ <object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="label" translatable="yes">Appli_cation Shortcuts</property>
<property name="use_underline">True</property>
- </widget>
+ </object>
<packing>
- <property name="type">tab</property>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
- <widget class="GtkVBox" id="xkb_tab_layout_vbox">
+ <object class="GtkVBox" id="xkb_tab_layout_vbox">
<property name="border_width">12</property>
+ <property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkCheckButton" id="xkb_use_system_default_checkbutton">
+ <object class="GtkCheckButton" id="xkb_use_system_default_checkbutton">
+ <property name="label" translatable="yes">_Use system defaults</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Specifies whether the keyboard layout is controlled with this settings dialog, or by the X server</property>
- <property name="label" translatable="yes">_Use system defaults</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Specifies whether the keyboard layout is controlled with this settings dialog, or by the X server</property>
<property name="use_underline">True</property>
<property name="active">True</property>
- <property name="response_id">0</property>
<property name="draw_indicator">True</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkFrame" id="xkb_model_frame">
+ <object class="GtkFrame" id="xkb_model_frame">
<property name="visible">True</property>
<property name="label_xalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">none</property>
<child>
- <widget class="GtkAlignment" id="alignment1">
+ <object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="border_width">6</property>
- <property name="left_padding">6</property>
+ <property name="left_padding">12</property>
<child>
- <widget class="GtkComboBox" id="xkb_model_combo">
+ <object class="GtkComboBox" id="xkb_model_combo">
<property name="visible">True</property>
- </widget>
+ </object>
</child>
- </widget>
+ </object>
</child>
- <child>
- <widget class="GtkLabel" id="label11">
+ <child type="label">
+ <object class="GtkLabel" id="label11">
<property name="visible">True</property>
- <property name="label" translatable="yes"><b>Keyboard model</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <property name="label" translatable="yes">Keyboard model</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
</child>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkFrame" id="xkb_layout_frame">
+ <object class="GtkFrame" id="xkb_layout_frame">
<property name="visible">True</property>
<property name="label_xalign">0</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
+ <property name="shadow_type">none</property>
<child>
- <widget class="GtkAlignment" id="alignment4">
+ <object class="GtkAlignment" id="alignment4">
<property name="visible">True</property>
- <property name="border_width">6</property>
- <property name="left_padding">6</property>
+ <property name="left_padding">12</property>
<child>
- <widget class="GtkHBox" id="hbox1">
+ <object class="GtkVBox" id="vbox8">
<property name="visible">True</property>
- <property name="spacing">12</property>
+ <property name="border_width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
<child>
- <widget class="GtkTreeView" id="xkb_layout_view">
+ <object class="GtkTreeView" id="xkb_layout_view">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="search_column">0</property>
- </widget>
+ </object>
</child>
- </widget>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <widget class="GtkVBox" id="vbox10">
+ <object class="GtkHButtonBox" id="hbuttonbox2">
<property name="visible">True</property>
<property name="spacing">6</property>
+ <property name="layout_style">spread</property>
<child>
- <widget class="GtkButton" id="xkb_layout_add_button">
+ <object class="GtkButton" id="xkb_layout_add_button">
+ <property name="label">gtk-add</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label">gtk-add</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="xkb_layout_edit_button">
+ <object class="GtkButton" id="xkb_layout_edit_button">
+ <property name="label">gtk-edit</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label">gtk-edit</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="xkb_layout_delete_button">
+ <object class="GtkButton" id="xkb_layout_delete_button">
+ <property name="label">gtk-delete</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label">gtk-delete</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
</child>
- </widget>
+ </object>
</child>
- <child>
- <widget class="GtkLabel" id="label8">
+ <child type="label">
+ <object class="GtkLabel" id="label8">
<property name="visible">True</property>
- <property name="label" translatable="yes"><b>Keyboard layout</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
+ <property name="label" translatable="yes">Keyboard layout</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
</child>
- </widget>
+ </object>
<packing>
<property name="position">2</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">2</property>
</packing>
</child>
- <child>
- <widget class="GtkLabel" id="label4">
+ <child type="tab">
+ <object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="label" translatable="yes">_Layout</property>
<property name="use_underline">True</property>
- </widget>
+ </object>
<packing>
- <property name="type">tab</property>
<property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
+ <object class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_EDGE</property>
+ <property name="layout_style">end</property>
<child>
- <widget class="GtkButton" id="button1">
+ <object class="GtkButton" id="button2">
+ <property name="label">gtk-close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label">gtk-help</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
- </widget>
- </child>
- <child>
- <widget class="GtkButton" id="button2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="label">gtk-close</property>
- <property name="use_stock">True</property>
- <property name="response_id">0</property>
- </widget>
+ </object>
<packing>
- <property name="position">1</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
- </widget>
+ </object>
</child>
- </widget>
- <widget class="XfceTitledDialog" id="keyboard-layout-selection-dialog">
+ <action-widgets>
+ <action-widget response="0">button2</action-widget>
+ </action-widgets>
+ </object>
+ <object class="XfceTitledDialog" id="keyboard-layout-selection-dialog">
<property name="title" translatable="yes">Keyboard layout selection</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+ <property name="window_position">center-on-parent</property>
<property name="default_height">300</property>
<property name="icon_name">preferences-desktop-keyboard</property>
- <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<property name="subtitle" translatable="yes">Select keyboard layout and variant</property>
<child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox2">
+ <object class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
+ <property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
- <widget class="GtkScrolledWindow" id="scrolledwindow3">
+ <object class="GtkScrolledWindow" id="scrolledwindow3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">6</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
<child>
- <widget class="GtkTreeView" id="layout_selection_view">
+ <object class="GtkTreeView" id="layout_selection_view">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<property name="search_column">0</property>
- </widget>
+ </object>
</child>
- </widget>
+ </object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area2">
+ <object class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="layout_style">end</property>
<child>
- <widget class="GtkButton" id="layout_selection_ok_button">
+ <object class="GtkButton" id="layout_selection_ok_button">
+ <property name="label">gtk-ok</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label">gtk-ok</property>
<property name="use_stock">True</property>
- <property name="response_id">1</property>
- </widget>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
- <widget class="GtkButton" id="layout_selection_cancel_button">
+ <object class="GtkButton" id="layout_selection_cancel_button">
+ <property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
- <property name="response_id">0</property>
- </widget>
+ </object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
- </widget>
+ </object>
<packing>
<property name="expand">False</property>
- <property name="pack_type">GTK_PACK_END</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
</packing>
</child>
- </widget>
+ </object>
</child>
- </widget>
-</glade-interface>
+ <action-widgets>
+ <action-widget response="0">layout_selection_ok_button</action-widget>
+ <action-widget response="0">layout_selection_cancel_button</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="stock">gtk-revert-to-saved</property>
+ </object>
+</interface>
Modified: xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/main.c
===================================================================
--- xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/main.c 2009-07-11 08:52:34 UTC (rev 30269)
+++ xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/main.c 2009-07-11 09:42:25 UTC (rev 30270)
@@ -2,19 +2,19 @@
/*-
* Copyright (c) 2008 Jannis Pohlmann <jannis at xfce.org>.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
@@ -126,7 +126,7 @@
}
g_object_unref (settings);
-
+
xfconf_shutdown ();
return EXIT_SUCCESS;
Modified: xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/xfce-keyboard-settings.c
===================================================================
--- xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/xfce-keyboard-settings.c 2009-07-11 08:52:34 UTC (rev 30269)
+++ xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/xfce-keyboard-settings.c 2009-07-11 09:42:25 UTC (rev 30270)
@@ -29,13 +29,12 @@
#include <glib.h>
#include <glib-object.h>
-
+#include <gdk/gdkx.h>
#include <gtk/gtk.h>
-#include <glade/glade.h>
#include <exo/exo.h>
#include <xfconf/xfconf.h>
-#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4ui/libxfce4ui.h>
#include <libxfce4kbd-private/xfce-shortcuts-provider.h>
#include <libxfce4kbd-private/xfce-shortcut-dialog.h>
@@ -58,16 +57,8 @@
-/* Property identifiers */
enum
{
- PROP_0,
- PROP_GLADE_XML,
-};
-
-
-enum
-{
XKB_COMBO_DESCRIPTION = 0,
XKB_COMBO_MODELS,
XKB_COMBO_NUM_COLUMNS
@@ -96,14 +87,6 @@
static void xfce_keyboard_settings_constructed (GObject *object);
static void xfce_keyboard_settings_finalize (GObject *object);
-static void xfce_keyboard_settings_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec);
-static void xfce_keyboard_settings_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
static void xfce_keyboard_settings_row_activated (GtkTreeView *tree_view,
GtkTreePath *path,
GtkTreeViewColumn *column,
@@ -136,7 +119,6 @@
#ifdef HAVE_LIBXKLAVIER
-static gchar * xfce_keyboard_settings_model_description (XklConfigItem *config_item);
static gboolean xfce_keyboard_settings_update_sensitive (GtkToggleButton *toggle,
XfceKeyboardSettings *settings);
static void xfce_keyboard_settings_system_default_cb (GtkToggleButton *toggle,
@@ -155,8 +137,6 @@
static void xfce_keyboard_settings_update_layout_buttons (XfceKeyboardSettings *settings);
static void xfce_keyboard_settings_update_edit_button (GtkTreeView *tree_view,
XfceKeyboardSettings *settings);
-static void xfce_keyboard_settings_update_edit_button (GtkTreeView *tree_view,
- XfceKeyboardSettings *settings);
static void xfce_keyboard_settings_edit_layout_button_cb (GtkWidget *widget,
XfceKeyboardSettings *settings);
static void xfce_keyboard_settings_add_layout_button_cb (GtkWidget *widget,
@@ -177,8 +157,6 @@
struct _XfceKeyboardSettingsPrivate
{
- GladeXML *glade_xml;
-
XfceShortcutsProvider *provider;
#ifdef HAVE_LIBXKLAVIER
@@ -202,7 +180,7 @@
-G_DEFINE_TYPE (XfceKeyboardSettings, xfce_keyboard_settings, G_TYPE_OBJECT)
+G_DEFINE_TYPE (XfceKeyboardSettings, xfce_keyboard_settings, GTK_TYPE_BUILDER)
@@ -214,21 +192,8 @@
g_type_class_add_private (klass, sizeof (XfceKeyboardSettingsPrivate));
gobject_class = G_OBJECT_CLASS (klass);
-#if GLIB_CHECK_VERSION (2,14,0)
gobject_class->constructed = xfce_keyboard_settings_constructed;
-#endif
gobject_class->finalize = xfce_keyboard_settings_finalize;
- gobject_class->get_property = xfce_keyboard_settings_get_property;
- gobject_class->set_property = xfce_keyboard_settings_set_property;
-
- g_object_class_install_property (gobject_class,
- PROP_GLADE_XML,
- g_param_spec_object ("glade-xml",
- "glade-xml",
- "glade-xml",
- GLADE_TYPE_XML,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
}
@@ -236,8 +201,9 @@
static void
xfce_keyboard_settings_init (XfceKeyboardSettings *settings)
{
+ GError *error = NULL;
+
settings->priv = XFCE_KEYBOARD_SETTINGS_GET_PRIVATE (settings);
- settings->priv->glade_xml = NULL;
settings->priv->keyboards_channel = xfconf_channel_new ("keyboards");
settings->priv->keyboard_layout_channel = xfconf_channel_new ("keyboard-layout");
@@ -248,6 +214,13 @@
G_CALLBACK (xfce_keyboard_settings_shortcut_added), settings);
g_signal_connect (settings->priv->provider, "shortcut-removed",
G_CALLBACK (xfce_keyboard_settings_shortcut_removed), settings);
+
+ if (gtk_builder_add_from_string (GTK_BUILDER (settings), keyboard_dialog_glade,
+ keyboard_dialog_glade_length, &error) == 0)
+ {
+ g_error ("Failed to load the glade file: %s.", error->message);
+ g_error_free (error);
+ }
}
@@ -262,45 +235,45 @@
GtkAdjustment *xkb_key_repeat_delay_scale;
GtkAdjustment *net_cursor_blink_time_scale;
GtkListStore *list_store;
- GtkWidget *xkb_key_repeat_check;
- GtkWidget *xkb_key_repeat_box;
- GtkWidget *net_cursor_blink_check;
- GtkWidget *net_cursor_blink_box;
- GtkWidget *kbd_shortcuts_view;
- GtkWidget *button;
+ GObject *xkb_key_repeat_check;
+ GObject *xkb_key_repeat_box;
+ GObject *net_cursor_blink_check;
+ GObject *net_cursor_blink_box;
+ GObject *kbd_shortcuts_view;
+ GObject *button;
#ifdef HAVE_LIBXKLAVIER
- GtkWidget *xkb_use_system_default_checkbutton;
- GtkWidget *xkb_tab_layout_vbox;
- GtkWidget *xkb_model_combo;
- GtkWidget *xkb_layout_view;
- GtkWidget *xkb_layout_add_button;
- GtkWidget *xkb_layout_edit_button;
- GtkWidget *xkb_layout_delete_button;
+ GObject *xkb_use_system_default_checkbutton;
+ GObject *xkb_tab_layout_vbox;
+ GObject *xkb_model_combo;
+ GObject *xkb_layout_view;
+ GObject *xkb_layout_add_button;
+ GObject *xkb_layout_edit_button;
+ GObject *xkb_layout_delete_button;
#endif /* HAVE_LIBXKLAVIER */
/* XKB settings */
- xkb_key_repeat_check = glade_xml_get_widget (settings->priv->glade_xml, "xkb_key_repeat_check");
- xkb_key_repeat_box = glade_xml_get_widget (settings->priv->glade_xml, "xkb_key_repeat_box");
+ xkb_key_repeat_check = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_key_repeat_check");
+ xkb_key_repeat_box = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_key_repeat_box");
exo_binding_new (G_OBJECT (xkb_key_repeat_check), "active", G_OBJECT (xkb_key_repeat_box), "sensitive");
xfconf_g_property_bind (settings->priv->keyboards_channel, "/Default/KeyRepeat", G_TYPE_BOOLEAN, G_OBJECT (xkb_key_repeat_check), "active");
- xkb_key_repeat_rate_scale = gtk_range_get_adjustment (GTK_RANGE (glade_xml_get_widget (settings->priv->glade_xml, "xkb_key_repeat_rate_scale")));
+ xkb_key_repeat_rate_scale = gtk_range_get_adjustment (GTK_RANGE (gtk_builder_get_object (GTK_BUILDER (settings), "xkb_key_repeat_rate_scale")));
xfconf_g_property_bind (settings->priv->keyboards_channel, "/Default/KeyRepeat/Rate", G_TYPE_INT, G_OBJECT (xkb_key_repeat_rate_scale), "value");
- xkb_key_repeat_delay_scale = gtk_range_get_adjustment (GTK_RANGE (glade_xml_get_widget (settings->priv->glade_xml, "xkb_key_repeat_delay_scale")));
+ xkb_key_repeat_delay_scale = gtk_range_get_adjustment (GTK_RANGE (gtk_builder_get_object (GTK_BUILDER (settings), "xkb_key_repeat_delay_scale")));
xfconf_g_property_bind (settings->priv->keyboards_channel, "/Default/KeyRepeat/Delay", G_TYPE_INT, G_OBJECT (xkb_key_repeat_delay_scale), "value");
/* XSETTINGS */
- net_cursor_blink_check = glade_xml_get_widget (settings->priv->glade_xml, "net_cursor_blink_check");
- net_cursor_blink_box = glade_xml_get_widget (settings->priv->glade_xml, "net_cursor_blink_box");
+ net_cursor_blink_check = gtk_builder_get_object (GTK_BUILDER (settings), "net_cursor_blink_check");
+ net_cursor_blink_box = gtk_builder_get_object (GTK_BUILDER (settings), "net_cursor_blink_box");
exo_binding_new (G_OBJECT (net_cursor_blink_check), "active", G_OBJECT (net_cursor_blink_box), "sensitive");
xfconf_g_property_bind (settings->priv->xsettings_channel, "/Net/CursorBlink", G_TYPE_BOOLEAN, G_OBJECT (net_cursor_blink_check), "active");
- net_cursor_blink_time_scale = gtk_range_get_adjustment (GTK_RANGE (glade_xml_get_widget (settings->priv->glade_xml, "net_cursor_blink_time_scale")));
+ net_cursor_blink_time_scale = gtk_range_get_adjustment (GTK_RANGE (gtk_builder_get_object (GTK_BUILDER (settings), "net_cursor_blink_time_scale")));
xfconf_g_property_bind (settings->priv->xsettings_channel, "/NetCursorBlinkTime", G_TYPE_INT, G_OBJECT (net_cursor_blink_time_scale), "value");
/* Configure shortcuts tree view */
- kbd_shortcuts_view = glade_xml_get_widget (settings->priv->glade_xml, "kbd_shortcuts_view");
+ kbd_shortcuts_view = gtk_builder_get_object (GTK_BUILDER (settings), "kbd_shortcuts_view");
gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (kbd_shortcuts_view)), GTK_SELECTION_MULTIPLE);
g_signal_connect (kbd_shortcuts_view, "row-activated", G_CALLBACK (xfce_keyboard_settings_row_activated), settings);
@@ -320,16 +293,15 @@
gtk_tree_view_append_column (GTK_TREE_VIEW (kbd_shortcuts_view), column);
/* Connect to add button */
- button = glade_xml_get_widget (settings->priv->glade_xml, "add_shortcut_button");
+ button = gtk_builder_get_object (GTK_BUILDER (settings), "add_shortcut_button");
g_signal_connect_swapped (button, "clicked", G_CALLBACK (xfce_keyboard_settings_add_button_clicked), settings);
/* Connect to remove button */
- button = glade_xml_get_widget (settings->priv->glade_xml, "delete_shortcut_button");
+ button = gtk_builder_get_object (GTK_BUILDER (settings), "delete_shortcut_button");
g_signal_connect_swapped (button, "clicked", G_CALLBACK (xfce_keyboard_settings_delete_button_clicked), settings);
/* Connect to reset button */
- button = glade_xml_get_widget (settings->priv->glade_xml, "reset_shortcuts_button");
- gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_stock (GTK_STOCK_REVERT_TO_SAVED, GTK_ICON_SIZE_BUTTON));
+ button = gtk_builder_get_object (GTK_BUILDER (settings), "reset_shortcuts_button");
g_signal_connect_swapped (button, "clicked", G_CALLBACK (xfce_keyboard_settings_reset_button_clicked), settings);
xfce_keyboard_settings_initialize_shortcuts (settings);
@@ -347,11 +319,11 @@
xkl_config_registry_load (settings->priv->xkl_registry);
/* Tab */
- xkb_tab_layout_vbox = glade_xml_get_widget (settings->priv->glade_xml, "xkb_tab_layout_vbox");
+ xkb_tab_layout_vbox = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_tab_layout_vbox");
gtk_widget_show (GTK_WIDGET (xkb_tab_layout_vbox));
/* USe system defaults, ie disable options */
- xkb_use_system_default_checkbutton = glade_xml_get_widget (settings->priv->glade_xml, "xkb_use_system_default_checkbutton");
+ xkb_use_system_default_checkbutton = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_use_system_default_checkbutton");
xfconf_g_property_bind (settings->priv->keyboard_layout_channel, "/Default/XkbDisable", G_TYPE_BOOLEAN,
(GObject *) xkb_use_system_default_checkbutton, "active");
xfce_keyboard_settings_update_sensitive (GTK_TOGGLE_BUTTON (xkb_use_system_default_checkbutton), settings);
@@ -361,7 +333,7 @@
settings);
/* Keyboard model combo */
- xkb_model_combo = glade_xml_get_widget (settings->priv->glade_xml, "xkb_model_combo");
+ xkb_model_combo = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_model_combo");
gtk_cell_layout_clear (GTK_CELL_LAYOUT (xkb_model_combo));
renderer = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (xkb_model_combo), renderer, TRUE);
@@ -380,7 +352,7 @@
/* Keyboard layout/variant treeview */
settings->priv->layout_selection_treestore = NULL;
- xkb_layout_view = glade_xml_get_widget (settings->priv->glade_xml, "xkb_layout_view");
+ xkb_layout_view = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_layout_view");
renderer = gtk_cell_renderer_toggle_new ();
gtk_cell_renderer_toggle_set_radio (GTK_CELL_RENDERER_TOGGLE (renderer), TRUE);
@@ -397,9 +369,9 @@
g_signal_connect (G_OBJECT (xkb_layout_view), "cursor-changed", G_CALLBACK (xfce_keyboard_settings_update_edit_button), settings);
/* Layout buttons */
- xkb_layout_add_button = glade_xml_get_widget (settings->priv->glade_xml, "xkb_layout_add_button");
- xkb_layout_edit_button = glade_xml_get_widget (settings->priv->glade_xml, "xkb_layout_edit_button");
- xkb_layout_delete_button = glade_xml_get_widget (settings->priv->glade_xml, "xkb_layout_delete_button");
+ xkb_layout_add_button = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_layout_add_button");
+ xkb_layout_edit_button = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_layout_edit_button");
+ xkb_layout_delete_button = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_layout_delete_button");
g_signal_connect (G_OBJECT (xkb_layout_add_button), "clicked", G_CALLBACK (xfce_keyboard_settings_add_layout_button_cb), settings);
g_signal_connect (G_OBJECT (xkb_layout_edit_button), "clicked", G_CALLBACK (xfce_keyboard_settings_edit_layout_button_cb), settings);
@@ -422,76 +394,17 @@
xkl_engine_stop_listen (settings->priv->xkl_engine);
#endif /* HAVE_LIBXKLAVIER */
- g_object_unref (settings->priv->provider);
+ g_object_unref (G_OBJECT (settings->priv->provider));
(*G_OBJECT_CLASS (xfce_keyboard_settings_parent_class)->finalize) (object);
}
-static void
-xfce_keyboard_settings_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- XfceKeyboardSettings *settings = XFCE_KEYBOARD_SETTINGS (object);
-
- switch (prop_id)
- {
- case PROP_GLADE_XML:
- g_value_set_object (value, settings->priv->glade_xml);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-
-
-static void
-xfce_keyboard_settings_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- XfceKeyboardSettings *settings = XFCE_KEYBOARD_SETTINGS (object);
-
- switch (prop_id)
- {
- case PROP_GLADE_XML:
- if (GLADE_IS_XML (settings->priv->glade_xml))
- g_object_unref (settings->priv->glade_xml);
-
- settings->priv->glade_xml = g_value_get_object (value);
-
- g_object_notify (object, "glade-xml");
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-
-
XfceKeyboardSettings *
xfce_keyboard_settings_new (void)
{
- XfceKeyboardSettings *settings = NULL;
- GladeXML *glade_xml;
-
- glade_xml = glade_xml_new_from_buffer (keyboard_dialog_glade, keyboard_dialog_glade_length, NULL, NULL);
-
- if (G_LIKELY (glade_xml != NULL))
- settings = g_object_new (XFCE_TYPE_KEYBOARD_SETTINGS, "glade-xml", glade_xml, NULL);
-
-#if !GLIB_CHECK_VERSION (2,14,0)
- xfce_keyboard_settings_constructed (G_OBJECT (settings));
-#endif
-
- return settings;
+ return g_object_new (XFCE_TYPE_KEYBOARD_SETTINGS, NULL);
}
@@ -500,7 +413,7 @@
xfce_keyboard_settings_create_dialog (XfceKeyboardSettings *settings)
{
g_return_val_if_fail (XFCE_IS_KEYBOARD_SETTINGS (settings), NULL);
- return glade_xml_get_widget (settings->priv->glade_xml, "keyboard-settings-dialog");
+ return GTK_WIDGET (gtk_builder_get_object (GTK_BUILDER (settings), "keyboard-settings-dialog"));
}
@@ -510,16 +423,16 @@
GdkNativeWindow socket_id)
{
GtkWidget *plug;
- GtkWidget *child;
+ GObject *child;
g_return_val_if_fail (XFCE_IS_KEYBOARD_SETTINGS (settings), NULL);
plug = gtk_plug_new (socket_id);
gtk_widget_show (plug);
- child = glade_xml_get_widget (settings->priv->glade_xml, "plug-child");
- gtk_widget_reparent (child, plug);
- gtk_widget_show (child);
+ child = gtk_builder_get_object (GTK_BUILDER (settings), "plug-child");
+ gtk_widget_reparent (GTK_WIDGET (child), plug);
+ gtk_widget_show (GTK_WIDGET (child));
return plug;
}
@@ -554,14 +467,14 @@
{
GtkTreeModel *tree_model;
GtkTreeIter iter;
- GtkWidget *tree_view;
+ GObject *tree_view;
g_return_if_fail (XFCE_IS_KEYBOARD_SETTINGS (settings));
g_return_if_fail (shortcut != NULL);
DBG ("property = %s, shortcut = %s, command = %s", shortcut->property_name, shortcut->shortcut, shortcut->command);
- tree_view = glade_xml_get_widget (settings->priv->glade_xml, "kbd_shortcuts_view");
+ tree_view = gtk_builder_get_object (GTK_BUILDER (settings), "kbd_shortcuts_view");
tree_model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
gtk_list_store_append (GTK_LIST_STORE (tree_model), &iter);
@@ -803,12 +716,12 @@
{
XfceShortcut *sc;
GtkTreeModel *model;
- GtkWidget *view;
+ GObject *view;
GtkTreeIter iter;
g_return_if_fail (XFCE_IS_KEYBOARD_SETTINGS (settings));
- view = glade_xml_get_widget (settings->priv->glade_xml, "kbd_shortcuts_view");
+ view = gtk_builder_get_object (GTK_BUILDER (settings), "kbd_shortcuts_view");
model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
sc = xfce_shortcuts_provider_get_shortcut (settings->priv->provider, shortcut);
@@ -855,11 +768,11 @@
XfceKeyboardSettings *settings)
{
GtkTreeModel *model;
- GtkWidget *view;
+ GObject *view;
g_return_if_fail (XFCE_IS_KEYBOARD_SETTINGS (settings));
- view = glade_xml_get_widget (settings->priv->glade_xml, "kbd_shortcuts_view");
+ view = gtk_builder_get_object (GTK_BUILDER (settings), "kbd_shortcuts_view");
model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
gtk_tree_model_foreach (model, (GtkTreeModelForeachFunc) _xfce_keyboard_settings_remove_shortcut,
@@ -874,7 +787,7 @@
{
GtkWidget *command_dialog;
GtkWidget *shortcut_dialog;
- GtkWidget *parent;
+ GObject *parent;
const gchar *shortcut;
const gchar *command;
gboolean finished = FALSE;
@@ -892,7 +805,7 @@
if (G_UNLIKELY (response == GTK_RESPONSE_OK &&
g_utf8_strlen (command_dialog_get_command (COMMAND_DIALOG (command_dialog)), -1) == 0))
- xfce_err (_("Shortcut command may not be empty."));
+ xfce_dialog_show_error (GTK_WINDOW (command_dialog), NULL, _("Shortcut command may not be empty."));
else
finished = TRUE;
}
@@ -912,8 +825,8 @@
g_signal_connect (shortcut_dialog, "validate-shortcut", G_CALLBACK (xfce_keyboard_settings_validate_shortcut), settings);
/* Run shortcut dialog until a valid shortcut is entered or the dialog is cancelled */
- parent = glade_xml_get_widget (settings->priv->glade_xml, "keyboard-shortcuts-dialog");
- response = xfce_shortcut_dialog_run (XFCE_SHORTCUT_DIALOG (shortcut_dialog), parent);
+ parent = gtk_builder_get_object (GTK_BUILDER (settings), "keyboard-shortcuts-dialog");
+ response = xfce_shortcut_dialog_run (XFCE_SHORTCUT_DIALOG (shortcut_dialog), GTK_WIDGET (parent));
/* Only continue if the shortcut dialog succeeded */
if (G_LIKELY (response == GTK_RESPONSE_OK))
@@ -942,7 +855,7 @@
GtkTreeModel *model;
GtkTreePath *path;
GtkTreeIter iter;
- GtkWidget *view;
+ GObject *view;
GList *rows;
GList *row_iter;
GList *row_references = NULL;
@@ -952,7 +865,7 @@
g_return_if_fail (XFCE_IS_KEYBOARD_SETTINGS (settings));
- view = glade_xml_get_widget (settings->priv->glade_xml, "kbd_shortcuts_view");
+ view = gtk_builder_get_object (GTK_BUILDER (settings), "kbd_shortcuts_view");
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
rows = gtk_tree_selection_get_selected_rows (selection, &model);
@@ -1036,19 +949,18 @@
static gboolean
xfce_keyboard_settings_update_sensitive (GtkToggleButton *toggle, XfceKeyboardSettings *settings)
{
- GtkWidget *xkb_model_frame;
- GtkWidget *xkb_layout_frame;
- gboolean active;
+ GObject *xkb_model_frame;
+ GObject *xkb_layout_frame;
+ gboolean active;
- g_return_if_fail (XFCE_IS_KEYBOARD_SETTINGS (settings));
- g_return_if_fail (GLADE_IS_XML (settings->priv->glade_xml));
+ g_return_val_if_fail (XFCE_IS_KEYBOARD_SETTINGS (settings), FALSE);
active = gtk_toggle_button_get_active (toggle);
- xkb_model_frame = glade_xml_get_widget (settings->priv->glade_xml, "xkb_model_frame");
- xkb_layout_frame = glade_xml_get_widget (settings->priv->glade_xml, "xkb_layout_frame");
+ xkb_model_frame = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_model_frame");
+ xkb_layout_frame = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_layout_frame");
- gtk_widget_set_sensitive (xkb_model_frame, !active);
- gtk_widget_set_sensitive (xkb_layout_frame, !active);
+ gtk_widget_set_sensitive (GTK_WIDGET (xkb_model_frame), !active);
+ gtk_widget_set_sensitive (GTK_WIDGET (xkb_layout_frame), !active);
return active;
}
@@ -1058,13 +970,10 @@
static void
xfce_keyboard_settings_system_default_cb (GtkToggleButton *toggle, XfceKeyboardSettings *settings)
{
- GtkWidget *xkb_model_frame;
- GtkWidget *xkb_layout_frame;
GtkWidget *warning_dialog;
gboolean use_system_defaults;
g_return_if_fail (XFCE_IS_KEYBOARD_SETTINGS (settings));
- g_return_if_fail (GLADE_IS_XML (settings->priv->glade_xml));
use_system_defaults = xfce_keyboard_settings_update_sensitive (toggle, settings);
if (use_system_defaults)
@@ -1083,7 +992,7 @@
static void
xfce_keyboard_settings_set_layout (XfceKeyboardSettings *settings)
{
- GtkWidget *view;
+ GObject *view;
GtkTreeModel *model;
GtkTreeIter iter;
gboolean active;
@@ -1093,7 +1002,7 @@
gchar *layouts;
gchar *tmp;
- view = glade_xml_get_widget (settings->priv->glade_xml, "xkb_layout_view");
+ view = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_layout_view");
model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
gtk_tree_model_get_iter_first (model, &iter);
gtk_tree_model_get (model, &iter, XKB_TREE_ACTIVE, &active, XKB_TREE_LAYOUTS, &val_layout, XKB_TREE_VARIANTS, &val_variant, -1);
@@ -1143,7 +1052,7 @@
xfce_keyboard_settings_init_layout (XfceKeyboardSettings *settings)
{
XklState *xkl_state = NULL;
- GtkWidget *view;
+ GObject *view;
GtkTreeModel *model;
GtkTreeIter iter;
gchar *val_layout;
@@ -1166,7 +1075,7 @@
layouts = g_strsplit (val_layout, ",", 0);
variants = g_strsplit (val_variant, ",", 0);
- view = glade_xml_get_widget (settings->priv->glade_xml, "xkb_layout_view");
+ view = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_layout_view");
model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
xkl_state = xkl_engine_get_current_state (settings->priv->xkl_engine);
@@ -1196,14 +1105,14 @@
XklConfigItem *config_item,
XfceKeyboardSettings *settings)
{
- GtkWidget *view;
+ GObject *view;
GtkTreeModel *model;
GtkTreeIter iter;
gchar *model_name;
model_name = xfce_keyboard_settings_xkb_description (config_item);
- view = glade_xml_get_widget (settings->priv->glade_xml, "xkb_model_combo");
+ view = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_model_combo");
model = gtk_combo_box_get_model (GTK_COMBO_BOX (view));
gtk_list_store_append (GTK_LIST_STORE (model), &iter );
@@ -1216,7 +1125,7 @@
static void
xfce_keyboard_settings_init_model (XfceKeyboardSettings *settings)
{
- GtkWidget *view;
+ GObject *view;
GtkTreeModel *model;
GtkTreeIter iter;
gchar *id;
@@ -1224,7 +1133,7 @@
gboolean item;
gboolean found = FALSE;
- view = glade_xml_get_widget (settings->priv->glade_xml, "xkb_model_combo");
+ view = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_model_combo");
model = gtk_combo_box_get_model (GTK_COMBO_BOX (view));
xkbmodel = xfconf_channel_get_string (settings->priv->keyboard_layout_channel, "/Default/XkbModel", settings->priv->xkl_rec_config->model);
@@ -1253,7 +1162,7 @@
gchar *path_str,
XfceKeyboardSettings *settings)
{
- GtkWidget *view;
+ GObject *view;
GtkTreeModel *model;
GtkTreeIter iter;
GtkTreePath *path1,
@@ -1262,7 +1171,7 @@
group_id = 0;
gboolean selected = FALSE;
- view = glade_xml_get_widget (settings->priv->glade_xml, "xkb_layout_view");
+ view = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_layout_view");
model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
path1 = gtk_tree_path_new_from_string (path_str);
column = g_object_get_data (G_OBJECT (cell), "column");
@@ -1305,23 +1214,23 @@
static void
xfce_keyboard_settings_update_layout_buttons (XfceKeyboardSettings *settings)
{
- GtkWidget *view;
+ GObject *view;
GtkTreeModel *model;
- GtkWidget *xkb_layout_add_button;
- GtkWidget *xkb_layout_delete_button;
+ GObject *object;
gint n_layouts;
gint max_layouts;
- xkb_layout_add_button = glade_xml_get_widget (settings->priv->glade_xml, "xkb_layout_add_button");
- xkb_layout_delete_button = glade_xml_get_widget (settings->priv->glade_xml, "xkb_layout_delete_button");
- view = glade_xml_get_widget (settings->priv->glade_xml, "xkb_layout_view");
+ view = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_layout_view");
model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
n_layouts = gtk_tree_model_iter_n_children (model, NULL);
max_layouts = xkl_engine_get_max_num_groups (settings->priv->xkl_engine);
- gtk_widget_set_sensitive (xkb_layout_add_button, (n_layouts < max_layouts));
- gtk_widget_set_sensitive (xkb_layout_delete_button, (n_layouts > 1));
+ object = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_layout_add_button");
+ gtk_widget_set_sensitive (GTK_WIDGET (object), (n_layouts < max_layouts));
+
+ object = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_layout_delete_button");
+ gtk_widget_set_sensitive (GTK_WIDGET (object), (n_layouts > 1));
}
@@ -1330,14 +1239,14 @@
xfce_keyboard_settings_update_edit_button (GtkTreeView *tree_view,
XfceKeyboardSettings *settings)
{
- GtkWidget *xkb_layout_edit_button;
+ GObject *object;
GtkTreePath *path;
GtkTreeViewColumn *column;
- xkb_layout_edit_button = glade_xml_get_widget (settings->priv->glade_xml, "xkb_layout_edit_button");
+ object = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_layout_edit_button");
gtk_tree_view_get_cursor (GTK_TREE_VIEW (tree_view), &path, &column);
- gtk_widget_set_sensitive (xkb_layout_edit_button, (path != NULL));
+ gtk_widget_set_sensitive (GTK_WIDGET (object), (path != NULL));
}
@@ -1347,14 +1256,14 @@
XfceKeyboardSettings *settings)
{
GtkTreeSelection *selection;
- GtkWidget *view;
+ GObject *view;
GtkTreeModel *model;
GtkTreeIter iter;
gchar *layout;
gchar **strings;
layout = xfce_keyboard_settings_layout_selection (settings);
- view = glade_xml_get_widget (settings->priv->glade_xml, "xkb_layout_view");
+ view = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_layout_view");
if (layout)
{
model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
@@ -1375,15 +1284,14 @@
xfce_keyboard_settings_add_layout_button_cb (GtkWidget *widget,
XfceKeyboardSettings *settings)
{
- GtkTreeSelection *selection;
- GtkWidget *view;
+ GObject *view;
GtkTreeModel *model;
GtkTreeIter iter;
gchar *layout;
gchar **strings;
layout = xfce_keyboard_settings_layout_selection (settings);
- view = glade_xml_get_widget (settings->priv->glade_xml, "xkb_layout_view");
+ view = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_layout_view");
if (layout)
{
model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
@@ -1404,12 +1312,12 @@
xfce_keyboard_settings_del_layout_button_cb (GtkWidget *widget,
XfceKeyboardSettings *settings)
{
- GtkWidget *view;
+ GObject *view;
GtkTreeModel *model;
GtkTreeIter iter;
GtkTreeSelection *selection;
- view = glade_xml_get_widget (settings->priv->glade_xml, "xkb_layout_view");
+ view = gtk_builder_get_object (GTK_BUILDER (settings), "xkb_layout_view");
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
if (gtk_tree_selection_get_selected (selection, &model, &iter))
@@ -1428,14 +1336,13 @@
XklConfigItem *config_item,
XfceKeyboardSettings *settings)
{
- GtkTreeModel *model;
GtkTreeStore *treestore;
GtkTreeIter iter;
- GtkWidget *treeview;
- char *variant;
+ GObject *treeview;
+ gchar *variant;
variant = xfce_keyboard_settings_xkb_description (config_item);
- treeview = glade_xml_get_widget (settings->priv->glade_xml, "layout_selection_view");
+ treeview = gtk_builder_get_object (GTK_BUILDER (settings), "layout_selection_view");
treestore = GTK_TREE_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (treeview)));
gtk_tree_store_append (treestore, &iter, &settings->priv->layout_selection_iter);
gtk_tree_store_set (treestore, &iter,
@@ -1451,14 +1358,12 @@
XklConfigItem *config_item,
XfceKeyboardSettings *settings)
{
- GtkTreeModel *model;
- GtkTreeIter iter;
GtkTreeStore *treestore;
- GtkWidget *treeview;
+ GObject *treeview;
gchar *layout;
layout = xfce_keyboard_settings_xkb_description (config_item);
- treeview = glade_xml_get_widget (settings->priv->glade_xml, "layout_selection_view");
+ treeview = gtk_builder_get_object (GTK_BUILDER (settings), "layout_selection_view");
treestore = GTK_TREE_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (treeview)));
gtk_tree_store_append (treestore, &settings->priv->layout_selection_iter, NULL);
gtk_tree_store_set (treestore, &settings->priv->layout_selection_iter,
@@ -1486,24 +1391,21 @@
static gchar *
xfce_keyboard_settings_layout_selection (XfceKeyboardSettings *settings)
{
- GtkWidget *keyboard_layout_selection_dialog;
- GtkWidget *layout_selection_ok_button;
- GtkWidget *layout_selection_cancel_button;
- GtkWidget *layout_selection_view;
+ GObject *keyboard_layout_selection_dialog;
+ GObject *layout_selection_view;
GtkTreePath *path;
GtkCellRenderer *renderer;
GtkTreeModel *model;
GtkTreeIter iter;
GtkTreeViewColumn *column;
GtkTreeSelection *selection;
- GtkTreeIter selected_iter;
gchar *val_layout;
gchar *layout;
gchar *variant;
gint result;
- keyboard_layout_selection_dialog = glade_xml_get_widget (settings->priv->glade_xml, "keyboard-layout-selection-dialog");
- layout_selection_view = glade_xml_get_widget (settings->priv->glade_xml, "layout_selection_view");
+ keyboard_layout_selection_dialog = gtk_builder_get_object (GTK_BUILDER (settings), "keyboard-layout-selection-dialog");
+ layout_selection_view = gtk_builder_get_object (GTK_BUILDER (settings), "layout_selection_view");
if (!settings->priv->layout_selection_treestore)
{
@@ -1519,7 +1421,7 @@
g_signal_connect (GTK_TREE_VIEW (layout_selection_view), "row-activated", G_CALLBACK (xfce_keyboard_settings_layout_activate_cb), keyboard_layout_selection_dialog);
}
val_layout = NULL;
- gtk_widget_show (keyboard_layout_selection_dialog);
+ gtk_widget_show (GTK_WIDGET (keyboard_layout_selection_dialog));
result = gtk_dialog_run (GTK_DIALOG (keyboard_layout_selection_dialog));
if (result)
{
@@ -1543,7 +1445,7 @@
g_free (variant);
}
- gtk_widget_hide (keyboard_layout_selection_dialog);
+ gtk_widget_hide (GTK_WIDGET (keyboard_layout_selection_dialog));
return val_layout;
}
Modified: xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/xfce-keyboard-settings.h
===================================================================
--- xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/xfce-keyboard-settings.h 2009-07-11 08:52:34 UTC (rev 30269)
+++ xfce4-settings/branches/migration-to-4ui/dialogs/keyboard-settings/xfce-keyboard-settings.h 2009-07-11 09:42:25 UTC (rev 30270)
@@ -2,19 +2,19 @@
/*-
* Copyright (c) 2008 Jannis Pohlmann <jannis at xfce.org>.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
@@ -23,7 +23,7 @@
#include <glib-object.h>
-G_BEGIN_DECLS;
+G_BEGIN_DECLS
typedef struct _XfceKeyboardSettingsPrivate XfceKeyboardSettingsPrivate;
typedef struct _XfceKeyboardSettingsClass XfceKeyboardSettingsClass;
@@ -47,16 +47,16 @@
struct _XfceKeyboardSettingsClass
{
- GObjectClass __parent__;
+ GtkBuilderClass __parent__;
};
struct _XfceKeyboardSettings
{
- GObject __parent__;
+ GtkBuilder __parent__;
XfceKeyboardSettingsPrivate *priv;
};
-G_END_DECLS;
+G_END_DECLS
#endif /* !__XFCE_KEYBOARD_SETTINGS_H__ */
More information about the Xfce4-commits
mailing list