[Aptitude-svn-commit] r4219 - in branches/aptitude-0.3/aptitude: .
src
Daniel Burrows
dburrows at costa.debian.org
Sat Sep 24 04:59:06 UTC 2005
Author: dburrows
Date: Sat Sep 24 04:59:03 2005
New Revision: 4219
Modified:
branches/aptitude-0.3/aptitude/ChangeLog
branches/aptitude-0.3/aptitude/src/menu_redirect.cc
branches/aptitude-0.3/aptitude/src/menu_redirect.h
Log:
Add menu_redirect hooks for the undo command.
Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog (original)
+++ branches/aptitude-0.3/aptitude/ChangeLog Sat Sep 24 04:59:03 2005
@@ -1,5 +1,9 @@
2005-09-23 Daniel Burrows <dburrows at debian.org>
+ * src/menu_redirect.cc, src/menu_redirect.h:
+
+ Add menu_redirect hooks for the "undo" command.
+
* src/ui.cc, src/ui.h:
Connect undo() through a signal instead of directly. For now
Modified: branches/aptitude-0.3/aptitude/src/menu_redirect.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/menu_redirect.cc (original)
+++ branches/aptitude-0.3/aptitude/src/menu_redirect.cc Sat Sep 24 04:59:03 2005
@@ -26,6 +26,8 @@
#include <vscreen/ref_ptr.h>
#include <vscreen/vs_container.h>
+bool menu_redirect::undo_undo_enabled() { return false; }
+bool menu_redirect::undo_undo() { return false; }
bool menu_redirect::package_enabled() { return false; }
bool menu_redirect::package_install() { return false; }
bool menu_redirect::package_remove() { return false; }
@@ -81,10 +83,16 @@
void create_menu_bindings(menu_redirect *menu_handler,
const ref_ptr<vscreen_widget> &valve)
{
- // Connect the appropriate signals..
+ undo_undo_enabled.connect(sigc::bind(ptr_fun(do_menu_callback,
+ valve.weak_ref(),
+ menu_handler,
+ &menu_redirect::undo_undo_enabled)));
+
+ undo_undo.connect(sigc::bind(ptr_fun(do_menu_callback,
+ valve.weak_ref(),
+ menu_handler,
+ &menu_redirect::undo_undo)));
- // TODO: need to change the condition for enabling the menu to
- // check whether the overall widget is visible...
package_menu_enabled.connect(sigc::bind(sigc::ptr_fun(do_menu_callback),
valve.weak_ref(),
menu_handler,
Modified: branches/aptitude-0.3/aptitude/src/menu_redirect.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/menu_redirect.h (original)
+++ branches/aptitude-0.3/aptitude/src/menu_redirect.h Sat Sep 24 04:59:03 2005
@@ -13,6 +13,12 @@
class menu_redirect:virtual public sigc::trackable
{
public:
+ /** \return \b true if the 'undo' command should be enabled. */
+ virtual bool undo_undo_enabled();
+
+ /** Perform the 'undo' command. */
+ virtual bool undo_undo();
+
/** \return \b true iff the package commands should be enabled. */
virtual bool package_enabled();
More information about the Aptitude-svn-commit
mailing list