#include "mainwindow.h"
#include <QApplication>


#include "grifoscope.h"

#include "bsk_versign.h"

#include <QLocale>

#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif

BSK_VERSIGN_STD_DEFINE("GrifoScope", BSK_VERSIGN_STR_VER3(1, 10, 0), "N/A", "GrifoScope", "GCC " __VERSION__);

static void attach_to_console();

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QLocale::setDefault(QLocale::C);

    QString appNameVer=
            QString("%1 (%2-%3)")
                .arg("GrifoScope")
                .arg(versign_application_signature_.data.vstr)
                .arg(versign_application_ext_signature_.data.buildid);

    a.setApplicationDisplayName(appNameVer); //"GrifoScope");

    //QgScopeWorkbench& wb=QgScopeWorkbench::instance();
    //wb.setApplicationTitle("GRIFO-E Scope");
    //wb.show();

    //a.aboutQt();

    attach_to_console();

    GrifoScope gs;

    return a.exec();
}


#include <Windows.h>

static void attach_to_console()
{
    if (AttachConsole(ATTACH_PARENT_PROCESS))
    {
        freopen("CONOUT$", "w", stdout);
        freopen("CONOUT$", "w", stderr);
        freopen("CONIN$", "r", stdin);
    }
}
