(void)column;
}
+void button_clicked(GtkButton *button, gpointer user_data)
+{
+ GtkWidget *list = (GtkWidget *)user_data;
+ GtkTreeSelection *selection;
+ GtkTreeIter iter;
+ GtkTreeModel *model;
+ GtkTreePath *path;
+
+ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list));
+ gtk_tree_selection_get_selected(selection, &model, &iter);
+ path = gtk_tree_model_get_path(model, &iter);
+ gtk_tree_view_row_activated(GTK_TREE_VIEW(list), path, gtk_tree_view_get_column(GTK_TREE_VIEW(list), 0));
+ gtk_tree_path_free(path);
+
+ (void)button;
+}
+
gboolean key_press(GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
if(event->key.keyval==GDK_KEY_Escape)
int main(int argc, char **argv)
{
GtkWidget *window;
+ GtkWidget *box;
GtkWidget *viewport;
GtkWidget *list;
GtkListStore *store;
GtkTreeSelection *selection;
+ GtkWidget *button;
GtkTreeIter iter;
Device *devices;
int i;
g_signal_connect(window, "destroy", G_CALLBACK(>k_main_quit), NULL);
g_signal_connect(window, "key-press-event", G_CALLBACK(&key_press), NULL);
+ box = gtk_vbox_new(FALSE, 5);
+ gtk_container_add(GTK_CONTAINER(window), box);
+
viewport = gtk_viewport_new(NULL, NULL);
gtk_viewport_set_shadow_type(GTK_VIEWPORT(viewport), GTK_SHADOW_IN);
- gtk_container_add(GTK_CONTAINER(window), viewport);
+ gtk_box_pack_start(GTK_BOX(box), viewport, TRUE, TRUE, 0);
list = gtk_tree_view_new();
gtk_container_add(GTK_CONTAINER(viewport), list);
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list));
+ button = gtk_button_new_with_label(umount ? "Unmount" : "Mount");
+ g_signal_connect(button, "clicked", G_CALLBACK(&button_clicked), list);
+ gtk_box_pack_start(GTK_BOX(box), button, FALSE, TRUE, 0);
+
devices = get_devices();
n_listed = 0;
if(devices)