Commit d15a5903 authored by vfjpl's avatar vfjpl

consolidation of notifier and notifier_kde

parent 72419e60
......@@ -2,6 +2,7 @@
* This file is part of Manjaro Settings Manager.
*
* Ramon Buldó <ramon@manjaro.org>
* Kacper Piwiński
*
* Manjaro Settings Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -37,4 +37,3 @@ public:
};
#endif //NOTIFIERAPP_H
......@@ -2,6 +2,7 @@
* This file is part of Manjaro Settings Manager.
*
* Ramon Buldó <ramon@manjaro.org>
* Kacper Piwiński
*
* Manjaro Settings Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -54,23 +55,20 @@ int main( int argc, char* argv[] )
{
NotifierSettingsDialog* m_settingsDialog = new NotifierSettingsDialog( NULL );
m_settingsDialog->setAttribute( Qt::WidgetAttribute::WA_DeleteOnClose, true );
m_settingsDialog->exec();
return 0;
return m_settingsDialog->exec();
}
// ensure only one tray icon application is runnung
KDSingleApplicationGuard guard( KDSingleApplicationGuard::AutoKillOtherInstances );
int returnCode = 0;
if ( guard.isPrimaryInstance() )
{
app.init();
Notifier notifier( &app );
returnCode = app.exec();
return app.exec();
}
else
qDebug() << "MSM Notifier is already running, shutting down.";
return returnCode;
return 0;
}
......@@ -23,9 +23,8 @@
#include "LanguagePackagesItem.h"
#include "NotifierSettingsDialog.h"
#include <KNotifications/KStatusNotifierItem>
#include <QtCore/QTimer>
#include <KNotifications/KStatusNotifierItem>
class Notifier : public QObject
{
......
......@@ -2,6 +2,7 @@
* This file is part of Manjaro Settings Manager.
*
* Ramon Buldó <ramon@manjaro.org>
* Kacper Piwiński
*
* Manjaro Settings Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -30,6 +31,7 @@ NotifierApp::NotifierApp( int& argc, char* argv[] )
setOrganizationDomain( "Manjaro" );
setApplicationName( "MSM Notifier for Plasma5" );
setApplicationVersion( PROJECT_VERSION );
setQuitOnLastWindowClosed( false );
}
......
......@@ -37,4 +37,3 @@ public:
};
#endif //NOTIFIERAPP_H
......@@ -2,6 +2,7 @@
* This file is part of Manjaro Settings Manager.
*
* Ramon Buldó <ramon@manjaro.org>
* Kacper Piwiński
*
* Manjaro Settings Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -24,9 +25,8 @@
#include <QtWidgets/QApplication>
#include <QtCore/QTranslator>
#include <QtCore/QFile>
#include <QtCore/QCommandLineParser>
#include <QtCore/QDir>
#include <QtCore/QCommandLineParser>
#include <QDebug>
int main( int argc, char* argv[] )
......@@ -37,6 +37,9 @@ int main( int argc, char* argv[] )
Q_INIT_RESOURCE( translations );
QCommandLineParser parser;
parser.setApplicationDescription( app.applicationName() );
parser.addHelpOption();
QCommandLineOption settingsOption( QStringList() << "s" << "settings",
"Show msm notifier options" );
parser.addOption( settingsOption );
......@@ -52,22 +55,20 @@ int main( int argc, char* argv[] )
{
NotifierSettingsDialog* m_settingsDialog = new NotifierSettingsDialog( NULL );
m_settingsDialog->setAttribute( Qt::WidgetAttribute::WA_DeleteOnClose, true );
m_settingsDialog->exec();
return 0;
return m_settingsDialog->exec();
}
// ensure only one tray icon application is runnung
KDSingleApplicationGuard guard( KDSingleApplicationGuard::AutoKillOtherInstances );
int returnCode = 0;
if ( guard.isPrimaryInstance() )
{
app.init();
Notifier notifier( &app );
returnCode = app.exec();
return app.exec();
}
else
qDebug() << "MSM Notifier is already running, shutting down.";
return returnCode;
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment