28 #define YUILogComponent "ui"
31 #include "YApplication.h"
33 #include "YUIException.h"
34 #include "YShortcut.h"
37 #include "YCommandLine.h"
41 typedef std::map<std::string, int> YFunctionKeyMap;
47 : productName(
"openSUSE" )
48 , reverseLayout(
false )
51 std::string productName;
53 std::string applicationTitle;
54 std::string applicationIcon;
55 YFunctionKeyMap defaultFunctionKey;
57 std::map<std::string,std::string> releaseNotes;
64 YUI_CHECK_NEW( priv );
67 if ( cmdLine.
argc() > 0 )
68 priv->applicationTitle = cmdLine.
arg(0);
93 return priv->iconLoader->iconBasePath();
100 priv->iconLoader->setIconBasePath ( newIconBasePath );
104 YApplication::iconLoader()
106 return priv->iconLoader;
119 return priv->productName;
125 priv->releaseNotes = relNotes;
128 std::map<std::string,std::string>
131 return priv->releaseNotes;
137 priv->reverseLayout = reverse;
143 return priv->reverseLayout;
150 YFunctionKeyMap::const_iterator result =
153 if ( result == priv->defaultFunctionKey.end() )
156 return result->second;
173 priv->defaultFunctionKey.clear();
182 if ( ! encoding.empty() )
188 setenv(
"LANG", lang.c_str(), 1 );
189 setlocale( LC_NUMERIC,
"C" );
191 yuiMilestone() <<
"Setting language to " << lang << endl;
198 const char *lang_env = getenv(
"LANG" );
203 std::string lang( lang_env );
207 std::string::size_type pos = lang.find_first_of(
".@" );
209 if ( pos != std::string::npos )
211 lang = lang.substr( 0, pos );
222 if ( sym == YUIGlyph_ArrowLeft )
return (
reverseLayout() ?
"->" :
"<-" );
223 else if ( sym == YUIGlyph_ArrowRight )
return (
reverseLayout() ?
"<-" :
"->" );
224 else if ( sym == YUIGlyph_ArrowUp )
return (
"^" );
225 else if ( sym == YUIGlyph_ArrowDown )
return (
"v" );
226 else if ( sym == YUIGlyph_CheckMark )
return (
"x" );
227 else if ( sym == YUIGlyph_BulletArrowRight )
return (
"=>" );
228 else if ( sym == YUIGlyph_BulletCircle )
return (
"o" );
229 else if ( sym == YUIGlyph_BulletSquare )
return (
"[]" );
232 yuiError() <<
"Unknown glyph `" << sym << endl;
249 return (
int) ( layoutUnits + 0.5 );
263 yuiError() <<
"Not in text mode: Cannot run external program in terminal." << endl;
270 priv->applicationTitle = title;
275 return priv->applicationTitle;
280 priv->applicationIcon = icon;
284 return priv->applicationIcon;