-rw-r--r-- | library/qpeapplication.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 34f5e6a..d959c7a 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -1708,134 +1708,134 @@ void QPEApplication::pidMessage( const QCString& msg, const QByteArray& data) | |||
1708 | emit reload(); | 1708 | emit reload(); |
1709 | } | 1709 | } |
1710 | else if ( msg == "setDocument(QString)" ) { | 1710 | else if ( msg == "setDocument(QString)" ) { |
1711 | d->keep_running = TRUE; | 1711 | d->keep_running = TRUE; |
1712 | QDataStream stream( data, IO_ReadOnly ); | 1712 | QDataStream stream( data, IO_ReadOnly ); |
1713 | QString doc; | 1713 | QString doc; |
1714 | stream >> doc; | 1714 | stream >> doc; |
1715 | QWidget *mw = mainWidget(); | 1715 | QWidget *mw = mainWidget(); |
1716 | if ( !mw ) | 1716 | if ( !mw ) |
1717 | mw = d->qpe_main_widget; | 1717 | mw = d->qpe_main_widget; |
1718 | if ( mw ) | 1718 | if ( mw ) |
1719 | Global::setDocument( mw, doc ); | 1719 | Global::setDocument( mw, doc ); |
1720 | 1720 | ||
1721 | } else if ( msg == "QPEProcessQCop()" ) { | 1721 | } else if ( msg == "QPEProcessQCop()" ) { |
1722 | processQCopFile(); | 1722 | processQCopFile(); |
1723 | d->sendQCopQ(); | 1723 | d->sendQCopQ(); |
1724 | }else | 1724 | }else |
1725 | { | 1725 | { |
1726 | bool p = d->keep_running; | 1726 | bool p = d->keep_running; |
1727 | d->keep_running = FALSE; | 1727 | d->keep_running = FALSE; |
1728 | emit appMessage( msg, data); | 1728 | emit appMessage( msg, data); |
1729 | if ( d->keep_running ) { | 1729 | if ( d->keep_running ) { |
1730 | d->notbusysent = FALSE; | 1730 | d->notbusysent = FALSE; |
1731 | raiseAppropriateWindow(); | 1731 | raiseAppropriateWindow(); |
1732 | if ( !p ) { | 1732 | if ( !p ) { |
1733 | // Tell the system we're still chugging along... | 1733 | // Tell the system we're still chugging along... |
1734 | #ifndef QT_NO_COP | 1734 | #ifndef QT_NO_COP |
1735 | QCopEnvelope e("QPE/System", "appRaised(QString)"); | 1735 | QCopEnvelope e("QPE/System", "appRaised(QString)"); |
1736 | e << d->appName; | 1736 | e << d->appName; |
1737 | #endif | 1737 | #endif |
1738 | } | 1738 | } |
1739 | } | 1739 | } |
1740 | if ( p ) | 1740 | if ( p ) |
1741 | d->keep_running = p; | 1741 | d->keep_running = p; |
1742 | } | 1742 | } |
1743 | #endif | 1743 | #endif |
1744 | } | 1744 | } |
1745 | 1745 | ||
1746 | 1746 | ||
1747 | /*! | 1747 | /*! |
1748 | Sets widget \a mw as the mainWidget() and shows it. For small windows, | 1748 | Sets widget \a mw as the mainWidget() and shows it. For small windows, |
1749 | consider passing TRUE for \a nomaximize rather than the default FALSE. | 1749 | consider passing TRUE for \a nomaximize rather than the default FALSE. |
1750 | 1750 | ||
1751 | \sa showMainDocumentWidget() | 1751 | \sa showMainDocumentWidget() |
1752 | */ | 1752 | */ |
1753 | void QPEApplication::showMainWidget( QWidget* mw, bool nomaximize ) | 1753 | void QPEApplication::showMainWidget( QWidget* mw, bool nomaximize ) |
1754 | { | 1754 | { |
1755 | // setMainWidget(mw); this breaks FastLoading because lastWindowClose() would quit | 1755 | // setMainWidget(mw); this breaks FastLoading because lastWindowClose() would quit |
1756 | d->show(mw, nomaximize ); | 1756 | d->show(mw, nomaximize ); |
1757 | } | 1757 | } |
1758 | 1758 | ||
1759 | /*! | 1759 | /*! |
1760 | Sets widget \a mw as the mainWidget() and shows it. For small windows, | 1760 | Sets widget \a mw as the mainWidget() and shows it. For small windows, |
1761 | consider passing TRUE for \a nomaximize rather than the default FALSE. | 1761 | consider passing TRUE for \a nomaximize rather than the default FALSE. |
1762 | 1762 | ||
1763 | This calls designates the application as | 1763 | This calls designates the application as |
1764 | a \link docwidget.html document-oriented\endlink application. | 1764 | a \link docwidget.html document-oriented\endlink application. |
1765 | 1765 | ||
1766 | The \a mw widget \e must have this slot: setDocument(const QString&). | 1766 | The \a mw widget \e must have this slot: setDocument(const QString&). |
1767 | 1767 | ||
1768 | \sa showMainWidget() | 1768 | \sa showMainWidget() |
1769 | */ | 1769 | */ |
1770 | void QPEApplication::showMainDocumentWidget( QWidget* mw, bool nomaximize ) | 1770 | void QPEApplication::showMainDocumentWidget( QWidget* mw, bool nomaximize ) |
1771 | { | 1771 | { |
1772 | if ( mw && argc() == 2 ) | 1772 | if ( mw ) { |
1773 | Global::setDocument( mw, QString::fromUtf8(argv()[1]) ); | 1773 | if ( argc() == 2 ) |
1774 | Global::setDocument( mw, QString::fromUtf8(argv()[1]) ); | ||
1774 | 1775 | ||
1775 | 1776 | d->show(mw, nomaximize ); | |
1776 | // setMainWidget(mw); see above | 1777 | } |
1777 | d->show(mw, nomaximize ); | ||
1778 | } | 1778 | } |
1779 | 1779 | ||
1780 | 1780 | ||
1781 | /*! | 1781 | /*! |
1782 | If an application is started via a \link qcop.html QCop\endlink | 1782 | If an application is started via a \link qcop.html QCop\endlink |
1783 | message, the application will process the \link qcop.html | 1783 | message, the application will process the \link qcop.html |
1784 | QCop\endlink message and then quit. If the application calls this | 1784 | QCop\endlink message and then quit. If the application calls this |
1785 | function while processing a \link qcop.html QCop\endlink message, | 1785 | function while processing a \link qcop.html QCop\endlink message, |
1786 | after processing its outstanding \link qcop.html QCop\endlink | 1786 | after processing its outstanding \link qcop.html QCop\endlink |
1787 | messages the application will start 'properly' and show itself. | 1787 | messages the application will start 'properly' and show itself. |
1788 | 1788 | ||
1789 | \sa keepRunning() | 1789 | \sa keepRunning() |
1790 | */ | 1790 | */ |
1791 | void QPEApplication::setKeepRunning() | 1791 | void QPEApplication::setKeepRunning() |
1792 | { | 1792 | { |
1793 | if ( qApp && qApp->inherits( "QPEApplication" ) ) { | 1793 | if ( qApp && qApp->inherits( "QPEApplication" ) ) { |
1794 | QPEApplication * qpeApp = ( QPEApplication* ) qApp; | 1794 | QPEApplication * qpeApp = ( QPEApplication* ) qApp; |
1795 | qpeApp->d->keep_running = TRUE; | 1795 | qpeApp->d->keep_running = TRUE; |
1796 | } | 1796 | } |
1797 | } | 1797 | } |
1798 | 1798 | ||
1799 | /*! | 1799 | /*! |
1800 | Returns TRUE if the application will quit after processing the | 1800 | Returns TRUE if the application will quit after processing the |
1801 | current list of qcop messages; otherwise returns FALSE. | 1801 | current list of qcop messages; otherwise returns FALSE. |
1802 | 1802 | ||
1803 | \sa setKeepRunning() | 1803 | \sa setKeepRunning() |
1804 | */ | 1804 | */ |
1805 | bool QPEApplication::keepRunning() const | 1805 | bool QPEApplication::keepRunning() const |
1806 | { | 1806 | { |
1807 | return d->keep_running; | 1807 | return d->keep_running; |
1808 | } | 1808 | } |
1809 | 1809 | ||
1810 | /*! | 1810 | /*! |
1811 | \internal | 1811 | \internal |
1812 | */ | 1812 | */ |
1813 | void QPEApplication::internalSetStyle( const QString &style ) | 1813 | void QPEApplication::internalSetStyle( const QString &style ) |
1814 | { | 1814 | { |
1815 | #if QT_VERSION >= 0x030000 | 1815 | #if QT_VERSION >= 0x030000 |
1816 | if ( style == "QPE" ) { | 1816 | if ( style == "QPE" ) { |
1817 | setStyle( new QPEStyle ); | 1817 | setStyle( new QPEStyle ); |
1818 | } | 1818 | } |
1819 | else { | 1819 | else { |
1820 | QStyle *s = QStyleFactory::create( style ); | 1820 | QStyle *s = QStyleFactory::create( style ); |
1821 | if ( s ) | 1821 | if ( s ) |
1822 | setStyle( s ); | 1822 | setStyle( s ); |
1823 | } | 1823 | } |
1824 | #else | 1824 | #else |
1825 | if ( style == "Windows" ) { | 1825 | if ( style == "Windows" ) { |
1826 | setStyle( new QWindowsStyle ); | 1826 | setStyle( new QWindowsStyle ); |
1827 | } | 1827 | } |
1828 | else if ( style == "QPE" ) { | 1828 | else if ( style == "QPE" ) { |
1829 | setStyle( new QPEStyle ); | 1829 | setStyle( new QPEStyle ); |
1830 | } | 1830 | } |
1831 | else if ( style == "Light" ) { | 1831 | else if ( style == "Light" ) { |
1832 | setStyle( new LightStyle ); | 1832 | setStyle( new LightStyle ); |
1833 | } | 1833 | } |
1834 | #ifndef QT_NO_STYLE_PLATINUM | 1834 | #ifndef QT_NO_STYLE_PLATINUM |
1835 | else if ( style == "Platinum" ) { | 1835 | else if ( style == "Platinum" ) { |
1836 | setStyle( new QPlatinumStyle ); | 1836 | setStyle( new QPlatinumStyle ); |
1837 | } | 1837 | } |
1838 | #endif | 1838 | #endif |
1839 | #ifndef QT_NO_STYLE_MOTIF | 1839 | #ifndef QT_NO_STYLE_MOTIF |
1840 | else if ( style == "Motif" ) { | 1840 | else if ( style == "Motif" ) { |
1841 | setStyle( new QMotifStyle ); | 1841 | setStyle( new QMotifStyle ); |