[Aptitude-svn-commit] r4194 - in branches/aptitude-0.3/aptitude: .
src
Daniel Burrows
dburrows at costa.debian.org
Thu Sep 22 23:37:27 UTC 2005
Author: dburrows
Date: Thu Sep 22 23:37:25 2005
New Revision: 4194
Modified:
branches/aptitude-0.3/aptitude/ChangeLog
branches/aptitude-0.3/aptitude/src/solution_item.cc
branches/aptitude-0.3/aptitude/src/solution_item.h
Log:
Split the key responses off into public methods.
Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog (original)
+++ branches/aptitude-0.3/aptitude/ChangeLog Thu Sep 22 23:37:25 2005
@@ -1,5 +1,9 @@
2005-09-22 Daniel Burrows <dburrows at debian.org>
+ * src/solution_item.cc, src/solution_item.h:
+
+ Split the key response actions into public methods.
+
* src/Makefile.am, src/apt_info_tree.h, src/load_grouppolicy.cc, src/menu_tree.cc, src/menu_tree.h, src/pkg_tree.cc, src/pkg_tree.h, src/solution_screen.cc, src/ui.cc:
Rename pkg_menu_tree to menu_tree and split it into a separate
Modified: branches/aptitude-0.3/aptitude/src/solution_item.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/solution_item.cc (original)
+++ branches/aptitude-0.3/aptitude/src/solution_item.cc Thu Sep 22 23:37:25 2005
@@ -160,23 +160,9 @@
bool solution_item::dispatch_key(const key &k, vs_tree *owner)
{
if(global_bindings.key_matches(k, "SolutionActionReject"))
- {
- if(is_rejected())
- unreject();
- else
- reject();
-
- owner->line_down();
- }
+ toggle_rejected();
else if(global_bindings.key_matches(k, "SolutionActionApprove"))
- {
- if(is_mandatory())
- unmandate();
- else
- mandate();
-
- owner->line_down();
- }
+ toggle_mandated();
else
return vs_treeitem::dispatch_key(k, owner);
@@ -243,24 +229,29 @@
set_active_dep(aptitude_resolver_dep());
}
-bool solution_act_item::dispatch_key(const key &k, vs_tree *owner)
+void solution_act_item::show_target_info()
{
- if(global_bindings.key_matches(k, "InfoScreen"))
- {
- pkgCache::VerIterator real_ver = ver.get_ver();
- pkgCache::PkgIterator pkg = ver.get_pkg();
+ pkgCache::VerIterator real_ver = ver.get_ver();
+ pkgCache::PkgIterator pkg = ver.get_pkg();
- if(real_ver.end())
- real_ver = ver.get_package().current_version().get_ver();
+ if(real_ver.end())
+ real_ver = ver.get_package().current_version().get_ver();
- if(real_ver.end())
- real_ver = pkg.VersionList();
+ if(real_ver.end())
+ real_ver = pkg.VersionList();
- // Show information about the corresponding package/version.
- insert_main_widget(make_info_screen(pkg, real_ver),
- ssprintf(_("%s info"), pkg.Name()),
- "",
- ssprintf(_("Information about %s"), pkg.Name()));
+ // Show information about the corresponding package/version.
+ insert_main_widget(make_info_screen(pkg, real_ver),
+ ssprintf(_("%s info"), pkg.Name()),
+ "",
+ ssprintf(_("Information about %s"), pkg.Name()));
+}
+
+bool solution_act_item::dispatch_key(const key &k, vs_tree *owner)
+{
+ if(global_bindings.key_matches(k, "InfoScreen"))
+ {
+ show_target_info();
return true;
}
else
Modified: branches/aptitude-0.3/aptitude/src/solution_item.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/solution_item.h (original)
+++ branches/aptitude-0.3/aptitude/src/solution_item.h Thu Sep 22 23:37:25 2005
@@ -56,6 +56,22 @@
/** Make this item not mandatory. */
virtual void unmandate() = 0;
+ void toggle_rejected()
+ {
+ if(!is_rejected())
+ reject();
+ else
+ unreject();
+ }
+
+ void toggle_mandated()
+ {
+ if(!is_mandatory())
+ mandate();
+ else
+ unmandate();
+ }
+
style get_normal_style();
bool dispatch_key(const key &k, vs_tree *owner);
@@ -105,6 +121,8 @@
void unmandate();
+ void show_target_info();
+
void highlighted(vs_tree *win);
void unhighlighted(vs_tree *win);
More information about the Aptitude-svn-commit
mailing list