mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 19:27:49 +02:00
DaemonQT
This commit is contained in:
parent
70e502e55d
commit
b0e3339370
4 changed files with 46 additions and 32 deletions
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue