# # # patch "Annotate.pm" # from [1493920915b434690ff4c1f7e6192a4c32e7bb77] # to [27b565bcb841d57451ff9944b3c1c7d031530576] # # patch "ChangeLog.pm" # from [0bcce5bab01ed8d7f2ad28c2a11c2be78674f6b7] # to [8c4a5ab8cd8fc1f6358cd19034a7453b199fed75] # # patch "Common.pm" # from [fb67a843887c653331e9f572815089f9ae7e40f5] # to [4be075be01f981beabb7f5fc8639a1857806d682] # # patch "FindFiles.pm" # from [b00f4bb068df519f3b552d2373b4aaf465908c33] # to [5e474522d4a1e5ca3f9c36c885d23a6a1447d92b] # # patch "History.pm" # from [5541b98ade535910280cc2c3485d8a0fa7b76e97] # to [67ca912ec21997a9775b03bcbfcdf0e2528c9bc8] # # patch "Preferences.pm" # from [aa95319d71e080bd6fb6a5c6cc32780d94dff0f6] # to [62aa371bb3c929f7ddec596ecf1d0ccbd15c9198] # # patch "mtn-browse" # from [7941007394f980bb6aa7d268764738b9fd349d1b] # to [414504459ff48f2d5992df9bd4d164d8cb61fe1a] # # patch "mtn-browse.glade" # from [2421c38b711c897d61865b398aad77d1df4133da] # to [3aae1d88b0e9e1225c40bebd4a887aabd00d25fc] # ============================================================ --- Annotate.pm 1493920915b434690ff4c1f7e6192a4c32e7bb77 +++ Annotate.pm 27b565bcb841d57451ff9944b3c1c7d031530576 @@ -62,8 +62,8 @@ sub mtn_annotate($$$$); # # Description - Display the annotated listing for the specified file. # -# Data - $mtn : The Monotone instance handle that is to be -# used to display the annotated file. +# Data - $mtn : The Monotone::AutomateStdio object that is +# to be used to display the annotated file. # $revision_id : The revision id in which the desired version # of the file resides. # $file_name : The name of the file that is to be @@ -297,7 +297,7 @@ sub get_annotation_window() # # Data - $list : A reference to the list that is to contain # the output from the annotate command. -# $mtn : The Monotone database that is to be used or +# $mtn_db : The Monotone database that is to be used or # undef if the database associated with the # current workspace is to be used. # $revision_id : The revision id on which the desired version ============================================================ --- ChangeLog.pm 0bcce5bab01ed8d7f2ad28c2a11c2be78674f6b7 +++ ChangeLog.pm 8c4a5ab8cd8fc1f6358cd19034a7453b199fed75 @@ -81,8 +81,8 @@ sub get_change_log_window(); # # Description - Display a revision's change log in a window. # -# Data - $mtn : The Monotone instance handle that is to be -# used to display the change log. +# Data - $mtn : The Monotone::AutomateStdio object that is +# to be used to display the change log. # $revision_id : The revision id that is to have its change # log displayed. # $text_colour : Either the colour of the text or undef or "" ============================================================ --- Common.pm fb67a843887c653331e9f572815089f9ae7e40f5 +++ Common.pm 4be075be01f981beabb7f5fc8639a1857806d682 @@ -549,8 +549,8 @@ sub save_as_file($$$) # that take into account the user's preferences for ordering # and the maximum number of revisions to display. # -# Data - $mtn : The Monotone database handle that is to be -# used. +# Data - $mtn : The Monotone::AutomateStdio object that is to +# be used. # $branch : The name of the branch that revisions are to # be found for. # $tags : True if the list of revisions are to be tags, @@ -772,8 +772,8 @@ sub get_revision_ids($$;$) # # Description - Get the details of the specified file. # -# Data - $mtn : The Monotone database handle that -# is to be used. +# Data - $mtn : The Monotone::AutomateStdio object +# that is to be used. # $revision_id : The revision id from where the # search for the latest file update # is to start, working backwards. @@ -1228,6 +1228,9 @@ sub glade_signal_autoconnect($$) my($glade, $client_data) = @_; + my $caller_package = caller(); + $caller_package = "main" if (! defined($caller_package)); + $glade->signal_autoconnect (sub { my($callback_name, $widget, $signal_name, $signal_data, @@ -1237,7 +1240,7 @@ sub glade_signal_autoconnect($$) # Need to fully qualify any callback name that isn't prefixed by # it's package name with the name of the calling package. - $callback_name = __PACKAGE__ . "::" . $callback_name + $callback_name = $caller_package . "::" . $callback_name if (index($callback_name, "::") < 0); # Actually connect the signal handler. ============================================================ --- FindFiles.pm b00f4bb068df519f3b552d2373b4aaf465908c33 +++ FindFiles.pm 5e474522d4a1e5ca3f9c36c885d23a6a1447d92b @@ -93,8 +93,8 @@ sub validate_query($$); # # Description - Display the find files window. # -# Data - $mtn : The Monotone instance handle that is to -# be used to search for files. +# Data - $mtn : The Monotone::AutomateStdio object that +# is to be used to search for files. # $tag : Either a tag name for the specified # revision that is to be used in the window # title instead of the revision id or undef ============================================================ --- History.pm 5541b98ade535910280cc2c3485d8a0fa7b76e97 +++ History.pm 67ca912ec21997a9775b03bcbfcdf0e2528c9bc8 @@ -105,8 +105,8 @@ sub save_differences_button_clicked_cb($ # Description - Display a revision's change history, complete with # selection and comparison buttons. # -# Data - $mtn : The Monotone instance handle that is to be -# used to get the change history. +# Data - $mtn : The Monotone::AutomateStdio object that is +# to be used to get the change history. # $tag : Either a tag name for the specified revision # that is to be used in the window title # instead of the revision id or undef if the @@ -310,8 +310,8 @@ sub display_revision_change_history($$$) # Description - Display a file's change history, complete with selection # and comparison buttons. # -# Data - $mtn : The Monotone instance handle that is to be -# used to get the change history. +# Data - $mtn : The Monotone::AutomateStdio object that is +# to be used to get the change history. # $revision_id : The revision id in which the desired version # of the file resides. # $file_name : The name of the file that is to have its @@ -683,8 +683,8 @@ sub compare_button_clicked_cb($$) # specified revisions, optionally restricting it to the # specified file. # -# Data - $mtn : The Monotone instance handle that is to be -# used to do the comparison. +# Data - $mtn : The Monotone::AutomateStdio object that is +# to be used to do the comparison. # $revision_id_1 : The first revision id that is to be # compared. # $revision_id_2 : The second revision id that is to be @@ -1747,7 +1747,7 @@ sub get_revision_comparison_window() # # Data - $list : A reference to the list that is to contain # the output from the diff command. -# $mtn : The Monotone database that is to be used +# $mtn_db : The Monotone database that is to be used # or undef if the database associated with # the current workspace is to be used. # $revision_id_1 : The first revision id that is to be ============================================================ --- Preferences.pm aa95319d71e080bd6fb6a5c6cc32780d94dff0f6 +++ Preferences.pm 62aa371bb3c929f7ddec596ecf1d0ccbd15c9198 @@ -60,7 +60,7 @@ use constant PREFERENCES_FILE_NAME => ". # Constant for the preferences file's format version. -use constant PREFERENCES_FORMAT_VERSION => 4; +use constant PREFERENCES_FORMAT_VERSION => 5; # Text viewable application mime types. @@ -433,8 +433,13 @@ sub defaults_button_clicked_cb($$) $page_nr = $instance->{notebook}->get_current_page(); if ($page_nr == 0) { - @fields = - ("default_mtn_db", "workspace", "query", "diffs_application"); + @fields = ("default_mtn_db", + "workspace", + "auto_select_head", + "show_suspended", + "show_file_details", + "query", + "diffs_application"); } elsif ($page_nr == 1) { @@ -1001,6 +1006,8 @@ sub get_preferences_window($$) "id_lists_limit_spinbutton", "id_lists_sort_cronologically_radiobutton", "id_lists_sort_by_id_radiobutton", + "show_suspended_revisions_checkbutton", + "detailed_file_listing_checkbutton", "external_diffs_app_entry", # Appearance pane widgets. @@ -1219,6 +1226,11 @@ sub load_preferences_into_gui($) { $instance->{id_lists_sort_by_id_radiobutton}->set_active(TRUE); } + $instance->{show_suspended_revisions_checkbutton}-> + set_active($instance->{preferences}->{show_suspended} ? TRUE : FALSE); + $instance->{detailed_file_listing_checkbutton}-> + set_active($instance->{preferences}->{show_file_details} ? + TRUE : FALSE); $instance->{external_diffs_app_entry}-> set_text($instance->{preferences}->{diffs_application}); @@ -1375,8 +1387,13 @@ sub save_preferences_from_gui($) $instance->{preferences}->{query}->{id}->{limit} = $instance->{id_lists_limit_spinbutton}->get_value_as_int(); $instance->{preferences}->{query}->{id}->{sort_cronologically} = - $instance->{id_lists_sort_cronologically_radiobutton}->get_active() - ? 1 : 0; + $instance->{id_lists_sort_cronologically_radiobutton}->get_active() ? + 1 : 0; + $instance->{preferences}->{show_suspended} = + $instance->{show_suspended_revisions_checkbutton}->get_active() ? + 1 : 0; + $instance->{preferences}->{show_file_details} = + $instance->{detailed_file_listing_checkbutton}->get_active() ? 1 : 0; $instance->{preferences}->{diffs_application} = $instance->{external_diffs_app_entry}->get_text(); @@ -1527,6 +1544,12 @@ sub upgrade_preferences($) $preferences->{auto_select_head} = 0; $preferences->{version} = 4; } + if ($preferences->{version} == 4) + { + $preferences->{show_suspended} = 0; + $preferences->{show_file_details} = 1; + $preferences->{version} = 5; + } $preferences->{version} = PREFERENCES_FORMAT_VERSION; @@ -1564,6 +1587,8 @@ sub initialise_preferences() sort_cronologically => 1}, id => {limit => 200, sort_cronologically => 1}}, + show_suspended => 0, + show_file_details => 1, diffs_application => "kompare '{file1}' '{file2}'", coloured_diffs => 1, fixed_font => "monospace 10", ============================================================ --- mtn-browse 7941007394f980bb6aa7d268764738b9fd349d1b +++ mtn-browse 414504459ff48f2d5992df9bd4d164d8cb61fe1a @@ -79,7 +79,7 @@ use Time::Local; # Monotone AutomateStdio module. -use Monotone::AutomateStdio; +use Monotone::AutomateStdio qw(:constants); # Modules specific to this application. @@ -146,6 +146,7 @@ sub search_text_button_clicked_cb($$); sub revision_change_log_button_clicked_cb($$); sub save_as_button_clicked_cb($$); sub search_text_button_clicked_cb($$); +sub setup_mtn_object($$); sub setup_sigchld_handler($); sub show_line_numbers_togglebutton_toggled_cb($$); sub sigchld_handler(); @@ -312,8 +313,7 @@ sub view_button_clicked_cb($$); $browser = get_browser_window($mtn); if (defined($mtn)) { - $mtn->register_db_locked_handler(\&mtn_db_locked_handler, - $browser->{window}); + setup_mtn_object($mtn, $browser->{window}); if (defined($branch)) { Glib::Idle->add @@ -533,9 +533,8 @@ sub open_toolbutton_clicked_cb($$) if (open_database($browser->{window}, \$mtn, undef)) { + setup_mtn_object($mtn, $browser->{window}); $browser->{mtn} = $mtn; - $mtn->register_db_locked_handler(\&mtn_db_locked_handler, - $browser->{window}); &{$browser->{update_handler}}($browser, DATABASE_CHANGED); } @@ -1419,10 +1418,10 @@ sub main_window_delete_event_cb($$$) # # Description - Creates or prepares an existing browser window for use. # -# Data - $mtn : The Monotone instance handle that is to be -# used for the browser window. If it is undef -# then no database is used and a blank browser -# window is displayed. +# Data - $mtn : The Monotone::AutomateStdio object that is +# to be used for the browser window. If it is +# undef then no database is used and a blank +# browser window is displayed. # $branch : The branch name that is to be preselected in # the browser window. This is optional unless # any of the following arguments are @@ -1571,26 +1570,33 @@ sub get_browser_window(;$$$$$) $tv_column->set_attributes($renderer, "text" => MLS_NAME_COLUMN); $browser->{manifest_browser_treeview}->append_column($tv_column); - $tv_column = Gtk2::TreeViewColumn->new(); - $tv_column->set_title(__("Last Update")); - $tv_column->set_resizable(TRUE); - $tv_column->set_sizing("grow-only"); - $tv_column->set_sort_column_id(MLS_DATE_COLUMN); - $renderer = Gtk2::CellRendererText->new(); - $tv_column->pack_start($renderer, FALSE); - $tv_column->set_attributes($renderer, "text" => MLS_DATE_COLUMN); - $browser->{manifest_browser_treeview}->append_column($tv_column); + # Only set up the remaining columns if that is what the user wants. - $tv_column = Gtk2::TreeViewColumn->new(); - $tv_column->set_title(__("Author")); - $tv_column->set_resizable(TRUE); - $tv_column->set_sizing("grow-only"); - $tv_column->set_sort_column_id(MLS_AUTHOR_COLUMN); - $renderer = Gtk2::CellRendererText->new(); - $tv_column->pack_start($renderer, FALSE); - $tv_column->set_attributes($renderer, "text" => MLS_AUTHOR_COLUMN); - $browser->{manifest_browser_treeview}->append_column($tv_column); + if ($user_preferences->{show_file_details}) + { + $tv_column = Gtk2::TreeViewColumn->new(); + $tv_column->set_title(__("Last Update")); + $tv_column->set_resizable(TRUE); + $tv_column->set_sizing("grow-only"); + $tv_column->set_sort_column_id(MLS_DATE_COLUMN); + $renderer = Gtk2::CellRendererText->new(); + $tv_column->pack_start($renderer, FALSE); + $tv_column->set_attributes($renderer, "text" => MLS_DATE_COLUMN); + $browser->{manifest_browser_treeview}->append_column($tv_column); + $tv_column = Gtk2::TreeViewColumn->new(); + $tv_column->set_title(__("Author")); + $tv_column->set_resizable(TRUE); + $tv_column->set_sizing("grow-only"); + $tv_column->set_sort_column_id(MLS_AUTHOR_COLUMN); + $renderer = Gtk2::CellRendererText->new(); + $tv_column->pack_start($renderer, FALSE); + $tv_column->set_attributes($renderer, "text" => MLS_AUTHOR_COLUMN); + $browser->{manifest_browser_treeview}->append_column($tv_column); + + } + $browser->{show_file_details} = $user_preferences->{show_file_details}; + $browser->{manifest_browser_treeview}-> set_search_column(MLS_NAME_COLUMN); @@ -2127,11 +2133,12 @@ sub update_browser_state($$) foreach my $item (@directory_entry_list) { - # Get the latest modification time and the author if the entry is a - # file (caching the result in the manifest for future reference if - # we have to work it out). + # Get the latest modification time and the author if that is what + # the user wants and the entry is a file (caching the result in the + # manifest for future reference if we have to work it out). - if ($item->{manifest_entry}->{type} eq "file") + if ($browser->{show_file_details} + && $item->{manifest_entry}->{type} eq "file") { if (! exists($item->{manifest_entry}->{author})) { @@ -2259,13 +2266,12 @@ sub update_browser_state($$) if (! exists($manifest_entry->{last_changed_revision})) { - my($dummy, - @revision_ids); + my @revision_ids; get_revision_ids($browser, address@hidden); get_file_details($browser->{mtn}, $revision_ids[0], $manifest_entry->{name}, - \$dummy, + \$manifest_entry->{author}, \$manifest_entry->{last_update}, \$manifest_entry-> {last_changed_revision}); @@ -2548,6 +2554,68 @@ sub determine_mime_type($$$$) # ############################################################################## # +# Routine - setup_mtn_object +# +# Description - Sets up a new Monotone::AutomateStdio object so that it can +# be used in this application. +# +# Data - $mtn : The Monotone::AutomateStdio object that is to be +# setup. +# $parent : The parent window widget that is to be used for +# assorted dialog windows that may appear. +# +############################################################################## + + + +sub setup_mtn_object($$) +{ + + my($mtn, $parent) = @_; + + $mtn->register_db_locked_handler(\&mtn_db_locked_handler, $parent); + if ($user_preferences->{show_suspended}) + { + if ($mtn->can(MTN_IGNORE_SUSPEND_CERTS)) + { + $mtn->ignore_suspend_certs(1); + } + else + { + my $dialog = Gtk2::MessageDialog-> + new($parent, + ["modal"], + "info", + "close", + __("Your version of Monotone does not support\n" + . "suspend certificates. I will adjusted your\n" + . "preferences accordingly.")); + $dialog->run(); + $dialog->destroy(); + $user_preferences->{show_suspended} = 0; + eval + { + save_preferences($user_preferences); + }; + if ($@ ne "") + { + chomp($@); + my $dialog = Gtk2::MessageDialog->new + (undef, + ["modal"], + "warning", + "close", + __("Your preferences could not be saved:\n") . $@); + $dialog->run(); + $dialog->destroy(); + } + } + } + +} +# +############################################################################## +# # Routine - enable_find_text_dialog # # Description - Enable or disable any find text dialog associated with the @@ -2600,7 +2668,7 @@ sub enable_find_text_dialog($$) # Description - This routine is called when ever a locked database # condition is detected. # -# Data - $mtn : The Monotone instance handle that +# Data - $mtn : The Monotone::AutomateStdio object that # encountered the locked database. # $parent : The parent window for any dialogs that are # to be displayed. ============================================================ --- mtn-browse.glade 2421c38b711c897d61865b398aad77d1df4133da +++ mtn-browse.glade 3aae1d88b0e9e1225c40bebd4a887aabd00d25fc @@ -5189,6 +5189,114 @@ the tags to be order aphabetically + + True + 0 + 0.5 + GTK_SHADOW_ETCHED_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 0 + 0 + + + + 5 + True + False + 5 + + + + True + Select Show suspended revisions +if you want suspended revisions +and their related branches to be +displayed + True + Show suspended revisions + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + Select Detailed file listings if you +want a file's latest modification +time and author to be displayed +alongside the file name + +Please note that selecting this +option may have a severe +performance penalty depending +upon the version of Monotone +that you are using + True + Detailed file listings + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + + + + + True + <b>Browser Display Options</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + label_item + + + + + 0 + False + True + + + + True 0