mirror of
https://github.com/arcan1s/netctl-gui.git
synced 2025-04-24 15:37:23 +00:00
implement datetime logging feature
This commit is contained in:
parent
168a270c98
commit
7dc1a5eda3
@ -8,7 +8,7 @@ ProjectRootRelative=./
|
|||||||
|
|
||||||
[CMake][CMake Build Directory 0]
|
[CMake][CMake Build Directory 0]
|
||||||
Build Directory Path=file:///home/arcanis/Documents/github/netctl-gui/build
|
Build Directory Path=file:///home/arcanis/Documents/github/netctl-gui/build
|
||||||
Build Type=Debug
|
Build Type=Release
|
||||||
CMake Binary=file:///usr/bin/cmake
|
CMake Binary=file:///usr/bin/cmake
|
||||||
Environment Profile=
|
Environment Profile=
|
||||||
Extra Arguments=
|
Extra Arguments=
|
||||||
|
2
sources/3rdparty/pdebug
vendored
2
sources/3rdparty/pdebug
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 9be4fe36819cc48a574b5f649ddb210b432e2097
|
Subproject commit 75e4a0df83478802bba53345486b42c56713fe09
|
@ -39,7 +39,12 @@ include_directories (${CMAKE_SOURCE_DIR}
|
|||||||
set (PLUGIN_NAME ${SUBPROJECT})
|
set (PLUGIN_NAME ${SUBPROJECT})
|
||||||
file (GLOB SUBPROJECT_DESKTOP_IN *.desktop)
|
file (GLOB SUBPROJECT_DESKTOP_IN *.desktop)
|
||||||
file (RELATIVE_PATH SUBPROJECT_DESKTOP ${CMAKE_SOURCE_DIR} ${SUBPROJECT_DESKTOP_IN})
|
file (RELATIVE_PATH SUBPROJECT_DESKTOP ${CMAKE_SOURCE_DIR} ${SUBPROJECT_DESKTOP_IN})
|
||||||
file (GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp)
|
if (BUILD_KDE4)
|
||||||
|
file (GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp)
|
||||||
|
else ()
|
||||||
|
file (GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp
|
||||||
|
${PROJECT_TRDPARTY_DIR}/pdebug/*.cpp)
|
||||||
|
endif ()
|
||||||
set (TASK_HEADER ${PROJECT_TRDPARTY_DIR}/task/task.h)
|
set (TASK_HEADER ${PROJECT_TRDPARTY_DIR}/task/task.h)
|
||||||
file (GLOB SUBPROJECT_CONF *.conf)
|
file (GLOB SUBPROJECT_CONF *.conf)
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include <KStandardDirs>
|
#include <KStandardDirs>
|
||||||
#else
|
#else
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
#include <pdebug/pdebug-time.h>
|
||||||
#endif /* BUILD_KDE4 */
|
#endif /* BUILD_KDE4 */
|
||||||
|
|
||||||
|
|
||||||
@ -44,6 +45,9 @@ Netctl::Netctl(QObject *parent, const QVariantList &args)
|
|||||||
{
|
{
|
||||||
Q_UNUSED(args)
|
Q_UNUSED(args)
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
qInstallMessageHandler(debugString);
|
||||||
|
#endif /* QT_VERSION >= 0x050000 */
|
||||||
// debug
|
// debug
|
||||||
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
|
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
|
||||||
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
|
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
# set files
|
# set files
|
||||||
file (GLOB_RECURSE SOURCES *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp
|
if (USE_QT5)
|
||||||
${PROJECT_TRDPARTY_DIR}/language/*.cpp
|
file (GLOB_RECURSE SOURCES *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp
|
||||||
${PROJECT_TRDPARTY_DIR}/listmap/*.cpp)
|
${PROJECT_TRDPARTY_DIR}/language/*.cpp
|
||||||
|
${PROJECT_TRDPARTY_DIR}/listmap/*.cpp
|
||||||
|
${PROJECT_TRDPARTY_DIR}/pdebug/*.cpp)
|
||||||
|
else ()
|
||||||
|
file (GLOB_RECURSE SOURCES *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp
|
||||||
|
${PROJECT_TRDPARTY_DIR}/language/*.cpp
|
||||||
|
${PROJECT_TRDPARTY_DIR}/listmap/*.cpp)
|
||||||
|
endif ()
|
||||||
file (GLOB_RECURSE HEADERS *.h ${PROJECT_TRDPARTY_DIR}/task/*.h
|
file (GLOB_RECURSE HEADERS *.h ${PROJECT_TRDPARTY_DIR}/task/*.h
|
||||||
${PROJECT_TRDPARTY_DIR}/language/*.h)
|
${PROJECT_TRDPARTY_DIR}/language/*.h)
|
||||||
file (GLOB_RECURSE FORMS *.ui ${PROJECT_TRDPARTY_DIR}/about/*.ui)
|
file (GLOB_RECURSE FORMS *.ui ${PROJECT_TRDPARTY_DIR}/about/*.ui)
|
||||||
|
@ -32,6 +32,10 @@
|
|||||||
#include "messages.h"
|
#include "messages.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
#include <pdebug/pdebug-time.h>
|
||||||
|
#endif /* QT_VERSION >= 0x050000 */
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -157,6 +161,9 @@ int main(int argc, char *argv[])
|
|||||||
// detach from console
|
// detach from console
|
||||||
if (args[QString("detached")].toBool())
|
if (args[QString("detached")].toBool())
|
||||||
daemon(0, 0);
|
daemon(0, 0);
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
qInstallMessageHandler(debugString);
|
||||||
|
#endif
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
QApplication::setQuitOnLastWindowClosed(false);
|
QApplication::setQuitOnLastWindowClosed(false);
|
||||||
// reread translations according to flags
|
// reread translations according to flags
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
# set files
|
# set files
|
||||||
file (GLOB_RECURSE SOURCES *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp
|
if (USE_QT5)
|
||||||
${PROJECT_TRDPARTY_DIR}/language/*.cpp
|
file (GLOB_RECURSE SOURCES *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp
|
||||||
${PROJECT_TRDPARTY_DIR}/listmap/*.cpp)
|
${PROJECT_TRDPARTY_DIR}/language/*.cpp
|
||||||
|
${PROJECT_TRDPARTY_DIR}/listmap/*.cpp
|
||||||
|
${PROJECT_TRDPARTY_DIR}/pdebug/*.cpp)
|
||||||
|
else ()
|
||||||
|
file (GLOB_RECURSE SOURCES *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp
|
||||||
|
${PROJECT_TRDPARTY_DIR}/language/*.cpp
|
||||||
|
${PROJECT_TRDPARTY_DIR}/listmap/*.cpp)
|
||||||
|
endif ()
|
||||||
file (GLOB_RECURSE HEADERS *.h ${PROJECT_TRDPARTY_DIR}/task/*.h
|
file (GLOB_RECURSE HEADERS *.h ${PROJECT_TRDPARTY_DIR}/task/*.h
|
||||||
${PROJECT_TRDPARTY_DIR}/language/*.h)
|
${PROJECT_TRDPARTY_DIR}/language/*.h)
|
||||||
|
|
||||||
|
@ -32,6 +32,10 @@
|
|||||||
#include "netctlhelper.h"
|
#include "netctlhelper.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
|
#if QT_VERSION >= 0x050000
|
||||||
|
#include <pdebug/pdebug-time.h>
|
||||||
|
#endif /* QT_VERSION >= 0x050000 */
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -115,6 +119,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
#if QT_VERSION >= 0x050000
|
||||||
QCoreApplication::setSetuidAllowed(true);
|
QCoreApplication::setSetuidAllowed(true);
|
||||||
|
qInstallMessageHandler(debugString);
|
||||||
#endif
|
#endif
|
||||||
QCoreApplication a(argc, argv);
|
QCoreApplication a(argc, argv);
|
||||||
// reread translations according to flags
|
// reread translations according to flags
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
# set files
|
# set files
|
||||||
file (GLOB_RECURSE SOURCES *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp)
|
if (USE_QT5)
|
||||||
|
file (GLOB_RECURSE SOURCES *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp
|
||||||
|
${PROJECT_TRDPARTY_DIR}/pdebug/*.cpp)
|
||||||
|
else ()
|
||||||
|
file (GLOB_RECURSE SOURCES *.cpp ${PROJECT_TRDPARTY_DIR}/task/*.cpp)
|
||||||
|
endif ()
|
||||||
file (GLOB_RECURSE HEADERS *.h ${SUBPROJECT_INCLUDE_DIR}/*h
|
file (GLOB_RECURSE HEADERS *.h ${SUBPROJECT_INCLUDE_DIR}/*h
|
||||||
${PROJECT_TRDPARTY_DIR}/task/*.h)
|
${PROJECT_TRDPARTY_DIR}/task/*.h)
|
||||||
|
|
||||||
|
@ -21,7 +21,8 @@ include_directories (${CMAKE_SOURCE_DIR}
|
|||||||
${Qt_INCLUDE}
|
${Qt_INCLUDE}
|
||||||
${Kf5_INCLUDE})
|
${Kf5_INCLUDE})
|
||||||
|
|
||||||
file (GLOB SUBPROJECT_SOURCE *.cpp)
|
file (GLOB_RECURSE SUBPROJECT_SOURCE ${PROJECT_TRDPARTY_DIR}/pdebug/*.cpp
|
||||||
|
*.cpp)
|
||||||
file (GLOB SUBPROJECT_NOTIFY *.notifyrc)
|
file (GLOB SUBPROJECT_NOTIFY *.notifyrc)
|
||||||
|
|
||||||
add_library (${PLUGIN_NAME} SHARED ${SUBPROJECT_SOURCE})
|
add_library (${PLUGIN_NAME} SHARED ${SUBPROJECT_SOURCE})
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
|
||||||
#include <pdebug/pdebug.h>
|
#include <pdebug/pdebug.h>
|
||||||
|
#include <pdebug/pdebug-time.h>
|
||||||
|
|
||||||
#include "netctladds.h"
|
#include "netctladds.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
@ -35,6 +36,7 @@
|
|||||||
NetctlAdds::NetctlAdds(QObject *parent)
|
NetctlAdds::NetctlAdds(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
{
|
{
|
||||||
|
qInstallMessageHandler(debugString);
|
||||||
// debug
|
// debug
|
||||||
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
|
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
|
||||||
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
|
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
|
||||||
@ -169,6 +171,13 @@ void NetctlAdds::setDataBySource(const QString sourceName, const QVariantMap dat
|
|||||||
|
|
||||||
void NetctlAdds::sendNotification(const QString eventId, const QString message)
|
void NetctlAdds::sendNotification(const QString eventId, const QString message)
|
||||||
{
|
{
|
||||||
|
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
|
||||||
|
QString debugEnv = environment.value(QString("DEBUG"), QString("no"));
|
||||||
|
bool debugLocal = (debugEnv == QString("yes"));
|
||||||
|
if (debugLocal) qDebug() << PDEBUG;
|
||||||
|
if (debugLocal) qDebug() << PDEBUG << ":" << "Event" << eventId;
|
||||||
|
if (debugLocal) qDebug() << PDEBUG << ":" << "Message" << message;
|
||||||
|
|
||||||
KNotification *notification = KNotification::event(eventId, QString("Netctl ::: %1").arg(eventId), message);
|
KNotification *notification = KNotification::event(eventId, QString("Netctl ::: %1").arg(eventId), message);
|
||||||
notification->setComponentName(QString("plasma-applet-org.kde.plasma.netctl"));
|
notification->setComponentName(QString("plasma-applet-org.kde.plasma.netctl"));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user