Author: kmachalkova
Date: Wed Feb 6 09:56:11 2008
New Revision: 44178
URL: http://svn.opensuse.org/viewcvs/yast?rev=44178&view=rev
Log:
er, ehm ..
Added:
branches/tmp/bubli/ncurses/src/NCtoY2Event.cc
branches/tmp/bubli/ncurses/src/NCtoY2Event.h
Modified:
branches/tmp/bubli/ncurses/VERSION
branches/tmp/bubli/ncurses/package/yast2-ncurses.changes
branches/tmp/bubli/ncurses/src/Makefile.am
branches/tmp/bubli/ncurses/src/NCApplication.cc
branches/tmp/bubli/ncurses/src/NCApplication.h
branches/tmp/bubli/ncurses/src/NCAskForDirectory.cc
branches/tmp/bubli/ncurses/src/NCAskForFile.cc
branches/tmp/bubli/ncurses/src/NCBusyIndicator.cc
branches/tmp/bubli/ncurses/src/NCDialog.cc
branches/tmp/bubli/ncurses/src/NCDialog.h
branches/tmp/bubli/ncurses/src/NCMenuButton.cc
branches/tmp/bubli/ncurses/src/NCPopupInfo.cc
branches/tmp/bubli/ncurses/src/NCRichText.cc
branches/tmp/bubli/ncurses/src/YNCursesUI.cc
branches/tmp/bubli/ncurses/src/YNCursesUI.h
branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupDeps.cc
branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupDescr.cc
branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupDiskspace.cc
branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupRepo.cc
branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupSearch.cc
branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupSelection.cc
branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupTable.cc
branches/tmp/bubli/ncurses/yast2-ncurses.spec.in
Modified: branches/tmp/bubli/ncurses/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/VERSION?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/VERSION (original)
+++ branches/tmp/bubli/ncurses/VERSION Wed Feb 6 09:56:11 2008
@@ -1 +1 @@
-2.16.12
+2.16.14
Modified: branches/tmp/bubli/ncurses/package/yast2-ncurses.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/package/yast2-ncurses.changes?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/package/yast2-ncurses.changes (original)
+++ branches/tmp/bubli/ncurses/package/yast2-ncurses.changes Wed Feb 6 09:56:11 2008
@@ -1,4 +1,16 @@
-------------------------------------------------------------------
+Fri Feb 1 15:49:47 CET 2008 - sh@suse.de
+
+- Moved event handling from YUI / YNCursesUI to YDialog / NCDialog
+- V 2.16.14
+
+-------------------------------------------------------------------
+Thu Jan 31 15:27:49 CET 2008 - sh@suse.de
+
+- Simplified dialog handling
+- V 2.16.13
+
+-------------------------------------------------------------------
Thu Jan 31 14:22:36 CET 2008 - kmachalkova@suse.cz
- Align numbers in IntFields to the right margin of the label, not
Modified: branches/tmp/bubli/ncurses/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/Makefile.am?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/Makefile.am (original)
+++ branches/tmp/bubli/ncurses/src/Makefile.am Wed Feb 6 09:56:11 2008
@@ -31,6 +31,7 @@
tnode.h \
position.h \
YNCursesUI.h \
+ NCtoY2Event.h \
NCApplication.h \
NCWidgetFactory.h \
NCOptionalWidgetFactory.h \
@@ -101,6 +102,7 @@
Y2Log.cc \
position.cc \
YNCursesUI.cc \
+ NCtoY2Event.cc \
NCApplication.cc \
NCWidgetFactory.cc \
NCOptionalWidgetFactory.cc \
Modified: branches/tmp/bubli/ncurses/src/NCApplication.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCApplication.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCApplication.cc (original)
+++ branches/tmp/bubli/ncurses/src/NCApplication.cc Wed Feb 6 09:56:11 2008
@@ -10,15 +10,19 @@
| (C) SuSE GmbH |
\----------------------------------------------------------------------/
- File: NCApplication.cc
+ File: NCApplication.cc
- Author: Gabriele Mohr
+ Authors: Gabriele Mohr
+ Stefan Hundhammer
/-*/
+#include
+
#include "Y2Log.h"
#include "NCurses.h"
+#include "YNCursesUI.h"
#include "NCApplication.h"
#include "NCAskForDirectory.h"
#include "NCAskForFile.h"
@@ -94,3 +98,81 @@
return retEvent.result;
}
+
+/**
+ * Run external program supplied as string parameter the same terminal.
+ **/
+int
+NCApplication::runInTerminal( const string & cmd )
+{
+ int ret;
+
+ // Save tty modes and end ncurses mode temporarily
+ ::def_prog_mode();
+ ::endwin();
+
+ // Regenerate saved stdout and stderr, so that app called
+ // via system() can use them and draw something to the terminal
+ dup2( YNCursesUI::ui()->stdout_save, 1 );
+ dup2( YNCursesUI::ui()->stderr_save, 2 );
+
+ // Call external program
+ ret = system( cmd.c_str() );
+
+ if ( ret != 0 )
+ {
+ NCERR << cmd << " returned:" << ret << endl;
+ }
+
+ // Redirect stdout and stderr to y2log again
+ YNCursesUI::ui()->RedirectToLog();
+
+ // Resume tty modes and refresh the screen
+ ::reset_prog_mode();
+ ::refresh();
+
+ return ret;
+}
+
+
+int
+NCApplication::displayWidth()
+{
+ return ::COLS; // exported from ncurses.h
+}
+
+int
+NCApplication::displayHeight()
+{
+ return ::LINES; // exported from ncurses.h
+}
+
+int
+NCApplication::displayDepth()
+{
+ return -1;
+}
+
+long
+NCApplication::displayColors()
+{
+ return NCattribute::colors();
+}
+
+int
+NCApplication::defaultWidth()
+{
+ return ::COLS; // exported from ncurses.h
+}
+
+int
+NCApplication::defaultHeight()
+{
+ return ::LINES; // exported from ncurses.h
+}
+
+bool
+NCApplication::hasFullUtf8Support()
+{
+ return ( NCstring::terminalEncoding() == "UTF-8" );
+}
Modified: branches/tmp/bubli/ncurses/src/NCApplication.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCApplication.h?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCApplication.h (original)
+++ branches/tmp/bubli/ncurses/src/NCApplication.h Wed Feb 6 09:56:11 2008
@@ -115,6 +115,40 @@
virtual string askForSaveFileName( const string & startWith,
const string & filter,
const string & headline );
+
+ /**
+ * Run a shell command (typically an interactive program using NCurses)
+ * in a terminal (window).
+ *
+ * Here in the NCurses UI, this shuts down the NCurses lib, runs the
+ * command and then restores the status of the NCurses lib so that the next
+ * instance of the NCurses lib from the started command doesn't interfere
+ * with the NCurses UI's instance.
+ *
+ * Reimplemented from YApplication.
+ **/
+ virtual int runInTerminal ( const string & command );
+
+
+ // Display information and UI capabilities.
+ //
+ // All implemented from YApplication.
+
+ virtual int displayWidth();
+ virtual int displayHeight();
+ virtual int displayDepth();
+ virtual long displayColors();
+
+ virtual int defaultWidth();
+ virtual int defaultHeight();
+
+ virtual bool isTextMode() { return true; }
+ virtual bool hasImageSupport() { return false; }
+ virtual bool hasIconSupport() { return false; }
+ virtual bool hasAnimationSupport() { return false; }
+ virtual bool hasFullUtf8Support();
+ virtual bool richTextSupportsTable() { return false; }
+ virtual bool leftHandedMouse() { return false; }
};
Modified: branches/tmp/bubli/ncurses/src/NCAskForDirectory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCAskForDirectory.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCAskForDirectory.cc (original)
+++ branches/tmp/bubli/ncurses/src/NCAskForDirectory.cc Wed Feb 6 09:56:11 2008
@@ -22,7 +22,6 @@
#include "NCAskForDirectory.h"
-#include "YWidgetID.h"
#include "YDialog.h"
#include "YTypes.h"
#include "NCLayoutBox.h"
@@ -39,14 +38,6 @@
Textdomain "packages"
*/
-namespace
-{
- const string idOk( "ok" );
- const string idCancel( "cancel" );
- const string idDirList( "dirlist" );
- const string idDirName( "dirname" );
- const string idDetails( "details" );
-}
///////////////////////////////////////////////////////////////////
//
@@ -107,18 +98,11 @@
dirName->setNotify( true );
dirName->setStretchable( YD_HORIZ, true );
-#warning is this widget ID really needed?
- YStringWidgetID * dirID = new YStringWidgetID( idDirName );
- dirName->setId( dirID );
-
// add the checkBox detailed
NCLayoutBox * hSplit = new NCLayoutBox( split, YD_HORIZ );
// label for checkbox
detailed = new NCCheckBox( hSplit, _( "&Detailed View" ), false );
-#warning is this widget ID really needed?
- YStringWidgetID * detailsID = new YStringWidgetID( idDetails );
- detailed->setId( detailsID );
detailed->setNotify( true );
// create table header for table type T_Overview
@@ -132,10 +116,6 @@
NCFileTable::T_Overview,
iniDir );
-#warning is this widget ID really needed?
- YStringWidgetID * dirListID = new YStringWidgetID( idDirList );
- dirList->setId( dirListID );
-
new NCSpacing( split, YD_VERT, false, 1.0 );
// HBox for the buttons
@@ -147,10 +127,6 @@
okButton = new NCPushButton( hSplit1, _( "&OK" ) );
okButton->setFunctionKey( 10 );
okButton->setStretchable( YD_HORIZ, true );
-
-#warning is this widget ID really needed?
- YStringWidgetID * okID = new YStringWidgetID ( idOk );
- okButton->setId( okID );
new NCSpacing( hSplit1, YD_HORIZ, true, 0.4 );
@@ -159,12 +135,7 @@
cancelButton->setFunctionKey( 9 );
cancelButton->setStretchable( YD_HORIZ, true);
-#warning is this widget ID really needed?
- YStringWidgetID * cancelID = new YStringWidgetID (idCancel );
- cancelButton->setId( cancelID );
-
new NCSpacing( hSplit1, YD_HORIZ, true, 0.2 );
-
}
///////////////////////////////////////////////////////////////////
@@ -238,60 +209,55 @@
postevent.detail = NCursesEvent::NODETAIL;
-#warning compare widget pointers here, not IDs
- YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
-
- if ( currentId )
+ if ( postevent.widget == okButton )
{
- if ( currentId->toString() == idOk )
- {
- postevent.result = dirList->getCurrentDir();
- // return false means: close the popup
- return false;
- }
- else if ( currentId->toString() == idDirList )
- {
- if ( postevent.result == "" )
- return true;
+ postevent.result = dirList->getCurrentDir();
+ // return false means: close the popup
+ return false;
+ }
+ else if ( postevent.widget == dirList )
+ {
+ if ( postevent.result == "" )
+ return true;
- // show the currently selected directory
- NCDBG << "Add item: " << postevent.result << endl;
+ // show the currently selected directory
+ NCDBG << "Add item: " << postevent.result << endl;
- dirName->addItem( postevent.result,
- true );
+ dirName->addItem( postevent.result,
+ true );
- if ( postevent.reason == YEvent::Activated )
- {
- // fill the directory list
- dirList->fillList();
- }
- }
- else if ( currentId->toString() == idDirName )
+ if ( postevent.reason == YEvent::Activated )
{
- dirList->setStartDir( dirName->value() );
+ // fill the directory list
dirList->fillList();
}
- else if ( currentId->toString() == idDetails )
+ }
+ else if ( postevent.widget == dirName )
+ {
+ dirList->setStartDir( dirName->value() );
+ dirList->fillList();
+ }
+ else if ( postevent.widget == detailed )
+ {
+ bool details = getCheckBoxValue( detailed );
+ if ( details )
{
- bool details = getCheckBoxValue( detailed );
- if ( details )
- {
- dirList->setTableType( NCFileTable::T_Detailed );
- }
- else
- {
- dirList->setTableType( NCFileTable::T_Overview );
- }
- dirList->fillList();
+ dirList->setTableType( NCFileTable::T_Detailed );
}
else
{
- postevent.result = "";
- return false;
+ dirList->setTableType( NCFileTable::T_Overview );
}
+ dirList->fillList();
+ }
+ else
+ {
+ postevent.result = "";
+ return false;
}
- if (postevent == NCursesEvent::cancel)
+ if ( postevent.widget == cancelButton ||
+ postevent == NCursesEvent::cancel )
{
postevent.result = "";
return false;
Modified: branches/tmp/bubli/ncurses/src/NCAskForFile.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCAskForFile.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCAskForFile.cc (original)
+++ branches/tmp/bubli/ncurses/src/NCAskForFile.cc Wed Feb 6 09:56:11 2008
@@ -21,7 +21,6 @@
#include "NCAskForFile.h"
#include "YDialog.h"
-#include "YWidgetID.h"
#include "NCLayoutBox.h"
#include "NCSpacing.h"
@@ -38,15 +37,6 @@
Textdomain "packages"
*/
-namespace
-{
- const string idOk( "ok" );
- const string idCancel( "cancel" );
- const string idDirList( "dirlist" );
- const string idFileList( "filelist" );
- const string idDirName( "dirname" );
- const string idDetails( "details" );
-}
///////////////////////////////////////////////////////////////////
//
@@ -147,17 +137,12 @@
dirName = new NCComboBox( frame, _( "Selected Directory:" ), false ); // editable = false;
dirName->setNotify( true );
dirName->setStretchable( YD_HORIZ, true );
-
- YStringWidgetID * dirID = new YStringWidgetID( idDirName );
- dirName->setId( dirID );
// add the checkBox detailed
NCLayoutBox * hSplit = new NCLayoutBox( split, YD_HORIZ );
// label for checkbox
detailed = new NCCheckBox( hSplit, _( "&Detailed View" ), false );
- YStringWidgetID * detailsID = new YStringWidgetID( idDetails );
- detailed->setId( detailsID );
detailed->setNotify( true );
// HBox for the lists
@@ -174,9 +159,6 @@
NCFileSelection::T_Overview,
startDir );
dirList->setSendKeyEvents( true );
-
- YStringWidgetID * dirListID = new YStringWidgetID( idDirList );
- dirList->setId( dirListID );
// create table header for table type T_Overview
YTableHeader * fileHeader = new YTableHeader();
@@ -191,8 +173,6 @@
startDir );
fileList->setSendKeyEvents( true );
- YStringWidgetID * dirFileID = new YStringWidgetID( idFileList );
- fileList->setId( dirFileID );
NCLayoutBox * hSplit2 = new NCLayoutBox( split, YD_HORIZ );
@@ -226,9 +206,6 @@
okButton = new NCPushButton( hSplit3, _( "&OK" ) );
okButton->setFunctionKey( 10 );
okButton->setStretchable( YD_HORIZ, true );
-
- YStringWidgetID * okID = new YStringWidgetID( idOk );
- okButton->setId( okID );
new NCSpacing( hSplit3, YD_HORIZ, true, 0.4 );
@@ -236,9 +213,6 @@
cancelButton = new NCPushButton( hSplit3, _( "&Cancel" ) );
cancelButton->setFunctionKey( 9 );
cancelButton->setStretchable( YD_HORIZ, true );
-
- YStringWidgetID * cancelID = new YStringWidgetID( idCancel );
- cancelButton->setId( cancelID );
new NCSpacing( hSplit3, YD_HORIZ, true, 0.2 );
}
@@ -343,69 +317,65 @@
return true;
}
- YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
-
- if ( currentId )
+ if ( postevent.widget == okButton )
{
- if ( currentId->toString() == idOk )
- {
- postevent.result = dirList->getCurrentDir() + "/" + getFileName();
- // return false means: close the popup
- return false;
- }
- else if ( ( currentId->toString() == idDirList ) &&
- ( postevent.result != "" ) )
- {
- // show the currently selected directory
- dirName->addItem( postevent.result,
- true );
- updateFileList();
+ postevent.result = dirList->getCurrentDir() + "/" + getFileName();
+ // return false means: close the popup
+ return false;
+ }
+ else if ( ( postevent.widget == dirList ) &&
+ ( postevent.result != "" ) )
+ {
+ // show the currently selected directory
+ dirName->addItem( postevent.result,
+ true );
+ updateFileList();
- if ( postevent.reason == YEvent::Activated )
- {
- // fill directory and file list
- dirList->fillList();
- updateFileList();
- }
- }
- else if ( currentId->toString() == idDirName )
+ if ( postevent.reason == YEvent::Activated )
{
- dirList->setStartDir( dirName->text() );
+ // fill directory and file list
dirList->fillList();
-
updateFileList();
}
- else if ( currentId->toString() == idDetails )
+ }
+ else if ( postevent.widget == dirName )
+ {
+ dirList->setStartDir( dirName->text() );
+ dirList->fillList();
+
+ updateFileList();
+ }
+ else if ( postevent.widget == detailed )
+ {
+ bool details = getCheckBoxValue( detailed );
+ if ( details )
{
- bool details = getCheckBoxValue( detailed );
- if ( details )
- {
- fileList->setTableType( NCFileTable::T_Detailed );
- dirList->setTableType( NCFileTable::T_Detailed );
- }
- else
- {
- fileList->setTableType( NCFileTable::T_Overview );
- dirList->setTableType( NCFileTable::T_Overview );
- }
- fileList->fillList();
- dirList->fillList();
+ fileList->setTableType( NCFileTable::T_Detailed );
+ dirList->setTableType( NCFileTable::T_Detailed );
}
- else if ( currentId->toString() == idFileList )
+ else
{
- if ( postevent.result != "" )
- {
- fileName->setValue( postevent.result );
- }
+ fileList->setTableType( NCFileTable::T_Overview );
+ dirList->setTableType( NCFileTable::T_Overview );
}
- else
+ fileList->fillList();
+ dirList->fillList();
+ }
+ else if ( postevent.widget == fileList )
+ {
+ if ( postevent.result != "" )
{
- postevent.result = "";
- return false;
+ fileName->setValue( postevent.result );
}
}
+ else
+ {
+ postevent.result = "";
+ return false;
+ }
- if (postevent == NCursesEvent::cancel)
+ if ( postevent.widget == cancelButton ||
+ postevent == NCursesEvent::cancel )
{
postevent.result = "";
return false;
Modified: branches/tmp/bubli/ncurses/src/NCBusyIndicator.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCBusyIndicator.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCBusyIndicator.cc (original)
+++ branches/tmp/bubli/ncurses/src/NCBusyIndicator.cc Wed Feb 6 09:56:11 2008
@@ -374,7 +374,7 @@
if ( !win )
return;
- int cp = (_twin->maxx()) * _position;
+ int cp = (int) ( (_twin->maxx()) * _position );
const NCstyle::StProgbar & style( wStyle().progbar );
_twin->bkgdset( style.nonbar.chattr );
Modified: branches/tmp/bubli/ncurses/src/NCDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCDialog.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCDialog.cc (original)
+++ branches/tmp/bubli/ncurses/src/NCDialog.cc Wed Feb 6 09:56:11 2008
@@ -23,6 +23,7 @@
#include "NCMenuButton.h"
#include "YShortcut.h"
#include "NCi18n.h"
+#include "NCtoY2Event.h"
#include "ncursesw.h"
@@ -247,6 +248,13 @@
}
}
+
+void NCDialog::openInternal()
+{
+ showDialog();
+}
+
+
///////////////////////////////////////////////////////////////////
//
//
@@ -324,6 +332,20 @@
}
}
+
+/**
+ * Implementation of YDialog::activate().
+ *
+ * This is called e.g. for the next-lower dialog in the dialog stack when the
+ * topmost dialog is destroyed: That next-lower dialog is now the active
+ * dialog.
+ **/
+void NCDialog::activate()
+{
+ activate( true ); // Forward to NCurses-specific activate()
+}
+
+
///////////////////////////////////////////////////////////////////
//
//
@@ -1026,6 +1048,7 @@
return returnEvent;
}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -1056,6 +1079,37 @@
return returnEvent;
}
+
+/**
+ * Back-end for YDialog::waitForEvent()
+ **/
+YEvent * NCDialog::waitForEventInternal( int timeout_millisec )
+{
+ NCtoY2Event cevent;
+ activate ( true );
+ cevent = userInput( timeout_millisec ? timeout_millisec : -1 );
+ activate ( false );
+
+ YEvent * yevent = cevent.propagate();
+
+ return yevent;
+}
+
+
+/**
+ * Back-end for YDialog::pollEvent()
+ **/
+YEvent * NCDialog::pollEventInternal()
+{
+ // no activation here, done in pollInput, if..
+ NCtoY2Event cevent = pollInput();
+ YEvent * yevent = cevent.propagate();
+
+ return yevent;
+}
+
+
+
///////////////////////////////////////////////////////////////////
//
//
Modified: branches/tmp/bubli/ncurses/src/NCDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCDialog.h?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCDialog.h (original)
+++ branches/tmp/bubli/ncurses/src/NCDialog.h Wed Feb 6 09:56:11 2008
@@ -119,6 +119,35 @@
virtual void startMultipleChanges();
virtual void doneMultipleChanges();
+
+ /**
+ * Internal open() method: Initialize what is left over to initialize after
+ * all dialog children have been created.
+ * YDialog::setInitialSize() is already called before this in
+ * YDailog::open(), so don't call it here again (very expensive!).
+ *
+ * This function is called (exactly once during the life time of the
+ * dialog) in YDialog::open().
+ *
+ * Implemented from YDialog.
+ **/
+ virtual void openInternal();
+
+ /**
+ * Wait for a user event.
+ *
+ * Implemented from YDialog.
+ **/
+ virtual YEvent * waitForEventInternal( int timeout_millisec );
+
+ /**
+ * Check if a user event is pending. If there is one, return it.
+ * If there is none, do not wait for one - return 0.
+ *
+ * Implemented from YDialog.
+ **/
+ virtual YEvent * pollEventInternal();
+
public:
@@ -148,6 +177,14 @@
**/
virtual void setSize( int newWidth, int newHeight );
+ /**
+ * Activate this dialog: Make sure that it is shown as the topmost dialog
+ * of this application and that it can receive input.
+ *
+ * Implemented from YDialog.
+ **/
+ virtual void activate();
+
protected:
enum NCDopts {
Modified: branches/tmp/bubli/ncurses/src/NCMenuButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCMenuButton.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCMenuButton.cc (original)
+++ branches/tmp/bubli/ncurses/src/NCMenuButton.cc Wed Feb 6 09:56:11 2008
@@ -21,8 +21,6 @@
#include "NCMenuButton.h"
#include "NCPopupMenu.h"
-#include "YWidgetID.h"
-
///////////////////////////////////////////////////////////////////
//
//
Modified: branches/tmp/bubli/ncurses/src/NCPopupInfo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCPopupInfo.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCPopupInfo.cc (original)
+++ branches/tmp/bubli/ncurses/src/NCPopupInfo.cc Wed Feb 6 09:56:11 2008
@@ -25,8 +25,6 @@
#include "NCLayoutBox.h"
#include "NCSpacing.h"
-#include "YWidgetID.h"
-
namespace
{
const string idOk( "ok" );
@@ -105,9 +103,6 @@
// add the OK button
okButton = new NCPushButton( hSplit, okButtonLabel );
okButton->setFunctionKey( 10 );
-
- YStringWidgetID * okID = new YStringWidgetID (idOk );
- okButton->setId( okID );
}
if ( cancelButtonLabel != "" )
@@ -117,9 +112,6 @@
// add the Cancel button
cancelButton = new NCPushButton( hSplit, cancelButtonLabel );
cancelButton->setFunctionKey( 9 );
-
- YStringWidgetID * cancelID = new YStringWidgetID( idCancel );
- cancelButton->setId( cancelID );
new NCSpacing( hSplit, YD_HORIZ, true, 0.4 );
}
@@ -242,10 +234,7 @@
if ( okButton && cancelButton )
{
- YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
-
- if ( currentId
- && currentId->toString() == idCancel )
+ if ( postevent.widget == cancelButton )
{
NCMIL << "Cancel button pressed" << endl;
// close the dialog
Modified: branches/tmp/bubli/ncurses/src/NCRichText.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCRichText.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCRichText.cc (original)
+++ branches/tmp/bubli/ncurses/src/NCRichText.cc Wed Feb 6 09:56:11 2008
@@ -25,8 +25,6 @@
#include "YMenuItem.h"
-#include "YWidgetID.h"
-
#if 0
#undef DBG_CLASS
#define DBG_CLASS "_NCRichText_"
Added: branches/tmp/bubli/ncurses/src/NCtoY2Event.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCtoY2Event.cc?rev=44178&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCtoY2Event.cc (added)
+++ branches/tmp/bubli/ncurses/src/NCtoY2Event.cc Wed Feb 6 09:56:11 2008
@@ -0,0 +1,107 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCtoY2Event.h
+
+ Authors: Michael Andres
+ Stefan Hundhammer
+
+/-*/
+
+
+#include "NCtoY2Event.h"
+#include "NCWidget.h"
+#include "Y2Log.h"
+
+
+NCtoY2Event::NCtoY2Event( const NCursesEvent & ncev )
+ : NCursesEvent( ncev )
+{
+}
+
+
+NCtoY2Event &
+NCtoY2Event::operator=( const NCursesEvent & ncev )
+{
+ if ( ncev.isInternalEvent() )
+ NCursesEvent::operator=( none );
+ else
+ NCursesEvent::operator=( ncev );
+ return *this;
+}
+
+
+YEvent *
+NCtoY2Event::propagate()
+{
+ switch ( type )
+ {
+ // Note: libyui assumes ownership of YEvents, so they need to be
+ // created on the heap with 'new'. libyui takes care of deleting them.
+
+ case button:
+ if ( widget->isValid() )
+ return new YWidgetEvent( dynamic_cast (widget), reason );
+ else
+ return 0;
+
+ case menu:
+ if ( selection )
+ return new YMenuEvent( selection );
+ else
+ return 0;
+
+ case cancel:
+ return new YCancelEvent();
+
+ case timeout:
+ return new YTimeoutEvent();
+
+ case key:
+ if ( widget->isValid() )
+ return new YKeyEvent( keySymbol, dynamic_cast (widget) );
+ else
+ return 0;
+
+ case none:
+ case handled:
+ return 0;
+
+ // Intentionally omitting 'default' branch so the compiler can
+ // detect unhandled enums
+ }
+
+ // If we get this far, there must be an error.
+
+ UIINT << "Can't propagate through (EventType*)0" << endl;
+ UIDBG << *this << endl;
+ return 0;
+}
+
+
+ostream &
+operator<< ( std::ostream & stream, const NCtoY2Event & event )
+{
+ stream << static_cast (event);
+
+ if ( ! event.selection )
+ {
+ stream << "(-)";
+ }
+ else
+ {
+ // FIXME: check this - was valuetype() see above
+ stream << "(" << event.selection->label() << ")";
+ }
+ return stream << " for " << event.widget;
+}
+
Added: branches/tmp/bubli/ncurses/src/NCtoY2Event.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/NCtoY2Event.h?rev=44178&view=auto
==============================================================================
--- branches/tmp/bubli/ncurses/src/NCtoY2Event.h (added)
+++ branches/tmp/bubli/ncurses/src/NCtoY2Event.h Wed Feb 6 09:56:11 2008
@@ -0,0 +1,57 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: NCtoY2Event.h
+
+ Authors: Michael Andres
+ Stefan Hundhammer
+
+/-*/
+
+#ifndef NCtoY2Event_h
+#define NCtoY2Event_h
+
+#include // NCursesEvent, iostream
+
+
+/**
+ * Helper class for translating an NCurses event to a YEvent.
+ **/
+class NCtoY2Event : public NCursesEvent
+{
+public:
+ friend ostream & operator<<( std::ostream & stream, const NCtoY2Event & event );
+
+ /**
+ * Default constructor
+ **/
+ NCtoY2Event() {}
+
+ /**
+ * Constructor from an NCursesEvent
+ **/
+ NCtoY2Event( const NCursesEvent & ncev );
+
+ /**
+ * Assignment operator
+ **/
+ NCtoY2Event & operator=( const NCursesEvent & ncev );
+
+ /**
+ * The reason of existence of this class:
+ * Translate the NCursesEvent to a YEvent.
+ **/
+ YEvent * propagate();
+};
+
+
+#endif // ifndef NCtoY2Event_h
Modified: branches/tmp/bubli/ncurses/src/YNCursesUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/YNCursesUI.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/YNCursesUI.cc (original)
+++ branches/tmp/bubli/ncurses/src/YNCursesUI.cc Wed Feb 6 09:56:11 2008
@@ -175,160 +175,6 @@
///////////////////////////////////////////////////////////////////
-struct NCtoY2Event : public NCursesEvent {
-
- friend ostream & operator<<( std::ostream & STREAM, const NCtoY2Event & OBJ ) {
- STREAM << static_cast(OBJ);
-#if 0
- if ( OBJ.selection.isNull() ) {
- STREAM << "(-)";
- } else {
- STREAM << "(" << OBJ.selection->valuetype() << ")";
- }
-#endif
- if ( !OBJ.selection )
- {
- STREAM << "(-)";
- }
- else
- {
- // FIXME: check this - was valuetype() see above
- STREAM << "(" << OBJ.selection->label() << ")";
- }
- return STREAM << " for " << OBJ.widget;
- }
-
- NCtoY2Event() {}
- NCtoY2Event( const NCursesEvent & ncev ) : NCursesEvent( ncev ) {}
-
- NCtoY2Event & operator=( const NCursesEvent & ncev ) {
- if ( ncev.isInternalEvent() )
- NCursesEvent::operator=( none );
- else
- NCursesEvent::operator=( ncev );
- return *this;
- }
-
- YEvent * propagate()
- {
- switch ( type )
- {
- // Note: libyui assumes ownership of YEvents, so they need to be
- // created on the heap with 'new'. libyui takes care of deleting them.
-
- case button:
- if ( widget->isValid() )
- return new YWidgetEvent( dynamic_cast (widget), reason );
- else
- return 0;
-
- case menu:
- if ( selection )
- return new YMenuEvent( selection );
- else
- return 0;
-
- case cancel:
- return new YCancelEvent();
-
- case timeout:
- return new YTimeoutEvent();
-
- case key:
- if ( widget->isValid() )
- return new YKeyEvent( keySymbol, dynamic_cast (widget) );
- else
- return 0;
-
- case none:
- case handled:
- return 0;
-
- // Intentionally omitting 'default' branch so the compiler can
- // detect unhandled enums
- }
-
- // If we get this far, there must be an error.
-
- UIINT << "Can't propagate through (EventType*)0" << endl;
- UIDBG << *this << endl;
- return 0;
- }
-};
-
-
-///////////////////////////////////////////////////////////////////
-//
-//
-// METHOD NAME : YNCursesUI::userInput
-// METHOD TYPE : YEvent *
-//
-// DESCRIPTION :
-//
-YEvent * YNCursesUI::userInput( unsigned long timeout_millisec )
-{
- NCDialog * ncd = static_cast( YDialog::currentDialog() );
- if ( !ncd ) {
- UIERR << "No current NCDialog " << endl;
- return 0;
- }
-
- NCtoY2Event cevent;
- ncd->activate ( true );
- cevent = ncd->userInput( timeout_millisec ? (long)timeout_millisec : -1 );
- ncd->activate ( false );
-
- YEvent * yevent = cevent.propagate();
-
- return yevent;
-}
-
-///////////////////////////////////////////////////////////////////
-//
-//
-// METHOD NAME : YNCursesUI::pollInput
-// METHOD TYPE : YWidget *
-//
-// DESCRIPTION :
-//
-YEvent * YNCursesUI::pollInput()
-{
- NCDialog * ncd = static_cast( YDialog::currentDialog() );
- if ( !ncd ) {
- UIERR << "No current NCDialog " << endl;
- return 0;
- }
-
- // no activation here, done in pollInput, if..
- NCtoY2Event cevent = ncd->pollInput();
-
- YEvent * yevent = cevent.propagate();
-
- return yevent;
-}
-
-///////////////////////////////////////////////////////////////////
-//
-// Dialog and widgets
-//
-///////////////////////////////////////////////////////////////////
-
-void YNCursesUI::showDialog( YDialog * dialog ) {
- NCDialog * dlg = dynamic_cast( dialog );
- UIDBG << dlg << endl;
- if ( dlg )
- {
- dlg->showDialog();
- //dlg->dumpWidgetTree();
- }
-}
-
-void YNCursesUI::closeDialog( YDialog * dialog ) {
- NCDialog * dlg = dynamic_cast( dialog );
- UIDBG << dlg << endl;
- if ( dlg )
- dlg->closeDialog();
-}
#define ONCREATE WIDDBG << endl
//#define ONCREATE
@@ -432,48 +278,6 @@
///////////////////////////////////////////////////////////////////
//
//
-// METHOD NAME : YNCursesUI::runInTerminal
-// METHOD TYPE : YCPValue
-//
-// DESCRIPTION:: Run external program supplied as string parameter
-// in the same terminal
-//
-
-int YNCursesUI::runInTerminal( const YCPString & module )
-{
- int ret;
- string cmd = module->value();
-
- //Save tty modes and end ncurses mode temporarily
- ::def_prog_mode();
- ::endwin();
-
- //Regenerate saved stdout and stderr, so that app called
- //via system() can use them and draw something to the terminal
- dup2(NCurses::stdout_save, 1);
- dup2(NCurses::stderr_save, 2);
-
- //Call external program
- ret = system(cmd.c_str());
-
- if ( ret != 0 )
- {
- NCERR << cmd << " returned:" << ret << endl;
- }
-
- //Redirect stdout and stderr to y2log again
- NCurses::RedirectToLog();
-
- //Resume tty modes and refresh the screen
- ::reset_prog_mode();
- ::refresh();
-
- return ret;
-}
-
-///////////////////////////////////////////////////////////////////
-//
-//
// METHOD NAME : YNCursesUI::setConsoleFont
// METHOD TYPE : YCPValue
//
@@ -560,26 +364,6 @@
///////////////////////////////////////////////////////////////////
//
//
-// METHOD NAME : YNCursesUI::hasFullUtf8Support
-// METHOD TYPE : bool
-//
-// DESCRIPTION :
-//
-bool YNCursesUI::hasFullUtf8Support()
-{
- if ( NCstring::terminalEncoding() == "UTF-8" )
- {
- return true;
- }
- else
- {
- return false;
- }
-}
-
-///////////////////////////////////////////////////////////////////
-//
-//
// METHOD NAME : YNCursesUI::init_title
// METHOD TYPE : void
//
Modified: branches/tmp/bubli/ncurses/src/YNCursesUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/YNCursesUI.h?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/YNCursesUI.h (original)
+++ branches/tmp/bubli/ncurses/src/YNCursesUI.h Wed Feb 6 09:56:11 2008
@@ -107,31 +107,6 @@
virtual void idleLoop( int fd_ycp );
/**
- * Go into event loop until user input is available or until the specified
- * timeout (in milliseconds) has elapsed.
- *
- * Reimplemented from YUIInterpreter.
- */
- virtual YEvent * userInput( unsigned long timeout_millisec );
-
- /**
- * Check the event queue for user input. Don't wait.
- *
- * Reimplemented from YUIInterpreter.
- */
- virtual YEvent * pollInput();
-
- /**
- * Inherited from YUIInterpreter. Shows and activates a dialog
- */
- virtual void showDialog( YDialog * dialog );
-
- /**
- * Inherited from YUIInterpreter. Decativates and closes a dialog
- */
- virtual void closeDialog( YDialog * dialog );
-
- /**
* Fills the PackageSelector widget and runs package selection.
*/
virtual YEvent * runPkgSelection( YWidget * packageSelector );
@@ -149,14 +124,6 @@
virtual YCPValue setKeyboard ( );
/**
- * UI-specific runInTerminal() function.
- * Returns (integer) return code of external program it spawns
- * in the same terminal
- */
-
- virtual int runInTerminal ( const YCPString & module);
-
- /**
* UI-specific beep() function.
* Beeps the system bell.
*/
@@ -173,22 +140,6 @@
* This default implementation does nothing.
*/
virtual void redrawScreen() { Refresh(); }
-
- /**
- * UI-specific getDisplayInfo() functions.
- * See UI builtin GetDisplayInfo() doc for details.
- **/
- virtual int getDisplayWidth() { return cols(); }
- virtual int getDisplayHeight() { return lines(); }
- virtual int getDisplayDepth() { return -1; }
- virtual long getDisplayColors() { return NCattribute::colors(); }
- virtual int getDefaultWidth() { return cols(); }
- virtual int getDefaultHeight() { return lines(); }
- virtual bool textMode() { return true; }
- virtual bool hasImageSupport() { return false; }
- virtual bool hasIconSupport() { return false; }
-
- virtual bool hasFullUtf8Support();
};
#endif // YNCursesUI_h
Modified: branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupDeps.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupDeps.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupDeps.cc (original)
+++ branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupDeps.cc Wed Feb 6 09:56:11 2008
@@ -31,8 +31,6 @@
#include "NCPopupInfo.h"
#include "NCInputField.h"
-#include "YWidgetID.h"
-
#include "NCi18n.h"
/*
@@ -168,9 +166,6 @@
// add the solve button
solveButton = new NCPushButton( hSplit, NCPkgNames::SolveLabel() );
solveButton->setFunctionKey( 10 );
- //solveButton->setId( NCPkgNames::Solve () );
- YStringWidgetID * solveID = new YStringWidgetID("solve");
- solveButton->setId( solveID );
//hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
new NCSpacing( hSplit, YD_HORIZ, true, 0.2 ); // stretchable = true
@@ -178,9 +173,6 @@
// add the cancel button
cancelButton = new NCPushButton( hSplit, NCPkgNames::CancelLabel() );
cancelButton->setFunctionKey( 9 );
- // cancelButton->setId( NCPkgNames::Cancel () );
- YStringWidgetID * cancelID = new YStringWidgetID("cancel");
- cancelButton->setId( cancelID );
new NCSpacing( vSplit, YD_VERT, false, 1 ); // stretchable = false
}
@@ -401,17 +393,12 @@
if ( ! postevent.widget )
return false;
- // YCPValue currentId = dynamic_cast(postevent.widget)->id();
- YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
- if ( !currentId )
- return false;
-
- if ( currentId->toString() == "cancel" )
+ if ( postevent.widget == cancelButton )
{
// close the dialog
postevent = NCursesEvent::cancel;
}
- else if ( currentId->toString() == "solve" )
+ else if ( postevent.widget == solveButton )
{
// apply the solution here
zypp::Resolver_Ptr resolver = zypp::getZYpp()->resolver();
Modified: branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupDescr.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupDescr.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupDescr.cc (original)
+++ branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupDescr.cc Wed Feb 6 09:56:11 2008
@@ -21,7 +21,6 @@
#include "YMenuButton.h"
#include "YDialog.h"
-#include "YWidgetID.h"
#include "NCLayoutBox.h"
#include "NCSpacing.h"
@@ -125,9 +124,6 @@
// add the OK button
opt.key_Fxx.setValue( 10 );
okButton = new NCPushButton( split, NCPkgNames::OKLabel() );
- YStringWidgetID * okID = new YStringWidgetID( "ok" );
- okButton->setId( okID );
-
}
///////////////////////////////////////////////////////////////////
@@ -232,16 +228,6 @@
if ( ! postevent.widget )
return false;
- // YCPValue currentId = dynamic_cast(postevent.widget)->id();
- YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
-
- if ( currentId
- && currentId->toString() == "cancel" )
- {
- // close the dialog
- postevent = NCursesEvent::cancel;
- }
-
if ( postevent == NCursesEvent::button || postevent == NCursesEvent::cancel )
{
// return false means: close the popup dialog
Modified: branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupDiskspace.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupDiskspace.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupDiskspace.cc (original)
+++ branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupDiskspace.cc Wed Feb 6 09:56:11 2008
@@ -21,7 +21,6 @@
#include "YMenuButton.h"
#include "YDialog.h"
-#include "YWidgetID.h"
#include "YTypes.h"
#include "NCLayoutBox.h"
@@ -118,10 +117,7 @@
// add the ok button
okButton = new NCPushButton( split, NCPkgNames::OKLabel() );
- YStringWidgetID * okID = new YStringWidgetID( "ok" );
okButton->setFunctionKey( 10 );
- okButton->setId( okID );
-
}
///////////////////////////////////////////////////////////////////
Modified: branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupRepo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupRepo.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupRepo.cc (original)
+++ branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupRepo.cc Wed Feb 6 09:56:11 2008
@@ -220,9 +220,6 @@
//the cute button
okButton = new NCPushButton( split, NCPkgNames::OKLabel() );
- YStringWidgetID * okID = new YStringWidgetID("ok");
-
- okButton->setId( okID );
okButton->setFunctionKey(10);
new NCSpacing( split, YD_VERT, false, 0.4 );
@@ -379,10 +376,7 @@
postevent.detail = NCursesEvent::NODETAIL;
- YWidgetID *currentId = dynamic_cast(postevent.widget)->id();
-
- if ( currentId
- && currentId->toString() == "ok" )
+ if ( postevent.widget == okButton )
{
postevent.detail = NCursesEvent::USERDEF ;
// return false means: close the popup
Modified: branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupSearch.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupSearch.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupSearch.cc (original)
+++ branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupSearch.cc Wed Feb 6 09:56:11 2008
@@ -29,8 +29,6 @@
#include "NCPkgNames.h"
#include "NCPackageSelector.h"
-#include "YWidgetID.h"
-
#include "NCi18n.h"
/*
@@ -103,8 +101,6 @@
NCPkgNames::SearchPhrase(),
true ); // editable = true
- YStringWidgetID * searchID = new YStringWidgetID ("search_box" );
- searchExpr->setId( searchID );
searchExpr->setStretchable( YD_HORIZ, true );
searchExpr->addItem( new YTableItem() );
@@ -148,15 +144,11 @@
// add the cancel and the ok button
okButton = new NCPushButton( hSplit3, NCPkgNames::OKLabel() );
- YStringWidgetID * okID = new YStringWidgetID("ok");
- okButton->setId( okID );
okButton->setFunctionKey( 10 );
new NCSpacing( hSplit3, YD_HORIZ, true, 0.4 );
cancelButton = new NCPushButton( hSplit3, NCPkgNames::CancelLabel() );
- YStringWidgetID * cancelID = new YStringWidgetID("cancel");
- cancelButton->setId( cancelID );
cancelButton->setFunctionKey( 9 );
new NCSpacing( hSplit3, YD_HORIZ, true, 0.2 );
@@ -275,10 +267,7 @@
postevent.result = "";
- YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
-
- if ( currentId &&
- currentId->toString() == "cancel" )
+ if ( postevent.widget == cancelButton )
{
postevent = NCursesEvent::cancel;
}
Modified: branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupSelection.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupSelection.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupSelection.cc (original)
+++ branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupSelection.cc Wed Feb 6 09:56:11 2008
@@ -137,9 +137,6 @@
// add an OK button
okButton = new NCPushButton( split, NCPkgNames::OKLabel() );
- YStringWidgetID * okID = new YStringWidgetID("ok");
-
- okButton->setId( okID );
okButton->setFunctionKey(10);
new NCSpacing( split, YD_VERT, false, 0.4 );
@@ -312,10 +309,7 @@
postevent.detail = NCursesEvent::NODETAIL;
- YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
-
- if ( currentId
- && currentId->toString() == "ok" )
+ if ( postevent.widget == okButton )
{
postevent.detail = NCursesEvent::USERDEF ;
// return false means: close the popup
Modified: branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupTable.cc?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupTable.cc (original)
+++ branches/tmp/bubli/ncurses/src/pkg/NCPkgPopupTable.cc Wed Feb 6 09:56:11 2008
@@ -20,7 +20,6 @@
#include "YMenuButton.h"
#include "YDialog.h"
-#include "YWidgetID.h"
#include "NCLayoutBox.h"
#include "NCSpacing.h"
@@ -125,8 +124,6 @@
// add the OK button
opt.key_Fxx.setValue( 10 );
okButton = new NCPushButton( hSplit, NCPkgNames::OKLabel() );
- YStringWidgetID * okID = new YStringWidgetID( "ok" );
- okButton->setId( okID );
//hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
new NCSpacing( hSplit, YD_HORIZ, true, 0.4 );
@@ -134,8 +131,6 @@
// add the Cancel button
opt.key_Fxx.setValue( 9 );
cancelButton = new NCPushButton( hSplit, NCPkgNames::CancelLabel() );
- YStringWidgetID * cancelID = new YStringWidgetID( "cancel" );
- cancelButton->setId( cancelID );
//hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
new NCSpacing( hSplit, YD_HORIZ, true, 0.2 );
@@ -301,10 +296,7 @@
if ( ! postevent.widget )
return false;
- // YCPValue currentId = dynamic_cast(postevent.widget)->id();
- YWidgetID * currentId = dynamic_cast(postevent.widget)->id();
- if ( currentId
- && currentId->toString() == "cancel" )
+ if ( postevent.widget == cancelButton )
{
//user hit cancel - discard set of changes (if not empty)
packager->clearVerifiedPkgs();
Modified: branches/tmp/bubli/ncurses/yast2-ncurses.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/bubli/ncurses/yast2-ncurses.spec.in?rev=44178&r1=44177&r2=44178&view=diff
==============================================================================
--- branches/tmp/bubli/ncurses/yast2-ncurses.spec.in (original)
+++ branches/tmp/bubli/ncurses/yast2-ncurses.spec.in Wed Feb 6 09:56:11 2008
@@ -17,12 +17,10 @@
Provides: y2curses
Obsoletes: y2curses
Requires: glibc-locale
-BuildRequires: yast2-core-devel >= 2.16.24
-Requires: yast2-core >= 2.16.24
+BuildRequires: yast2-core-devel >= 2.16.28
+Requires: yast2-core >= 2.16.28
#adapted to libzypp 3.11 refactoring
Requires: libzypp >= 3.11.8
-#FSize.h and YRpmGroupsTree.h moved to libyui
-Requires: yast2-core >= 2.16.8
%description
-
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org