123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- #ifndef APP_H
- #define APP_H
- #include "mainwindow.h"
- #include "ui_mainwindow.h"
- #include "config.h"
- #include "anetwork.h"
- #include "helper.h"
- #include "downloadmanager.h"
- #include <QRegExp>
- #include <QBitmap>
- #include <QClipboard>
- #include <QException>
- #include <QWidget>
- #include <QGraphicsDropShadowEffect>
- #include <QDesktopWidget>
- #include <QFile>
- #include <QFileInfo>
- #include <QDir>
- #include <QFileDialog>
- #include <QMessageBox>
- #include <QRect>
- #include <QGridLayout>
- #include <QMovie>
- #include <QListWidget>
- #include <QtConcurrent/QtConcurrent>
- #include <QMessageLogger>
- #include <QDebug>
- #include <QFutureWatcher>
- #include "LotroDat.h"
- #include <string>
- using namespace LOTRO_DAT;
- class App {
- public:
- App() {
- config = new AConfig();
- network = new ANetwork();
- helper = new Helper();
- downloader = new DownloadManager();
- writtenLabel = new QLabel();
- buildSeparators(9472, 65507, 45, 60, 48, 85);//9472 создаем разделители
- }
- static App& getInstance() {
- static App instance;
- return instance;
- }
- AConfig * config;
- ANetwork * network;
- Helper * helper;
- MainWindow * window;
- DownloadManager * downloader;
- QLabel * writtenLabel;
- QString state;
- QString app_folder = "";
- QString qsep, qsepn, tsep, tsepn, bsep, bsepn;
- QString stylehtml;
- bool ready = true;
- void log(QString msg){
- QString format = "[" + QDate::currentDate().toString(Qt::ISODate).toUtf8() + " " + QTime::currentTime().toString(Qt::ISODate).toUtf8() + "] " + msg;
- fprintf(stderr, (format + "\n").toUtf8());
- }
- void logSectionStart(const char * msg){
- topSeparate();
- fprintf(stderr, "%s\n", msg);
- bottomSeparate();
- }
- void logSectionEnd(){
- fprintf(stderr, " \n");
- }
- void topSeparate(){
- fprintf(stderr, tsepn.toUtf8());
- }
- void bottomSeparate(){
- fprintf(stderr, bsepn.toUtf8());
- }
- void buildSeparators(int code_top, int code_bottom, int qcode, int tsize, int bsize, int qsize){
- for(int i = 0; i < tsize; i++){ tsep.append(QChar(QChar(code_top))); }
- tsepn = tsep + "\n";
- for(int i = 0; i < bsize; i++){ bsep.append(QChar(QChar(code_bottom))); }
- bsepn = bsep + "\n";
- for(int i = 0; i < qsize; i++){ qsep.append(QChar(QChar(qcode))); }
- qsepn = qsep + "\n";
- }
- };
- #endif // APP_H
|