65
66
Selection_t *data = (Selection_t*) param;
67
if (data->select_lock) {
68
data->select_lock = FALSE;
70
Command_t *command, *sub_command;
72
GList *list = gtk_tree_selection_get_selected_rows (selection, &model);
74
command = subcommand_start (NULL);
75
sub_command = unselect_all_command_new (data->object_list, NULL);
76
command_add_subcommand (command, sub_command);
78
for (; list; list = list->next)
68
if (data->select_lock)
70
data->select_lock = FALSE;
82
GtkTreePath *path = (GtkTreePath*) list->data;
84
gtk_tree_model_get_iter (model, &iter, path);
85
gtk_tree_model_get (model, &iter, 0, &obj, -1);
87
sub_command = select_command_new (obj);
88
command_add_subcommand (command, sub_command);
91
command_set_name (command, sub_command->name);
94
command_execute (command);
96
g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
73
Command_t *command, *sub_command;
75
GList *list, *selected_rows;
77
selected_rows = gtk_tree_selection_get_selected_rows (selection,
80
command = subcommand_start (NULL);
81
sub_command = unselect_all_command_new (data->object_list, NULL);
82
command_add_subcommand (command, sub_command);
84
for (list = selected_rows; list; list = list->next)
88
GtkTreePath *path = (GtkTreePath*) list->data;
90
gtk_tree_model_get_iter (model, &iter, path);
91
gtk_tree_model_get (model, &iter, 0, &obj, -1);
93
sub_command = select_command_new (obj);
94
command_add_subcommand (command, sub_command);
97
command_set_name (command, sub_command->name);
100
command_execute (command);
102
g_list_foreach (selected_rows, (GFunc) gtk_tree_path_free, NULL);
103
g_list_free (selected_rows);
141
selection_command(GtkWidget *widget, gpointer data)
143
CommandFactory_t *factory = (CommandFactory_t*) data;
144
Command_t *command = (*factory)();
145
command_execute(command);
149
make_selection_toolbar(Selection_t *data)
153
toolbar = gtk_toolbar_new();
154
gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS);
155
gtk_toolbar_set_orientation(GTK_TOOLBAR(toolbar), GTK_ORIENTATION_VERTICAL);
156
gtk_container_set_border_width(GTK_CONTAINER(toolbar), 0);
158
data->arrow_up = make_toolbar_stock_icon(toolbar, GTK_STOCK_GO_UP,
159
"MoveUp", _("Move Up"),
162
data->arrow_down = make_toolbar_stock_icon(toolbar, GTK_STOCK_GO_DOWN,
163
"MoveDown", _("Move Down"),
165
&data->cmd_move_down);
166
toolbar_add_space(toolbar);
167
data->edit = make_toolbar_stock_icon(toolbar, GTK_STOCK_PROPERTIES,
168
"Edit", _("Edit"), selection_command,
170
toolbar_add_space(toolbar);
171
data->remove = make_toolbar_stock_icon(toolbar, GTK_STOCK_DELETE, "Delete",
172
_("Delete"), selection_command,
175
gtk_widget_show(toolbar);
181
147
selection_set_selected(Selection_t *selection, gint row)
183
149
GtkTreeIter iter;
313
279
Object_t *obj = selection_get_object (model, &iter);
314
280
if (!obj->locked) {
315
281
command_list_add(edit_object_command_new (obj));
316
object_set_url (obj, data->data);
282
object_set_url (obj, (const gchar *) data->data);
317
283
object_emit_update_signal (obj);
329
295
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
331
297
Object_t *obj = selection_get_object (tree_model, iter);
332
g_object_set(cell, "stock-id", obj->class->get_stock_icon_name(), NULL);
298
g_object_set(cell, "stock-id", object_get_stock_icon_name(obj), NULL);
473
439
/* For handling doubleclick */
475
g_signal_connect (list, "button_press_event",
441
g_signal_connect (list, "button-press-event",
476
442
G_CALLBACK(button_press_cb), data);
477
g_signal_connect (list, "button_release_event",
443
g_signal_connect (list, "button-release-event",
478
444
G_CALLBACK(button_release_cb), data);
480
446
/* Callbacks we are interested in */