summaryrefslogtreecommitdiff
path: root/libopie2/opiecore
Side-by-side diff
Diffstat (limited to 'libopie2/opiecore') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/oapplication.cpp14
-rw-r--r--libopie2/opiecore/oapplication.h16
2 files changed, 30 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
@@ -92,11 +92,13 @@ void OApplication::init()
}
}
+
void OApplication::setMainWidget( QWidget* widget )
{
showMainWidget( widget );
}
+
void OApplication::showMainWidget( QWidget* widget, bool nomax )
{
#ifdef Q_WS_QWS
@@ -106,5 +108,17 @@ void OApplication::showMainWidget( QWidget* widget, bool nomax )
widget->show();
#endif
widget->setCaption( _appname );
+}
+
+void OApplication::setTitle( QString title ) const
+{
+ if ( mainWidget() )
+ {
+ if ( !title.isNull() )
+ mainWidget()->setCaption( QString(_appname) + QString( " - " ) + title );
+ else
+ mainWidget()->setCaption( _appname );
+ }
}
+
diff --git a/libopie2/opiecore/oapplication.h b/libopie2/opiecore/oapplication.h
index 736e786..4d25202 100644
--- a/libopie2/opiecore/oapplication.h
+++ b/libopie2/opiecore/oapplication.h
@@ -69,6 +69,7 @@ class OApplication: public OApplicationBaseClass
* more than one cannot be created in the same application. It
* saves you the trouble of having to pass the pointer explicitly
* to every function that may require it.
+ *
* @return the current application object
*/
static const OApplication* oApplication() { return _instance; };
@@ -92,15 +93,30 @@ class OApplication: public OApplicationBaseClass
/**
* Sets the main widget - reimplemented to call showMainWidget()
* on Qt/Embedded.
+ *
+ * @param mainWidget the widget to become the main widget
+ * @see QWidget object
*/
virtual void setMainWidget( QWidget *mainWidget );
/**
* Shows the main widget - reimplemented to call setMainWidget()
* on platforms other than Qt/Embedded.
+ *
+ * @param mainWidget the widget to become the main widget
+ * @see QWidget object
*/
virtual void showMainWidget( QWidget* widget, bool nomax = false );
+ /**
+ * Set the application title. The application title will be concatenated
+ * to the application name given in the constructor.
+ *
+ * @param title the title. If not given, resets caption to appname
+ */
+ virtual void setTitle( QString title = QString::null ) const;
+ //virtual void setTitle() const;
+
protected:
void init();