SF.net SVN: geany:[5680] trunk/src/tools.c

colombanw at users.sourceforge.net colombanw at xxxxx
Sun Apr 3 15:54:10 UTC 2011


Revision: 5680
          http://geany.svn.sourceforge.net/geany/?rev=5680&view=rev
Author:   colombanw
Date:     2011-04-03 15:54:09 +0000 (Sun, 03 Apr 2011)

Log Message:
-----------
Simplify a bit `Set Custom Command` dialog code

Modified Paths:
--------------
    trunk/src/tools.c

Modified: trunk/src/tools.c
===================================================================
--- trunk/src/tools.c	2011-04-03 15:53:48 UTC (rev 5679)
+++ trunk/src/tools.c	2011-04-03 15:54:09 UTC (rev 5680)
@@ -59,8 +59,6 @@
 	CC_COLUMN_STATUS,
 	CC_COLUMN_TOOLTIP,
 	CC_COLUMN_CMD,
-	CC_COLUMN_EDITABLE,
-	CC_COLUMN_ELLIPSIZE,
 	CC_COLUMN_COUNT
 };
 
@@ -113,8 +111,7 @@
 	cmd = (idx >= 0) ? ui_prefs.custom_commands[idx] : NULL;
 
 	gtk_list_store_append(cc->store, &iter);
-	gtk_list_store_set(cc->store, &iter, CC_COLUMN_ID, cc->count, CC_COLUMN_CMD, cmd,
-			CC_COLUMN_EDITABLE, TRUE, CC_COLUMN_ELLIPSIZE, PANGO_ELLIPSIZE_END, -1);
+	gtk_list_store_set(cc->store, &iter, CC_COLUMN_ID, cc->count, CC_COLUMN_CMD, cmd, -1);
 	cc_dialog_update_row_status(cc->store, &iter, cmd);
 	cc->count++;
 
@@ -495,7 +492,7 @@
 
 	cc.count = 1;
 	cc.store = gtk_list_store_new(CC_COLUMN_COUNT, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING,
-			G_TYPE_STRING, G_TYPE_BOOLEAN, PANGO_TYPE_ELLIPSIZE_MODE);
+			G_TYPE_STRING);
 	cc.view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(cc.store));
 	gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(cc.view), CC_COLUMN_TOOLTIP);
 	gtk_tree_view_set_reorderable(GTK_TREE_VIEW(cc.view), TRUE);
@@ -511,10 +508,10 @@
 	gtk_tree_view_column_pack_start(column, renderer, FALSE);
 	gtk_tree_view_column_set_attributes(column, renderer, "stock-id", CC_COLUMN_STATUS, NULL);
 	renderer = gtk_cell_renderer_text_new();
+	g_object_set(renderer, "editable", TRUE, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
 	g_signal_connect(renderer, "edited", G_CALLBACK(cc_dialog_on_command_edited), &cc);
 	gtk_tree_view_column_pack_start(column, renderer, TRUE);
-	gtk_tree_view_column_set_attributes(column, renderer, "text", CC_COLUMN_CMD,
-			"editable", CC_COLUMN_EDITABLE, "ellipsize", CC_COLUMN_ELLIPSIZE, NULL);
+	gtk_tree_view_column_set_attributes(column, renderer, "text", CC_COLUMN_CMD, NULL);
 	cc.edit_column = column;
 	gtk_tree_view_append_column(GTK_TREE_VIEW(cc.view), column);
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list