# # # patch "lib/perl/ComboAutoCompletion.pm" # from [cc02b44560887fa8b6f6f4bacf447234509d1707] # to [08a0dee78655323a818220d9b072d54094f687c7] # # patch "lib/perl/Common.pm" # from [edccfd362dd15887a63ab5aa64d83bb8cbfb164a] # to [eefddd1fdb6572dfdb9739737e880caf0ea2736a] # # patch "lib/perl/FindText.pm" # from [6473576a783cdc54af4b39545bd9b201d7421cb4] # to [a5971f518219228fe2390cb24d028149b71648cd] # # patch "lib/perl/Preferences.pm" # from [458718b2ddce656838152ac714c0595bc880368d] # to [e702905f2e523fa8617f6053fc0d52260f93772a] # # patch "lib/ui/mtn-browse.glade" # from [960512beb54230deef97e1e6fe61a826df8d06c3] # to [f9155626bd73dc13b653b81af23f1026d5966574] # # patch "mtn-browse" # from [5e1390c6eeed92e87359d294984d4ef6bdb7841f] # to [a73380c1c6aa66ea49c21062a6bd4fe04815bc91] # ============================================================ --- lib/perl/ComboAutoCompletion.pm cc02b44560887fa8b6f6f4bacf447234509d1707 +++ lib/perl/ComboAutoCompletion.pm 08a0dee78655323a818220d9b072d54094f687c7 @@ -256,13 +256,22 @@ sub comboboxentry_key_release_event_cb($ $combo_details->{value} = $value; $combo_details->{complete} = $complete; - # Update the pulldown choices. + # Update the pulldown choices if that is what the user wants. - $combo->get_model()->clear(); - foreach $item (@{$combo_details->{list}}) + if (! $user_preferences->{static_lists}) { - $combo->append_text($item) if ($value eq substr($item, 0, $len)); - $combo_details->{complete} = 1 if (! $complete && $value eq $item); + $combo->get_model()->clear(); + foreach $item (@{$combo_details->{list}}) + { + $combo->append_text($item) + if ($value eq substr($item, 0, $len)); + + # The following check is needed in the case when the user is + # simply deleting characters from the right. + + $combo_details->{complete} = 1 + if (! $complete && $value eq $item); + } } # Update the window state on a significant change. ============================================================ --- lib/perl/Common.pm edccfd362dd15887a63ab5aa64d83bb8cbfb164a +++ lib/perl/Common.pm eefddd1fdb6572dfdb9739737e880caf0ea2736a @@ -105,17 +105,17 @@ sub generate_tmp_path($) for ($i = 0; ; ++ $i) { - if (-d ($tmp_dir . "/" . $i)) + if (-d File::Spec->catfile($tmp_dir, $i)) { - if (! -e ($path = $tmp_dir . "/" . $i . "/" . $file_name)) + if (! -e ($path = File::Spec->catfile($tmp_dir, $i, $file_name))) { return $path; } } else { - return unless mkdir($tmp_dir . "/" . $i); - return $tmp_dir . "/" . $i . "/" . $file_name; + return unless mkdir(File::Spec->catfile($tmp_dir, $i)); + return File::Spec->catfile($tmp_dir, $i, $file_name); } } @@ -916,9 +916,11 @@ sub get_revision_ids($$;$) return unless ($instance->{revision_combo_details}->{complete}); if ($instance->{tagged_checkbutton}->get_active()) { - $instance->{mtn}-> - select($revision_ids, - "t:" . $instance->{revision_combo_details}->{value}); + my $query = ""; + $query = "b:" . $instance->{branch_combo_details}->{value} . "/" + if ($instance->{branch_combo_details}->{complete}); + $query .= "t:" . $instance->{revision_combo_details}->{value}; + $instance->{mtn}->select($revision_ids, $query); $$tag = $instance->{revision_combo_details}->{value} if (defined($tag)); } ============================================================ --- lib/perl/FindText.pm 6473576a783cdc54af4b39545bd9b201d7421cb4 +++ lib/perl/FindText.pm a5971f518219228fe2390cb24d028149b71648cd @@ -66,6 +66,7 @@ sub find_current_window($); sub find_comboboxentry_changed_cb($$); sub find_current_window($); +sub find_text_button_clicked_cb($$); sub get_find_text_window($$); # ############################################################################## @@ -157,7 +158,7 @@ sub enable_find_text($$) if ($enable) { $instance->{main_vbox}->set_sensitive(TRUE); - $instance->{find_button}->set_sensitive + $instance->{find_text_button}->set_sensitive ((length($instance->{find_comboboxentry}->child()->get_text()) > 0) ? TRUE : FALSE); @@ -165,7 +166,7 @@ sub enable_find_text($$) else { $instance->{main_vbox}->set_sensitive(FALSE); - $instance->{find_button}->set_sensitive(FALSE); + $instance->{find_text_button}->set_sensitive(FALSE); } } @@ -330,7 +331,7 @@ sub find_text_textview_key_press_event_c # ############################################################################## # -# Routine - find_button_clicked_cb +# Routine - find_text_button_clicked_cb # # Description - Callback routine called when the user clicks on the find # button in the find text window. @@ -343,7 +344,7 @@ sub find_text_textview_key_press_event_c -sub find_button_clicked_cb($$) +sub find_text_button_clicked_cb($$) { my($widget, $instance) = @_; @@ -559,8 +560,8 @@ sub find_button_clicked_cb($$) get_iter_at_offset($instance->{match_offset_end}); $instance->{text_buffer}->select_range($start_iter, $end_iter); $instance->{text_view}->scroll_to_iter - ($start_line_iter, 0, FALSE, 0, 0); - $instance->{text_view}->scroll_to_iter($end_iter, 0, FALSE, 0, 0); + ($start_line_iter, 0.05, FALSE, 0, 0); + $instance->{text_view}->scroll_to_iter($end_iter, 0.05, FALSE, 0, 0); } else { @@ -606,7 +607,7 @@ sub find_comboboxentry_changed_cb($$) return if ($instance->{in_cb}); local $instance->{in_cb} = 1; - $instance->{find_button}->set_sensitive + $instance->{find_text_button}->set_sensitive ((length($instance->{find_comboboxentry}->child()->get_text()) > 0) ? TRUE : FALSE); @@ -694,7 +695,7 @@ sub get_find_text_window($$) "case_sensitive_checkbutton", "search_backwards_checkbutton", "regular_expression_checkbutton", - "find_button") + "find_text_button") { $instance->{$widget} = $instance->{glade}->get_widget($widget); } @@ -754,7 +755,7 @@ sub get_find_text_window($$) # Make sure the find button is only enabled when there is something entered # into the comboboxentry widget. - $instance->{find_button}->set_sensitive + $instance->{find_text_button}->set_sensitive ((length($instance->{find_comboboxentry}->child()->get_text()) > 0) ? TRUE : FALSE); ============================================================ --- lib/perl/Preferences.pm 458718b2ddce656838152ac714c0595bc880368d +++ lib/perl/Preferences.pm e702905f2e523fa8617f6053fc0d52260f93772a @@ -60,7 +60,7 @@ use constant PREFERENCES_FILE_NAME => ". # Constant for the preferences file's format version. -use constant PREFERENCES_FORMAT_VERSION => 6; +use constant PREFERENCES_FORMAT_VERSION => 7; # Text viewable application mime types. @@ -440,6 +440,8 @@ sub defaults_button_clicked_cb($$) "history_size", "show_suspended", "show_file_details", + "show_line_numbers", + "static_lists", "diffs_application"); } elsif ($page_nr == 1) @@ -1012,6 +1014,8 @@ sub get_preferences_window($$) "history_size_spinbutton", "show_suspended_revisions_checkbutton", "detailed_file_listing_checkbutton", + "show_line_numbers_checkbutton", + "static_lists_checkbutton", "external_diffs_app_entry", # Appearance pane widgets. @@ -1244,6 +1248,11 @@ sub load_preferences_into_gui($) $instance->{detailed_file_listing_checkbutton}-> set_active($instance->{preferences}->{show_file_details} ? TRUE : FALSE); + $instance->{show_line_numbers_checkbutton}-> + set_active($instance->{preferences}->{show_line_numbers} ? + TRUE : FALSE); + $instance->{static_lists_checkbutton}-> + set_active($instance->{preferences}->{static_lists} ? TRUE : FALSE); $instance->{external_diffs_app_entry}-> set_text($instance->{preferences}->{diffs_application}); @@ -1409,6 +1418,10 @@ sub save_preferences_from_gui($) 1 : 0; $instance->{preferences}->{show_file_details} = $instance->{detailed_file_listing_checkbutton}->get_active() ? 1 : 0; + $instance->{preferences}->{show_line_numbers} = + $instance->{show_line_numbers_checkbutton}->get_active() ? 1 : 0; + $instance->{preferences}->{static_lists} = + $instance->{static_lists_checkbutton}->get_active() ? 1 : 0; $instance->{preferences}->{diffs_application} = $instance->{external_diffs_app_entry}->get_text(); @@ -1570,6 +1583,12 @@ sub upgrade_preferences($) $preferences->{history_size} = 20; $preferences->{version} = 6; } + if ($preferences->{version} == 6) + { + $preferences->{show_line_numbers} = 0; + $preferences->{static_lists} = 0; + $preferences->{version} = 7; + } $preferences->{version} = PREFERENCES_FORMAT_VERSION; @@ -1610,6 +1629,8 @@ sub initialise_preferences() history_size => 20, show_suspended => 0, show_file_details => 1, + show_line_numbers => 0, + static_lists => 0, diffs_application => "kompare '{file1}' '{file2}'", fixed_font => "monospace 10", coloured_diffs => 1, ============================================================ --- lib/ui/mtn-browse.glade 960512beb54230deef97e1e6fe61a826df8d06c3 +++ lib/ui/mtn-browse.glade f9155626bd73dc13b653b81af23f1026d5966574 @@ -21,7 +21,7 @@ False GDK_WINDOW_TYPE_HINT_NORMAL GDK_GRAVITY_NORTH_WEST - True + False @@ -3453,7 +3453,7 @@ Tag True 1 1 - 0 0 376 10 338.4 376 + 0 0 375 10 337.5 375 0 0 17 10 15.3 17 @@ -3515,7 +3515,7 @@ Tag True 1 1 - 0 0 376 10 338.4 376 + 0 0 375 10 337.5 375 0 0 17 10 15.3 17 @@ -4267,7 +4267,7 @@ selected file in an external viewer - + True True True @@ -4276,7 +4276,7 @@ selected file in an external viewerGTK_RELIEF_NORMAL True 0 - + @@ -5358,6 +5358,53 @@ that you are using False + + + + True + Select Show line numbers if you +want line numbers to be shown +in file listings by default + True + Show line numbers + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + Select Static branch and revision +lists if you do not want the branch +and revision combobox entry lists +to update as you type in values +(can help with speed when dealing +with large lists) + True + Static branch and revision lists + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + ============================================================ --- mtn-browse 5e1390c6eeed92e87359d294984d4ef6bdb7841f +++ mtn-browse a73380c1c6aa66ea49c21062a6bd4fe04815bc91 @@ -71,7 +71,8 @@ use Gtk2::SourceView; use Gtk2::Helper; use Gtk2::Pango; use Gtk2::SourceView; -use Locale::TextDomain ("mtn-browse", PREFIX_DIR . "/share/locale"); +use Locale::TextDomain ("mtn-browse", + File::Spec->catfile(PREFIX_DIR, "share", "locale")); use IO::File; use IPC::Open3; use POSIX qw(:errno_h :locale_h :sys_wait_h strftime); @@ -176,14 +177,16 @@ sub view_button_clicked_cb($$); # Initialise stuff. - Gnome2::Program->init(APPLICATION_NAME, - APPLICATION_VERSION, - undef, - app_datadir => PREFIX_DIR . "/share"); + Gnome2::Program->init + (APPLICATION_NAME, + APPLICATION_VERSION, + undef, + app_datadir => File::Spec->catfile(PREFIX_DIR, "share")); setup_sigchld_handler(\&sigchld_handler); - $glade_file = LIB_DIR . "/ui/mtn-browse.glade"; + $glade_file = File::Spec->catfile(LIB_DIR, "ui", "mtn-browse.glade"); $tooltips = Gtk2::Tooltips->new(); - $line_image = Gtk2::Gdk::Pixbuf->new_from_file(LIB_DIR . "/ui/line.png"); + $line_image = Gtk2::Gdk::Pixbuf->new_from_file + (File::Spec->catfile(LIB_DIR, "ui", "line.png")); # Set up the default database locked and I/O wait handlers for the Monotone # class. @@ -413,7 +416,7 @@ sub about_activate_cb($$) local $browser->{in_cb} = 1; $large_logo = Gtk2::Gdk::Pixbuf->new_from_file - (LIB_DIR . "/ui/mtn-browse-large.png") + (File::Spec->catfile(LIB_DIR, "ui", "mtn-browse-large.png")) if (! defined($large_logo)); Gnome2::About->new (APPLICATION_NAME, @@ -1662,6 +1665,15 @@ sub get_browser_window(;$$$$$) $browser); $browser->{file_view_sv}->show_all(); + # Enable the showing of line numbers by default if that is what the + # user wants. + + if ($user_preferences->{show_line_numbers}) + { + $browser->{show_line_numbers_togglebutton}->set_active(TRUE); + $browser->{file_view_sv}->set_show_line_numbers(TRUE); + } + local $browser->{in_cb} = 1; $browser->{window}->show_all(); @@ -1705,8 +1717,16 @@ sub get_browser_window(;$$$$$) $browser->{file_being_viewed_preset_value} = ""; $browser->{manifest_browser_treeview}-> set_search_column(MLS_NAME_COLUMN); - $browser->{show_line_numbers_togglebutton}->set_active(FALSE); - $browser->{file_view_sv}->set_show_line_numbers(FALSE); + if ($user_preferences->{show_line_numbers}) + { + $browser->{show_line_numbers_togglebutton}->set_active(TRUE); + $browser->{file_view_sv}->set_show_line_numbers(TRUE); + } + else + { + $browser->{show_line_numbers_togglebutton}->set_active(FALSE); + $browser->{file_view_sv}->set_show_line_numbers(FALSE); + } &{$browser->{update_handler}}($browser, ALL_CHANGED); $browser->{window}->show_all();