gnome-commander r1681 - in trunk: . src
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r1681 - in trunk: . src
- Date: Wed, 2 Apr 2008 20:04:29 +0100 (BST)
Author: epiotr
Date: Wed Apr 2 20:04:28 2008
New Revision: 1681
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1681&view=rev
Log:
Use libegg cell renderer and accelerators
Modified:
trunk/ChangeLog
trunk/configure.in
trunk/src/eggaccelerators.cc
trunk/src/eggcellrendererkeys.cc
trunk/src/gnome-cmd-key-shortcuts-dialog.cc
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Wed Apr 2 20:04:28 2008
@@ -44,7 +44,7 @@
GLIB_REQ=2.6.0
GMODULE_REQ=2.0.0
-GTK_REQ=2.10.0
+GTK_REQ=2.8.0
GNOME_REQ=2.0.0
GNOMEUI_REQ=2.4.0
GNOMEVFS_REQ=2.0.0
Modified: trunk/src/eggaccelerators.cc
==============================================================================
--- trunk/src/eggaccelerators.cc (original)
+++ trunk/src/eggaccelerators.cc Wed Apr 2 20:04:28 2008
@@ -363,21 +363,21 @@
*/
gchar *egg_virtual_accelerator_name (guint accelerator_key, EggVirtualModifierType accelerator_mods)
{
- static const gchar text_release[] = "<Release>";
- static const gchar text_shift[] = "<Shift>";
- static const gchar text_control[] = "<Control>";
- static const gchar text_mod1[] = "<Alt>";
- static const gchar text_mod2[] = "<Mod2>";
- static const gchar text_mod3[] = "<Mod3>";
- static const gchar text_mod4[] = "<Mod4>";
- static const gchar text_mod5[] = "<Mod5>";
- static const gchar text_meta[] = "<Meta>";
- static const gchar text_super[] = "<Super>";
- static const gchar text_hyper[] = "<Hyper>";
+ static const gchar text_release[] = "Release+";
+ static const gchar text_shift[] = "Shift+";
+ static const gchar text_control[] = "Ctrl+";
+ static const gchar text_mod1[] = "Alt+";
+ static const gchar text_mod2[] = "Mod2+";
+ static const gchar text_mod3[] = "Mod3+";
+ static const gchar text_mod4[] = "Mod4+";
+ static const gchar text_mod5[] = "Mod5+";
+ static const gchar text_meta[] = "Meta+";
+ static const gchar text_super[] = "Super+";
+ static const gchar text_hyper[] = "Hyper+";
(guint &) accelerator_mods &= EGG_VIRTUAL_MODIFIER_MASK;
- gchar *keyval_name = gdk_keyval_name (gdk_keyval_to_lower (accelerator_key));
+ gchar *keyval_name = gdk_keyval_name (gdk_keyval_to_upper (accelerator_key));
if (!keyval_name)
keyval_name = "";
Modified: trunk/src/eggcellrendererkeys.cc
==============================================================================
--- trunk/src/eggcellrendererkeys.cc (original)
+++ trunk/src/eggcellrendererkeys.cc Wed Apr 2 20:04:28 2008
@@ -94,13 +94,13 @@
{
static const GTypeInfo cell_keys_info =
{
- sizeof (EggCellRendererKeysClass),
+ sizeof(EggCellRendererKeysClass),
NULL, /* base_init */
NULL, /* base_finalize */
- (GClassInitFunc)egg_cell_renderer_keys_class_init,
+ (GClassInitFunc) egg_cell_renderer_keys_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
- sizeof (EggCellRendererKeys),
+ sizeof(EggCellRendererKeys),
0, /* n_preallocs */
(GInstanceInitFunc) egg_cell_renderer_keys_init
};
@@ -176,11 +176,9 @@
object_class->finalize = egg_cell_renderer_keys_finalize;
- // FIXME if this gets moved to a real library, rename the properties to match whatever the GTK convention is
-
g_object_class_install_property (object_class,
PROP_ACCEL_KEY,
- g_param_spec_uint ("accel_key",
+ g_param_spec_uint ("accel-key",
_("Accelerator key"),
_("Accelerator key"),
0,
@@ -190,7 +188,7 @@
g_object_class_install_property (object_class,
PROP_ACCEL_MASK,
- g_param_spec_flags ("accel_mask",
+ g_param_spec_flags ("accel-mods",
_("Accelerator modifiers"),
_("Accelerator modifiers"),
GDK_TYPE_MODIFIER_TYPE,
@@ -200,7 +198,7 @@
/* FIXME: Register the enum when moving to GTK+ */
g_object_class_install_property (object_class,
PROP_ACCEL_MODE,
- g_param_spec_int ("accel_mode",
+ g_param_spec_int ("accel-mode",
_("Accelerator Mode"),
_("The type of accelerator."),
0,
@@ -208,7 +206,7 @@
0,
GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE)));
- g_signal_new ("keys_edited",
+ g_signal_new ("accel-edited",
EGG_TYPE_CELL_RENDERER_KEYS,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EggCellRendererKeysClass, keys_edited),
@@ -325,7 +323,7 @@
GtkRequisition requisition;
if (keys->sizing_label == NULL)
- keys->sizing_label = gtk_label_new (_("Type a new accelerator, or press Backspace to clear"));
+ keys->sizing_label = gtk_label_new (_("Type a new accelerator"));
gtk_widget_size_request (keys->sizing_label, &requisition);
(* GTK_CELL_RENDERER_CLASS (parent_class)->get_size) (cell, widget, cell_area, x_offset, y_offset, width, height);
@@ -417,7 +415,7 @@
keys->grab_widget = NULL;
if (edited)
- g_signal_emit_by_name (G_OBJECT (keys), "keys_edited", path, accel_keyval, accel_mods, event->hardware_keycode);
+ g_signal_emit_by_name (G_OBJECT (keys), "accel-edited", path, accel_keyval, accel_mods, event->hardware_keycode);
g_free (path);
@@ -529,7 +527,7 @@
gtk_widget_modify_fg (label, GTK_STATE_NORMAL, &widget->style->fg[GTK_STATE_SELECTED]);
if (keys->accel_key != 0)
- gtk_label_set_text (GTK_LABEL (label), _("Type a new accelerator, or press Backspace to clear"));
+ gtk_label_set_text (GTK_LABEL (label), _("Type a new accelerator"));
else
gtk_label_set_text (GTK_LABEL (label), _("Type a new accelerator"));
@@ -558,7 +556,7 @@
if (keyval != keys->accel_key)
{
keys->accel_key = keyval;
- g_object_notify (G_OBJECT (keys), "accel_key");
+ g_object_notify (G_OBJECT (keys), "accel-key");
changed = TRUE;
}
@@ -566,7 +564,7 @@
{
keys->accel_mask = mask;
- g_object_notify (G_OBJECT (keys), "accel_mask");
+ g_object_notify (G_OBJECT (keys), "accel-mods");
changed = TRUE;
}
Modified: trunk/src/gnome-cmd-key-shortcuts-dialog.cc
==============================================================================
--- trunk/src/gnome-cmd-key-shortcuts-dialog.cc (original)
+++ trunk/src/gnome-cmd-key-shortcuts-dialog.cc Wed Apr 2 20:04:28 2008
@@ -21,6 +21,7 @@
#include "gnome-cmd-includes.h"
#include "gnome-cmd-key-shortcuts-dialog.h"
+#include "eggcellrendererkeys.h"
#include "gnome-cmd-data.h"
#include "gnome-cmd-hintbox.h"
#include "dict.h"
@@ -242,15 +243,15 @@
inline GtkTreeViewColumn *create_new_accel_column (GtkTreeView *view, GtkCellRenderer *&renderer, gint COL_KEYS_ID, gint COL_MODS_ID, const gchar *title=NULL)
{
- renderer = gtk_cell_renderer_accel_new ();
- renderer->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
- GTK_CELL_RENDERER_TEXT (renderer)->editable = TRUE;
+ renderer = (GtkCellRenderer *) g_object_new (EGG_TYPE_CELL_RENDERER_KEYS,
+ "editable", TRUE,
+ "accel-mode", EGG_CELL_RENDERER_KEYS_MODE_GTK,
+ NULL);
GtkTreeViewColumn *col = gtk_tree_view_column_new_with_attributes (title,
renderer,
"accel-key", COL_KEYS_ID,
"accel-mods", COL_MODS_ID,
- // "accel-mode", GTK_CELL_RENDERER_ACCEL_MODE_OTHER,
NULL);
g_object_set (col,
"clickable", TRUE,
@@ -342,7 +343,11 @@
gtk_tree_view_column_set_sort_column_id (col, SORTID_ACCEL);
g_signal_connect (renderer, "accel-edited", G_CALLBACK (accel_edited_callback), view);
- // g_signal_connect (renderer, "accel-cleared", G_CALLBACK (gimp_action_view_accel_cleared), view);
+
+ g_object_set (renderer,
+ "ellipsize-set", TRUE,
+ "ellipsize", PANGO_ELLIPSIZE_END,
+ NULL);
GtkTreeModel *combo_model = gnome_cmd_user_actions_create_model ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]