Commit 0e3a9077 authored by Naba Kumar's avatar Naba Kumar

Make parsable lines distinct by adding a "Click me" description in the

	* plugins/tools/execute.c: Make parsable lines distinct by adding
	a "Click me" description in the message. Allow tools to open arbibrary
	file in editory using gdb-styled annotation (The line starts with two
	\032 characters followed by the file:line).

	* plugins/tools/scripts/prepare-changelog.pl,
	plugins/tools/scripts/tools-2.xml.in: Fixed to add changelog entry in
	ChangeLog file itself and open it.
parent 47175f14
2005-05-22 Naba Kumar <naba@gnome.org>
* plugins/tools/execute.c: Make parsable lines distinct by adding
a "Click me" description in the message. Allow tools to open arbibrary
file in editory using gdb-styled annotation (The line starts with two
\032 characters followed by the file:line).
* plugins/tools/scripts/prepare-changelog.pl,
plugins/tools/scripts/tools-2.xml.in: Fixed to add changelog entry in
ChangeLog file itself and open it.
2005-06-21 Sebastien Granjoux <seb.sfo@free.fr>
* plugins/tools/execute.c:
......
......@@ -293,15 +293,29 @@ on_message_buffer_click (IAnjutaMessageView *view, const gchar *line,
}
static void
on_message_buffer_flush (IAnjutaMessageView *view, const gchar *line,
on_message_buffer_flush (IAnjutaMessageView *view, const gchar *msg_line,
ATPOutputContext *this)
{
gchar *dummy_fn;
gint dummy_int;
gchar *line;
IAnjutaMessageViewType type;
/* If there is a gdb style annotation to open a file, open it */
if (strlen(msg_line) > 2 && msg_line[0] == '\032' && msg_line[1] == '\032')
{
line = g_strdup_printf (_("Opening %s"), &msg_line[2]);
on_message_buffer_click (view, &msg_line[2], this);
}
else
{
line = g_strdup (msg_line);
}
if (this->view)
{
gchar *desc = "";
type = IANJUTA_MESSAGE_VIEW_TYPE_NORMAL;
if (parse_error_line(line, &dummy_fn, &dummy_int))
{
......@@ -309,13 +323,15 @@ on_message_buffer_flush (IAnjutaMessageView *view, const gchar *line,
type = IANJUTA_MESSAGE_VIEW_TYPE_WARNING;
else if (strstr (line, _("error:")) != NULL)
type = IANJUTA_MESSAGE_VIEW_TYPE_ERROR;
desc = _("Click to visit the location");
}
else if (strstr (line, ":") != NULL)
{
type = IANJUTA_MESSAGE_VIEW_TYPE_INFO;
}
ianjuta_message_view_append (this->view, type, line, "", NULL);
ianjuta_message_view_append (this->view, type, line, desc, NULL);
}
g_free (line);
}
/* Handle output for stdout and stderr */
......
......@@ -37,13 +37,13 @@ unless (-d "$project_root/CVS") {
}
my %data_hash;
print STDERR "Preparing ChangeLog for $project_root\n";
print "Preparing ChangeLog for $project_root\n";
process_directory ("", \%data_hash);
my @files = keys (%data_hash);
if (@files <= 0) {
print STDERR "No changes made to project\n";
print "No changes made to project\n";
exit(0);
}
......@@ -64,16 +64,29 @@ foreach my $file (sort @files) {
}
$changelog .= ":\n\n";
print $changelog;
my $changelog_file = "$project_root/ChangeLog";
if ((-r $changelog_file) && (-w $changelog_file)) {
$changelog .= `cat $changelog_file`;
unless (open (CHLOG, ">$changelog_file")) {
print STDERR "Failed to open $changelog_file for reading/writing\n";
exit (1);
}
print CHLOG $changelog;
close (CHLOG);
print "\032\032$changelog_file:0\n";
} else {
print STDERR "Failed to open $changelog_file for reading/writing\n";
exit(1);
}
sub process_directory
{
my ($dir, $data_hr) = @_;
if ($dir ne "") {
print STDERR "Scanning $dir\n";
print "Scanning $dir\n";
} else {
print STDERR "Scanning .\n";
print "Scanning .\n";
}
open (ENTRIES, "$project_root/$dir/CVS/Entries") or
die "Can not open $project_root/$dir/CVS/Entries for reading";
......@@ -86,14 +99,16 @@ sub process_directory
if ($line =~ /^\/([^\/]+)\/([^\/]+)\/([^\/]+)/) {
my $file = $1;
my $repo_time = $3;
my $file_time = `date -u -r $project_root/$dir/$file`;
$file_time =~ s/\s+$//sg;
$file_time =~ s/\w+\s+(\d+)$/$1/;
## print "Comparing '$repo_time' and '$file_time'\n";
if ($file_time ne $repo_time) {
my $path = "$dir/$file";
$path =~ s/^\///;
$data_hr->{$path} = "modified";
if (-f "$project_root/$dir/$file") {
my $file_time = `date -u -r $project_root/$dir/$file`;
$file_time =~ s/\s+$//sg;
$file_time =~ s/\w+\s+(\d+)$/$1/;
## print "Comparing '$repo_time' and '$file_time'\n";
if ($file_time ne $repo_time) {
my $path = "$dir/$file";
$path =~ s/^\///;
$data_hr->{$path} = "modified";
}
}
}
}
......
......@@ -7,8 +7,8 @@
<enabled>1</enabled>
<autosave>0</autosave>
<run_in_terminal>0</run_in_terminal>
<output>3</output>
<error>1</error>
<output>1</output>
<error>0</error>
<input_type>0</input_type>
<shortcut></shortcut>
</tool>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment