Diffstat (limited to 'libopie2/opiecore/oapplication.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/oapplication.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libopie2/opiecore/oapplication.cpp b/libopie2/opiecore/oapplication.cpp index a0abcc2..12418d5 100644 --- a/libopie2/opiecore/oapplication.cpp +++ b/libopie2/opiecore/oapplication.cpp | |||
@@ -71,40 +71,54 @@ OApplication::~OApplication() | |||
71 | 71 | ||
72 | OConfig* OApplication::config() | 72 | OConfig* OApplication::config() |
73 | { | 73 | { |
74 | if ( not _config ) | 74 | if ( not _config ) |
75 | { | 75 | { |
76 | _config = new OConfig( _appname ); | 76 | _config = new OConfig( _appname ); |
77 | } | 77 | } |
78 | return _config; | 78 | return _config; |
79 | } | 79 | } |
80 | 80 | ||
81 | 81 | ||
82 | void OApplication::init() | 82 | void OApplication::init() |
83 | { | 83 | { |
84 | d = new OApplicationPrivate(); | 84 | d = new OApplicationPrivate(); |
85 | if ( !OApplication::_instance ) | 85 | if ( !OApplication::_instance ) |
86 | { | 86 | { |
87 | OApplication::_instance = this; | 87 | OApplication::_instance = this; |
88 | } | 88 | } |
89 | else | 89 | else |
90 | { | 90 | { |
91 | qFatal( "OApplication: Can't create more than one OApplication object. Aborting." ); | 91 | qFatal( "OApplication: Can't create more than one OApplication object. Aborting." ); |
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||
95 | |||
95 | void OApplication::setMainWidget( QWidget* widget ) | 96 | void OApplication::setMainWidget( QWidget* widget ) |
96 | { | 97 | { |
97 | showMainWidget( widget ); | 98 | showMainWidget( widget ); |
98 | } | 99 | } |
99 | 100 | ||
101 | |||
100 | void OApplication::showMainWidget( QWidget* widget, bool nomax ) | 102 | void OApplication::showMainWidget( QWidget* widget, bool nomax ) |
101 | { | 103 | { |
102 | #ifdef Q_WS_QWS | 104 | #ifdef Q_WS_QWS |
103 | QPEApplication::showMainWidget( widget, nomax ); | 105 | QPEApplication::showMainWidget( widget, nomax ); |
104 | #else | 106 | #else |
105 | QApplication::setMainWidget( widget ); | 107 | QApplication::setMainWidget( widget ); |
106 | widget->show(); | 108 | widget->show(); |
107 | #endif | 109 | #endif |
108 | widget->setCaption( _appname ); | 110 | widget->setCaption( _appname ); |
111 | } | ||
109 | 112 | ||
113 | |||
114 | void OApplication::setTitle( QString title ) const | ||
115 | { | ||
116 | if ( mainWidget() ) | ||
117 | { | ||
118 | if ( !title.isNull() ) | ||
119 | mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title ); | ||
120 | else | ||
121 | mainWidget()->setCaption( _appname ); | ||
110 | } | 122 | } |
123 | } | ||
124 | |||