[gnome-control-center] Changing Print layout to Show layout
- From: Sergey V. Udaltsov <svu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] Changing Print layout to Show layout
- Date: Wed, 26 May 2010 00:06:32 +0000 (UTC)
commit 46cd0b40f9350204b2907c773445f1f0f2c46ab4
Author: Sergey V. Udaltsov <svu gnome org>
Date: Wed May 26 01:04:46 2010 +0100
Changing Print layout to Show layout
Using new shared function from libgnomekbd
configure.ac | 2 +-
.../keyboard/gnome-keyboard-properties-dialog.ui | 6 ++--
panels/keyboard/gnome-keyboard-properties-xkblt.c | 28 +++++++------------
3 files changed, 14 insertions(+), 22 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index a6e21fc..aa9e4f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -201,7 +201,7 @@ PKG_CHECK_MODULES(LIBGNOMEKBD, [libgnomekbd >= 2.31.1 libxklavier >= 4.0])
AC_SUBST(LIBGNOMEKBD_CFLAGS)
AC_SUBST(LIBGNOMEKBD_LIBS)
-PKG_CHECK_MODULES(LIBGNOMEKBDUI, [libgnomekbdui >= 2.31.1])
+PKG_CHECK_MODULES(LIBGNOMEKBDUI, [libgnomekbdui >= 2.31.2])
AC_SUBST(LIBGNOMEKBDUI_CFLAGS)
AC_SUBST(LIBGNOMEKBDUI_LIBS)
diff --git a/panels/keyboard/gnome-keyboard-properties-dialog.ui b/panels/keyboard/gnome-keyboard-properties-dialog.ui
index 4652902..fb03d27 100644
--- a/panels/keyboard/gnome-keyboard-properties-dialog.ui
+++ b/panels/keyboard/gnome-keyboard-properties-dialog.ui
@@ -601,8 +601,8 @@
<property name="spacing">6</property>
<property name="homogeneous">True</property>
<child>
- <object class="GtkButton" id="xkb_layouts_print">
- <property name="label">_Print...</property>
+ <object class="GtkButton" id="xkb_layouts_show">
+ <property name="label">_Show...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -1850,7 +1850,7 @@ default settings</property>
</object>
</child>
<action-widgets>
- <action-widget response="-11">helpbutton1</action-widget>
+ <action-widget response="-1">helpbutton1</action-widget>
<action-widget response="-1">button4</action-widget>
</action-widgets>
</object>
diff --git a/panels/keyboard/gnome-keyboard-properties-xkblt.c b/panels/keyboard/gnome-keyboard-properties-xkblt.c
index 02e1630..948eea5 100644
--- a/panels/keyboard/gnome-keyboard-properties-xkblt.c
+++ b/panels/keyboard/gnome-keyboard-properties-xkblt.c
@@ -25,6 +25,7 @@
# include <config.h>
#endif
+#include <gdk/gdkx.h>
#include <gconf/gconf-client.h>
#include <glib/gi18n.h>
@@ -128,7 +129,7 @@ static void
xkb_layouts_enable_disable_buttons (GtkBuilder * dialog)
{
GtkWidget *add_layout_btn = WID ("xkb_layouts_add");
- GtkWidget *print_layout_btn = WID ("xkb_layouts_print");
+ GtkWidget *show_layout_btn = WID ("xkb_layouts_show");
GtkWidget *del_layout_btn = WID ("xkb_layouts_remove");
GtkWidget *selected_layouts_tree = WID ("xkb_layouts_selected");
GtkWidget *move_up_layout_btn = WID ("xkb_layouts_move_up");
@@ -155,7 +156,7 @@ xkb_layouts_enable_disable_buttons (GtkBuilder * dialog)
|| max_selected_layouts == 0));
gtk_widget_set_sensitive (del_layout_btn, (n_selected_layouts > 1)
&& (n_selected_selected_layouts > 0));
- gtk_widget_set_sensitive (print_layout_btn,
+ gtk_widget_set_sensitive (show_layout_btn,
(n_selected_selected_layouts > 0));
gtk_widget_set_sensitive (move_up_layout_btn, sidx > 0);
gtk_widget_set_sensitive (move_down_layout_btn, sidx >= 0
@@ -350,7 +351,7 @@ add_selected_layout (GtkWidget * button, GtkBuilder * dialog)
}
static void
-print_selected_layout (GtkWidget * button, GtkBuilder * dialog)
+show_selected_layout (GtkWidget * button, GtkBuilder * dialog)
{
gint idx = find_selected_layout_idx (dialog);
@@ -358,20 +359,11 @@ print_selected_layout (GtkWidget * button, GtkBuilder * dialog)
GSList *layouts_list = xkb_layouts_get_selected_list ();
const gchar *id = g_slist_nth_data (layouts_list, idx);
char *descr = xkb_layout_description_utf8 (id);
-
- GtkWidget *window = WID ("keyboard_dialog");
- GtkWidget *kbdraw =
- xkb_layout_preview_create_widget (NULL);
- g_object_ref_sink (kbdraw);
- gtk_widget_set_parent (kbdraw, window);
- xkb_layout_preview_set_drawing_layout (kbdraw, id);
- gkbd_keyboard_drawing_print (GKBD_KEYBOARD_DRAWING
- (kbdraw), GTK_WINDOW (window),
- descr);
- g_object_unref (kbdraw);
- g_free (descr);
-
+ GtkWidget *parent = WID ("keyboard_dialog");
+ GtkWidget *popup = gkbd_keyboard_drawing_new_dialog (idx, descr);
+ gtk_widget_set_parent (popup, parent);
clear_xkb_elements_list (layouts_list);
+ g_free (descr);
}
}
@@ -451,8 +443,8 @@ xkb_layouts_register_buttons_handlers (GtkBuilder * dialog)
{
g_signal_connect (G_OBJECT (WID ("xkb_layouts_add")), "clicked",
G_CALLBACK (add_selected_layout), dialog);
- g_signal_connect (G_OBJECT (WID ("xkb_layouts_print")), "clicked",
- G_CALLBACK (print_selected_layout), dialog);
+ g_signal_connect (G_OBJECT (WID ("xkb_layouts_show")), "clicked",
+ G_CALLBACK (show_selected_layout), dialog);
g_signal_connect (G_OBJECT (WID ("xkb_layouts_remove")), "clicked",
G_CALLBACK (remove_selected_layout), dialog);
g_signal_connect (G_OBJECT (WID ("xkb_layouts_move_up")),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]