[Xfce4-commits] r23666 - in xarchiver/branches/xarchiver-psybsd: . libxarchiver src

Stephan Arts stephan at xfce.org
Sat Nov 4 17:09:01 CET 2006


Author: stephan
Date: 2006-11-04 16:08:59 +0000 (Sat, 04 Nov 2006)
New Revision: 23666

Modified:
   xarchiver/branches/xarchiver-psybsd/TODO
   xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.c
   xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.h
   xarchiver/branches/xarchiver-psybsd/src/archive_store.c
   xarchiver/branches/xarchiver-psybsd/src/archive_store.h
   xarchiver/branches/xarchiver-psybsd/src/navigation_bar.c
   xarchiver/branches/xarchiver-psybsd/src/navigation_bar.h
   xarchiver/branches/xarchiver-psybsd/src/notebook.c
   xarchiver/branches/xarchiver-psybsd/src/notebook.h
   xarchiver/branches/xarchiver-psybsd/src/path_bar.c
   xarchiver/branches/xarchiver-psybsd/src/tool_bar.c
Log:
Changed stuff



Modified: xarchiver/branches/xarchiver-psybsd/TODO
===================================================================
--- xarchiver/branches/xarchiver-psybsd/TODO	2006-11-04 15:14:02 UTC (rev 23665)
+++ xarchiver/branches/xarchiver-psybsd/TODO	2006-11-04 16:08:59 UTC (rev 23666)
@@ -10,20 +10,26 @@
 
   Make thunar-vfs dependency optional.
   Make libxfce4-util dependency optional.
-+-+-+-+
 
-  Add Settings support
-+-+-+-+
+  Fix navigation-bars to work with notebook
 
+  Close Buttons
+
+	Fix Command-line options
+
+  Add Dialog
+
+  New Dialog 
+
+  Open Dialog 
+
+  Settings support
+
   Comment library functions
     (explain their purpose)
-+-+-+-+
 
   Increase performance
-+-+-+-+ 
 
   Implement multi-threading (for libarchive support)
-+-+-+-+
 
-  Complete TODO-file
-+-+-+-+
+  ... Complete TODO-file

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.c	2006-11-04 15:14:02 UTC (rev 23665)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.c	2006-11-04 16:08:59 UTC (rev 23666)
@@ -108,6 +108,18 @@
 	return result;
 }
 
+const gchar *
+lxa_mime_info_get_icon_name(const LXAMimeInfo *mime_info, GtkIconTheme *icon_theme)
+{
+	const gchar *result = NULL;
+#ifdef HAVE_THUNAR_VFS
+	result = thunar_vfs_mime_info_lookup_icon_name((ThunarVfsMimeInfo *)mime_info, icon_theme);
+#else
+
+#endif
+	return result;
+}
+
 void
 lxa_mime_convert_to_icon_name(GtkIconTheme *icon_theme, GValue *value)
 {

Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.h	2006-11-04 15:14:02 UTC (rev 23665)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/mime.h	2006-11-04 16:08:59 UTC (rev 23666)
@@ -44,6 +44,8 @@
 
 const gchar *
 lxa_mime_info_get_name(const LXAMimeInfo *mime_info);
+const gchar *
+lxa_mime_info_get_icon_name(const LXAMimeInfo *mime_info, GtkIconTheme *icon_theme);
 
 void
 lxa_mime_info_unref(LXAMimeInfo *mime_info);

Modified: xarchiver/branches/xarchiver-psybsd/src/archive_store.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/archive_store.c	2006-11-04 15:14:02 UTC (rev 23665)
+++ xarchiver/branches/xarchiver-psybsd/src/archive_store.c	2006-11-04 16:08:59 UTC (rev 23666)
@@ -1347,3 +1347,17 @@
 	else
 		return g_value_dup_string(value);
 }
+
+void
+xa_archive_store_set_history(XAArchiveStore *store, GList *history, GList *pwd)
+{
+	store->navigation.history = history;
+	store->navigation.pwd = pwd;
+}
+
+void
+xa_archive_store_get_history(XAArchiveStore *store, GList **history, GList **pwd)
+{
+	(*history)=store->navigation.history;
+	(*pwd) = store->navigation.pwd;
+}

Modified: xarchiver/branches/xarchiver-psybsd/src/archive_store.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/archive_store.h	2006-11-04 15:14:02 UTC (rev 23665)
+++ xarchiver/branches/xarchiver-psybsd/src/archive_store.h	2006-11-04 16:08:59 UTC (rev 23666)
@@ -57,6 +57,10 @@
 		guint _sort_folders_first : 1;
 		guint _sort_case_sensitive : 1;
 	} props;
+	struct {
+		GList *history;
+		GList *pwd;
+	} navigation;
 };
 
 typedef struct _XAArchiveStoreClass XAArchiveStoreClass;
@@ -100,4 +104,9 @@
 
 gchar *
 xa_archive_store_get_filename(XAArchiveStore *store, GtkTreeIter *iter);
+
+void
+xa_archive_store_set_history(XAArchiveStore *store, GList *history, GList *pwd);
+void
+xa_archive_store_get_history(XAArchiveStore *store, GList **history, GList **pwd);
 #endif /* __XARCHIVER_ARCHIVE_STORE_H__ */

Modified: xarchiver/branches/xarchiver-psybsd/src/navigation_bar.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/navigation_bar.c	2006-11-04 15:14:02 UTC (rev 23665)
+++ xarchiver/branches/xarchiver-psybsd/src/navigation_bar.c	2006-11-04 16:08:59 UTC (rev 23666)
@@ -53,6 +53,8 @@
 	XA_NAVIGATION_BAR_NAV_HISTORY = 1
 };
 
+static gint xa_navigation_bar_signals[1];
+
 GType
 xa_navigation_bar_get_type ()
 {
@@ -97,6 +99,17 @@
 		XA_NAVIGATION_BAR_MAX_HISTORY,
 		G_PARAM_READWRITE);
 	g_object_class_install_property(object_class, XA_NAVIGATION_BAR_NAV_HISTORY, pspec);
+
+	xa_navigation_bar_signals[0] = g_signal_new("xa_store_set",
+			G_TYPE_FROM_CLASS(navigation_bar_class),
+			G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+			0,
+			NULL,
+			NULL,
+			g_cclosure_marshal_VOID__VOID,
+			G_TYPE_NONE,
+			0,
+			NULL);
 }
 
 static void
@@ -105,8 +118,8 @@
 	GTK_WIDGET_SET_FLAGS(navigation_bar, GTK_NO_WINDOW);
 	gtk_widget_set_redraw_on_allocate(GTK_WIDGET(navigation_bar), FALSE);
 
-	navigation_bar->_cb_pwd_changed = (GCallback)cb_xa_navigation_bar_pwd_changed;
-	navigation_bar->_cb_new_archive = (GCallback)cb_xa_navigation_bar_new_archive;
+	navigation_bar->_cb_pwd_changed = cb_xa_navigation_bar_pwd_changed;
+	navigation_bar->_cb_new_archive = cb_xa_navigation_bar_new_archive;
 	navigation_bar->max_history = XA_NAVIGATION_BAR_MAX_HISTORY;
 	navigation_bar->pwd = NULL;
 	navigation_bar->history = NULL;
@@ -116,26 +129,39 @@
 xa_navigation_bar_finalize(GObject *object)
 {
 	XANavigationBar *navigation_bar = XA_NAVIGATION_BAR(object);
-	if(navigation_bar->_cb_pwd_changed)
-		g_signal_handlers_disconnect_by_func(navigation_bar->store, navigation_bar->_cb_pwd_changed, navigation_bar);
-	if(navigation_bar->_cb_new_archive)
-		g_signal_handlers_disconnect_by_func(navigation_bar->store, navigation_bar->_cb_new_archive, navigation_bar);
+	if(navigation_bar->store)
+	{
+		if(navigation_bar->_cb_pwd_changed)
+			g_signal_handlers_disconnect_by_func(navigation_bar->store, navigation_bar->_cb_pwd_changed, navigation_bar);
+		if(navigation_bar->_cb_new_archive)
+			g_signal_handlers_disconnect_by_func(navigation_bar->store, navigation_bar->_cb_new_archive, navigation_bar);
+	}
 }
 
 void
 xa_navigation_bar_set_store(XANavigationBar *navigation_bar, XAArchiveStore *store)
 {
-	if(store)
+	if(navigation_bar->store)
 	{
-		g_return_if_fail(XA_IS_ARCHIVE_STORE(store));
-		g_return_if_fail(XA_IS_NAVIGATION_BAR(navigation_bar));
+		if(navigation_bar->_cb_pwd_changed)
+			g_signal_handlers_disconnect_by_func(navigation_bar->store, navigation_bar->_cb_pwd_changed, navigation_bar);
+		if(navigation_bar->_cb_new_archive)
+			g_signal_handlers_disconnect_by_func(navigation_bar->store, navigation_bar->_cb_new_archive, navigation_bar);
+
+		xa_archive_store_set_history(navigation_bar->store, navigation_bar->history, navigation_bar->pwd);
 	}
 
 	navigation_bar->store = store;
 	if(store)
 	{
+		g_return_if_fail(XA_IS_ARCHIVE_STORE(store));
+		g_return_if_fail(XA_IS_NAVIGATION_BAR(navigation_bar));
 		g_signal_connect(G_OBJECT(store), "xa-pwd-changed", (GCallback)navigation_bar->_cb_pwd_changed, navigation_bar);
 		g_signal_connect(G_OBJECT(store), "xa-new-archive", (GCallback)navigation_bar->_cb_new_archive, navigation_bar);
+		xa_archive_store_get_history(store, &navigation_bar->history, &navigation_bar->pwd);
+
+		/* should be signal, window might want to know */
+		g_signal_emit(G_OBJECT(navigation_bar), xa_navigation_bar_signals[0], 0, navigation_bar);
 	}
 }
 

