Author: sh-sh-sh
Date: Tue Nov 6 15:05:22 2007
New Revision: 41821
URL: http://svn.opensuse.org/viewcvs/yast?rev=41821&view=rev
Log:
fixed F-keys
Modified:
branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc
branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.cc
branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.cc
branches/tmp/sh/mod-ui/ncurses/src/NCWidget.cc
branches/tmp/sh/mod-ui/ncurses/src/NCWidget.h
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc?rev=41821&r1=41820&r2=41821&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc Tue Nov 6 15:05:22 2007
@@ -1391,34 +1391,22 @@
for ( tnode * c = this->Next(); c; c = c->Next() )
{
- int fkey = c->Value()->GetFunctionHotkey( );
- if ( fkey != 0 )
+ YWidget * w = dynamic_cast (c->Value() );
+
+ if ( w && w->hasFunctionKey() )
{
- YWidget * w = dynamic_cast (c->Value() );
+ // Retrieve the widget's "shortcut property" that describes
+ // whatever it is - regardless of widget type (PushButton, ...)
+ //YCPSymbol propertyName( w->shortcutProperty() );
+ //YCPValue propertyValue = w->queryWidget( propertyName );
+ // Get rid of unwanted '&' shortcut markers
+ //string desc = YShortcut::cleanShortcutString( propertyValue->asString()->value() );
- if ( w )
- {
- // Retrieve the widget's "shortcut property" that describes
- // whatever it is - regardless of widget type (PushButton, ...)
- //YCPSymbol propertyName( w->shortcutProperty() );
- //YCPValue propertyValue = w->queryWidget( propertyName );
- // Get rid of unwanted '&' shortcut markers
- //string desc = YShortcut::cleanShortcutString( propertyValue->asString()->value() );
-
- // FIXME ??? correct string ???
- string desc = w->debugLabel();
-
- int no = fkey - KEY_F(1) + 1;
- if ( no == 1 )
- {
- hasF1 = true;
- }
- fkeys[ no ] = desc;
- }
- else
+ if ( w->functionKey() == 1 )
{
- NCERR << "Dynamic cast to YWidget * failed for" << c->Value() << endl;
+ hasF1 = true;
}
+ fkeys[ w->functionKey() ] = w->debugLabel();
}
}
// create the text with sorted F-keys
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.cc?rev=41821&r1=41820&r2=41821&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCFileSelection.cc Tue Nov 6 15:05:22 2007
@@ -350,7 +350,7 @@
data.reserve(6);
data.push_back( fileInfo._name );
char size_buf[50];
- sprintf( size_buf, "%ld", fileInfo._size);
+ sprintf( size_buf, "%lld", fileInfo._size);
data.push_back( size_buf );
data.push_back( fileInfo._perm );
data.push_back( fileInfo._user );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc?rev=41821&r1=41820&r2=41821&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc Tue Nov 6 15:05:22 2007
@@ -39,11 +39,6 @@
WIDDBG << endl;
setLabel( nlabel );
hotlabel = &label;
-
- // FIXME
- // if ( opt.isDefaultButton.value() )
- // setKeyboardFocus();
- // setFunctionHotkey( opt );
}
///////////////////////////////////////////////////////////////////
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.cc?rev=41821&r1=41820&r2=41821&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.cc Tue Nov 6 15:05:22 2007
@@ -36,9 +36,6 @@
setWidgetRep(this);
setLabel( nlabel );
hotlabel = &label;
-
- // FIXME !!!
- //setFunctionHotkey( opt );
}
///////////////////////////////////////////////////////////////////
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCWidget.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCWidget.cc?rev=41821&r1=41820&r2=41821&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCWidget.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCWidget.cc Tue Nov 6 15:05:22 2007
@@ -49,7 +49,6 @@
, skipNoDimWin( true )
, wstate( NC::WSnormal )
, hotlabel( 0 )
- , hotfkey( 0 )
{
NCWidget * myparent = dynamic_cast (parent);
@@ -71,7 +70,6 @@
, skipNoDimWin( true )
, wstate( NC::WSnormal )
, hotlabel( 0 )
- , hotfkey( 0 )
{
if ( myparent ) {
ReparentTo( *myparent );
@@ -590,29 +588,19 @@
//
bool NCWidget::HasFunctionHotkey( int key ) const
{
- if ( key < 0 || (hotfkey == 0) )
- return false;
-
- return( key == hotfkey ) ;
-}
+ const YWidget * w = dynamic_cast( this );
-int NCWidget::GetFunctionHotkey() const
-{
- return hotfkey;
-}
+ if ( w )
+ {
+ if ( key < 0 || ( ! w->hasFunctionKey() ) )
+ return false;
-///////////////////////////////////////////////////////////////////
-//
-// METHOD NAME : NCWidget::setFunctionHotkey
-// METHOD TYPE : void
-//
-// DESCRIPTION :
-//
-void NCWidget::setFunctionHotkey( const YWidgetOpt & opt )
-{
- if ( opt.key_Fxx.value() > 0 )
+ return( key == KEY_F( w->functionKey() ) );
+ }
+ else
{
- hotfkey = KEY_F( (int) opt.key_Fxx.value() );
+ NCERR << "No YWidget" << endl;
+ return false;
}
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCWidget.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCWidget.h?rev=41821&r1=41820&r2=41821&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCWidget.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCWidget.h Tue Nov 6 15:05:22 2007
@@ -123,9 +123,6 @@
protected:
NClabel * hotlabel;
- int hotfkey;
-
- virtual void setFunctionHotkey( const YWidgetOpt & opt );
public:
@@ -166,7 +163,6 @@
virtual bool HasHotkey( int key ) const;
virtual bool HasFunctionHotkey( int key ) const;
- virtual int GetFunctionHotkey() const;
virtual NCursesEvent wHandleHotkey( wint_t key );
virtual NCursesEvent wHandleInput( wint_t key );
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org