[Goodies-commits] r4002 - in xfbib/trunk: . src

Jesper Karlsson zarper at xfce.org
Tue Feb 26 23:25:14 CET 2008


Author: zarper
Date: 2008-02-26 22:25:14 +0000 (Tue, 26 Feb 2008)
New Revision: 4002

Modified:
   xfbib/trunk/TODO
   xfbib/trunk/src/entry_edit_dialog.c
   xfbib/trunk/src/toolbar.c
Log:
Xfbib:
Removed about button in toolbar.
Added edit entry button in toolbar.
Updated TODO.

Modified: xfbib/trunk/TODO
===================================================================
--- xfbib/trunk/TODO	2008-02-26 21:51:05 UTC (rev 4001)
+++ xfbib/trunk/TODO	2008-02-26 22:25:14 UTC (rev 4002)
@@ -4,10 +4,8 @@
 
 - Right click menu. (0.0.2)
 
-- Ability to att variables. (0.0.2)
+- Ability to add variables. (0.0.2)
 
-- Remove about button in toolbar. (0.0.2)
-
 - Test suite for the parser.
 
 - Preamble and comment support.

Modified: xfbib/trunk/src/entry_edit_dialog.c
===================================================================
--- xfbib/trunk/src/entry_edit_dialog.c	2008-02-26 21:51:05 UTC (rev 4001)
+++ xfbib/trunk/src/entry_edit_dialog.c	2008-02-26 22:25:14 UTC (rev 4002)
@@ -185,13 +185,15 @@
 
 static void entry_sensitivity(struct edit_entry *entries, gint type)
 {
-	/* These entries is not used by any of the standard types in bibtex */
+	_DEBUG(("entry_sensitivity"));
+	
+	/* These entries are not used by any of the standard types in bibtex */
 	//gtk_widget_set_sensitive(GTK_WIDGET(entries[get_entry_pos("url")].entry), FALSE);
 	//gtk_widget_set_sensitive(GTK_WIDGET(entries[get_entry_pos("e-print")].entry), FALSE);
 	//gtk_widget_set_sensitive(GTK_WIDGET(entries[get_entry_pos("crossref")].entry), FALSE);
 	//gtk_widget_set_sensitive(GTK_WIDGET(entries[get_entry_pos("annote")].entry), FALSE);
 	
-	/* These entries is use by all types */
+	/* These entries are use by all types */
 	//gtk_widget_set_sensitive(GTK_WIDGET(entries[get_entry_pos("title")].entry), TRUE);
 	//gtk_widget_set_sensitive(GTK_WIDGET(entries[get_entry_pos("month")].entry), TRUE);
 	//gtk_widget_set_sensitive(GTK_WIDGET(entries[get_entry_pos("year")].entry), TRUE);
@@ -211,7 +213,7 @@
 	gtk_widget_set_sensitive(GTK_WIDGET(entries[get_entry_pos("pages")].entry), type == ARTICLE || type == CONFERENCE || type == INBOOK || type == INCOLLECTION || type == INPROCEEDINGS ? TRUE : FALSE);
 	gtk_widget_set_sensitive(GTK_WIDGET(entries[get_entry_pos("volume")].entry), type == ARTICLE || type == BOOK || type == INBOOK ? TRUE : FALSE);
 	gtk_widget_set_sensitive(GTK_WIDGET(entries[get_entry_pos("address")].entry), type == ARTICLE || type == MISC || type == UNPUBLISHED ? FALSE : TRUE);
-	gtk_widget_set_sensitive(GTK_WIDGET(entries[get_entry_pos("how published")].entry), type == BOOKLET || type == MISC ? TRUE : FALSE);
+	gtk_widget_set_sensitive(GTK_WIDGET(entries[get_entry_pos("howpublished")].entry), type == BOOKLET || type == MISC ? TRUE : FALSE);
 	gtk_widget_set_sensitive(GTK_WIDGET(entries[get_entry_pos("journal")].entry), type == ARTICLE ? TRUE : FALSE);
 	gtk_widget_set_sensitive(GTK_WIDGET(entries[get_entry_pos("publisher")].entry), type == BOOK || type == CONFERENCE || type == INBOOK || type == INCOLLECTION || type == INPROCEEDINGS || type == PROCEEDINGS ? TRUE : FALSE);
 	gtk_widget_set_sensitive(GTK_WIDGET(entries[get_entry_pos("series")].entry), type == BOOK || type == INBOOK ? TRUE : FALSE);

Modified: xfbib/trunk/src/toolbar.c
===================================================================
--- xfbib/trunk/src/toolbar.c	2008-02-26 21:51:05 UTC (rev 4001)
+++ xfbib/trunk/src/toolbar.c	2008-02-26 22:25:14 UTC (rev 4002)
@@ -17,7 +17,6 @@
 #include <gtk/gtk.h>
 
 #include "toolbar.h"
-#include "about_dialog.h"
 #include "entry_edit_dialog.h"
 #include "save_dialog.h"
 #include "open_dialog.h"
@@ -44,18 +43,33 @@
 		save(xfbib);
 	}
 }
