monotone

monotone Commit Details

Date:2008-06-05 12:44:56 (11 years 2 months ago)
Author:Tony Cooper
Branch:net.venge.monotone.contrib.mtn-browse
Commit:43fe14a63ad8d76544bfa88fdc61316022207c1a
Parents: 83549b7e34eb5be77a5111f32d368f0c11074627
Message:- Got the busy window handling working properly at long last.

- New now auto loads the current view.
- Have an extra option for creating blank browser windows.
- Many bugs fixed.
Changes:
MAdvancedFind.pm (15 diffs)
MAnnotate.pm (6 diffs)
MChangeLog.pm (2 diffs)
MComboAutoCompletion.pm (1 diff)
MCompletion.pm (2 diffs)
MFindText.pm (1 diff)
MHistory.pm (22 diffs)
MPreferences.pm (3 diffs)
MUtilities.pm (12 diffs)
MWindowManager.pm (8 diffs)
Mmtn-browse (27 diffs)
Mmtn-browse.glade (1 diff)

File differences

AdvancedFind.pm
4444
4545
4646
47
47
4848
4949
5050
......
8989
9090
9191
92
9293
9394
9495
......
121122
122123
123124
125
124126
125127
126128
127129
128130
131
129132
130133
131134
......
641644
642645
643646
644
645
647
648
646649
647650
648651
......
708711
709712
710713
711
714
712715
713716
714717
......
739742
740743
741744
742
745
743746
744747
745748
......
747750
748751
749752
750
753
751754
752755
753756
......
755758
756759
757760
758
761
759762
760763
761764
762765
763766
764
767
765768
766769
767770
......
790793
791794
792795
793
796
794797
795798
796799
......
805808
806809
807810
808
811
809812
810813
811814
......
813816
814817
815818
816
819
817820
818821
819822
820823
821824
822
825
823826
824827
825828
......
839842
840843
841844
842
845
843846
844847
845848
......
871874
872875
873876
874
877
875878
876879
877880
......
896899
897900
898901
899
900
902
903
901904
902905
903906
......
941944
942945
943946
944
947
945948
946949
947950
948951
949952
950953
951
954
952955
953956
954957
use strict;
# ***** FUNCTIONAL PROTOTYPES FOR THIS FILE *****
# ***** FUNCTIONAL PROTOTYPES *****
# Public routines.
my($advanced_find,
$ret_val);
my $wm = WindowManager->instance();
$advanced_find = get_advanced_find_window($browser);
# Handle all events until the dialog is dismissed.
$wm->make_busy($advanced_find, 1, 1);
$advanced_find->{done} = 0;
while (! $advanced_find->{done})
{
Gtk2->main_iteration();
}
$wm->make_busy($advanced_find, 0);
$advanced_find->{window}->hide();
# Deal with the result.
# Register the window for management.
$wm->manage($instance, $window_type);
$wm->add_busy_widgets($instance,
$wm->manage($instance, $window_type, $instance->{window});
$wm->add_busy_windows($instance,
$instance->{details_textview}->
get_window("text"));
$wm->make_busy($advanced_find, 1);
}
$advanced_find->{appbar}->push("");
gtk2_update();
$wm->update_gui();
# The list of available branches has changed.
# Get the new list of branches.
$advanced_find->{appbar}->set_status(__("Fetching branch list"));
gtk2_update();
$wm->update_gui();
$advanced_find->{mtn}->branches(\@branch_list)
if (defined($advanced_find->{mtn}));
$advanced_find->{branch_combo_details}->{list} = \@branch_list;
# Update the branch list combobox.
$advanced_find->{appbar}->set_status(__("Populating branch list"));
gtk2_update();
$wm->update_gui();
my $counter = 1;
$advanced_find->{branch_comboboxentry}->get_model()->clear();
foreach my $branch (@branch_list)
$advanced_find->{branch_comboboxentry}->append_text($branch);
$advanced_find->{appbar}->set_progress_percentage
($counter ++ / scalar(@branch_list));
gtk2_update();
$wm->update_gui();
}
$advanced_find->{branch_comboboxentry}->child()->
set_text($advanced_find->{branch_combo_details}->{value});
$advanced_find->{appbar}->set_progress_percentage(0);
$advanced_find->{appbar}->set_status("");
gtk2_update();
$wm->update_gui();
}
if ($advanced_find->{branch_combo_details}->{complete})
{
$advanced_find->{appbar}->set_status(__("Fetching revision list"));
gtk2_update();
$wm->update_gui();
get_branch_revisions($advanced_find->{mtn},
$advanced_find->{branch_combo_details}->
{value},
$advanced_find->{appbar}->set_progress_percentage(0);
$advanced_find->{appbar}->set_status(__("Populating revision list"));
gtk2_update();
$wm->update_gui();
my $counter = 1;
$advanced_find->{revision_comboboxentry}->get_model()->clear();
foreach my $revision (@revision_list)
$advanced_find->{revision_comboboxentry}->append_text($revision);
$advanced_find->{appbar}->set_progress_percentage
($counter ++ / scalar(@revision_list));
gtk2_update();
$wm->update_gui();
}
$advanced_find->{revision_comboboxentry}->child()->
set_text($advanced_find->{revision_combo_details}->{value});
$advanced_find->{appbar}->set_progress_percentage(0);
$advanced_find->{appbar}->set_status("");
gtk2_update();
$wm->update_gui();
}
# Get the list of matching revisions.
$advanced_find->{appbar}->set_status(__("Finding revisions"));
gtk2_update();
$wm->update_gui();
if ($advanced_find->{simple_query_radiobutton}->get_active())
{
if ($advanced_find->{revision_combo_details}->{complete})
. __x("gave:\n<b><i>{error_message}</i></b>",
error_message =>
Glib::Markup::escape_text($message)));
$dialog->run();
$wm->allow_input(sub { $dialog->run(); });
$dialog->destroy();
die("Bad query"); });
eval
"info",
"close",
__("No revisions matched your query."));
$dialog->run();
$dialog->destroy();
$wm->allow_input(sub { $dialog->run(); });
$dialog->destroy();
}
$found = 0;
foreach my $entry (@{$advanced_find->{query_history}})
0, $item);
$advanced_find->{appbar}->set_progress_percentage
($counter ++ / scalar(@revision_ids));
gtk2_update();
$wm->update_gui();
}
$advanced_find->{revisions_treeview}->scroll_to_point(0, 0)
if ($advanced_find->{revisions_treeview}->realized());
$advanced_find->{appbar}->set_progress_percentage(0);
$advanced_find->{appbar}->set_status("");
gtk2_update();
$wm->update_gui();
}
Annotate.pm
4444
4545
4646
47
47
4848
4949
5050
......
9999
100100
101101
102
102
103103
104104
105105
106106
107
107
108108
109109
110110
......
124124
125125
126126
127
127
128128
129129
130130
......
164164
165165
166166
167
167
168168
169169
170170
......
184184
185185
186186
187
187
188188
189189
190190
......
261261
262262
263263
264
264
265265
266266
267267
use strict;
# ***** FUNCTIONAL PROTOTYPES FOR THIS FILE *****
# ***** FUNCTIONAL PROTOTYPES *****
# Public routines.
$wm->make_busy($instance, 1);
$instance->{appbar}->push("");
gtk2_update();
$wm->update_gui();
# Get Monotone to do the annotation.
$instance->{appbar}->set_status(__("Annotating file"));
gtk2_update();
$wm->update_gui();
mtn_annotate(\@lines, $mtn->get_db_name(), $revision_id, $file_name);
# Find the longest line for future padding and also split each line into
$instance->{appbar}->set_status
(__("Formatting and displaying annotated file"));
gtk2_update();
$wm->update_gui();
$padding = " " x $max_len;
$prefix_tag = $text_tag = "";
for ($i = 0; $i <= $#lines; ++ $i)
{
$instance->{appbar}->set_progress_percentage
(($i + 1) / scalar(@lines));
gtk2_update();
$wm->update_gui();
}
}
$instance->{annotation_scrolledwindow}->get_hadjustment()->set_value(0);
$instance->{appbar}->set_progress_percentage(0);
$instance->{appbar}->set_status("");
gtk2_update();
$wm->update_gui();
$instance->{appbar}->pop();
$wm->make_busy($instance, 0);
# Register the window for management.
$wm->manage($instance, $window_type, $instance->{window});
$wm->add_busy_widgets($instance,
$wm->add_busy_windows($instance,
$instance->{annotation_textview}->
get_window("text"));
}
ChangeLog.pm
4444
4545
4646
47
47
4848
4949
5050
......
177177
178178
179179
180
180
181181
182182
183183
use strict;
# ***** FUNCTIONAL PROTOTYPES FOR THIS FILE *****
# ***** FUNCTIONAL PROTOTYPES *****
# Public routines.
# Register the window for management.
$wm->manage($instance, $window_type, $instance->{window});
$wm->add_busy_widgets($instance,
$wm->add_busy_windows($instance,
$instance->{changelog_textview}->
get_window("text"));
}
ComboAutoCompletion.pm
4545
4646
4747
48
48
4949
5050
5151
use strict;
# ***** FUNCTIONAL PROTOTYPES FOR THIS FILE *****
# ***** FUNCTIONAL PROTOTYPES *****
# Public routines.
Completion.pm
6060
6161
6262
63
63
6464
6565
6666
6767
68
68
6969
7070
7171
......
8383
8484
8585
86
86
8787
8888
89
90
89
90
9191
9292
9393
9494
9595
9696
97
98
97
9998
10099
101100
our @EXPORT_OK = qw();
our $VERSION = 0.1;
# ***** FUNCTIONAL PROTOTYPES FOR THIS FILE *****
# ***** FUNCTIONAL PROTOTYPES *****
# Public methods.
sub get_completion($$$$);
sub new($@);
sub new($;$);
#
##############################################################################
#
sub new($@)
sub new($;$)
{
my($class, $list) = @_;
$class = ref($class) if ref($class);
my $class = (ref($_[0]) ne "") ? ref($_[0]) : $_[0];
my $list = $_[1];
my($char,
$item,
$level,
$this);
$this = {};
$this->{tree} = {};
$this = {tree => {}};
# Build up a hash tree for the list of possible items.
FindText.pm
5050
5151
5252
53
53
5454
5555
5656
my $window_type = "find_text_window";
# ***** FUNCTIONAL PROTOTYPES FOR THIS FILE *****
# ***** FUNCTIONAL PROTOTYPES *****
# Public routines.
History.pm
5151
5252
5353
54
54
5555
5656
5757
......
113113
114114
115115
116
116
117117
118118
119119
......
122122
123123
124124
125
125
126126
127127
128128
129129
130130
131131
132
132
133133
134134
135135
......
139139
140140
141141
142
142
143143
144144
145145
......
246246
247247
248248
249
249
250250
251251
252252
......
264264
265265
266266
267
267
268268
269269
270270
......
315315
316316
317317
318
318
319319
320320
321321
......
324324
325325
326326
327
327
328328
329329
330330
......
334334
335335
336336
337
337
338338
339339
340340
......
344344
345345
346346
347
347
348348
349349
350350
......
444444
445445
446446
447
447
448448
449449
450450
......
456456
457457
458458
459
459
460460
461461
462462
......
704704
705705
706706
707
707
708708
709709
710710
......
713713
714714
715715
716
716
717717
718718
719719
......
737737
738738
739739
740
740
741741
742742
743743
......
866866
867867
868868
869
869
870870
871871
872872
......
882882
883883
884884
885
885
886886
887887
888888
......
893893
894894
895895
896
896
897897
898898
899899
900
900
901901
902902
903903
......
10731073
10741074
10751075
1076
1077
1076
1077
1078
1079
1080
10781081
10791082
10801083
......
11421145
11431146
11441147
1145
1148
11461149
11471150
11481151
......
11881191
11891192
11901193
1191
1194
11921195
11931196
11941197
......
13031306
13041307
13051308
1306
1307
1309
1310
1311
1312
1313
13081314
13091315
13101316
use constant CLS_NAME_COLUMN => 0;
use constant CLS_LINE_NR_COLUMN => 1;
# ***** FUNCTIONAL PROTOTYPES FOR THIS FILE *****
# ***** FUNCTIONAL PROTOTYPES *****
# Public routines.
$wm->make_busy($instance, 1);
$instance->{appbar}->push("");
gtk2_update();
$wm->update_gui();
$instance->{stop_button}->set_sensitive(TRUE);
$instance->{appbar}->set_progress_percentage(0);
$instance->{appbar}->set_status(__("Fetching revision list"));
gtk2_update();
$wm->update_gui();
$history_hash{$revision_id} = 1;
get_revision_history_helper($instance, \%history_hash, $revision_id);
# Sort the list.
$instance->{appbar}->set_status(__("Sorting revision list"));
gtk2_update();
$wm->update_gui();
$instance->{history} = [];
$instance->{mtn}->toposort($instance->{history}, keys(%history_hash));
%history_hash = ();
$instance->{appbar}->set_progress_percentage(0);
$instance->{appbar}->set_status(__("Displaying revision history"));
gtk2_update();
$wm->update_gui();
$counter = 1;
$instance->{stop} = 0;
$instance->{history_buffer}->set_text("");
{
$instance->{appbar}->set_progress_percentage
($counter / scalar(@{$instance->{history}}));
gtk2_update();
$wm->update_gui();
}
++ $counter;
$instance->{history_scrolledwindow}->get_hadjustment()->set_value(0);
$instance->{appbar}->set_progress_percentage(0);
$instance->{appbar}->set_status("");
gtk2_update();
$wm->update_gui();
$instance->{appbar}->pop();
$wm->make_busy($instance, 0);
$wm->make_busy($instance, 1);
$instance->{appbar}->push("");
gtk2_update();
$wm->update_gui();
# Get the list of file change revisions. Remember that a warning is
# generated when one goes back beyond a file's addition revision, so
$instance->{appbar}->set_progress_percentage(0);
$instance->{appbar}->set_status(__("Fetching revision list"));
$instance->{stop_button}->set_sensitive(TRUE);
gtk2_update();
$wm->update_gui();
Monotone::AutomateStdio->register_error_handler("warning");
get_file_history_helper($instance, \%history_hash, $revision_id);
Monotone::AutomateStdio->register_error_handler("both",
# Sort the list.
$instance->{appbar}->set_status(__("Sorting revision list"));
gtk2_update();
$wm->update_gui();
$instance->{history} = [];
$instance->{mtn}->toposort($instance->{history}, keys(%history_hash));
%history_hash = ();
$instance->{appbar}->set_progress_percentage(0);
$instance->{appbar}->set_status(__("Displaying file history"));
gtk2_update();
$wm->update_gui();
$counter = 1;
$instance->{history_buffer}->set_text("");
for my $revision_id (@{$instance->{history}})
$instance->{appbar}->set_progress_percentage
($counter ++ / scalar(@{$instance->{history}}));
gtk2_update();
$wm->update_gui();
}
$instance->{history_scrolledwindow}->get_hadjustment()->set_value(0);
$instance->{appbar}->set_progress_percentage(0);
$instance->{appbar}->set_status("");
gtk2_update();
$wm->update_gui();
$instance->{appbar}->pop();
$wm->make_busy($instance, 0);
$wm->make_busy($instance, 1);
$instance->{appbar}->push("");
gtk2_update();
$wm->update_gui();
$instance->{mtn} = $mtn;
$instance->{revision_id_1} = $revision_id_1;
# Get Monotone to do the comparison.
$instance->{appbar}->set_status(__("Calculating differences"));
gtk2_update();
$wm->update_gui();
mtn_diff(\@lines,
$mtn->get_db_name(),
$revision_id_1,
$instance->{appbar}->
set_status(__("Formatting and displaying differences"));
gtk2_update();
$wm->update_gui();
$padding = " " x $max_len;
$line = substr(" Summary" . $padding, 0, $max_len);
$instance->{comparison_buffer}->insert_with_tags_by_name
{
$instance->{appbar}->set_progress_percentage
(($i + 1) / scalar(@lines));
gtk2_update();
$wm->update_gui();
}
}
$instance->{appbar}->set_progress_percentage(0);
$instance->{appbar}->set_status(__("Populating file list"));
gtk2_update();
$wm->update_gui();
@files = sort({ $a->{file_name} cmp $b->{file_name} } @files);
$i = 1;
$instance->{file_comparison_combobox}->get_model()->clear();
CLS_NAME_COLUMN, $file->{file_name},
CLS_LINE_NR_COLUMN, $file->{line_nr});
$instance->{appbar}->set_progress_percentage($i ++ / scalar(@files));
gtk2_update();
$wm->update_gui();
}
$instance->{appbar}->set_progress_percentage(0);
$instance->{appbar}->set_status("");
gtk2_update();
$wm->update_gui();
# Make sure we are at the top.
# Register the window for management.
$wm->manage($instance, $window_type, $instance->{stop_button});
$wm->add_busy_widgets($instance,
$wm->manage($instance,
$window_type,
$instance->{window},
$instance->{stop_button});
$wm->add_busy_windows($instance,
$instance->{history_textview}->
get_window("text"));
}
$hash->{$revision} = 1;
set_label_value($instance->{numbers_value_label},
scalar(keys(%$hash)));
gtk2_update();
WindowManager->update_gui();
@parents = ();
$instance->{mtn}->parents(\@parents, $revision);
foreach my $parent (@parents)
$hash->{$parent} = 1;
set_label_value($instance->{numbers_value_label},
scalar(keys(%$hash)));
gtk2_update();
WindowManager->update_gui();
get_revision_history_helper($instance, $hash, $parent);
}
}
# Register the window for management.
$wm->manage($instance, $window_type, $instance->{stop_button});
$wm->add_busy_widgets($instance,
$wm->manage($instance,
$window_type,
$instance->{window},
$instance->{stop_button});
$wm->add_busy_windows($instance,
$instance->{comparison_textview}->
get_window("text"));
}
Preferences.pm
114114
115115
116116
117
117
118118
119119
120120
......
163163
164164
165165
166
166167
167168
168169
......
190191
191192
192193
194
193195
194196
195197
196198
197199
200
198201
199202
200203
{widget => "revision_2_highlight_colorbutton",
record => "cmp_revision_2"});
# ***** FUNCTIONAL PROTOTYPES FOR THIS FILE *****
# ***** FUNCTIONAL PROTOTYPES *****
# Public routines.
my($instance,
$preferences);
my $wm = WindowManager->instance();
# Load in the user's preferences.
# Handle all events until the dialog is dismissed.
$wm->make_busy($instance, 1, 1);
$instance->{done} = 0;
while (! $instance->{done})
{
Gtk2->main_iteration();
}
$wm->make_busy($instance, 0);
$instance->{window}->hide();
# Deal with the result.
Utilities.pm
4444
4545
4646
47
47
4848
4949
5050
......
5757
5858
5959
60
6160
6261
6362
......
235234
236235
237236
238
239
237
240238
241239
242240
......
366364
367365
368366
369
367
370368
371369
372370
......
421419
422420
423421
424
422
425423
426424
427425
......
441439
442440
443441
444
442
445443
446444
447445
......
455453
456454
457455
458
456
459457
460458
461459
......
677675
678676
679677
680
681
682
678
679
680
681
683682
684683
685684
686
685
687686
688
687
689688
690
689
690
691
691692
692
693
694
695
696
697693
698
694
699695
700696
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
721735
736
737
722738
723
739
724740
725
726
727
728
729
741
730742
731
743
732744
733
745
734746
735
747
748
749
736750
737751
738752
......
757771
758772
759773
760
774
761775
762776
763
777
764778
765779
766780
767781
768782
769
783
770784
771785
772786
......
777791
778792
779793
780
794
781795
782796
783797
......
798812
799813
800814
801
815
802816
803817
804818
......
10901104
10911105
10921106
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
11051107
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
11191108
use strict;
# ***** FUNCTIONAL PROTOTYPES FOR THIS FILE *****
# ***** FUNCTIONAL PROTOTYPES *****
# Public routines.
sub get_dir_contents($$$);
sub get_revision_ids($$);
sub glade_signal_autoconnect($$);
sub gtk2_update();
sub hex_dump($);
sub open_database($$$);
sub run_command($@);
" " . $type . ":\n",
$italics);
%seen = ();
@unique = sort(grep { ! $seen{$_} ++ }
@{$revision_data{$type}});
@unique = sort(grep(! $seen{$_} ++, @{$revision_data{$type}}));
foreach my $line (@unique)
{
$text_buffer->insert_with_tags_by_name
name => Glib::Markup::escape_text($args[0]))
. __x("the system gave:\n<b><i>{error_message}</b></i>",
error_message => Glib::Markup::escape_text($@)));
$dialog->run();
WindowManager->instance()->allow_input(sub { $dialog->run(); });
$dialog->destroy();
return;
}
"close",
__x("waitpid failed with:\n<b><i>{error_message}</i></b>",
error_message => Glib::Markup::escape_text($!)));
$dialog->run();
WindowManager->instance()->allow_input(sub { $dialog->run(); });
$dialog->destroy();
return;
}
. __x("<b><i>{error_message}</i></b>",
error_message =>
Glib::Markup::escape_text(join("", @err))));
$dialog->run();
WindowManager->instance()->allow_input(sub { $dialog->run(); });
$dialog->destroy();
return;
}
__x("The {name} subprocess was terminated by signal {number}.",
name => Glib::Markup::escape_text($args[0]),
number => WTERMSIG($status)));
$dialog->run();
WindowManager->instance()->allow_input(sub { $dialog->run(); });
$dialog->destroy();
return;
}
if ($tags)
{
my(@certs,
@list,
%seen);
my(%rev_id_to_tags,
%seen,
@sorted_rev_ids,
@tags);
# Get the list of revision tags.
$mtn->tags(\@list, $branch);
$mtn->tags(\@tags, $branch);
$appbar->set_progress_percentage(0.5) if (defined($appbar));
gtk2_update();
WindowManager->update_gui();
# Dedupe it.
# Does the list need truncating (in which case we need to sort by date
# to keep the most recent tags) or does the user want to sort tags by
# date?
@list = grep({ ! $seen{$_->{tag}} ++ } @list);
# Sort it by date if necessary (because it needs to be truncated or
# that's how the user wants it sorted).
if (($user_preferences->{query}->{tagged}->{limit} > 0
&& scalar(@list) > $user_preferences->{query}->{tagged}->{limit})
&& scalar(@tags) > $user_preferences->{query}->{tagged}->{limit})
|| $user_preferences->{query}->{tagged}->{sort_cronologically})
{
@list = sort({
foreach my $rec ($a, $b)
{
if (! exists($rec->{date}))
{
$mtn->certs(\@certs,
$rec->{revision_id});
foreach my $cert (@certs)
{
if ($cert->{name} eq "date")
{
$rec->{date} = $cert->{value};
last;
}
}
}
}
$b->{date} cmp $a->{date};
}
@list);
# Yes tags are to be either sorted by date or need to be truncated
# (requiring them to temporarily be sorted by date).
# Build up a hash mapping revision id to tag(s).
foreach my $tag (@tags)
{
if (exists($rev_id_to_tags{$tag->{revision_id}}))
{
push(@{$rev_id_to_tags{$tag->{revision_id}}}, $tag->{tag});
}
else
{
$rev_id_to_tags{$tag->{revision_id}} = [$tag->{tag}];
}
}
# Sort the revision ids into date order (youngest first).
$mtn->toposort(\@sorted_rev_ids, keys(%rev_id_to_tags));
@sorted_rev_ids = reverse(@sorted_rev_ids);
# Now build up a list of tags based on this ordering, deduping
# items and stopping when we have enough tags.
revision: foreach my $rev_id (@sorted_rev_ids)
{
foreach my $tag (sort(@{$rev_id_to_tags{$rev_id}}))
{
push(@$revisions, $tag) if (! $seen{$tag} ++);
last revision
if ($user_preferences->{query}->{tagged}->{limit} > 0
&& scalar(@$revisions) >=
$user_preferences->{query}->{tagged}->{limit});
}
}
}
else
{
# Truncate the list if necessary.
# No tags are to be sorted by name, without truncation.
if ($user_preferences->{query}->{tagged}->{limit} > 0
&& scalar(@list) > $user_preferences->{query}->{tagged}->{limit})
{
splice(@list, $user_preferences->{query}->{tagged}->{limit});
}
# At this stage simply extract the tags and dedupe them.
# Extract the list of tags.
@$revisions = map($_->{tag}, grep(! $seen{$_->{tag}} ++, @tags));
@$revisions = map({ $_->{tag} } @list);
}
# Sort alphabetically if required.
# We now have a list of tags in @$revisions of the correct size and
# sorted by date if so required by the user. So resort the list
# aplhabetically if required.
@$revisions = sort(@$revisions)
if (! $user_preferences->{query}->{tagged}->{sort_cronologically});
if ($user_preferences->{query}->{id}->{sort_cronologically})
{
$appbar->set_progress_percentage(0.33) if (defined($appbar));
gtk2_update();
WindowManager->update_gui();
$mtn->toposort($revisions, @$revisions);
$appbar->set_progress_percentage(0.66) if (defined($appbar));
gtk2_update();
WindowManager->update_gui();
@$revisions = reverse(@$revisions);
}
else
{
$appbar->set_progress_percentage(0.5) if (defined($appbar));
gtk2_update();
WindowManager->update_gui();
@$revisions = sort(@$revisions);
}
# Yes so truncate and then sort it.
$appbar->set_progress_percentage(0.33) if (defined($appbar));
gtk2_update();
WindowManager->update_gui();
$mtn->toposort($revisions, @$revisions);
$appbar->set_progress_percentage(0.66) if (defined($appbar));
splice(@$revisions,
}
$appbar->set_progress_percentage(1) if (defined($appbar));
gtk2_update();
WindowManager->update_gui();
}
#
$client_data);
}
#
##############################################################################
#
# Routine - gtk2_update
#
# Description - Process all outstanding Gtk2 toolkit events. This is used
# to update the GUI whilst the application is busy doing
# something.
#
# Data - None.
#
##############################################################################
sub gtk2_update()
{
return if (Gtk2->main_level() == 0);
while (Gtk2->events_pending())
{
Gtk2->main_iteration();
}
}
1;
WindowManager.pm
5959
6060
6161
62
63
64
65
66
67
68
6269
6370
6471
......
7380
7481
7582
76
83
7784
7885
7986
80
87
88
8189
82
90
8391
8492
85
86
93
94
95
96
8797
8898
8999
......
103113
104114
105115
106
116
107117
108118
109119
110
111
112
113
120
121
122
123
114124
115125
116126
......
148158
149159
150160
151
152
153
154161
155162
156163
......
167174
168175
169176
170
171
172
173
174
177
178
179
180
181
182
175183
176184
177185
178186
179187
180
188
181189
182190
183
191
184192
185
193
186194
187
188
189
190
191
192
193
194
195
196
195
196
197
198
199
200
197201
198
199
200
201
202
203
204
205
206
207
208
209202
210203
211204
212205
213
206
214207
215
208
216209
217210
218211
219212
220213
221
222
214
215
223216
224217
225218
226219
227220
228
221
229222
230223
231
224
232225
233
226
234227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
235243
236244
237245
......
258266
259267
260268
261
269
262270
263271
264272
......
290298
291299
292300
293
301
294302
295303
296304
297305
298306
299307
300
301
308
309
310
302311
303312
304313
......
318327
319328
320329
330
331
332
333
321334
322335
323336
324337
325338
326
339
327340
328341
329
342
330343
331
332
344
345
346
347
333348
334
349
335350
336
337
351
338352
339
340
341
353
354
355
356
357
358
359
360
361
362
342363
364
365
366
367
368
343369
344370
345
371
372
373
374
346375
347376
348
377
349378
350
379
380
381
382
383
384
385
386
351387
352388
353
389
390
391
392
354393
355394
356395
357
358
396
397
359398
360
361
399
400
401
402
403
404
405
362406
363
407
364408
365
409
410
366411
412
413
414
415
416
417
418
419
420
421
422
423
367424
368425
369426
370427
428
429
430
431
371432
372433
373
374
434
435
436
437
375438
376439
377440
378441
379442
443
444
445
446
447
448
449
450
451
452
453
454
455
380456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
381603
# ***** GLOBAL DATA DECLARATIONS *****
# A list of event types that are to be filtered out when updating a busy GUI.
my @filtered_events = ("button-press",
"button-release",
"key-press",
"key-release");
# The singleton object.
my $singleton;
our @EXPORT_OK = qw();
our $VERSION = 0.1;
# ***** FUNCTIONAL PROTOTYPES FOR THIS FILE *****
# ***** FUNCTIONAL PROTOTYPES *****
# Public methods.
sub add_busy_widgets($$@);
sub add_busy_windows($$@);
sub allow_input($&);
sub cleanup($);
sub cond_find($$$);
sub cond_find($$&);
sub find_unused($$);
sub instance($);
sub make_busy($$$);
sub manage($$$;$);
sub make_busy($$$;$);
sub manage($$$$;$);
sub reset_state($);
sub update_gui();
#
##############################################################################
#
sub instance($)
{
my $class = ref($_[0]) ? ref($_[0]) : $_[0];
my $class = (ref($_[0]) ne "") ? ref($_[0]) : $_[0];
if (! defined($singleton))
{
$singleton = {};
$singleton->{windows} = [];
$singleton->{busy_cursor} = undef;
$singleton->{grab_widget_stack} = [];
$singleton = {windows => [],
busy_cursor => Gtk2::Gdk::Cursor->new("watch"),
state_stack => [],
allow_input => 0};
return bless($singleton, $class);
}
# Free up everything used by this object and associated window instance
# records.
$this->{windows} = [];
$this->{busy_cursor} = undef;
$this->{grab_widget_stack} = [];
$singleton = undef;
}
# $instance : A reference to the window instance record
# that is to be managed.
# $type : The type of window that is to be managed.
# $grab_widget : The widget that should be used with an input
# grab when making the window busy. This is
# optional but if not present then the
# instance record is expected to contain an
# `appbar' widget field.
# $window : The Gtk2::Window object for the window that
# is to be managed.
# $grab_widget : The widget that is to still remain
# responsive when making the window busy, most
# typically this will be a `stop' button. This
# is optional.
#
##############################################################################
sub manage($$$;$)
sub manage($$$$;$)
{
my($this, $instance, $type, $grab_widget) = @_;
my($this, $instance, $type, $window, $grab_widget) = @_;
# Check for instance record compliance.
# Simply store the details in our window list.
croak(__("No window field found")) unless (exists($instance->{window}));
croak(__("No appbar field found"))
unless (exists($instance->{appbar}) || defined($grab_widget));
foreach my $field ("busy_widgets", "grab_widget", "type")
{
croak(__x("{field} field found - I manage this", field => $field))
if (exists($instance->{$field}));
}
croak(__("Cannot manage unrealised windows"))
unless(defined($instance->{window}->window()));
push(@{$this->{windows}},
{instance => $instance,
type => $type,
window => $window,
busy_windows => [$window->window()],
grab_widget => $grab_widget});
# Ok so store what we need in the instance record.
$instance->{type} = $type;
$instance->{busy_widgets} = [$instance->{window}->window()];
$instance->{grab_widget} =
defined($grab_widget) ? $grab_widget : $instance->{appbar};
# Store the instance record in our window list.
push(@{$this->{windows}}, $instance);
}
#
##############################################################################
#
# Routine - add_busy_widgets
# Routine - add_busy_windows
#
# Description - Add the specified additional widgets for busy cursor
# Description - Add the specified additional windows for busy cursor
# handling.
#
# Data - $this : The object.
# $instance : A reference to the window instance record that
# is to be updated.
# @widgets : The list of additional widgets that are to be
# handled.
# @windows : The list of additional Gtk2::Gdk::Window
# objects that are to be handled.
#
##############################################################################
sub add_busy_widgets($$@)
sub add_busy_windows($$@)
{
my($this, $instance, @widgets) = @_;
my($this, $instance, @windows) = @_;
push(@{$instance->{busy_widgets}}, @widgets);
my $entry;
# Find the relevant entry for this instance.
foreach my $win_instance (@{$this->{windows}})
{
if ($win_instance->{instance} == $instance)
{
$entry = $win_instance;
last;
}
}
croak(__("Called with an unmanaged instance record"))
unless (defined($entry));
push(@{$entry->{busy_windows}}, @windows);
}
#
##############################################################################
foreach my $window (@{$this->{windows}})
{
return $window
return $window->{instance}
if ($window->{type} eq $type && ! $window->{window}->mapped());
}
sub cond_find($$$)
sub cond_find($$&)
{
my($this, $type, $predicate) = @_;
foreach my $window (@{$this->{windows}})
{
return $window if ((! defined ($type) || $window->{type} eq $type)
&& &$predicate($window));
return $window->{instance}
if ((! defined($type) || $window->{type} eq $type)
&& &$predicate($window->{instance}));
}
return;
# $busy : True if the window is to be made busy,
# otherwise false if the window is to be made
# active.
# $exclude : True if the window referenced by $instance is
# to be excluded from the list of windows that
# are to be made busy (this is used by modal
# dialogs).
#
##############################################################################
sub make_busy($$$)
sub make_busy($$$;$)
{
my($this, $instance, $busy) = @_;
my($this, $instance, $busy, $exclude) = @_;
croak(__("Called with an unmanaged instance record"))
unless (exists($instance->{grab_widget}));
my($entry,
$found,
$head,
@list);
# Create and store the cursors if we haven't done so already.
$exclude = defined($exclude) ? $exclude : 0;
$this->{busy_cursor} = Gtk2::Gdk::Cursor->new("watch")
unless (defined($this->{busy_cursor}));
# Find the relevant entry for this instance.
# Do it. Make the grab widget, usually the window's application bar, grab
# the input when the window is busy, that way we gobble up keyboard and
# mouse events that could muck up the application state.
foreach my $win_instance (@{$this->{windows}})
{
if ($win_instance->{instance} == $instance)
{
$entry = $win_instance;
last;
}
}
croak(__("Called with an unmanaged instance record"))
unless (defined($entry));
# When making things busy filter out keyboard and mouse button events
# unless they relate to the grab widget (usually a `stop' button) and make
# the mouse cursor busy. Making things unbusy is simply the reverse. Also
# cope with nested calls.
if ($busy)
{
Gtk2->grab_add($instance->{grab_widget});
Gtk2::Gdk::Event->handler_set(\&main::window_manager_event_filter,
{singleton => $this,
grab_widget => $entry->{grab_widget}})
if (! $exclude);
foreach my $win_instance (@{$this->{windows}})
{
foreach my $window (@{$win_instance->{busy_widgets}})
if (! $exclude || $win_instance->{instance} != $instance)
{
$window->set_cursor($this->{busy_cursor});
foreach my $window (@{$win_instance->{busy_windows}})
{
if ($window->is_visible())
{
$window->set_cursor($this->{busy_cursor});
push(@list, $window);
}
}
}
}
push(@{$this->{grab_widget_stack}}, $instance->{grab_widget});
push(@{$this->{state_stack}},
{exclude => $exclude,
grab_widget => $instance->{grab_widget},
window_list => \@list});
}
else
{
my $grab_widget;
if (defined($grab_widget = pop(@{$this->{grab_widget_stack}})))
pop(@{$this->{state_stack}});
if (scalar(@{$this->{state_stack}}) == 0)
{
Gtk2->grab_remove($grab_widget);
if ($#{$this->{grab_widget_stack}} < 0)
reset_state($this);
}
else
{
$head =
$this->{state_stack}->[$#{$this->{state_stack}}];
foreach my $win_instance (@{$this->{windows}})
{
foreach my $win_instance (@{$this->{windows}})
foreach my $window (@{$win_instance->{busy_windows}})
{
foreach my $window (@{$win_instance->{busy_widgets}})
$found = 0;
foreach my $busy_window (@{$head->{window_list}})
{
if ($window == $busy_window)
{
$found = 1;
last;
}
}
if ($found)
{
$window->set_cursor($this->{busy_cursor});
}
else
{
$window->set_cursor(undef);
}
}
}
if ($head->{exclude})
{
Gtk2::Gdk::Event->handler_set(undef);
}
else
{
Gtk2->grab_add($this->{grab_widget_stack}->
[$#{$this->{grab_widget_stack}}]);
Gtk2::Gdk::Event->handler_set
(\&main::window_manager_event_filter,
{singleton => $this,
grab_widget => $entry->{grab_widget}});
}
}
}
}
#
##############################################################################
#
# Routine - allow_input
#
# Description - Execute the specified code block whilst allowing mouse and
# keyboard input. Used for displaying dialog windows when the
# application is busy.
#
# Data - $this : The object.
# $code : The code block to be executed.
#
##############################################################################
sub allow_input($&)
{
my($this, $code) = @_;
my $head = $this->{state_stack}->[$#{$this->{state_stack}}];
local $this->{allow_input} = 1;
&$code();
}
#
##############################################################################
#
# Routine - reset_state
#
# Description - Completely resets the state of all windows and input
# handling. Useful when resetting the GUI after an exception
# was raised.
#
# Data - $this : The object.
#
##############################################################################
sub reset_state($)
{
my $this = $_[0];
$this->{state_stack} = [];
$this->{allow_input} = 0;
foreach my $win_instance (@{$this->{windows}})
{
foreach my $window (@{$win_instance->{busy_windows}})
{
$window->set_cursor(undef);
}
}
Gtk2::Gdk::Event->handler_set(undef);
}
#
##############################################################################
#
# Routine - update_gui
#
# Description - Process all outstanding Gtk2 toolkit events. This is used
# to update the GUI whilst the application is busy doing
# something.
#
# Data - None.
#
##############################################################################
sub update_gui()
{
return if (Gtk2->main_level() == 0);
while (Gtk2->events_pending())
{
Gtk2->main_iteration();
}
}
#
##############################################################################
#
# Package - main
#
# Description - The event filter routine has to be in the main package as
# this is assumed when constructing calling Perl callbacks.
#
##############################################################################
# ***** PACKAGE DECLARATION *****
package main;
# ***** DIRECTIVES *****
require 5.008;
use strict;
use integer;
# ***** REQUIRED PACKAGES *****
# Standard Perl and CPAN modules.
use Gtk2;
# ***** FUNCTIONAL PROTOTYPES *****
# Public methods.
sub window_manager_event_filter($$);
#
##############################################################################
#
# Routine - window_manager_event_filter
#
# Description - Filter for getting rid of unwanted keyboard and mouse
# button events when the application is busy.
#
# Data - $event : The Gtk2::Gdk::Event object representing the
# current event.
# $client_data : The client data that was registered along
# with this event handler.
#
##############################################################################
sub window_manager_event_filter($$)
{
my($event, $client_data) = @_;
my $grab_widget = $client_data->{grab_widget};
my $this = $client_data->{singleton};
my $type = $event->type();
if (! $this->{allow_input})
{
foreach my $filter_type (@filtered_events)
{
return
if ($type eq $filter_type
&& (! defined($grab_widget)
|| Gtk2->get_event_widget($event) != $grab_widget));
}
}
Gtk2->main_do_event($event);
}
1;
mtn-browse
4949
5050
5151
52
5352
5453
5554
......
6867
6968
7069
71
70
7271
7372
7473
......
111110
112111
113112
114
113
115114
116115
117116
......
129128
130129
131130
131
132132
133133
134134
......
200200
201201
202202
203
203
204204
205205
206206
......
396396
397397
398398
399
399
400400
401401
402402
......
429429
430430
431431
432
433
432434
433435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
434468
435469
436470
......
15871621
15881622
15891623
1590
1591
1624
1625
15921626
15931627
15941628
......
16921726
16931727
16941728
1695
1729
16961730
16971731
16981732
......
17671801
17681802
17691803
1770
1804
17711805
17721806
17731807
17741808
17751809
17761810
1777
1811
17781812
17791813
17801814
......
17821816
17831817
17841818
1785
1819
17861820
17871821
17881822
17891823
17901824
1791
1825
17921826
17931827
17941828
......
18181852
18191853
18201854
1821
1855
18221856
18231857
18241858
......
18311865
18321866
18331867
1834
1868
18351869
18361870
18371871
......
18391873
18401874
18411875
1842
1876
18431877
18441878
18451879
18461880
18471881
1848
1882
18491883
18501884
18511885
......
18811915
18821916
18831917
1884
1918
18851919
18861920
18871921
......
19021936
19031937
19041938
1905
1939
19061940
19071941
19081942
......
19391973
19401974
19411975
1942
1976
19431977
19441978
19451979
......
19471981
19481982
19491983
1950
1984
19511985
19521986
19531987
19541988
19551989
1956
1990
19571991
19581992
19591993
......
19611995
19621996
19631997
1964
1998
19651999
19662000
19672001
......
19722006
19732007
19742008
1975
2009
19762010
19772011
19782012
......
20912125
20922126
20932127
2094
2128
20952129
20962130
20972131
......
21022136
21032137
21042138
2105
2139
21062140
21072141
21082142
......
24122446
24132447
24142448
2449
24152450
24162451
24172452
......
24242459
24252460
24262461
2427
2462
24282463
2464
24292465
24302466
24312467
......
24392475
24402476
24412477
2442
2478
24432479
24442480
24452481
......
24652501
24662502
24672503
2504
2505
24682506
24692507
24702508
......
25032541
25042542
25052543
2506
2544
25072545
2546
25082547
25092548
25102549
use constant MIME_GLOB_FILE => "/usr/share/mime/globs";
}
use lib LIB_PATH;
use lib "/home/aecoope/locale/lib/perl5/site_perl/5.8.5";
use strict;
# ***** REQUIRED PACKAGES *****
use Gtk2::Helper;
use Gtk2::Pango;
use Gtk2::SourceView;
use Locale::TextDomain ("mtn-browse", "/home/aecoope/perl/locale");
use Locale::TextDomain ("mtn-browse", LIB_PATH . "/share/locale");
use IO::File;
use IPC::Open3;
use POSIX qw(:errno_h :locale_h :sys_wait_h strftime);
my $large_logo;
# ***** FUNCTIONAL PROTOTYPES FOR THIS FILE *****
# ***** FUNCTIONAL PROTOTYPES *****
# Private routines.
sub manifest_browser_treeview_row_activated_cb($$$$);
sub monotone_viz_button_clicked_cb($$);
sub mtn_error_handler($$);
sub new_blank_menu_item_clicked_cb($$);
sub new_toolbutton_clicked_cb($$);
sub open_toolbutton_clicked_cb($$);
sub preferences_toolbutton_clicked_cb($$);
eval
{
$tmp_dir = File::Temp::tempdir("mtn-browse_XXXXXXXXXX",
$tmp_dir = File::Temp->tempdir("mtn-browse_XXXXXXXXXX",
TMPDIR => 1,
CLEANUP => 1);
};
if (! defined($large_logo));
Gnome2::About->new
("mtn-browse",
"0.3b",
"0.4b",
__("Copyright \xa9 2007-2009 Anthony Cooper"),
__("A graphical front-end browser for Monotone VCS databases"),
["Anthony Cooper <support\@coosoft.plus.com>"],
return if ($browser->{in_cb});
local $browser->{in_cb} = 1;
my @revision_ids;
# Simply get a new/unused browser window and display it.
get_revision_ids($browser, \@revision_ids);
get_browser_window($browser->{mtn},
$browser->{branch_combo_details}->{value},
$revision_ids[0]);
}
#
##############################################################################
#
# Routine - new_blank_menu_item_clicked_cb
#
# Description - Callback routine called when the user clicks on the new
# blank menu item in a main browser window.
#
# Data - $widget : The widget object that received the signal.
# $browser : The browser instance that is associated with
# this widget.
#
##############################################################################
sub new_blank_menu_item_clicked_cb($$)
{
my($widget, $browser) = @_;
return if ($browser->{in_cb});
local $browser->{in_cb} = 1;
# Simply get a new/unused browser window and display it.
get_browser_window();
}
# Register the window for management.
$wm->manage($browser, $window_type);
$wm->add_busy_widgets($browser,
$wm->manage($browser, $window_type, $browser->{window});
$wm->add_busy_windows($browser,
$browser->{file_view_sv}->get_window("text"));
# Update the browser's internal state.
$wm->make_busy($browser, 1);
$browser->{appbar}->push("");
gtk2_update();
$wm->update_gui();
# The database has changed.
# Get the new list of branches.
$browser->{appbar}->set_status(__("Fetching branch list"));
gtk2_update();
$wm->update_gui();
$browser->{mtn}->branches(\@branch_list) if (defined($browser->{mtn}));
$browser->{branch_combo_details}->{list} = \@branch_list;
# Update the branch list combobox.
$browser->{appbar}->set_status(__("Populating branch list"));
gtk2_update();
$wm->update_gui();
my $counter = 1;
$browser->{branch_comboboxentry}->get_model()->clear();
foreach my $branch (@branch_list)
$browser->{branch_comboboxentry}->append_text($branch);
$browser->{appbar}->set_progress_percentage
($counter ++ / scalar(@branch_list));
gtk2_update();
$wm->update_gui();
}
$browser->{branch_comboboxentry}->child()->
set_text($browser->{branch_combo_details}->{value});
$browser->{appbar}->set_progress_percentage(0);
$browser->{appbar}->set_status("");
gtk2_update();
$wm->update_gui();
}
if ($browser->{branch_combo_details}->{complete})
{
$browser->{appbar}->set_status(__("Fetching revision list"));
gtk2_update();
$wm->update_gui();
get_branch_revisions($browser->{mtn},
$browser->{branch_combo_details}->{value},
$browser->{tagged_checkbutton}->get_active(),
$browser->{appbar}->set_progress_percentage(0);
$browser->{appbar}->set_status(__("Populating revision list"));
gtk2_update();
$wm->update_gui();
my $counter = 1;
$browser->{revision_comboboxentry}->get_model()->clear();
foreach my $revision (@revision_list)
$browser->{revision_comboboxentry}->append_text($revision);
$browser->{appbar}->set_progress_percentage
($counter ++ / scalar(@revision_list));
gtk2_update();
$wm->update_gui();
}
$browser->{revision_comboboxentry}->child()->
set_text($browser->{revision_combo_details}->{value});
$browser->{appbar}->set_progress_percentage(0);
$browser->{appbar}->set_status("");
gtk2_update();
$wm->update_gui();
}
# Get the new manifest.
$browser->{appbar}->set_status(__("Fetching manifest"));
gtk2_update();
$wm->update_gui();
if ($browser->{revision_combo_details}->{complete})
{
my @revision_ids;
}
my $dialog = Gtk2::MessageDialog->new_with_markup
($browser->{window}, ["modal"], "info", "close", $message);
$dialog->run();
$wm->allow_input(sub { $dialog->run(); });
$dialog->destroy();
$browser->{revision_combo_details}->{complete} = 0;
$browser->{revision_combo_details}->{value} = "";
# Generate a simple list of directories for auto completion.
$browser->{appbar}->set_progress_percentage(0.5);
gtk2_update();
$wm->update_gui();
foreach my $item (@manifest_list)
{
push(@directory_list, $item->{name})
}
$browser->{directory_combo_details}->{list} = \@directory_list;
$browser->{appbar}->set_progress_percentage(1);
gtk2_update();
$wm->update_gui();
# Update the directory list combobox.
$browser->{appbar}->set_progress_percentage(0);
$browser->{appbar}->set_status(__("Populating directory list"));
gtk2_update();
$wm->update_gui();
my $counter = 1;
$browser->{directory_comboboxentry}->get_model()->clear();
foreach my $item (@directory_list)
$browser->{directory_comboboxentry}->append_text($item);
$browser->{appbar}->set_progress_percentage
($counter ++ / scalar(@directory_list));
gtk2_update();
$wm->update_gui();
}
$browser->{directory_comboboxentry}->child()->
set_text($browser->{directory_combo_details}->{value});
$widget->
set_sensitive($browser->{revision_combo_details}->{complete});
}
gtk2_update();
$wm->update_gui();
}
{
$browser->{appbar}->set_progress_percentage
($counter / scalar(@directory_entry_list));
gtk2_update();
$wm->update_gui();
}
++ $counter;
$browser->{appbar}->set_progress_percentage(0);
$browser->{appbar}->set_status("");
gtk2_update();
$wm->update_gui();
}
my($severity, $message) = @_;
my $dialog;
my $wm = WindowManager->instance();
if ($severity eq "warning")
{
. __x("<b><i>{error_message}</i></b>\n",
error_message => Glib::Markup::escape_text($message))
. __("This should not be happening!"));
$dialog->run();
$wm->allow_input(sub { $dialog->run(); });
$dialog->destroy();
$wm->reset_state();
die($message);
}
else
. __x("<b><i>{error_message}</i></b>\n",
error_message => Glib::Markup::escape_text($message))
. __("This is fatal, I am going to exit."));
$dialog->run();
$wm->allow_input(sub { $dialog->run(); });
$dialog->destroy();
Gtk2->main_quit() unless (Gtk2->main_level() == 0);
die($message);
my($pid,
$status);
my $wm = WindowManager->instance();
while (($pid = waitpid(-1, WNOHANG)) > 0)
{
$status = $?;
error_message => $message)
. __("This should not be happening!\n")
. __("It will be restarted when needed."));
$dialog->run();
$wm->allow_input(sub { $dialog->run(); });
$dialog->destroy();
$wm->reset_state();
return 1;
}
return;
mtn-browse.glade
5757
5858
5959
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
6081
6182
6283
</child>
<child>
<widget class="GtkImageMenuItem" id="new_blank1">
<property name="visible">True</property>
<property name="label" translatable="yes">New _Blank</property>
<property name="use_underline">True</property>
<signal name="activate" handler="new_blank_menu_item_clicked_cb" last_modification_time="Thu, 05 Jun 2008 10:14:27 GMT"/>
<child internal-child="image">
<widget class="GtkImage" id="image36">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="open1">
<property name="visible">True</property>
<property name="stock_item">GNOMEUIINFO_MENU_OPEN_ITEM</property>

Archive Download the corresponding diff file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status