SF.net SVN: geany-plugins:[1227] trunk/geany-plugins/treebrowser

dimitrov-adrian at users.sourceforge.net dimitrov-adrian at xxxxx
Sat Apr 10 16:59:28 UTC 2010


Revision: 1227
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1227&view=rev
Author:   dimitrov-adrian
Date:     2010-04-10 16:59:27 +0000 (Sat, 10 Apr 2010)

Log Message:
-----------
Treebrowser, highlighing addressbar if typed directory not exists

Modified Paths:
--------------
    trunk/geany-plugins/treebrowser/ChangeLog
    trunk/geany-plugins/treebrowser/src/treebrowser.c

Modified: trunk/geany-plugins/treebrowser/ChangeLog
===================================================================
--- trunk/geany-plugins/treebrowser/ChangeLog	2010-04-10 16:41:30 UTC (rev 1226)
+++ trunk/geany-plugins/treebrowser/ChangeLog	2010-04-10 16:59:27 UTC (rev 1227)
@@ -26,6 +26,7 @@
 		fixed wrong root refresh on delete and create when objects are in toplevel
 		some string changed in prefs dialog
 		added option to close document if it is deleted from treebrowser
+		highlighing addressbar if typed directory not exists
 
 
 31-03-2010 	Adrian Dimitrov 		<dimitrov.adrian at gmail.com>

Modified: trunk/geany-plugins/treebrowser/src/treebrowser.c
===================================================================
--- trunk/geany-plugins/treebrowser/src/treebrowser.c	2010-04-10 16:41:30 UTC (rev 1226)
+++ trunk/geany-plugins/treebrowser/src/treebrowser.c	2010-04-10 16:59:27 UTC (rev 1227)
@@ -725,6 +725,20 @@
 on_addressbar_activate(GtkEntry *entry, gpointer user_data)
 {
 	gchar *directory = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
+
+	static const GdkColor red   = {0, 0xffff, 0x6666, 0x6666};
+	static const GdkColor white = {0, 0xffff, 0xffff, 0xffff};
+	static gboolean old_value = TRUE;
+	gboolean success = g_file_test(directory, G_FILE_TEST_IS_DIR);
+
+	g_return_if_fail(GTK_WIDGET(entry) != NULL);
+	if (old_value != success)
+	{
+		gtk_widget_modify_base(GTK_WIDGET(entry), GTK_STATE_NORMAL, success ? NULL : &red);
+		gtk_widget_modify_text(GTK_WIDGET(entry), GTK_STATE_NORMAL, success ? NULL : &white);
+		old_value = success;
+	}
+
 	treebrowser_chroot(directory);
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Plugins-Commits mailing list