Browse Source

fixed qt .pro file

pull/892/head
hypnosis-i2p 8 years ago
parent
commit
5b769869d0
  1. 40
      qt/i2pd_qt/DaemonQT.cpp
  2. 10
      qt/i2pd_qt/DaemonQT.h
  3. 179
      qt/i2pd_qt/i2pd_qt.pro
  4. 56
      qt/i2pd_qt/mainwindow.cpp
  5. 11
      qt/i2pd_qt/mainwindow.h
  6. 2383
      qt/i2pd_qt/mainwindow.ui

40
qt/i2pd_qt/DaemonQT.cpp

@ -18,23 +18,41 @@ namespace qt @@ -18,23 +18,41 @@ namespace qt
void Worker::startDaemon()
{
qDebug("Performing daemon start...");
m_Daemon.start();
qDebug("Daemon started.");
emit resultReady();
//try{
m_Daemon.start();
qDebug("Daemon started.");
emit resultReady(false, "");
/*}catch(std::exception ex){
emit resultReady(true, ex.what());
}catch(...){
emit resultReady(true, QObject::tr("Error: unknown exception"));
}*/
}
void Worker::restartDaemon()
{
qDebug("Performing daemon restart...");
m_Daemon.restart();
qDebug("Daemon restarted.");
emit resultReady();
}
//try{
m_Daemon.restart();
qDebug("Daemon restarted.");
emit resultReady(false, "");
/*}catch(std::exception ex){
emit resultReady(true, ex.what());
}catch(...){
emit resultReady(true, QObject::tr("Error: unknown exception"));
}*/
}
void Worker::stopDaemon() {
qDebug("Performing daemon stop...");
m_Daemon.stop();
qDebug("Daemon stopped.");
emit resultReady();
}
//try{
m_Daemon.stop();
qDebug("Daemon stopped.");
emit resultReady(false, "");
/*}catch(std::exception ex){
emit resultReady(true, ex.what());
}catch(...){
emit resultReady(true, QObject::tr("Error: unknown exception"));
}*/
}
Controller::Controller(DaemonQTImpl& daemon):
m_Daemon (daemon)

10
qt/i2pd_qt/DaemonQT.h

@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
#include <QObject>
#include <QThread>
#include <QMutex>
#include <QMessageBox>
namespace i2p
{
@ -32,6 +33,7 @@ namespace qt @@ -32,6 +33,7 @@ namespace qt
bool isRunning();
private:
void setRunning(bool running);
void showError(std::string errorMsg);
private:
QMutex* mutex;
bool m_IsRunning;
@ -55,7 +57,7 @@ namespace qt @@ -55,7 +57,7 @@ namespace qt
void stopDaemon();
signals:
void resultReady();
void resultReady(bool failed, QString failureMessage);
};
class Controller : public QObject
@ -69,7 +71,11 @@ namespace qt @@ -69,7 +71,11 @@ namespace qt
DaemonQTImpl& m_Daemon;
public slots:
void handleResults(){}
void handleResults(bool failed, QString failureMessage){
if(failed){
QMessageBox::critical(0, QObject::tr("Error"), failureMessage);
}
}
signals:
void startDaemon();
void stopDaemon();

179
qt/i2pd_qt/i2pd_qt.pro

