On Mon, Oct 17, 2005 at 12:31:54PM +0200, Michal Čihař <[EMAIL PROTECTED]> was 
heard to say:
> in previous versions showing changelog from preview window it opened
> separate window, while now it replaces this window, so after closing
> changelog man gets back to main view. I thing previous behaviour was
> better.

  Fixed with the attached patch.

  Daniel
Mon Oct 17 10:00:15 PDT 2005  Daniel Burrows <[EMAIL PROTECTED]>
  * Add a parameter to the ui_download_manager constructor that determines 
whether the preview is automatically hidden.
  This is set only when starting an install run; Closes: #334343.
Mon Oct 17 09:51:16 PDT 2005  Daniel Burrows <[EMAIL PROTECTED]>
  * Allow callers of ui_start_download to choose whether or not the preview is 
hidden.
diff -rN -udp old-head/src/ui.cc new-head/src/ui.cc
--- old-head/src/ui.cc  2005-10-17 10:02:10.000000000 -0700
+++ new-head/src/ui.cc  2005-10-17 09:54:32.000000000 -0700
@@ -190,14 +190,14 @@ const char *default_pkgstatusdisplay="%d
 const char *default_pkgheaderdisplay="%N %n #%B %u %o";
 const char 
*default_grpstr="task,status,section(subdir,passthrough),section(topdir)";
 
-void ui_start_download()
+void ui_start_download(bool hide_preview)
 {
   active_download = true;
 
   if(apt_cache_file != NULL)
     (*apt_cache_file)->set_read_only(true);
 
-  if(active_preview.valid())
+  if(hide_preview && active_preview.valid())
     active_preview->destroy();
 }
 
@@ -1059,7 +1059,7 @@ void install_or_remove_packages()
   m->post_install_hook.connect(sigc::ptr_fun(&finish_install_run));
   m->post_forget_new_hook.connect(package_states_changed.make_slot());
 
-  (new ui_download_manager(m, false, false,
+  (new ui_download_manager(m, false, false, true,
                           _("Downloading packages"),
                           _("View the progress of the package download"),
                           _("Package Download")))->start();
@@ -1387,7 +1387,7 @@ void really_do_update_lists()
   m->pre_autoclean_hook.connect(sigc::bind(sigc::ptr_fun(lists_autoclean_msg),
                                           m));
   m->post_forget_new_hook.connect(package_states_changed.make_slot());
-  (new ui_download_manager(m, false, true,
+  (new ui_download_manager(m, false, true, false,
                           _("Updating package lists"),
                           _("View the progress of the package list update"),
                           _("List Update")))->start();
diff -rN -udp old-head/src/ui_download_manager.cc 
new-head/src/ui_download_manager.cc
--- old-head/src/ui_download_manager.cc 2005-10-17 10:02:10.000000000 -0700
+++ new-head/src/ui_download_manager.cc 2005-10-17 09:54:22.000000000 -0700
@@ -34,6 +34,7 @@
 ui_download_manager::ui_download_manager(download_manager *_manager,
                                         bool force_noninvasive,
                                         bool list_update,
+                                        bool hide_preview,
                                         const std::string &title,
                                         const std::string &longtitle,
                                         const std::string &tablabel)
@@ -50,7 +51,7 @@ ui_download_manager::ui_download_manager
   download_status = progpair.second;
   st              = new background_status(log);
 
-  ui_start_download();
+  ui_start_download(hide_preview);
 }
 
 ui_download_manager::~ui_download_manager()
diff -rN -udp old-head/src/ui_download_manager.h 
new-head/src/ui_download_manager.h
--- old-head/src/ui_download_manager.h  2005-10-17 10:02:10.000000000 -0700
+++ new-head/src/ui_download_manager.h  2005-10-17 09:54:09.000000000 -0700
@@ -82,6 +82,7 @@ public:
   ui_download_manager(download_manager *_manager,
                      bool force_noninvasive,
                      bool list_update,
+                     bool hide_preview,
                      const std::string &title,
                      const std::string &longtitle,
                      const std::string &tablabel);
diff -rN -udp old-head/src/ui.h new-head/src/ui.h
--- old-head/src/ui.h   2005-10-17 10:02:10.000000000 -0700
+++ new-head/src/ui.h   2005-10-17 09:51:14.000000000 -0700
@@ -295,8 +295,11 @@ void show_message(const std::string &msg
 /** Call this when a download starts; it sets the flag associated with
  *  the existence of a download, destroys the active preview (if any),
  *  and maeks the apt cache read-only.
+ *
+ *  \param hide_preview if \b true, the preview screen will be hidden
+ *  prior to starting the download.
  */
-void ui_start_download();
+void ui_start_download(bool hide_preview = true);
 
 /** Call this when a download finishes; it clears the flag associated
  *  with the existence of a download and puts the cache back into
diff -rN -udp old-head/src/view_changelog.cc new-head/src/view_changelog.cc
--- old-head/src/view_changelog.cc      2005-10-17 10:02:10.000000000 -0700
+++ new-head/src/view_changelog.cc      2005-10-17 09:54:38.000000000 -0700
@@ -221,7 +221,7 @@ void view_changelog(pkgCache::VerIterato
                                            
sigc::bind(sigc::ptr_fun(&do_view_changelog), pkgname, curverstr));
 
   if(manager != NULL)
-    (new ui_download_manager(manager, true, false,
+    (new ui_download_manager(manager, true, false, false,
                             _("Downloading Changelog"),
                             _(""),
                             _("Download Changelog")))->start();

Attachment: signature.asc
Description: Digital signature

Reply via email to