[Aptitude-devel] r3169 - in branches/aptitude-0.3/aptitude: . src

Daniel Burrows dburrows@costa.debian.org
Thu, 28 Apr 2005 02:46:28 +0000


Author: dburrows
Date: Thu Apr 28 02:46:25 2005
New Revision: 3169

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/download.cc
   branches/aptitude-0.3/aptitude/src/pkg_item.cc
   branches/aptitude-0.3/aptitude/src/pkg_ver_item.cc
   branches/aptitude-0.3/aptitude/src/ui.cc
   branches/aptitude-0.3/aptitude/src/ui.h
   branches/aptitude-0.3/aptitude/src/view_changelog.cc
Log:
Use tabs for the main multiplex.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Thu Apr 28 02:46:25 2005
@@ -1,5 +1,9 @@
 2005-04-27  Daniel Burrows  <dburrows@debian.org>
 
+	* src/download.cc, src/pkg_item.cc, src/pkg_ver_item.cc, src/ui.cc, src/ui.h, src/view_changelog.cc:
+
+	  Use tabs for the main multiplex.
+
 	* doc/en/aptitude.xml, src/vscreen/vscreen.cc:
 
 	  Use less vomit-inducing default colors for multiplex tabs.

Modified: branches/aptitude-0.3/aptitude/src/download.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/download.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/download.cc	Thu Apr 28 02:46:25 2005
@@ -110,6 +110,7 @@
   if(!text_download)
     download_progress=gen_download_progress(false, _("Updating package lists"),
 					    _("View the progress of the package list update"),
+					    _("List Update"),
 					    NULL);
   else
     download_progress=gen_cmdline_download_progress();
@@ -328,6 +329,7 @@
     download_progress=gen_download_progress(false,
 					    _("Downloading packages"),
 					    _("View the progress of the package download"),
+					    _("Package Download"),
 					    arg(sigc::mem_fun(abortable,
 							      &downloader::abort)));
   else

Modified: branches/aptitude-0.3/aptitude/src/pkg_item.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/pkg_item.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/pkg_item.cc	Thu Apr 28 02:46:25 2005
@@ -220,10 +220,13 @@
 {
   char buf[512]="Foo";
   snprintf(buf, 512, _("Information about %s"), package.Name());
+  string menulabel(buf);
+  snprintf(buf, 512, _("%s info"), package.Name());
+  string tablabel(buf);
 
   vscreen_widget *w=make_info_screen(package, visible_version());
   // what to use as the menu description?
-  insert_main_widget(w, buf, "");
+  insert_main_widget(w, menulabel, "", tablabel);
 }
 
 void pkg_item::show_changelog()