Modified: xarchiver/branches/xarchiver-psybsd/src/navigation_bar.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/navigation_bar.h	2006-11-04 15:14:02 UTC (rev 23665)
+++ xarchiver/branches/xarchiver-psybsd/src/navigation_bar.h	2006-11-04 16:08:59 UTC (rev 23666)
@@ -49,8 +49,9 @@
 	GList *history;
 	GList *pwd;
 	gint max_history;
-	GCallback _cb_pwd_changed;
-	GCallback _cb_new_archive;
+	void (*_cb_pwd_changed)(XAArchiveStore *, XANavigationBar *);
+	void (*_cb_new_archive)(XAArchiveStore *, XANavigationBar *);
+	void (*_cb_store_set)(XANavigationBar *);
 };
 
 typedef struct _XANavigationBarClass XANavigationBarClass;

Modified: xarchiver/branches/xarchiver-psybsd/src/notebook.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/notebook.c	2006-11-04 15:14:02 UTC (rev 23665)
+++ xarchiver/branches/xarchiver-psybsd/src/notebook.c	2006-11-04 16:08:59 UTC (rev 23666)
@@ -23,6 +23,8 @@
 #include <libxarchiver/libxarchiver.h>
 #include "archive_store.h"
 #include "navigation_bar.h"
+#include "tool_bar.h"
+#include "path_bar.h"
 #include "notebook.h"
 
 static void
@@ -42,6 +44,9 @@
 xa_notebook_treeview_reset_columns(LXAArchive *archive, GtkTreeView *treeview);
 
 void
+cb_notebook_close_archive(GtkButton *button, GtkTreeView *treeview);
+
+void
 cb_notebook_archive_status_changed(LXAArchive *archive, XANotebook *notebook);
 void
 cb_notebook_archive_refreshed(LXAArchive *archive, GtkTreeView *tree_view);
@@ -101,6 +106,11 @@
 xa_notebook_init(XANotebook *notebook)
 {
 	g_signal_connect(G_OBJECT(notebook), "switch-page", G_CALLBACK(cb_xa_notebook_page_switched), NULL);
+	notebook->tool_tips = gtk_tooltips_new();
+	gtk_tooltips_enable(notebook->tool_tips);
+	gtk_notebook_set_tab_border(GTK_NOTEBOOK(notebook), 0);
+	gtk_notebook_set_show_border(GTK_NOTEBOOK(notebook), FALSE);
+	gtk_notebook_set_scrollable(GTK_NOTEBOOK(notebook), TRUE);
 }
 
 static void
@@ -115,8 +125,13 @@
 
 	notebook = g_object_new(XA_TYPE_NOTEBOOK, NULL);
 
+	notebook->props._up_dir = TRUE;
 	if(bar)
+	{
 		xa_notebook_set_navigation_bar(notebook, bar);
+		if(XA_IS_TOOL_BAR(bar) || XA_IS_PATH_BAR(bar))
+			notebook->props._up_dir = FALSE;
+	}
 
 	notebook->props._show_icons = TRUE;
 