@ -138,3 +138,182 @@ linux:!android { @@ -138,3 +138,182 @@ linux:!android {
QT += xml
#INSTALLS += sources
}
DISTFILES += \
../../android/bin/classes.dex \
../../android/bin/I2PD.apk \
../../android/bin/AndroidManifest.xml \
../../android/AndroidManifest.xml \
../../libi2pd.a \
../../libi2pdclient.a \
../../i2pd \
../../android/bin/classes/org/purplei2p/i2pd/BuildConfig.class \
../../android/bin/classes/org/purplei2p/i2pd/DaemonSingleton$1.class \
../../android/bin/classes/org/purplei2p/i2pd/DaemonSingleton$State.class \
../../android/bin/classes/org/purplei2p/i2pd/DaemonSingleton$StateChangeListener.class \
../../android/bin/classes/org/purplei2p/i2pd/DaemonSingleton.class \
../../android/bin/classes/org/purplei2p/i2pd/ForegroundService$LocalBinder.class \
../../android/bin/classes/org/purplei2p/i2pd/ForegroundService.class \
../../android/bin/classes/org/purplei2p/i2pd/I2PD$1$1.class \
../../android/bin/classes/org/purplei2p/i2pd/I2PD$1.class \
../../android/bin/classes/org/purplei2p/i2pd/I2PD$2.class \
../../android/bin/classes/org/purplei2p/i2pd/I2PD$3$1.class \
../../android/bin/classes/org/purplei2p/i2pd/I2PD$3.class \
../../android/bin/classes/org/purplei2p/i2pd/I2PD.class \
../../android/bin/classes/org/purplei2p/i2pd/I2PD_JNI.class \
../../android/bin/classes/org/purplei2p/i2pd/NetworkStateChangeReceiver.class \
../../android/bin/classes/org/purplei2p/i2pd/R$attr.class \
../../android/bin/classes/org/purplei2p/i2pd/R$drawable.class \
../../android/bin/classes/org/purplei2p/i2pd/R$id.class \
../../android/bin/classes/org/purplei2p/i2pd/R$menu.class \
../../android/bin/classes/org/purplei2p/i2pd/R$string.class \
../../android/bin/classes/org/purplei2p/i2pd/R.class \
../../android/bin/dexedLibs/android-support-v4-bddf40bf5b9bc79d6d6d4419e6234206.jar \
../../android/libs/android-support-v4.jar \
android/libs/android-support-v4.jar \
../../debian/i2pd.init \
../../debian/postinst \
../../debian/postrm \
../../entrypoint.sh \
../../contrib/certificates/family/i2p-dev.crt \
../../contrib/certificates/family/i2pd-dev.crt \
../../contrib/certificates/family/mca2-i2p.crt \
../../contrib/certificates/family/volatile.crt \
../../contrib/certificates/reseed/atomike_at_mail.i2p.crt \
../../contrib/certificates/reseed/backup_at_mail.i2p.crt \
../../contrib/certificates/reseed/bugme_at_mail.i2p.crt \
../../contrib/certificates/reseed/echelon_at_mail.i2p.crt \
../../contrib/certificates/reseed/hottuna_at_mail.i2p.crt \
../../contrib/certificates/reseed/meeh_at_mail.i2p.crt \
../../contrib/certificates/reseed/parg_at_mail.i2p.crt \
../../contrib/certificates/reseed/r4sas_at_mail.i2p.crt \
../../contrib/certificates/reseed/zmx_at_mail.i2p.crt \
../../contrib/certificates/router/killyourtv_at_mail.i2p.crt \
../../contrib/certificates/router/orignal_at_mail.i2p.crt \
../../contrib/certificates/router/str4d_at_mail.i2p.crt \
../../contrib/certificates/router/zzz_at_mail.i2p.crt \
../../build/fig.yml \
../../appveyor.yml \
../../android/res/menu/options_main.xml \
../../android/res/values/strings.xml \
../../android/build.xml \
android/res/layout/splash.xml \
android/res/values/libs.xml \
android/res/values/strings.xml \
android/res/values-de/strings.xml \
android/res/values-el/strings.xml \
android/res/values-es/strings.xml \
android/res/values-et/strings.xml \
android/res/values-fa/strings.xml \
android/res/values-fr/strings.xml \
android/res/values-id/strings.xml \
android/res/values-it/strings.xml \
android/res/values-ja/strings.xml \
android/res/values-ms/strings.xml \
android/res/values-nb/strings.xml \
android/res/values-nl/strings.xml \
android/res/values-pl/strings.xml \
android/res/values-pt-rBR/strings.xml \
android/res/values-ro/strings.xml \
android/res/values-rs/strings.xml \
android/res/values-ru/strings.xml \
android/res/values-zh-rCN/strings.xml \
android/res/values-zh-rTW/strings.xml \
../../android/bin/resources.ap_ \
../../Win32/ictoopie.bmp \
../../Win32/mask.bmp \
../../android/bin/res/crunch/drawable/icon.png \
../../android/bin/res/crunch/drawable/itoopie_notification_icon.png \
../../android/res/drawable/icon.png \
../../android/res/drawable/itoopie_notification_icon.png \
../../docs/itoopieImage.png \
android/res/drawable/itoopie_notification_icon.png \
android/res/drawable-hdpi/icon.png \
../../Win32/ictoopie.ico \
../../Win32/mask.ico \
docs/patch_openssl_so_libs.html \
../../android/bin/jarlist.cache \
../../android/jni/Android.mk \
../../android/jni/Application.mk \
../../android/proguard-project.txt \
../../android/project.properties \
../../build/cmake_modules/NSIS.template.in \
../../build/docker/old-ubuntu-based/Dockerfile \
../../contrib/debian/i2pd.service \
../../contrib/debian/i2pd.tmpfile \
../../contrib/rpm/i2pd.service \
../../debian/patches/series \
../../debian/source/format \
../../debian/compat \
../../debian/control \
../../debian/copyright \
../../debian/docs \
../../debian/i2pd.1 \
../../debian/i2pd.default \
../../debian/i2pd.dirs \
../../debian/i2pd.install \
../../debian/i2pd.links \
../../debian/i2pd.manpages \
../../debian/i2pd.openrc \
../../debian/i2pd.upstart \
../../debian/logrotate \
../../debian/watch \
../../docs/Doxyfile \
../../docs/index.rst \
../../docs/subscriptions.txt \
../../docs/tunnels.conf \
android/src/org/kde/necessitas/ministro/IMinistro.aidl \
android/src/org/kde/necessitas/ministro/IMinistroCallback.aidl \
android/build.gradle \
android/project.properties \
../../Win32/nsi/helper_readme.nsh \
../../Win32/nsi/servicelib.nsh \
../../Win32/i2pd.sln \
../../Win32/i2pd.vcxproj \
../../Win32/i2pd.vcxproj.filters \
../../Win32/inno_installer.iss \
../../Win32/install_service.bat \
../../Win32/installer.iss \
../../Win32/Itoopie.cmd \
../../Win32/PurpleI2P.nsi \
../../Win32/uninstall_service.bat \
../../Dockerfile \
../../filelist.mk \
../../LICENSE \
../../debian/changelog \
../../ChangeLog \
../../build/cmake_modules/FindMiniUPnPc.cmake \
../../build/CMakeLists.txt \
../../android/gen/org/purplei2p/i2pd/BuildConfig.java \
../../android/gen/org/purplei2p/i2pd/R.java \
../../android/src/org/purplei2p/i2pd/DaemonSingleton.java \
../../android/src/org/purplei2p/i2pd/ForegroundService.java \
../../android/src/org/purplei2p/i2pd/I2PD.java \
../../android/src/org/purplei2p/i2pd/I2PD_JNI.java \
../../android/src/org/purplei2p/i2pd/NetworkStateChangeReceiver.java \
android/src/org/purplei2p/i2pd/I2PDMainActivity.java \
android/src/org/purplei2p/i2pd/LocalService.java \
android/src/org/qtproject/qt5/android/bindings/QtActivity.java \
android/src/org/qtproject/qt5/android/bindings/QtApplication.java \
../../debian/rules \
../../build/docker/README.md \
../../docs/building/android.md \
../../docs/building/cross.md \
../../docs/building/ios.md \
../../docs/building/requirements.md \
../../docs/building/unix.md \
../../docs/building/windows.md \
../../docs/config_opts_after_2.3.0.md \
../../docs/configuration.md \
../../docs/family.md \
../../docs/hacking.md \
../../docs/usage.md \
README.md \
../../README.md \
../../docs/i2pd.conf \
../../build/cmake-zlib-amd64.patch \
../../build/cmake-zlib-static.patch \
../../debian/patches/01-tune-build-opts.patch \
../../docs/conf.py \
../../contrib/debian/README \
../../contrib/rpm/i2pd.spec

56
qt/i2pd_qt/mainwindow.cpp

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
#include "mainwindow.h"
//#include "ui_mainwindow.h"
#include "ui_mainwindow.h"
#include <QMessageBox>
#include <QTimer>
#include "RouterContext.h"
@ -8,56 +8,24 @@ @@ -8,56 +8,24 @@
#endif
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)/*,
ui(new Ui::MainWindow)*/
QMainWindow(parent),
ui(new Ui::MainWindow)
#ifndef ANDROID
,quitting(false)
#endif
{
//ui->setupUi(this);
if (objectName().isEmpty())
setObjectName(QStringLiteral("MainWindow"));
ui->setupUi(this);
resize(800, 480);
centralWidget = new QWidget(this);
centralWidget->setObjectName(QStringLiteral("centralWidget"));
verticalLayoutWidget = new QWidget(centralWidget);
verticalLayoutWidget->setObjectName(QStringLiteral("verticalLayoutWidget"));
//verticalLayoutWidget->setGeometry(QRect(10, 20, 771, 441));
verticalLayout1 = new QVBoxLayout(verticalLayoutWidget);
verticalLayout1->setSpacing(6);
verticalLayout1->setContentsMargins(11, 11, 11, 11);
verticalLayout1->setObjectName(QStringLiteral("verticalLayout1"));
verticalLayout1->setContentsMargins(0, 0, 0, 0);
quitButton = new QPushButton(verticalLayoutWidget);
quitButton->setObjectName(QStringLiteral("quitButton"));
QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
sizePolicy.setHorizontalStretch(1);
//sizePolicy.setVerticalStretch(1);
sizePolicy.setHeightForWidth(quitButton->sizePolicy().hasHeightForWidth());
quitButton->setSizePolicy(sizePolicy);
verticalLayout1->addWidget(quitButton);
gracefulQuitButton = new QPushButton(verticalLayoutWidget);
gracefulQuitButton->setObjectName(QStringLiteral("gracefulQuitButton"));
QSizePolicy sizePolicy2(QSizePolicy::Maximum, QSizePolicy::Maximum);
sizePolicy2.setHorizontalStretch(1);
//sizePolicy2.setVerticalStretch(1);
sizePolicy2.setHeightForWidth(gracefulQuitButton->sizePolicy().hasHeightForWidth());
gracefulQuitButton->setSizePolicy(sizePolicy2);
verticalLayout1->addWidget(gracefulQuitButton);
setCentralWidget(centralWidget);
setWindowTitle(QApplication::translate("MainWindow", "i2pd", 0));
quitButton->setText(QApplication::translate("MainWindow", "Quit", 0));
gracefulQuitButton->setText(QApplication::translate("MainWindow", "Graceful Quit", 0));
//ui->stackedWidget->setCurrentIndex(4);//quit page
ui->stackedWidget->setCurrentIndex(1);//sett. page
#ifndef ANDROID
createActions();
createTrayIcon();
#endif
QObject::connect(quitButton, SIGNAL(released()), this, SLOT(handleQuitButton()));
QObject::connect(gracefulQuitButton, SIGNAL(released()), this, SLOT(handleGracefulQuitButton()));
QObject::connect(ui->fastQuitPushButton, SIGNAL(released()), this, SLOT(handleQuitButton()));
QObject::connect(ui->gracefulQuitPushButton, SIGNAL(released()), this, SLOT(handleGracefulQuitButton()));
#ifndef ANDROID
QObject::connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
@ -138,10 +106,10 @@ void MainWindow::handleQuitButton() { @@ -138,10 +106,10 @@ void MainWindow::handleQuitButton() {
void MainWindow::handleGracefulQuitButton() {
qDebug("Graceful Quit pressed.");
gracefulQuitButton->setText(QApplication::translate("MainWindow", "Graceful quit is in progress", 0));
gracefulQuitButton->setEnabled(false);
gracefulQuitButton->adjustSize();
verticalLayoutWidget->adjustSize();
ui->gracefulQuitPushButton->setText(QApplication::translate("MainWindow", "Graceful quit is in progress", 0));
ui->gracefulQuitPushButton->setEnabled(false);
ui->gracefulQuitPushButton->adjustSize();
ui->quitPage->adjustSize();
i2p::context.SetAcceptsTunnels (false); // stop accpting tunnels
QTimer::singleShot(10*60*1000/*millis*/, this, SLOT(handleGracefulQuitTimerEvent()));
}

11
qt/i2pd_qt/mainwindow.h

@ -48,21 +48,14 @@ private: @@ -48,21 +48,14 @@ private:
#ifndef ANDROID
void createActions();
void createTrayIcon();
#endif
QWidget *centralWidget;
QWidget *verticalLayoutWidget;
QVBoxLayout *verticalLayout1;
QPushButton *quitButton;
QPushButton *gracefulQuitButton;
#ifndef ANDROID
bool quitting;
QAction *toggleWindowVisibleAction;
QSystemTrayIcon *trayIcon;
QMenu *trayIconMenu;
#endif
Ui::MainWindow* ui;
protected:
#ifndef ANDROID
void closeEvent(QCloseEvent *event);

2383
qt/i2pd_qt/mainwindow.ui

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save