[Goodies-commits] r4009 - in xfbib/trunk: . src
Jesper Karlsson
zarper at xfce.org
Fri Feb 29 21:35:08 CET 2008
Author: zarper
Date: 2008-02-29 20:35:08 +0000 (Fri, 29 Feb 2008)
New Revision: 4009
Modified:
xfbib/trunk/TODO
xfbib/trunk/src/open.c
xfbib/trunk/src/save.c
xfbib/trunk/src/statusbar.c
xfbib/trunk/src/statusbar.h
xfbib/trunk/src/treeview.c
xfbib/trunk/src/window.c
Log:
Xfbib: Statusbar now prompts when a file is opened or saved.
The title gets changed back to default when a new file is created after a file has been opened.
Updated TODO.
Modified: xfbib/trunk/TODO
===================================================================
--- xfbib/trunk/TODO 2008-02-29 19:36:46 UTC (rev 4008)
+++ xfbib/trunk/TODO 2008-02-29 20:35:08 UTC (rev 4009)
@@ -4,6 +4,8 @@
- Right click menu. (0.0.2)
+- Save before exiting dialog.
+
- Test suite for the parser.
- Preamble and comment support.
Modified: xfbib/trunk/src/open.c
===================================================================
--- xfbib/trunk/src/open.c 2008-02-29 19:36:46 UTC (rev 4008)
+++ xfbib/trunk/src/open.c 2008-02-29 20:35:08 UTC (rev 4009)
@@ -23,6 +23,7 @@
#include "open.h"
#include "debug.h"
#include "window.h"
+#include "statusbar.h"
int open_file (char *filename, struct xfbib *xfbib)
{
@@ -31,4 +32,6 @@
update_treeview(xfbib);
_DEBUG(("Opening: %s", xfbib->filename));
gtk_window_set_title(GTK_WINDOW(xfbib->window.window), create_title(xfbib));
-}
\ No newline at end of file
+ statusbar_push((GtkStatusbar *) xfbib->window.statusbar, 0, "File loaded.");
+ return 0;
+}
Modified: xfbib/trunk/src/save.c
===================================================================
--- xfbib/trunk/src/save.c 2008-02-29 19:36:46 UTC (rev 4008)
+++ xfbib/trunk/src/save.c 2008-02-29 20:35:08 UTC (rev 4009)
@@ -20,6 +20,7 @@
#include "debug.h"
#include "xfbib.h"
#include "node.h"
+#include "statusbar.h"
void save(struct xfbib *xfbib)
{
@@ -28,4 +29,5 @@
write_list(xfbib->list, file);
fclose(file);
_DEBUG(("Saving: %s", xfbib->filename));
+ statusbar_push((GtkStatusbar *) xfbib->window.statusbar, 0, "File saved.");
}
Modified: xfbib/trunk/src/statusbar.c
===================================================================
--- xfbib/trunk/src/statusbar.c 2008-02-29 19:36:46 UTC (rev 4008)
+++ xfbib/trunk/src/statusbar.c 2008-02-29 20:35:08 UTC (rev 4009)
@@ -26,3 +26,13 @@
statusbar = gtk_statusbar_new();
return statusbar;
}
+
+void statusbar_push (GtkStatusbar *statusbar, int id, char *message)
+{
+ gtk_statusbar_push (statusbar, id, message);
+}
+
+void statusbar_pop (GtkStatusbar *statusbar, int id)
+{
+ gtk_statusbar_pop (statusbar, id);
+}
Modified: xfbib/trunk/src/statusbar.h
===================================================================
--- xfbib/trunk/src/statusbar.h 2008-02-29 19:36:46 UTC (rev 4008)
+++ xfbib/trunk/src/statusbar.h 2008-02-29 20:35:08 UTC (rev 4009)
@@ -17,3 +17,5 @@
#include <gtk/gtk.h>
GtkWidget *create_statusbar(void);
+void statusbar_push (GtkStatusbar *statusbar, int id, char *message);
+void statusbar_pop (GtkStatusbar *statusbar, int id);
Modified: xfbib/trunk/src/treeview.c
===================================================================
--- xfbib/trunk/src/treeview.c 2008-02-29 19:36:46 UTC (rev 4008)
+++ xfbib/trunk/src/treeview.c 2008-02-29 20:35:08 UTC (rev 4009)
@@ -123,10 +123,10 @@
struct node *n;
struct entry *e;
struct string *s;
-
+
GtkListStore *main_list = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(xfbib->window.main_treeview)));
GtkListStore *var_list = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(xfbib->window.variable_treeview)));
-
+
gtk_list_store_clear (main_list);
gtk_list_store_clear (var_list);
@@ -148,6 +148,5 @@
gtk_list_store_set (var_list, &iter, VAR_COLUMN_STRING, n, -1);
break;
}
-
}
}
Modified: xfbib/trunk/src/window.c
===================================================================
--- xfbib/trunk/src/window.c 2008-02-29 19:36:46 UTC (rev 4008)
+++ xfbib/trunk/src/window.c 2008-02-29 20:35:08 UTC (rev 4009)
@@ -103,5 +103,8 @@
title[length] = '\0';
return title;*/
- return xfbib->filename;
+ if (xfbib->filename == NULL)
+ return "Xfbib";
+ else
+ return xfbib->filename;
}
More information about the Goodies-commits
mailing list