@@ -156,13 +171,23 @@
 {
 	GtkWidget *lbl_hbox = gtk_hbox_new(FALSE, 0);
 	GtkWidget *label = gtk_label_new(lxa_archive_get_filename(archive));
-	GtkWidget *close_button = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
+	GtkWidget *archive_image = gtk_image_new_from_icon_name(lxa_mime_info_get_icon_name(archive->mime_info, notebook->icon_theme), GTK_ICON_SIZE_MENU);
+	GtkWidget *close_button = gtk_button_new();
+	GtkWidget *close_image = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
 
+	gtk_button_set_image(GTK_BUTTON(close_button), close_image);
+	gtk_button_set_relief(GTK_BUTTON(close_button), GTK_RELIEF_NONE);
+
+	gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_MIDDLE);
+	gtk_label_set_max_width_chars(GTK_LABEL(label), 20);
+	gtk_tooltips_set_tip(notebook->tool_tips, label, lxa_archive_get_filename(archive), NULL);
+
 	GtkWidget *tree_view = gtk_tree_view_new();
 	gtk_tree_view_set_enable_search(GTK_TREE_VIEW(tree_view), TRUE);
 
 	GtkTreeModel *tree_model = xa_archive_store_new(archive, notebook->props._show_icons, notebook->props._up_dir, notebook->icon_theme);
 
+	gtk_box_pack_start(GTK_BOX(lbl_hbox), archive_image, FALSE, FALSE, 3);
 	gtk_box_pack_start(GTK_BOX(lbl_hbox), label, FALSE, FALSE, 0);
 	gtk_box_pack_start(GTK_BOX(lbl_hbox), close_button, FALSE, FALSE, 0);
 	gtk_widget_show_all(lbl_hbox);
@@ -171,10 +196,13 @@
 	g_signal_connect(G_OBJECT(archive), "lxa_status_changed", G_CALLBACK(cb_notebook_archive_status_changed), notebook);
 	g_signal_connect(G_OBJECT(archive), "lxa_refreshed", G_CALLBACK(cb_notebook_archive_refreshed), tree_view);
 
+	g_signal_connect(G_OBJECT(close_button), "clicked", G_CALLBACK(cb_notebook_close_archive), tree_view);
 
+
+	lxa_archive_support_refresh(support, archive);
+
 	xa_archive_store_connect_treeview(XA_ARCHIVE_STORE(tree_model), GTK_TREE_VIEW(tree_view));
 	gtk_tree_view_set_model(GTK_TREE_VIEW(tree_view), tree_model);
-	lxa_archive_support_refresh(support, archive);
 	gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tree_view, lbl_hbox);
 }
 
@@ -184,6 +212,11 @@
 }
 
 void
+cb_notebook_close_archive(GtkButton *button, GtkTreeView *treeview)
+{
+}
+
+void
 cb_notebook_archive_refreshed(LXAArchive *archive, GtkTreeView *treeview)
 {
 	xa_notebook_treeview_reset_columns(archive, treeview);
@@ -265,9 +298,7 @@
 static void
 cb_xa_notebook_page_switched(XANotebook *notebook, GtkNotebookPage *page, guint page_nr, gpointer data)
 {
-	g_debug("Page switched");
 	GtkWidget *treeview = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), page_nr);
 	GtkTreeModel *archive_store = gtk_tree_view_get_model(GTK_TREE_VIEW(treeview));
 	xa_navigation_bar_set_store(notebook->navigation_bar, XA_ARCHIVE_STORE(archive_store));
-	
 }

Modified: xarchiver/branches/xarchiver-psybsd/src/notebook.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/notebook.h	2006-11-04 15:14:02 UTC (rev 23665)
+++ xarchiver/branches/xarchiver-psybsd/src/notebook.h	2006-11-04 16:08:59 UTC (rev 23666)
@@ -53,6 +53,7 @@
 		gboolean _up_dir;
 	} props;
 	GtkIconTheme *icon_theme;
+	GtkTooltips *tool_tips;
 };
 
 typedef struct _XANotebookClass XANotebookClass;

Modified: xarchiver/branches/xarchiver-psybsd/src/path_bar.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/path_bar.c	2006-11-04 15:14:02 UTC (rev 23665)
+++ xarchiver/branches/xarchiver-psybsd/src/path_bar.c	2006-11-04 16:08:59 UTC (rev 23666)
@@ -54,9 +54,11 @@
 xa_path_bar_forall(GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data);
 
 static void