@@ -303,9 +306,16 @@
 {
   if(bindings->key_matches(ch, "Versions"))
     {
+      char buf[512];
+      snprintf(buf, 512, _("Available versions of %s"),
+	       package.Name());
+      string menulabel(buf);
+      snprintf(buf, 512, _("%s versions"),
+	       package.Name());
+      string tablabel(buf);
+
       vscreen_widget *w=make_ver_screen(package);
-      insert_main_widget(w, string(_("Available versions of "))+package.Name(),
-			 "");
+      insert_main_widget(w, menulabel, "", tablabel);
     }
   else if(bindings->key_matches(ch, "Dependencies"))
     {
@@ -313,9 +323,12 @@
 	{
 	  char buf[512];
 	  snprintf(buf, 512, _("Dependencies of %s"), package.Name());
+	  string menulabel(buf);
+	  snprintf(buf, 512, _("%s deps"), package.Name());
+	  string tablabel(buf);
 
 	  vscreen_widget *w=make_dep_screen(package, visible_version());
-	  insert_main_widget(w, buf, "");
+	  insert_main_widget(w, menulabel, "", tablabel);
 	  w->show();
 	}
     }
@@ -323,9 +336,12 @@
     {
       char buf[512];
       snprintf(buf, 512, _("Packages depending on %s"), package.Name());
+      string menulabel(buf);
+      snprintf(buf, 512, _("%s reverse deps"), package.Name());
+      string tablabel(buf);
 
       vscreen_widget *w=make_dep_screen(package, visible_version(), true);
-      insert_main_widget(w, buf, "");
+      insert_main_widget(w, buf, "", tablabel);
     }
   else if(bindings->key_matches(ch, "InfoScreen"))
     show_information();
@@ -428,7 +444,7 @@
       e->set_package(package, visible_version());
 
       // FIXME: better title
-      add_main_widget(e, _("Hierarchy editor"), "");
+      add_main_widget(e, _("Hierarchy editor"), "", _("Hierarchy Editor"));
 
       e->connect_key("Quit", &global_bindings,
 		     sigc::mem_fun(*e, &vscreen_widget::destroy));

Modified: branches/aptitude-0.3/aptitude/src/pkg_ver_item.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/pkg_ver_item.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/pkg_ver_item.cc	Thu Apr 28 02:46:25 2005
@@ -1,6 +1,6 @@
 // pkg_ver_item.cc
 //
-//  Copyright 1999,2000,2001 Daniel Burrows
+//  Copyright 1999-2005 Daniel Burrows
 //
 //  This program is free software; you can redistribute it and/or modify
 //  it under the terms of the GNU General Public License as published by
@@ -620,7 +620,14 @@
 void pkg_ver_item::show_information()
 {
   vscreen_widget *w=make_info_screen(version.ParentPkg(), version);
-  insert_main_widget(w, string(_("Information about "))+version.ParentPkg().Name(), "");
+
+  char buf[512];
+  snprintf(buf, 512, _("Information about %s"), version.ParentPkg().Name());
+  string menulabel(buf);
+  snprintf(buf, 512, _("%s info"), version.ParentPkg().Name());
+  string tablabel(buf);
+
+  insert_main_widget(w, menulabel, "", tablabel);
 }
 
 pkg_ver_screen::pkg_ver_screen(const pkgCache::PkgIterator &pkg)
@@ -646,18 +653,24 @@
     {
       char buf[512];
       snprintf(buf, 512, _("Dependencies of %s"), version.ParentPkg().Name());
+      string menulabel(buf);
+      snprintf(buf, 512, _("%s deps"), version.ParentPkg().Name());
+      string tablabel(buf);
 
       vscreen_widget *w=make_dep_screen(version.ParentPkg(), version);
-      insert_main_widget(w, buf, "");
+      insert_main_widget(w, menulabel, "", tablabel);
       return true;
     }
   else if(bindings->key_matches(ch, "ReverseDependencies"))
     {
       char buf[512];
       snprintf(buf, 512, _("Packages depending on %s"), version.ParentPkg().Name());
+      string menulabel(buf);
+      snprintf(buf, 512, _("%s reverse deps"), version.ParentPkg().Name());
+      string tablabel(buf);
 
       vscreen_widget *w=make_dep_screen(version.ParentPkg(), version, true);
-      insert_main_widget(w, buf, "");
+      insert_main_widget(w, menulabel, "", tablabel);
       return true;
     }
   else if(bindings->key_matches(ch, "InfoScreen"))

Modified: branches/aptitude-0.3/aptitude/src/ui.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/ui.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/ui.cc	Thu Apr 28 02:46:25 2005
@@ -586,7 +586,8 @@
 				    &tree->selected_signal,
 				    &tree->selected_desc_signal),
 		  _("Packages"),
-		  _("View available packages and choose actions to perform"));
+		  _("View available packages and choose actions to perform"),
+		  _("Packages"));
 
   tree->build_tree(progress);
 }
@@ -614,8 +615,9 @@
   add_main_widget(make_default_view(tree,
 				    &tree->selected_signal,
 				    &tree->selected_desc_signal),
-		  "Packages",
-		  _("View available packages and choose actions to perform"));
+		  _("Packages"),
+		  _("View available packages and choose actions to perform"),
+		  _("Packages"));
   tree->build_tree(progress);
 }
 
@@ -858,7 +860,8 @@
 				       &global_bindings,
 				       sigc::ptr_fun(actually_do_package_run));
       add_main_widget(active_preview, _("Preview of package installation"),
-		      _("View and/or adjust the actions that will be performed"));
+		      _("View and/or adjust the actions that will be performed"),
+		      _("Preview"));
 
       vs_progress *p=gen_progress_bar();
       active_preview_tree->build_tree(*p);
@@ -1083,7 +1086,7 @@
 
 static void do_sweep()
 {
-  add_main_widget(new cmine, _("Minesweeper"), _("Waste time trying to find mines"));
+  add_main_widget(new cmine, _("Minesweeper"), _("Waste time trying to find mines"), _("Minesweeper"));
 }
 
 static void do_clean()
@@ -1707,7 +1710,7 @@
   aptcfg->connect(string(PACKAGE "::UI::HelpBar"),
 		  sigc::mem_fun(*help_label, &help_bar::set_visibility));
 
