Author: sh-sh-sh
Date: Mon Jan 21 16:17:39 2008
New Revision: 43796
URL: http://svn.opensuse.org/viewcvs/yast?rev=43796&view=rev
Log:
Moved glyph handling from YUI to YApplication
(and got rid of YCP data types, too)
Modified:
trunk/core/libyui/doc/examples/Events.ycp
trunk/core/libyui/src/ChangeLog
trunk/core/libyui/src/YApplication.cc
trunk/core/libyui/src/YApplication.h
trunk/core/libyui/src/YUI.h
trunk/core/libyui/src/YUI_builtins.cc
trunk/ncurses/yast2-ncurses.spec.in
trunk/qt/src/YQApplication.cc
trunk/qt/src/YQApplication.h
trunk/qt/src/YQUI.h
trunk/qt/src/YQUI_builtins.cc
trunk/qt/yast2-qt.spec.in
Modified: trunk/core/libyui/doc/examples/Events.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/doc/examples/Events.ycp?rev=43796&r1=43795&r2=43796&view=diff
==============================================================================
--- trunk/core/libyui/doc/examples/Events.ycp (original)
+++ trunk/core/libyui/doc/examples/Events.ycp Mon Jan 21 16:17:39 2008
@@ -245,6 +245,7 @@
else if ( event["ID"]:nil == `order )
{
UI::ChangeWidget(`send_mafioso, `Value, nil );
+ UI::DumpWidgetTree();
}
else if ( event["ID"]:nil == `cancel_order )
{
Modified: trunk/core/libyui/src/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/ChangeLog?rev=43796&r1=43795&r2=43796&view=diff
==============================================================================
--- trunk/core/libyui/src/ChangeLog (original)
+++ trunk/core/libyui/src/ChangeLog Mon Jan 21 16:17:39 2008
@@ -463,3 +463,9 @@
* Now return empty string upon user cancel
+
+2008-01-20 sh@suse.de
+
+* Moved glyph handling from YUI to YApplication,
+ now using std::string instead of YCPString and YCPSymbol;
+ forget YMyUI::glyph(), implement YMyApplication::glyph()
Modified: trunk/core/libyui/src/YApplication.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YApplication.cc?rev=43796&r1=43795&r2=43796&view=diff
==============================================================================
--- trunk/core/libyui/src/YApplication.cc (original)
+++ trunk/core/libyui/src/YApplication.cc Mon Jan 21 16:17:39 2008
@@ -150,3 +150,22 @@
return lang;
}
+
+
+string
+YApplication::glyph( const string & sym )
+{
+ if ( sym == YUIGlyph_ArrowLeft ) return ( "<-" );
+ else if ( sym == YUIGlyph_ArrowRight ) return ( "->" );
+ else if ( sym == YUIGlyph_ArrowUp ) return ( "^" );
+ else if ( sym == YUIGlyph_ArrowDown ) return ( "v" );
+ else if ( sym == YUIGlyph_CheckMark ) return ( "x" );
+ else if ( sym == YUIGlyph_BulletArrowRight ) return ( "=>" );
+ else if ( sym == YUIGlyph_BulletCircle ) return ( "o" );
+ else if ( sym == YUIGlyph_BulletSquare ) return ( "[]" );
+ else // unknown glyph symbol
+ {
+ yuiError() << "Unknown glyph `" << sym << endl;
+ return "";
+ }
+}
Modified: trunk/core/libyui/src/YApplication.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YApplication.h?rev=43796&r1=43795&r2=43796&view=diff
==============================================================================
--- trunk/core/libyui/src/YApplication.h (original)
+++ trunk/core/libyui/src/YApplication.h Mon Jan 21 16:17:39 2008
@@ -133,6 +133,29 @@
string language( bool stripEncoding = false ) const;
/**
+ * Return a string for a named glyph:
+ *
+ * YUIGlyph_ArrowLeft
+ * YUIGlyph_ArrowRight
+ * YUIGlyph_ArrowUp
+ * YUIGlyph_ArrowDown
+ * YUIGlyph_CheckMark
+ * YUIGlyph_BulletArrowRight
+ * YUIGlyph_BulletCircle
+ * YUIGlyph_BulletSquare
+ *
+ * Using this is discouraged in new applications.
+ * This method is available for backward compatibility.
+ *
+ * This default implementation returns simple textual representations for
+ * each glyph simbol (e.g., "->" for YUIGlyphArrorRight).
+ *
+ * Derived classes are free to overwrite this. It does not make sense to
+ * call this base class method in a new implementation.
+ **/
+ virtual string glyph( const string & glyphSymbolName );
+
+ /**
* Open a directory selection box and prompt the user for an existing
* directory.
*
@@ -193,6 +216,7 @@
private:
+
ImplPtr<YApplicationPrivate> priv;
};
Modified: trunk/core/libyui/src/YUI.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YUI.h?rev=43796&r1=43795&r2=43796&view=diff
==============================================================================
--- trunk/core/libyui/src/YUI.h (original)
+++ trunk/core/libyui/src/YUI.h Mon Jan 21 16:17:39 2008
@@ -434,17 +434,6 @@
**/
virtual void closeDialog( YDialog *dialog );
-
- /**
- * Implement the 'Glyph()' builtin in the specific UI:
- *
- * Return a representation for the glyph symbol specified in UTF-8 encoding
- * or an empty string to get a default textual representation.
- *
- * Derived UIs may or may not choose to overwrite this.
- **/
- virtual YCPString glyph( const YCPSymbol & glyphSymbol ) { return YCPString( "" ); }
-
protected:
Modified: trunk/core/libyui/src/YUI_builtins.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YUI_builtins.cc?rev=43796&r1=43795&r2=43796&view=diff
==============================================================================
--- trunk/core/libyui/src/YUI_builtins.cc (original)
+++ trunk/core/libyui/src/YUI_builtins.cc Mon Jan 21 16:17:39 2008
@@ -1414,32 +1414,10 @@
*/
YCPString YUI::evaluateGlyph( const YCPSymbol & glyphSym )
{
- YCPString glyphText = glyph( glyphSym ); // ask specific UI
-
- if ( glyphText->value().length() == 0 ) // specific UI doesn't have a suitable representation
- {
- string sym = glyphSym->symbol();
-
- if ( sym == YUIGlyph_ArrowLeft ) glyphText = YCPString( "<-" );
- else if ( sym == YUIGlyph_ArrowRight ) glyphText = YCPString( "->" );
- else if ( sym == YUIGlyph_ArrowUp ) glyphText = YCPString( "^" );
- else if ( sym == YUIGlyph_ArrowDown ) glyphText = YCPString( "v" );
- else if ( sym == YUIGlyph_CheckMark ) glyphText = YCPString( "x" );
- else if ( sym == YUIGlyph_BulletArrowRight ) glyphText = YCPString( "=>" );
- else if ( sym == YUIGlyph_BulletCircle ) glyphText = YCPString( "o" );
- else if ( sym == YUIGlyph_BulletSquare ) glyphText = YCPString( "[]" );
- else // unknown glyph symbol
- {
- yuiError() << "Unknown glyph `" << sym << endl;
- return YCPNull();
- }
- }
-
- return glyphText;
+ return YCPString( YUI::app()->glyph( glyphSym->symbol() ) );
}
-
/**
* @builtin GetDisplayInfo
* @short Gets Display Info
Modified: trunk/ncurses/yast2-ncurses.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/yast2-ncurses.spec.in?rev=43796&r1=43795&r2=43796&view=diff
==============================================================================
--- trunk/ncurses/yast2-ncurses.spec.in (original)
+++ trunk/ncurses/yast2-ncurses.spec.in Mon Jan 21 16:17:39 2008
@@ -17,8 +17,8 @@
Provides: y2curses
Obsoletes: y2curses
Requires: glibc-locale
-BuildRequires: yast2-core-devel >= 2.16.15
-Requires: yast2-core >= 2.16.15
+BuildRequires: yast2-core-devel >= 2.16.23
+Requires: yast2-core >= 2.16.23
#adapted to libzypp 3.11 refactoring
Requires: libzypp >= 3.11.8
#FSize.h and YRpmGroupsTree.h moved to libyui
Modified: trunk/qt/src/YQApplication.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQApplication.cc?rev=43796&r1=43795&r2=43796&view=diff
==============================================================================
--- trunk/qt/src/YQApplication.cc (original)
+++ trunk/qt/src/YQApplication.cc Mon Jan 21 16:17:39 2008
@@ -27,6 +27,7 @@
#define y2log_component "qt-ui"
#include