-cb_xa_path_bar_pwd_changed(XAArchiveStore *store, XAPathBar *bar);
+cb_xa_path_bar_pwd_changed(XAArchiveStore *store, XANavigationBar *bar);
 static void
-cb_xa_path_bar_new_archive(XAArchiveStore *store, XAPathBar *bar);
+cb_xa_path_bar_new_archive(XAArchiveStore *store, XANavigationBar *bar);
+static void
+cb_xa_path_bar_store_set(XANavigationBar *bar);
 
 static void
 cb_xa_path_bar_path_button_clicked(GtkRadioButton *button, XAPathBar *path_bar);
@@ -122,8 +124,9 @@
 xa_path_bar_init(XAPathBar *path_bar)
 {
 	GtkWidget *arrow;
-	XA_NAVIGATION_BAR(path_bar)->_cb_pwd_changed = (GCallback)cb_xa_path_bar_pwd_changed;
-	XA_NAVIGATION_BAR(path_bar)->_cb_new_archive = (GCallback)cb_xa_path_bar_new_archive;
+	XA_NAVIGATION_BAR(path_bar)->_cb_pwd_changed = cb_xa_path_bar_pwd_changed;
+	XA_NAVIGATION_BAR(path_bar)->_cb_new_archive = cb_xa_path_bar_new_archive;
+	XA_NAVIGATION_BAR(path_bar)->_cb_store_set   = cb_xa_path_bar_store_set;
 
 	GTK_WIDGET_SET_FLAGS(path_bar, GTK_NO_WINDOW);
 	gtk_widget_set_redraw_on_allocate(GTK_WIDGET(path_bar), FALSE);
@@ -432,8 +435,9 @@
 }
 
 static void
-cb_xa_path_bar_new_archive(XAArchiveStore *store, XAPathBar *path_bar)
+cb_xa_path_bar_new_archive(XAArchiveStore *store, XANavigationBar *bar)
 {
+	XAPathBar *path_bar = XA_PATH_BAR(bar);
 	GSList *buttons = path_bar->path_button->next;
 
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(path_bar->path_button->data), TRUE);
@@ -451,8 +455,9 @@
 }
 
 static void
-cb_xa_path_bar_pwd_changed(XAArchiveStore *store, XAPathBar *path_bar)
+cb_xa_path_bar_pwd_changed(XAArchiveStore *store, XANavigationBar *bar)
 {
+	XAPathBar *path_bar = XA_PATH_BAR(bar);
 	GSList *path = xa_archive_store_get_pwd_list(store);
 	GSList *iter = path;
 	GSList *buttons = path_bar->path_button->next;
@@ -461,7 +466,7 @@
 	const gchar *label = xa_archive_store_get_pwd(store);
 	gint cmp = 0;
 
-	xa_navigation_bar_history_push(XA_NAVIGATION_BAR(path_bar), label);
+	xa_navigation_bar_history_push(bar, label);
 	g_free((gchar*)label);
 
 	while(iter && buttons)
@@ -558,3 +563,7 @@
 {
 }
 
+static void
+cb_xa_path_bar_store_set(XANavigationBar *bar)
+{
+}

Modified: xarchiver/branches/xarchiver-psybsd/src/tool_bar.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/tool_bar.c	2006-11-04 15:14:02 UTC (rev 23665)
+++ xarchiver/branches/xarchiver-psybsd/src/tool_bar.c	2006-11-04 16:08:59 UTC (rev 23666)
@@ -48,9 +48,11 @@
 xa_tool_bar_forall(GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data);
 
 static void
-cb_xa_tool_bar_pwd_changed(XAArchiveStore *store, XAToolBar *bar);
+cb_xa_tool_bar_pwd_changed(XAArchiveStore *store, XANavigationBar *bar);
 static void
-cb_xa_tool_bar_new_archive(XAArchiveStore *store, XAToolBar *bar);
+cb_xa_tool_bar_new_archive(XAArchiveStore *store, XANavigationBar *bar);
+static void
+cb_xa_tool_bar_store_set(XANavigationBar *bar);
 
 static void
 cb_xa_tool_bar_history_back(GtkWidget *button, XAToolBar *nav_bar);
@@ -113,8 +115,9 @@
 xa_tool_bar_init(XAToolBar *tool_bar)
 {
 	GtkToolItem *button = NULL;
-	XA_NAVIGATION_BAR(tool_bar)->_cb_pwd_changed = (GCallback)cb_xa_tool_bar_pwd_changed;
-	XA_NAVIGATION_BAR(tool_bar)->_cb_new_archive = (GCallback)cb_xa_tool_bar_new_archive;
+	XA_NAVIGATION_BAR(tool_bar)->_cb_pwd_changed = cb_xa_tool_bar_pwd_changed;
+	XA_NAVIGATION_BAR(tool_bar)->_cb_new_archive = cb_xa_tool_bar_new_archive;
+	XA_NAVIGATION_BAR(tool_bar)->_cb_store_set   = cb_xa_tool_bar_store_set;
 
 	GTK_WIDGET_SET_FLAGS(tool_bar, GTK_NO_WINDOW);
 	gtk_widget_set_redraw_on_allocate(GTK_WIDGET(tool_bar), FALSE);
@@ -165,6 +168,8 @@
 	gtk_widget_set_sensitive(GTK_WIDGET(tool_bar->hbox), 0);
 
 	gtk_widget_show_all(GTK_WIDGET(tool_bar->bar));
+
+	g_signal_connect(G_OBJECT(tool_bar), "xa_store_set", (GCallback)cb_xa_tool_bar_store_set, NULL);
 }
 
 XANavigationBar *
@@ -295,26 +300,28 @@
 }
 
 static void
