mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
DaemonQT
This commit is contained in:
39
qt/i2pd_qt/DaemonQT.cpp
Normal file
39
qt/i2pd_qt/DaemonQT.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#include <memory>
|
||||
#include "mainwindow.h"
|
||||
#include <QApplication>
|
||||
#include <stdlib.h>
|
||||
#include "../../Daemon.h"
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
std::unique_ptr<QApplication> app;
|
||||
bool DaemonQT::init(int argc, char* argv[])
|
||||
{
|
||||
app.reset (new QApplication (argc, argv));
|
||||
return Daemon_Singleton::init(argc, argv);
|
||||
}
|
||||
|
||||
bool DaemonQT::start()
|
||||
{
|
||||
return Daemon_Singleton::start();
|
||||
}
|
||||
|
||||
bool DaemonQT::stop()
|
||||
{
|
||||
return Daemon_Singleton::stop();
|
||||
}
|
||||
|
||||
void DaemonQT::run ()
|
||||
{
|
||||
MainWindow w;
|
||||
w.show ();
|
||||
if (app)
|
||||
{
|
||||
app->exec();
|
||||
app.reset (nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user