-  main_multiplex=new vs_multiplex;
+  main_multiplex=new vs_multiplex(true);
   main_table->add_widget_opts(main_multiplex, 1, 0, 1, 1,
 			      vs_table::EXPAND | vs_table::FILL | vs_table::SHRINK,
 			      vs_table::EXPAND | vs_table::FILL | vs_table::SHRINK);
@@ -1797,10 +1800,11 @@
 }
 
 void add_main_widget(vscreen_widget *w, const std::string &menuref,
-		     const std::string &menudesc)
+		     const std::string &menudesc,
+		     const std::string &tabdesc)
 {
   setup_main_widget(w, menuref, menudesc);
-  main_multiplex->add_widget(w);
+  main_multiplex->add_widget(w, tabdesc);
   w->show();
   w->destroyed.connect(sigc::ptr_fun(main_widget_destroyed));
 
@@ -1808,10 +1812,11 @@
 }
 
 void insert_main_widget(vscreen_widget *w, const std::string &menuref,
-			const std::string &menudesc)
+			const std::string &menudesc,
+			const std::string &tabdesc)
 {
   setup_main_widget(w, menuref, menudesc);
-  main_multiplex->add_widget_after(w, main_multiplex->visible_widget());
+  main_multiplex->add_widget_after(w, main_multiplex->visible_widget(), tabdesc);
   w->show();
 
   update_menubar_autohide();
@@ -1847,6 +1852,7 @@
 download_manager *gen_download_progress(bool force_noninvasive,
 					const string &title,
 					const string &longtitle,
+					const string &tablabel,
 					slot0arg abortslot)
 {
   download_manager *m=new download_manager;
@@ -1863,7 +1869,7 @@
   else
     {
       w=new download_list(abortslot);
-      add_main_widget(w, title, longtitle);
+      add_main_widget(w, title, longtitle, tablabel);
     }
 
   m->MediaChange_sig.connect(sigc::mem_fun(*w, &download_list::MediaChange));

Modified: branches/aptitude-0.3/aptitude/src/ui.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/ui.h	(original)
+++ branches/aptitude-0.3/aptitude/src/ui.h	Thu Apr 28 02:46:25 2005
@@ -129,10 +129,20 @@
 //
 // The "insert" form adds the new widget directly after the currently visible
 // widget.
+
+/** Add a new widget to the main interaction area.
+ *
+ *  \param w the widget to add
+ *  \param menuref the text to add in the corresponding menu
+ *  \param menudesc the description of the generated menu item
+ *  \param tablabel the label of the corresponding tab
+ */
 void add_main_widget(vscreen_widget *w, const std::string &menuref,
-		     const std::string &menudesc);
+		     const std::string &menudesc,
+		     const std::string &tablabel);
 void insert_main_widget(vscreen_widget *w, const std::string &menuref,
-			const std::string &menudesc);
+			const std::string &menudesc,
+			const std::string &tablabel);
 
 /** Returns the currently active main widget. */
 vscreen_widget *active_main_widget();
@@ -160,6 +170,7 @@
 download_manager *gen_download_progress(bool force_noninvasive,
 					const std::string &title,
 					const std::string &longtitle,
+					const std::string &tablabel,
 					slot0arg abortslot);
 
 // Asks the user for simple input (the question will appear in a "minibuffer"

Modified: branches/aptitude-0.3/aptitude/src/view_changelog.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/view_changelog.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/view_changelog.cc	Thu Apr 28 02:46:25 2005
@@ -51,6 +51,7 @@
   download_manager *widget=gen_download_progress(true,
 						 _("Downloading Changelog"),
 						 "",
+						 _("Download Changelog"),
 						 NULL);
   pkg_changelog *cl=get_changelog(ver, widget);
   widget->Complete();
@@ -58,6 +59,9 @@
     {
       char buf[512];
       snprintf(buf, 512, _("ChangeLog of %s"), ver.ParentPkg().Name());
+      string menulabel(buf);
+      snprintf(buf, 512, _("%s changes"), ver.ParentPkg().Name());
+      string tablabel(buf);
 
       pkg_changelog_screen *cs=new pkg_changelog_screen(cl);
       vs_table *t=new vs_table;
@@ -72,6 +76,6 @@
 
       t->show_all();
 
-      insert_main_widget(t, buf, "");
+      insert_main_widget(t, menulabel, "", tablabel);
     }
 }