50 lines
1.3 KiB
C++
50 lines
1.3 KiB
C++
#ifndef FCREATENOTIFY_H
|
|
#define FCREATENOTIFY_H
|
|
|
|
#include "webservernotify.h"
|
|
#include <QDialog>
|
|
#include "udatabase.h"
|
|
|
|
namespace Ui {
|
|
class FCreateNotify;
|
|
}
|
|
|
|
class FCreateNotify : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
signals:
|
|
void serverCreated(HttpServer *server, const QString &name);
|
|
void serverUpdated(HttpServer *server, const QString &name);
|
|
public:
|
|
explicit FCreateNotify(uDataBase *database = nullptr, QWidget *parent = nullptr);
|
|
~FCreateNotify();
|
|
void loadExistingServer(HttpServer *server, const QString &name);
|
|
void setEditMode(bool isEditMode);
|
|
protected:
|
|
void closeEvent(QCloseEvent *event) override;
|
|
|
|
private slots:
|
|
void on_btnOpenImg_clicked();
|
|
void on_btnOpenSong_clicked();
|
|
void on_btnTest_clicked();
|
|
void on_btnAdd_clicked();
|
|
void onServerStarted(bool success);
|
|
|
|
private:
|
|
Ui::FCreateNotify *ui;
|
|
void createNotification(bool isTest = false);
|
|
QString getAbsolutePath(const QString &relativePath);
|
|
void copyFileToAppDir(const QString &sourcePath, const QString &destSubDir);
|
|
bool m_isEditMode;
|
|
uDataBase *m_database;
|
|
QString m_existingServerName;
|
|
// Сервер
|
|
HttpServer *m_server;
|
|
int m_notificationCounter;
|
|
void createServer();
|
|
void applyCurrentSettingsToServer();
|
|
};
|
|
|
|
#endif // FCREATENOTIFY_H
|