Double-clicking on list dialog

This commit is contained in:
Lucas Almeida Rocha 2005-06-27 04:27:15 +00:00
parent 9c792cb86a
commit 5d584ca8ef
4 changed files with 37 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2005-06-27 Lucas Rocha <lucasr@cvs.gnome.org>
* src/tree.c, src/about.c: add double-clicking on
list dialog only for normal list (not on radio and
check lists) based on contribution from Norman Rasmussen
* THANKS: Update.
2005-06-26 Lucas Rocha <lucasr@cvs.gnome.org> 2005-06-26 Lucas Rocha <lucasr@cvs.gnome.org>
* src/zenity.h, src/option.c: new multiple option on list * src/zenity.h, src/option.c: new multiple option on list
@ -11,12 +18,12 @@
* src/notification.c: don't use parent widget for * src/notification.c: don't use parent widget for
hiding the tray icon because it breaks the 'visible' hiding the tray icon because it breaks the 'visible'
command command.
2005-06-13 Lucas Rocha <lucasr@cvs.gnome.org> 2005-06-13 Lucas Rocha <lucasr@cvs.gnome.org>
* MAINTAINERS: adding myself as a new maintainer * MAINTAINERS: adding myself as a new maintainer
* README: no more popt dependency * README: no more popt dependency.
2005-04-25 Glynn Foster <glynn.foster@sun.com> 2005-04-25 Glynn Foster <glynn.foster@sun.com>

1
THANKS
View File

@ -45,6 +45,7 @@
"Hidetoshi Tajima <hidetoshi tajima sun com>", "Hidetoshi Tajima <hidetoshi tajima sun com>",
"Tom Tromey <tromey redhat com>", "Tom Tromey <tromey redhat com>",
"Yann <bloch iie cnam fr>", "Yann <bloch iie cnam fr>",
"Norman Rasmussen <normanr gmail com>",
"", "",
"And all the translators that rock my world", "And all the translators that rock my world",
"==========================================", "==========================================",

View File

@ -90,6 +90,7 @@ static const gchar *author_credits[] = {
"Hidetoshi Tajima <hidetoshi tajima sun com>", "Hidetoshi Tajima <hidetoshi tajima sun com>",
"Tom Tromey <tromey redhat com>", "Tom Tromey <tromey redhat com>",
"Yann <bloch iie cnam fr>", "Yann <bloch iie cnam fr>",
"Norman Rasmussen <normanr gmail com>",
"", "",
"And all the translators that rock my world", "And all the translators that rock my world",
"==========================================", "==========================================",

View File

@ -38,6 +38,8 @@ static gboolean print_all_columns = FALSE;
static gint print_column_n = 1; static gint print_column_n = 1;
static void zenity_tree_dialog_response (GtkWidget *widget, int response, gpointer data); static void zenity_tree_dialog_response (GtkWidget *widget, int response, gpointer data);
static void zenity_tree_row_activated (GtkTreeView *tree_view, GtkTreePath *tree_path,
GtkTreeViewColumn *tree_col, gpointer data);
static gboolean static gboolean
zenity_tree_dialog_untoggle (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) zenity_tree_dialog_untoggle (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
@ -328,6 +330,10 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
tree_view = glade_xml_get_widget (glade_dialog, "zenity_tree_view"); tree_view = glade_xml_get_widget (glade_dialog, "zenity_tree_view");
if (!(tree_data->radiobox || tree_data->checkbox))
g_signal_connect (G_OBJECT (tree_view), "row-activated",
G_CALLBACK (zenity_tree_row_activated), data);
/* Create an empty list store */ /* Create an empty list store */
model = g_object_new (GTK_TYPE_LIST_STORE, NULL); model = g_object_new (GTK_TYPE_LIST_STORE, NULL);
@ -584,3 +590,23 @@ zenity_tree_dialog_response (GtkWidget *widget, int response, gpointer data)
} }
gtk_main_quit (); gtk_main_quit ();
} }
static void
zenity_tree_row_activated (GtkTreeView *tree_view, GtkTreePath *tree_path,
GtkTreeViewColumn *tree_col, gpointer data)
{
ZenityData *zen_data = data;
GtkTreeSelection *selection;
GtkTreeModel *model;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view));
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
gtk_tree_selection_selected_foreach (selection,
(GtkTreeSelectionForeachFunc) zenity_tree_dialog_get_selected,
GTK_TREE_VIEW (tree_view));
zenity_tree_dialog_output ();
zen_data->exit_code = zenity_util_return_exit_code (ZENITY_OK);
gtk_main_quit ();
}