-cb_xa_tool_bar_pwd_changed(XAArchiveStore *store, XAToolBar *tool_bar)
+cb_xa_tool_bar_pwd_changed(XAArchiveStore *store, XANavigationBar *bar)
 {
+	XAToolBar *tool_bar = XA_TOOL_BAR(bar);
 	gchar *path= xa_archive_store_get_pwd(store);
-	xa_navigation_bar_history_push(XA_NAVIGATION_BAR(tool_bar), path);
+
+	xa_navigation_bar_history_push(bar, path);
 	xa_tool_bar_refresh(tool_bar, path);
 	g_free(path);
 	gtk_widget_set_sensitive(GTK_WIDGET(tool_bar->hbox), TRUE);
 }
 
 static void
-cb_xa_tool_bar_new_archive(XAArchiveStore *store, XAToolBar *bar)
+cb_xa_tool_bar_new_archive(XAArchiveStore *store, XANavigationBar *bar)
 {
-	g_return_if_fail(XA_IS_TOOL_BAR(bar));
+	XAToolBar *tool_bar = XA_TOOL_BAR(bar);
 
-	xa_navigation_bar_clear_history(XA_NAVIGATION_BAR(bar));
-	gtk_widget_set_sensitive(GTK_WIDGET(bar->hbox), FALSE);
-	gtk_widget_set_sensitive(GTK_WIDGET(bar->up_button), FALSE);
-	gtk_widget_set_sensitive(GTK_WIDGET(bar->home_button), FALSE);
-	gtk_widget_set_sensitive(GTK_WIDGET(bar->forward_button), FALSE);
-	gtk_widget_set_sensitive(GTK_WIDGET(bar->back_button), FALSE);
+	xa_navigation_bar_clear_history(bar);
+	gtk_widget_set_sensitive(GTK_WIDGET(tool_bar->hbox), FALSE);
+	gtk_widget_set_sensitive(GTK_WIDGET(tool_bar->up_button), FALSE);
+	gtk_widget_set_sensitive(GTK_WIDGET(tool_bar->home_button), FALSE);
+	gtk_widget_set_sensitive(GTK_WIDGET(tool_bar->forward_button), FALSE);
+	gtk_widget_set_sensitive(GTK_WIDGET(tool_bar->back_button), FALSE);
 }
 
 static void
@@ -353,3 +360,15 @@
 	const gchar *path = gtk_entry_get_text(GTK_ENTRY(entry));
 	xa_archive_store_set_pwd(XA_ARCHIVE_STORE(XA_NAVIGATION_BAR(tool_bar)->store), path);
 }
+
+static void
+cb_xa_tool_bar_store_set(XANavigationBar *bar)
+{
+	XAToolBar *tool_bar = XA_TOOL_BAR(bar);
+
+	gchar *path= xa_archive_store_get_pwd(bar->store);
+
+	xa_tool_bar_refresh(tool_bar, path);
+	gtk_widget_set_sensitive(GTK_WIDGET(tool_bar->hbox), TRUE);
+	g_free(path);
+}



More information about the Xfce4-commits mailing list