[gnome-latex: 115/205] File browser: refresh button



commit 8b2cbc0e2f44e9bbed8084cc5077bb881af37ed1
Author: Sébastien Wilmet <sebastien wilmet gmail com>
Date:   Tue Nov 10 01:11:33 2009 +0100

    File browser: refresh button

 TODO               |  2 ++
 src/file_browser.c | 17 +++++++++++++++++
 2 files changed, 19 insertions(+)
---
diff --git a/TODO b/TODO
index 8b12984..00c0ecb 100644
--- a/TODO
+++ b/TODO
@@ -21,3 +21,5 @@ TODO LaTeXila
 [-] undo/redo and the "saved" document property
        - detect when the buffer is the same as in the file currently saved
 
+[-] open document
+       - verify if the document is not already opened
diff --git a/src/file_browser.c b/src/file_browser.c
index 493e29c..6ff469a 100644
--- a/src/file_browser.c
+++ b/src/file_browser.c
@@ -34,6 +34,7 @@
 static void fill_list_store_with_current_dir (void);
 static void cb_go_to_home_dir (GtkButton *button, gpointer user_data);
 static void cb_go_to_parent_dir (GtkButton *button, gpointer user_data);
+static void cb_refresh (GtkButton *button, gpointer user_data);
 static void cb_file_browser_row_activated (GtkTreeView *tree_view,
                GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data);
 static gint sort_list_alphabetical_order (gconstpointer a, gconstpointer b);
@@ -60,9 +61,19 @@ init_file_browser (void)
        g_signal_connect (G_OBJECT (parent_dir_button), "clicked",
                        G_CALLBACK (cb_go_to_parent_dir), NULL);
 
+       // refresh
+       GtkWidget *refresh_button = gtk_button_new ();
+       gtk_button_set_relief (GTK_BUTTON (refresh_button), GTK_RELIEF_NONE);
+       GtkWidget *refresh_icon = gtk_image_new_from_stock (GTK_STOCK_REFRESH,
+                       GTK_ICON_SIZE_BUTTON);
+       gtk_container_add (GTK_CONTAINER (refresh_button), refresh_icon);
+       g_signal_connect (G_OBJECT (refresh_button), "clicked",
+                       G_CALLBACK (cb_refresh), NULL);
+
        GtkWidget *hbox = gtk_hbox_new (TRUE, 0);
        gtk_box_pack_start (GTK_BOX (hbox), home_button, TRUE, TRUE, 0);
        gtk_box_pack_start (GTK_BOX (hbox), parent_dir_button, TRUE, TRUE, 0);
+       gtk_box_pack_start (GTK_BOX (hbox), refresh_button, TRUE, TRUE, 0);
        gtk_box_pack_start (GTK_BOX (latexila.file_browser.vbox), hbox,
                        FALSE, FALSE, 0);
 
@@ -246,6 +257,12 @@ cb_go_to_parent_dir (GtkButton *button, gpointer user_data)
        fill_list_store_with_current_dir ();
 }
 
+static void
+cb_refresh (GtkButton *button, gpointer user_data)
+{
+       fill_list_store_with_current_dir ();
+}
+
 static void
 cb_file_browser_row_activated (GtkTreeView *tree_view, GtkTreePath *path,
                GtkTreeViewColumn *column, gpointer user_data)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]