Subject: | notify user that the xpath is not correct |
Attached is a patch that changes text colour to red when the xpath is
not valid.
Currently if the "XPath:" query is typed the only indicator if it is
correct is that the "Evaluate" button is enabled/disabled.
Subject: | xpath-red.patch |
From a422e89e3d866f0df38bf1f44c81209d9c1c257b Mon Sep 17 00:00:00 2001
From: Jozef Kutej <jozef@kutej.net>
Date: Mon, 24 Nov 2008 14:06:10 +0100
Subject: [PATCH] set xpath text in red when not valid
---
bin/xacobeo | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/bin/xacobeo b/bin/xacobeo
index 2a8e8b4..efa5811 100755
--- a/bin/xacobeo
+++ b/bin/xacobeo
@@ -702,8 +702,16 @@ sub callback_xpath_entry_changed {
# Validate the XPath expression
if (! $self->document->validate($xpath) ) {
+ # disable button
$button->set_sensitive(FALSE);
+
+ # set red xpath text color
+ $widget->modify_text('normal', Gtk2::Gdk::Color->new(65535,0,0));
+
return;
+ } else {
+ # reset text color
+ $widget->modify_text('normal', undef);
}
$button->set_sensitive(TRUE);
--
1.5.6.5