Author: kmachalkova
Date: Wed Apr 15 17:29:49 2009
New Revision: 56795
URL: http://svn.opensuse.org/viewcvs/yast?rev=56795&view=rev
Log:
checkin in Stano's and mine initial work on this:
menus and dialog heading are displayes, but without
sending the right events around so far
Added:
branches/tmp/bubli/ncurses/src/NCWizard.cc
branches/tmp/bubli/ncurses/src/NCWizard.h
Modified:
branches/tmp/bubli/ncurses/src/Makefile.am
branches/tmp/bubli/ncurses/src/NCOptionalWidgetFactory.cc
branches/tmp/bubli/ncurses/src/NCOptionalWidgetFactory.h
branches/tmp/bubli/ncurses/src/NCtoY2Event.cc
Modified: branches/tmp/bubli/ncurses/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/Makefile.am?rev=56795&r1=56794&r2=56795&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/Makefile.am (original)
+++ branches/tmp/bubli/ncurses/src/Makefile.am Wed Apr 15 17:29:49 2009
@@ -92,7 +92,8 @@
NCAskForFile.h \
NCstyle.braille.h NCstyle.mono.h \
NCstyle.linux.h NCstyle.xterm.h \
- NCstyle.rxvt.h
+ NCstyle.rxvt.h \
+ NCWizard.h
install-pkgincludeHEADERS: $(pkgi/nclude_HEADERS)
@$(NORMAL_INSTALL)
@@ -173,7 +174,8 @@
NCPopupTextEntry.cc \
NCPopupInfo.cc \
NCAskForDirectory.cc \
- NCAskForFile.cc
+ NCAskForFile.cc \
+ NCWizard.cc
INCLUDES = -I$(includedir) -I$(includedir)/yui -I$(includedir)/ycp-ui
Modified: branches/tmp/bubli/ncurses/src/NCOptionalWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCOptionalWidgetFactory.cc?rev=56795&r1=56794&r2=56795&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCOptionalWidgetFactory.cc (original)
+++ branches/tmp/bubli/ncurses/src/NCOptionalWidgetFactory.cc Wed Apr 15 17:29:49 2009
@@ -51,5 +51,22 @@
return dumbTab;
}
+bool NCOptionalWidgetFactory::hasWizard()
+{
+ return true;
+}
+
+NCWizard *NCOptionalWidgetFactory::createWizard( YWidget * parent,
+ const string & backButtonLabel,
+ const string & abortButtonLabel,
+ const string & nextButtonLabel,
+ YWizardMode wizardMode)
+{
+ NCWizard * wizard = new NCWizard( parent, backButtonLabel, abortButtonLabel, nextButtonLabel, wizardMode );
+ YUI_CHECK_NEW( wizard );
+
+ return wizard;
+}
+
Modified: branches/tmp/bubli/ncurses/src/NCOptionalWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCOptionalWidgetFactory.h?rev=56795&r1=56794&r2=56795&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCOptionalWidgetFactory.h (original)
+++ branches/tmp/bubli/ncurses/src/NCOptionalWidgetFactory.h Wed Apr 15 17:29:49 2009
@@ -21,6 +21,7 @@
#include "YOptionalWidgetFactory.h"
#include "NCDumbTab.h"
+#include "NCWizard.h"
/**
@@ -58,9 +59,15 @@
virtual ~NCOptionalWidgetFactory();
bool hasDumbTab();
-
NCDumbTab *createDumbTab( YWidget * parent );
-
+
+ bool hasWizard();
+ NCWizard *createWizard( YWidget * parent,
+ const string & backButtonLabel,
+ const string & abortButtonLabel,
+ const string & nextButtonLabel,
+ YWizardMode wizardMode = YWizardMode_Standard );
+
}; // class NCOptionalWidgetFactory
Added: branches/tmp/bubli/ncurses/src/NCWizard.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCWizard.cc?rev=56795&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCWizard.cc (added)
+++ branches/tmp/bubli/ncurses/src/NCWizard.cc Wed Apr 15 17:29:49 2009
@@ -0,0 +1,394 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCWizard.cc
+
+ Authors: Stanislav Visnovsky
+ Bubli
+
+/-*/
+
+#include "NCWizard.h"
+#include "NCLabel.h"
+#include "NCLayoutBox.h"
+#include "NCSpacing.h"
+#include "NCAlignment.h"
+#include "NCi18n.h"
+#include "NCTree.h"
+#include "NCMenuButton.h"
+#include
+
+#define YUILogComponent "ncurses"
+#include
+
+NCWizardTreeItem::NCWizardTreeItem( YTreeItem* parent, string text, string id )
+ : YMenuItem( (YMenuItem*)parent, text )
+ , _id( id )
+{}
+
+NCWizardTreeItem::NCWizardTreeItem( string text, string id )
+ : YMenuItem( text )
+ , _id( id )
+{}
+
+class NCWizardTree: public NCTree {
+public:
+ NCWizardTree( YWidget * parent, const string & label ) : NCTree( parent, label )
+ {}
+
+ virtual ~NCWizardTree()
+ {}
+
+ virtual NCursesEvent wHandleInput( wint_t key )
+ {
+ NCursesEvent res = NCTree::wHandleInput(key);
+
+ // transform to menu event
+ // FIXME: check if we should
+
+ res = NCursesEvent::menu;
+ res.selection = (YMenuItem*)getCurrentItem();
+ return res;
+ }
+};
+
+NCWizard::NCWizard( YWidget * parent,
+ const string & backButtonLabel,
+ const string & abortButtonLabel,
+ const string & nextButtonLabel,
+ YWizardMode wizardMode )
+ : YWizard(parent, backButtonLabel, abortButtonLabel, nextButtonLabel, wizardMode)
+ , NCWidget( parent )
+ , _menu(0)
+ , _stepsArea(0)
+ , _treeArea(0)
+ , _helpText("")
+ , _currentStep("")
+{
+ NCLayoutBox* box = NULL;
+ switch( wizardMode ) {
+ case YWizardMode_Standard:
+ // no additional widget on the left
+ _box = new NCLayoutBox( this, YD_VERT );
+ box = _box;
+ break;
+ case YWizardMode_Steps:
+ // show step text on the left
+ _box = new NCLayoutBox( this, YD_HORIZ );
+ _stepsArea = new NCLabel( new NCAlignment( _box, YAlignBegin, YAlignBegin ), "" );
+ box = new NCLayoutBox( _box, YD_VERT );
+ break;
+ case YWizardMode_Tree:
+ // show tree on the left
+ _box = new NCLayoutBox( this, YD_HORIZ );
+ _treeArea = new NCWizardTree( _box, "" );
+ _treeArea->setNotify( true );
+ _treeArea->setImmediateMode( true );
+ box = new NCLayoutBox( _box, YD_VERT );
+ break;
+ }
+
+ // menu replacepoint
+ _menuPoint = new NCReplacePoint( box );
+ new NCSpacing( _menuPoint, YD_VERT, false, 2);
+
+ // heading
+ _heading = new NCLabel (new NCAlignment( box, YAlignBegin, YAlignBegin ), "", true, false );
+
+ _contents = new NCReplacePoint( box );
+
+ // stretch between replace point and buttons
+ new NCSpacing(box, YD_VERT, true);
+
+ box = new NCLayoutBox( box, YD_HORIZ );
+
+ // translators: Help button of the wizard widget
+ _helpButton = new NCPushButton( box, _("&Help") );
+
+ new NCSpacing(box, YD_HORIZ, true);
+
+ // FIXME: handle empty Back label as hide
+ _backButton = new NCPushButton( box, backButtonLabel );
+ new NCSpacing(box, YD_HORIZ, false,1);
+ _abortButton = new NCPushButton( box, abortButtonLabel );
+ new NCSpacing(box, YD_HORIZ, false,1);
+ _nextButton = new NCPushButton( box, nextButtonLabel );
+
+ _nextButton->setKeyboardFocus();
+}
+
+NCWizard::~NCWizard()
+{
+ // FIXME: free stuff
+}
+
+void NCWizard::setHelpText( const string & helpText )
+{
+ // FIXME: replace product macro
+ _helpText = helpText;
+}
+
+void NCWizard::setDialogIcon( const string & iconName )
+{
+ // noop for ncurses
+}
+
+
+void NCWizard::setDialogTitle( const string & titleText )
+{
+ // FIXME: keep the host name feature!
+ NCurses::SetTitle( titleText );
+}
+
+
+void NCWizard::setDialogHeading( const string & headingText )
+{
+ _heading->setText( headingText );
+ _heading->setSize( headingText.size(), 1);
+}
+
+void NCWizard::addStep( const string & text, const string & id )
+{
+ _steps.push_back( WizardStep(text,id) );
+ updateSteps();
+}
+void NCWizard::addStepHeading( const string & text )
+{
+ _steps.push_back( WizardStep(text,"",true) );
+ updateSteps();
+}
+
+void NCWizard::deleteSteps()
+{
+ _steps.clear();
+ updateSteps();
+}
+
+void NCWizard::setCurrentStep( const string & id )
+{
+ _currentStep = id;
+ updateSteps();
+}
+
+void NCWizard::updateSteps()
+{
+ if( wizardMode() != YWizardMode_Steps )
+ return;
+
+ // FIXME: this should be done via NCPad, not NCLabel
+ string stepsText = "";
+ string mark = "[x]";
+
+ // generate the new text
+ for( list<WizardStep>::const_iterator item = _steps.begin(); item != _steps.end(); item++ )
+ {
+ if( item->id == _currentStep )
+ mark = "-> ";
+
+ stepsText += "\n";
+
+ if( ! item->heading )
+ stepsText += mark;
+
+ stepsText += item->text;
+
+ if( item->id == _currentStep )
+ mark = " ";
+ }
+
+ _stepsArea->setText(stepsText);
+}
+
+void NCWizard::addTreeItem( const string & parentID,
+ const string & text,
+ const string & id )
+{
+
+ YTreeItem* item = NULL;
+
+
+ if( parentID.empty() )
+ {
+ item = new NCWizardTreeItem( text, id );
+
+ // add as root item
+ _treeArea->addItem( item );
+ }
+ else
+ {
+ YItem* parent = _treeItems[parentID];
+ if( !parent )
+ {
+ yuiError() << "Non-existent parent '" << parentID << "', ignoring item '" << id << "'" << endl;
+ return;
+ }
+
+ item = new NCWizardTreeItem( dynamic_cast(parent), text, id );
+ }
+
+ _treeItems[id] = item;
+
+ _treeArea->rebuildTree();
+}
+
+void NCWizard::selectTreeItem( const string & id )
+{
+ YItem* item = _treeItems[id];
+
+ if( _treeArea && item )
+ _treeArea->selectItem( item, true );
+}
+
+string NCWizard::currentTreeSelection()
+{
+
+ if( _treeArea && _treeArea->hasSelectedItem() )
+ {
+ YItem* item = _treeArea->selectedItem();
+
+ for( std::map::const_iterator i = _treeItems.begin(); i != _treeItems.end(); i++)
+ if( i->second == item )
+ {
+ return i->first;
+ }
+ }
+
+ // not found or nothing selected
+ return "";
+}
+
+void NCWizard::deleteTreeItems()
+{
+ if( _treeArea )
+ _treeArea->deleteAllItems();
+
+ _treeItems.clear();
+}
+
+void NCWizard::addMenu( const string & text,
+ const string & id )
+{
+ if( ! _menu )
+ {
+ YWidget* replaceChild = _menuPoint->firstChild();
+ wrect oldSize = dynamic_cast(replaceChild)->wGetSize();
+ delete replaceChild;
+
+ _menu = new NCLayoutBox( _menuPoint, YD_HORIZ );
+ _menu->setSize(oldSize.Sze.W, oldSize.Sze.H );
+ pos = 0;
+ }
+
+ NCMenuButton* newmenu = new NCMenuButton( _menu, text );
+ newmenu->setSize(newmenu->wGetDefsze().W, newmenu->wGetDefsze().H);
+
+ _menu->moveChild( newmenu, pos, 0);
+ pos += newmenu->wGetDefsze().W + 3;
+ _menu->Redraw();
+
+ _topLevelMenus[id] = newmenu;
+
+}
+
+void NCWizard::addSubMenu( const string & parentMenuID,
+ const string & text,
+ const string & id )
+{
+ addMenuEntry ( parentMenuID, text, id);
+}
+
+void NCWizard::addMenuEntry( const string & parentMenuID,
+ const string & text,
+ const string & id )
+{
+ if( _topLevelMenus.find(parentMenuID) != _topLevelMenus.end())
+ {
+ YMenuItem* item = new YMenuItem( text );
+ _topLevelMenus[parentMenuID]->addItem( item );
+ _menuItemIDs[id] = item;
+ }
+ else if( _menuItemIDs.find(parentMenuID) != _menuItemIDs.end())
+ {
+ YMenuItem* item = new YMenuItem( _menuItemIDs[parentMenuID], text );
+ _menuItemIDs[id] = item;
+ }
+ else
+ yuiError() << "Skipping adding submenu to non-existent '" << parentMenuID << "'" << endl;
+}
+
+void NCWizard::addMenuSeparator( const string & parentMenuID )
+{
+ addMenuEntry( parentMenuID, " ", "");
+}
+
+void NCWizard::deleteMenus()
+{
+ if( _menu )
+ {
+ // delete the collection
+ _topLevelMenus.clear();
+
+ delete _menu; // it will remove the box from replacepoint
+ _menu = 0;
+ }
+}
+
+void NCWizard::showReleaseNotesButton( const string & label,
+ const string & id )
+{
+ // not supported
+ return;
+}
+
+void NCWizard::hideReleaseNotesButton()
+{
+ // not supported
+ return;
+}
+
+void NCWizard::retranslateInternalButtons()
+{
+ // FIXME: retranslate Help button
+ return;
+}
+
+void NCWizard::setEnabled(bool enabled)
+{
+ YWizard::setEnabled( enabled );
+ NCWidget::setEnabled( enabled );
+}
+
+int NCWizard::preferredWidth()
+{
+ return NCurses::cols();
+}
+
+int NCWizard::preferredHeight()
+{
+ return NCurses::lines();
+}
+
+void NCWizard::setSize(int newheight, int newwidth)
+{
+ wRelocate( wpos( 0 ), wsze( newwidth, newheight ) );
+ _box->setSize(newheight, newwidth);
+}
+
+NCursesEvent NCWizard::wHandleInput( wint_t key )
+{
+ if( _treeArea )
+ {
+ return _treeArea->wHandleInput( key );
+ }
+
+ return NCursesEvent::none;
+}
Added: branches/tmp/bubli/ncurses/src/NCWizard.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCWizard.h?rev=56795&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCWizard.h (added)
+++ branches/tmp/bubli/ncurses/src/NCWizard.h Wed Apr 15 17:29:49 2009
@@ -0,0 +1,340 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCWizard.h
+
+ Authors: Stanislav Visnovsky
+ Bubli
+
+/-*/
+
+#ifndef NCWizard_h
+#define NCWizard_h
+
+#include <list>
+
+#include "NCWidget.h"
+#include "NCPushButton.h"
+#include "NCReplacePoint.h"
+#include "YWizard.h"
+
+class NCLayoutBox;
+class NCLabel;
+class NCMenuButton;
+class NCTree;
+class YItem;
+class YMenuItem;
+
+struct WizardStep {
+ string text;
+ string id;
+ bool heading;
+
+ WizardStep( string _text, string _id, bool _heading = false )
+ : text( _text )
+ , id( _id )
+ , heading( _heading )
+ {}
+};
+
+class NCWizardTreeItem: public YMenuItem {
+public:
+ NCWizardTreeItem( YTreeItem* parent, string text, string id );
+
+ NCWizardTreeItem( string text, string id );
+
+ const string id() { return _id; }
+private:
+ string _id;
+};
+
+
+/**
+ * A wizard is a more complex frame typically used for multi-step workflows:
+ *
+ * +------------+------------------------------------------------+
+ * | | |
+ * | | |
+ * | | |
+ * | | |
+ * | | |
+ * | | |
+ * | | |
+ * | | |
+ * | Side bar | Content Area |
+ * | | (YReplacePoint) |
+ * | | |
+ * | | |
+ * | | |
+ * | | |
+ * | | |
+ * | | |
+ * | | [Back] [Abort] [Next] |
+ * +------------+------------------------------------------------+
+ *
+ * The side bar can contain help text, a list of steps that are performed, or
+ * an embedded tree (much like the YTree widget).
+ *
+ * The client application creates the wizard and replaces the widget in the
+ * content area for each step.
+ *
+ * The wizard buttons can theoretically be used to do anything, but good UI
+ * design will stick to the model above: [Back], [Abort], [Next].
+ *
+ * If only two buttons are desired, leave the [Back] button's label emtpy. The
+ * remaining two buttons will be rearranged accordingly in the button area.
+ *
+ * In the last step of a multi-step workflow, the [Next] button's label is
+ * customarily replaced with a label that indicates that this is the last
+ * step. [Accept] is recommended for that button label: [Finish] (as sometimes
+ * used in other environments) by no means clearly indicates that this is the
+ * positive ending, the final "do it" button. Worse, translations of that are
+ * often downright miserable: To German, [Finish] gets translated as [Beenden]
+ * which is the same word as "Quit" (used in menus). This does not at all tell
+ * the user that that button really performs the requested action the
+ * multi-step wizard is all about.
+ **/
+class NCWizard: public YWizard, public NCWidget
+{
+public:
+ /**
+ * Constructor.
+ *
+ * If only two buttons are desired, leave 'backButtonLabel' empty.
+ **/
+ NCWizard( YWidget * parent,
+ const string & backButtonLabel,
+ const string & abortButtonLabel,
+ const string & nextButtonLabel,
+ YWizardMode wizardMode = YWizardMode_Standard );
+
+ /**
+ * Destructor.
+ **/
+ virtual ~NCWizard();
+
+ /**
+ * Returns a descriptive name of this widget class for logging,
+ * debugging etc.
+ **/
+ virtual const char * widgetClass() const { return "YWizard"; }
+
+ // stuff from YWidget
+ virtual void setEnabled(bool);
+
+ virtual int preferredWidth();
+
+ virtual int preferredHeight();
+
+ virtual void setSize(int, int);
+
+ //
+ // Wizard basics
+ //
+
+ /**
+ * Return the wizard buttons or 0 if there is no such button.
+ *
+ * Derived classes are required to implement this.
+ **/
+ virtual YPushButton * backButton() const { return _backButton; }
+ virtual YPushButton * abortButton() const { return _abortButton; }
+ virtual YPushButton * nextButton() const { return _nextButton; }
+
+ /**
+ * Return the internal contents ReplacePoint.
+ *
+ * Derived classes are required to implement this.
+ **/
+ virtual YReplacePoint * contentsReplacePoint() const { return _contents; }
+
+ /**
+ * Set the help text.
+ **/
+ virtual void setHelpText( const string & helpText );
+
+ /**
+ * Set the dialog icon. An empty icon name clears the current icon.
+ **/
+ virtual void setDialogIcon( const string & iconName );
+
+ /**
+ * Set the dialog title shown in the window manager's title bar.
+ An empty string clears the current title.
+ **/
+ virtual void setDialogTitle( const string & titleText );
+
+ /**
+ * Set the dialog heading.
+ **/
+ virtual void setDialogHeading( const string & headingText );
+
+
+ //
+ // Steps handling
+ //
+
+ /**
+ * Add a step for the steps panel on the side bar.
+ * This only adds the step to the internal list of steps.
+ * The display is only updated upon calling updateSteps().
+ **/
+ virtual void addStep( const string & text, const string & id );
+
+ /**
+ * Add a step heading for the steps panel on the side bar.
+ * This only adds the heading to the internal list of steps.
+ * The display is only updated upon calling updateSteps().
+ **/
+ virtual void addStepHeading( const string & text );
+
+ /**
+ * Delete all steps and step headings from the internal lists.
+ * The display is only updated upon calling updateSteps().
+ **/
+ virtual void deleteSteps();
+
+ /**
+ * Set the current step. This also triggers updateSteps() if necessary.
+ **/
+ virtual void setCurrentStep( const string & id );
+
+ /**
+ * Update the steps display: Reflect the internal steps and heading lists
+ * in the layout.
+ **/
+ virtual void updateSteps();
+
+
+ //
+ // Tree handling
+ //
+
+ /**
+ * Add a tree item. If "parentID" is an empty string, it will be a root
+ * item. 'text' is the text that will be displayed in the tree, 'id' the ID
+ * with which this newly created item can be referenced - and that will be
+ * returned when the user clicks on a tree item.
+ **/
+ virtual void addTreeItem( const string & parentID,
+ const string & text,
+ const string & id );
+
+ /**
+ * Select the tree item with the specified ID, if such an item exists.
+ **/
+ virtual void selectTreeItem( const string & id );
+
+ /**
+ * Returns the current tree selection or an empty string if nothing is
+ * selected or there is no tree.
+ **/
+ virtual string currentTreeSelection();
+
+ /**
+ * Delete all tree items.
+ **/
+ virtual void deleteTreeItems();
+
+
+ //
+ // Menu handling
+ //
+
+ /**
+ * Add a menu to the menu bar. If the menu bar is not visible yet, it will
+ * be made visible. 'text' is the user-visible text for the menu bar
+ * (including keyboard shortcuts marked with '&'), 'id' is the menu ID for
+ * later addMenuEntry() etc. calls.
+ **/
+ virtual void addMenu( const string & text,
+ const string & id );
+
+ /**
+ * Add a submenu to the menu with ID 'parentMenuID'.
+ **/
+ virtual void addSubMenu( const string & parentMenuID,
+ const string & text,
+ const string & id );
+
+ /**
+ * Add a menu entry to the menu with ID 'parentMenuID'. 'id' is what will
+ * be returned by UI::UserInput() etc. when a user activates this menu entry.
+ **/
+ virtual void addMenuEntry( const string & parentMenuID,
+ const string & text,
+ const string & id );
+
+ /**
+ * Add a menu separator to a menu.
+ **/
+ virtual void addMenuSeparator( const string & parentMenuID );
+
+ /**
+ * Delete all menus and hide the menu bar.
+ **/
+ virtual void deleteMenus();
+
+ /**
+ * Show a "Release Notes" button above the "Help" button in the steps panel
+ * with the specified label that will return the specified id to
+ * UI::UserInput() when clicked.
+ **/
+ virtual void showReleaseNotesButton( const string & label,
+ const string & id );
+
+ //
+ // Misc
+ //
+
+ /**
+ * Hide an existing "Release Notes" button.
+ **/
+ virtual void hideReleaseNotesButton();
+
+ /**
+ * Retranslate internal buttons that are not accessible from the outside:
+ * - [Help]
+ * - [Steps]
+ * - [Tree]
+ **/
+ virtual void retranslateInternalButtons();
+
+ virtual NCursesEvent wHandleInput( wint_t key );
+
+private:
+ NCPushButton* _helpButton;
+ NCPushButton* _nextButton;
+ NCPushButton* _backButton;
+ NCPushButton* _abortButton;
+ NCReplacePoint* _contents;
+ NCReplacePoint* _menuPoint;
+ NCLayoutBox* _menu;
+ NCLayoutBox* _box;
+ NCLabel* _heading;
+ NCLabel* _stepsArea;
+ NCTree* _treeArea;
+
+ string _helpText;
+
+ string _currentStep;
+ std::list<WizardStep> _steps;
+
+ std::map _treeItems;
+
+ std::map _topLevelMenus;
+ std::map _menuItemIDs;
+ int pos;
+};
+
+#endif
+
Modified: branches/tmp/bubli/ncurses/src/NCtoY2Event.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCtoY2Event.cc?rev=56795&r1=56794&r2=56795&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCtoY2Event.cc (original)
+++ branches/tmp/bubli/ncurses/src/NCtoY2Event.cc Wed Apr 15 17:29:49 2009
@@ -19,6 +19,7 @@
#include "NCtoY2Event.h"
#include "NCWidget.h"
+#include "NCWizard.h"
#define YUILogComponent "ncurses"
#include
@@ -59,7 +60,17 @@
case menu:
if ( selection )
- return new YMenuEvent( selection );
+ {
+ yuiDebug() << "Selection of event: " << selection << endl;
+
+ NCWizardTreeItem *wiz = dynamic_cast(selection);
+
+ yuiDebug() << "Wizard tree item: " << wiz << endl;
+ if( wiz )
+ return new YMenuEvent( wiz->id () );
+ else
+ return new YMenuEvent( selection );
+ }
else
return 0;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org