-/*
+
 static void toolbar_edit_event_handler (struct xfbib *xfbib)
 {
 	_DEBUG(("toolbar_edit_event_handler"));
-	show_edit_dialog(&xfbib, NULL);
+
+	GtkTreeSelection *selection;
+	GtkTreeModel *model;
+	GtkTreeIter iter;
+	struct node *node;
+	
+	/* This will only work in single or browse selection mode! */
+	
+	selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(xfbib->window.main_treeview));
+	if (gtk_tree_selection_get_selected(selection, &model, &iter))
+	{
+		gtk_tree_model_get(model, &iter, COLUMN_ENTRY, &node, -1);
+		show_entry_edit_dialog(xfbib, node->node);
+	} else {
+		_DEBUG(("No row selected."));
+	}
 }
-*/
+
 static void toolbar_add_event_handler (struct xfbib *xfbib)
 {
 	_DEBUG(("toolbar_add_event_handler"));
 	show_entry_edit_dialog(xfbib, NULL);
-	//add_to_treeview(xfbib);
+	update_treeview(xfbib);
 }
 
 static void toolbar_remove_event_handler (struct xfbib *xfbib)
@@ -78,13 +92,6 @@
 	update_treeview(xfbib);
 }
 
-static void toolbar_about_event_handler (GtkWidget *window)
-{
-	_DEBUG(("toolbar_about_event_handler"));
-	show_about_dialog();
-}
-
-
 GtkWidget *create_toolbar(struct xfbib *xfbib)
 {
 	_DEBUG(("create_toolbar"));
@@ -92,12 +99,9 @@
 	struct {
 		GtkToolItem *open;
 		GtkToolItem *save;
-	/*
 		GtkToolItem *edit;
-	*/
 		GtkToolItem *add;
 		GtkToolItem *remove;
-		GtkToolItem *about;
 	} toolitems;
 
 	/* Create and add toolbar */
@@ -106,36 +110,32 @@
 
 	toolitems.open = gtk_tool_button_new_from_stock(GTK_STOCK_OPEN);
 	toolitems.save = gtk_tool_button_new_from_stock(GTK_STOCK_SAVE);
-	/*
+	
 	toolitems.edit = gtk_tool_button_new_from_stock(GTK_STOCK_EDIT);
-	*/
+	
 	toolitems.add = gtk_tool_button_new_from_stock(GTK_STOCK_ADD);
 	toolitems.remove = gtk_tool_button_new_from_stock(GTK_STOCK_REMOVE);
-	toolitems.about = gtk_tool_button_new_from_stock(GTK_STOCK_ABOUT);
 	
 	g_signal_connect_swapped(G_OBJECT(toolitems.open),
 			"clicked", G_CALLBACK(toolbar_open_event_handler), xfbib);
 	g_signal_connect_swapped(G_OBJECT(toolitems.save),
 			"clicked", G_CALLBACK(toolbar_save_event_handler), xfbib);
-	/*
+	
 	g_signal_connect_swapped(G_OBJECT(toolitems.edit),
 			"clicked", G_CALLBACK(toolbar_edit_event_handler), xfbib);
-	*/
+	
 	g_signal_connect_swapped(G_OBJECT(toolitems.add),
 			"clicked", G_CALLBACK(toolbar_add_event_handler), xfbib);
 	g_signal_connect_swapped(G_OBJECT(toolitems.remove),
 			"clicked", G_CALLBACK(toolbar_remove_event_handler), xfbib);
-	g_signal_connect_swapped(G_OBJECT(toolitems.about),
-			"clicked", G_CALLBACK(toolbar_about_event_handler), NULL);
 
 	gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitems.open, 0);
 	gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitems.save, 1);
-	//gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitems.edit, );
 	gtk_toolbar_insert (GTK_TOOLBAR (toolbar), gtk_separator_tool_item_new(), 2);
 	gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitems.add, 3);
 	gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitems.remove, 4);
-	gtk_toolbar_insert (GTK_TOOLBAR (toolbar), gtk_separator_tool_item_new(), 5);
-	gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitems.about, 6);
+	//gtk_toolbar_insert (GTK_TOOLBAR (toolbar), gtk_separator_tool_item_new(), 5);
+	gtk_toolbar_insert (GTK_TOOLBAR (toolbar), toolitems.edit, 5);
 
 	return toolbar;
 }




More information about the Goodies-commits mailing list