diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2012-06-27 16:16:41 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2012-06-27 16:16:41 +0000 |
| commit | 181bc5313dbe9bbbeff2454ceca9d7450482716d (patch) | |
| tree | 613db9b030f000ad97cc72975d55f89712c63d84 | |
| parent | 299214e2a3ede0f2f3b469a63d112ca8cf8bc304 (diff) | |
| download | qmmp-181bc5313dbe9bbbeff2454ceca9d7450482716d.tar.gz qmmp-181bc5313dbe9bbbeff2454ceca9d7450482716d.tar.bz2 qmmp-181bc5313dbe9bbbeff2454ceca9d7450482716d.zip | |
added sessions support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2746 90c681e8-e032-0410-971d-27865f9a5e38
| -rw-r--r-- | src/app/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/app/app.pro | 8 | ||||
| -rw-r--r-- | src/app/main.cpp | 3 | ||||
| -rw-r--r-- | src/app/qmmpapplication.cpp | 34 | ||||
| -rw-r--r-- | src/app/qmmpapplication.h | 39 |
5 files changed, 83 insertions, 4 deletions
diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index cccd176ea..acbbd2483 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -33,6 +33,7 @@ SET(app_SRCS main.cpp qmmpstarter.cpp lxdesupport.cpp + qmmpapplication.cpp ) SET(app_HDRS lxdesupport.h) @@ -40,7 +41,7 @@ SET(app_HDRS lxdesupport.h) SET(app_MOC_HDRS builtincommandlineoption.h qmmpstarter.h - + qmmpapplication.h ) SET(app_RCCS images/images.qrc translations/qmmp_locales.qrc) diff --git a/src/app/app.pro b/src/app/app.pro index cc7597f76..12362d557 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -2,13 +2,15 @@ include(../../qmmp.pri) HEADERS += qmmpstarter.h \ builtincommandlineoption.h \ - lxdesupport.h + lxdesupport.h \ + qmmpapplication.h SOURCES += \ qmmpstarter.cpp \ builtincommandlineoption.cpp \ lxdesupport.cpp \ - main.cpp + main.cpp \ + qmmpapplication.cpp @@ -75,3 +77,5 @@ TRANSLATIONS = translations/qmmp_ru.ts \ translations/qmmp_ja.ts \ translations/qmmp_es.ts \ translations/qmmp_sk.ts + + diff --git a/src/app/main.cpp b/src/app/main.cpp index e19014b75..f9efa8540 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -27,11 +27,12 @@ #include <stdlib.h> #include <qmmp/qmmp.h> #include "lxdesupport.h" +#include "qmmpapplication.h" #include "qmmpstarter.h" int main(int argc, char *argv[]) { - QApplication a (argc, argv ); + QmmpApplication a (argc, argv ); a.setApplicationName("qmmp"); a.setWindowIcon(QIcon(":/32x32/qmmp.png")); diff --git a/src/app/qmmpapplication.cpp b/src/app/qmmpapplication.cpp new file mode 100644 index 000000000..b2a92ee58 --- /dev/null +++ b/src/app/qmmpapplication.cpp @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (C) 2012 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include <qmmpui/uihelper.h> +#include "qmmpapplication.h" + +QmmpApplication::QmmpApplication(int &argc, char **argv) : QApplication(argc, argv) +{ +} + +void QmmpApplication::commitData(QSessionManager &manager) +{ + if(UiHelper::instance()) + UiHelper::instance()->exit(); + else + QApplication::commitData(manager); +} diff --git a/src/app/qmmpapplication.h b/src/app/qmmpapplication.h new file mode 100644 index 000000000..694668f64 --- /dev/null +++ b/src/app/qmmpapplication.h @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (C) 2012 by Ilya Kotov * + * forkotov02@hotmail.ru * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef QMMPAPPLICATION_H +#define QMMPAPPLICATION_H + +#include <QApplication> + +/** + @author Ilya Kotov <forkotov02@hotmail.ru> +*/ +class QmmpApplication : public QApplication +{ + Q_OBJECT +public: + explicit QmmpApplication(int &argc, char **argv); + + void commitData(QSessionManager &manager); + +}; + +#endif // QMMPAPPLICATION_H |
