gnome-commander r1685 - branches/gcmd-1-3/src
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r1685 - branches/gcmd-1-3/src
- Date: Fri, 4 Apr 2008 20:30:59 +0100 (BST)
Author: epiotr
Date: Fri Apr 4 20:30:59 2008
New Revision: 1685
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1685&view=rev
Log:
Code cleanup
Modified:
branches/gcmd-1-3/src/eggcellrendererkeys.cc
branches/gcmd-1-3/src/gnome-cmd-key-shortcuts-dialog.cc
Modified: branches/gcmd-1-3/src/eggcellrendererkeys.cc
==============================================================================
--- branches/gcmd-1-3/src/eggcellrendererkeys.cc (original)
+++ branches/gcmd-1-3/src/eggcellrendererkeys.cc Fri Apr 4 20:30:59 2008
@@ -77,12 +77,12 @@
enum
{
PROP_0,
-
PROP_ACCEL_KEY,
PROP_ACCEL_MASK,
PROP_ACCEL_MODE
};
+
static GtkCellRendererTextClass *parent_class = NULL;
@@ -193,9 +193,8 @@
_("Accelerator modifiers"),
GDK_TYPE_MODIFIER_TYPE,
0,
- GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE)));
+ GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE)));
- /* FIXME: Register the enum when moving to GTK+ */
g_object_class_install_property (object_class,
PROP_ACCEL_MODE,
g_param_spec_int ("accel-mode",
@@ -204,7 +203,7 @@
0,
2,
0,
- GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE)));
+ GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE)));
g_signal_new ("accel-edited",
EGG_TYPE_CELL_RENDERER_KEYS,
@@ -260,6 +259,7 @@
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
}
}
@@ -323,12 +323,12 @@
GtkRequisition requisition;
if (keys->sizing_label == NULL)
- keys->sizing_label = gtk_label_new (_("Type a new accelerator"));
+ keys->sizing_label = gtk_label_new (_("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);
+ GTK_CELL_RENDERER_CLASS (parent_class)->get_size (cell, widget, cell_area, x_offset, y_offset, width, height);
- /* FIXME: need to take the cell_area et al. into account */
+ // FIXME: need to take the cell_area et al. into account
if (width)
*width = MAX (*width, requisition.width);
if (height)
@@ -436,7 +436,7 @@
static void pointless_eventbox_start_editing (GtkCellEditable *cell_editable, GdkEvent *event)
{
- /* do nothing, because we are pointless */
+ // do nothing, because we are pointless
}
@@ -454,13 +454,13 @@
{
static const GTypeInfo eventbox_info =
{
- sizeof (GtkEventBoxClass),
+ sizeof(GtkEventBoxClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL,
NULL, /* class_finalize */
NULL, /* class_data */
- sizeof (GtkEventBox),
+ sizeof(GtkEventBox),
0, /* n_preallocs */
(GInstanceInitFunc) NULL,
};
@@ -513,7 +513,7 @@
keys->grab_widget = widget;
- g_signal_connect (G_OBJECT (widget), "key_press_event", G_CALLBACK (grab_key_callback), keys);
+ g_signal_connect (G_OBJECT (widget), "key-press-event", G_CALLBACK (grab_key_callback), keys);
eventbox = (GtkWidget *) g_object_new (pointless_eventbox_subclass_get_type (), NULL);
keys->edit_widget = eventbox;
@@ -572,7 +572,7 @@
if (changed)
{
- /* sync string to the key values */
+ // sync string to the key values
GtkCellRendererText *celltext = GTK_CELL_RENDERER_TEXT (keys);
char *text = convert_keysym_state_to_string (keys->accel_key, keys->accel_mask);
g_object_set (keys, "text", text, NULL);
Modified: branches/gcmd-1-3/src/gnome-cmd-key-shortcuts-dialog.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-key-shortcuts-dialog.cc (original)
+++ branches/gcmd-1-3/src/gnome-cmd-key-shortcuts-dialog.cc Fri Apr 4 20:30:59 2008
@@ -243,10 +243,12 @@
inline GtkTreeViewColumn *create_new_accel_column (GtkTreeView *view, GtkCellRenderer *&renderer, gint COL_KEYS_ID, gint COL_MODS_ID, const gchar *title=NULL)
{
- renderer = (GtkCellRenderer *) g_object_new (EGG_TYPE_CELL_RENDERER_KEYS,
- "editable", TRUE,
- "accel-mode", EGG_CELL_RENDERER_KEYS_MODE_GTK,
- NULL);
+ renderer = egg_cell_renderer_keys_new ();
+
+ g_object_set (renderer,
+ "editable", TRUE,
+ "accel-mode", GTK_CELL_RENDERER_ACCEL_MODE_GTK,
+ NULL);
GtkTreeViewColumn *col = gtk_tree_view_column_new_with_attributes (title,
renderer,
@@ -344,11 +346,6 @@
g_signal_connect (renderer, "accel-edited", G_CALLBACK (accel_edited_callback), view);
- g_object_set (renderer,
- "ellipsize-set", TRUE,
- "ellipsize", PANGO_ELLIPSIZE_END,
- NULL);
-
GtkTreeModel *combo_model = gnome_cmd_user_actions_create_model ();
col = create_new_combo_column (GTK_TREE_VIEW (view), combo_model, renderer, COL_ACTION, _("Action"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]