Skip to content
Snippets Groups Projects
main.cpp 4.49 KiB
#include <QApplication>
#include <QGuiApplication>
#include <QtQml>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QIcon>
#include <QSystemSemaphore>
#include <QSharedMemory>
#include <QScreen>

#include "DapHalper.h"
#include "DapScreenDialog.h"
#include "DapScreenDialogChangeWidget.h"
#include "DapUiQmlWidgetModel.h"
#include "DapSettings.h"
#include "DapSettingsCipher.h"
#include "DapServiceClient.h"
#include "DapServiceController.h"
#include "DapLogger.h"
#include "DapLogMessage.h"
#include "DapLogModel.h"
#include "DapChainWalletsModel.h"
#include "DapChainNodeNetworkModel.h"
#include "DapChainNodeNetworkExplorer.h"
#include "DapScreenHistoryFilterModel.h"
#include "DapSettingsNetworkModel.h"
#include "DapConsoleModel.h"
#include "DapChainConvertor.h"
#include "DapClipboard.h"

#include "DapChainWalletModel.h"
#include "DapWalletFilterModel.h"

#include <QRegExp>

#include <sys/stat.h>

int main(int argc, char *argv[])
{
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

    QApplication app(argc, argv);
    app.setOrganizationName("DEMLABS");
    app.setOrganizationDomain("demlabs.net");
    app.setApplicationName("CellFrame Dashboard");
    app.setWindowIcon(QIcon(":/Resources/Icons/icon.ico"));
    
    DapLogger dapLogger;
    /// TODO: The code is commented out at the time of developing the logging strategy in the project
//#ifndef QT_DEBUG
    #ifdef Q_OS_LINUX
        dapLogger.setLogFile(QString("/opt/cellframe-dashboard/log/%1Gui.log").arg(DAP_BRAND));
    #elif defined Q_OS_MACOS
	mkdir("/tmp/cellframe-dashboard_log",0777);
	dapLogger.setLogFile(QString("/tmp/cellframe-dashboard_log/%1Gui.log").arg(DAP_BRAND));
    #elif defined Q_OS_WIN
    #endif
//#endif

    /// Local client.
    DapServiceClient dapServiceClient;
    // Creating a service controller
    DapServiceController &controller = DapServiceController::getInstance();
    controller.init(&dapServiceClient);
    dapServiceClient.init();
    controller.getWallets();
    controller.requestWalletData();
    controller.getHistory();
    controller.getCmdHistory();
    controller.getNetworkList();