diff options
author | Daniel Burrows <dburrows@debian.org> | 2008-03-29 11:38:47 -0700 |
---|---|---|
committer | Daniel Burrows <dburrows@debian.org> | 2008-03-29 11:38:47 -0700 |
commit | 616e362c0cc62d7047875f4043d75d0d815700b8 (patch) | |
tree | aff8c191a6da12f88823a37fa0126e83f8604d7c /src/pkg_view.cc | |
parent | eeeb112c9164f989c98824dbfb11d3747f68f248 (diff) | |
download | aptitude-616e362c0cc62d7047875f4043d75d0d815700b8.tar.gz |
Create an explicit menu entry for cycling the information display.
Hopefully this will make it a bit more obvious that the information
display can be cycled; I have the general feeling that this is an
"invisible" feature at the moment.
Diffstat (limited to 'src/pkg_view.cc')
-rw-r--r-- | src/pkg_view.cc | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/pkg_view.cc b/src/pkg_view.cc index 05861aca..976d1b63 100644 --- a/src/pkg_view.cc +++ b/src/pkg_view.cc @@ -497,6 +497,46 @@ public: typedef cw::util::ref_ptr<info_area_multiplex> info_area_multiplex_ref; +namespace +{ + bool view_is_active(cw::widget_ref view) + { + cw::util::ref_ptr<cw::container> owner = view->get_owner(); + + while(owner.valid()) + { + if(owner->get_active_widget() != view) + return false; + + view = owner; + owner = view->get_owner(); + } + + return true; + } + + bool do_info_multiplex_cycle_information_active(cw::widget &valveBare) + { + cw::widget_ref valve(&valveBare); + return view_is_active(valve); + } + + bool do_info_multiplex_cycle_information(cw::widget &valveBare, + info_area_multiplex &multiplexBare) + { + cw::widget_ref valve(&valveBare); + info_area_multiplex_ref multiplex(&multiplexBare); + + if(!view_is_active(valve)) + return false; + else + { + multiplex->cycle(); + return true; + } + } +} + cw::widget_ref make_package_view(list<package_view_item> &format, const cw::widget_ref &mainwidget, menu_redirect *menu_handler, @@ -606,6 +646,9 @@ cw::widget_ref make_package_view(list<package_view_item> &format, sigc::bind(sigc::mem_fun(*rval.unsafe_get_ref(), &cw::table::focus_widget_bare), m.weak_ref())); + package_cycle_information_enabled.connect(sigc::bind(sigc::ptr_fun(do_info_multiplex_cycle_information_active), rval.weak_ref())); + package_cycle_information.connect(sigc::bind(sigc::ptr_fun(do_info_multiplex_cycle_information), rval.weak_ref(), m.weak_ref())); + e->hidden_sig.connect(sigc::bind(sigc::mem_fun(*rval.unsafe_get_ref(), &cw::table::focus_widget_bare), mainwidget.weak_ref())); |