Exemplo n.º 1
0
bool
Mp3tunesHarmonyDaemon::allAboardTheDBus()
{

    setOrganizationName( "Amarok" );
    setOrganizationDomain( "amarok.kde.org" );
    setApplicationName( "Mp3tunes Harmony Daemon" );

    QDBusConnectionInterface *bus = 0;
    bus = QDBusConnection::sessionBus().interface();
    if( !bus ) {
        qFatal("No dbus!!");
        ::exit(126);
        return false;
    }
    QStringList parts = this->organizationDomain().split(QLatin1Char('.'), QString::SkipEmptyParts);
    QString reversedDomain;
    if (parts.isEmpty())
        reversedDomain = QLatin1String("local.");
    else
        foreach (const QString& s, parts)
        {
            reversedDomain.prepend(QLatin1Char('.'));
            reversedDomain.prepend(s);
        }
Exemplo n.º 2
0
Application::Application(int& argc, char** argv)
	: QApplication(argc, argv),
	m_window(0)
{
	setApplicationName("FocusWriter");
	setApplicationVersion("1.3.3");
	setOrganizationDomain("gottcode.org");
	setOrganizationName("GottCode");
	{
		QIcon fallback(":/hicolor/256x256/apps/focuswriter.png");
		fallback.addFile(":/hicolor/128x128/apps/focuswriter.png");
		fallback.addFile(":/hicolor/64x64/apps/focuswriter.png");
		fallback.addFile(":/hicolor/48x48/apps/focuswriter.png");
		fallback.addFile(":/hicolor/32x32/apps/focuswriter.png");
		fallback.addFile(":/hicolor/24x24/apps/focuswriter.png");
		fallback.addFile(":/hicolor/22x22/apps/focuswriter.png");
		fallback.addFile(":/hicolor/16x16/apps/focuswriter.png");
		setWindowIcon(QIcon::fromTheme("focuswriter", fallback));
	}
#ifndef Q_WS_MAC
	setAttribute(Qt::AA_DontUseNativeMenuBar);
	setAttribute(Qt::AA_DontShowIconsInMenus, !QSettings().value("Window/MenuIcons", false).toBool());
#else
	setAttribute(Qt::AA_DontShowIconsInMenus, true);
	new RTF::Converter;
#endif

	qputenv("UNICODEMAP_JP", "cp932");

	m_files = arguments().mid(1);
	processEvents();
}
Exemplo n.º 3
0
CalamaresApplication::CalamaresApplication( int& argc, char *argv[] )
    : QApplication( argc, argv )
    , m_mainwindow( 0 )
{
    setOrganizationName( QLatin1String( CALAMARES_ORGANIZATION_NAME ) );
    setOrganizationDomain( QLatin1String( CALAMARES_ORGANIZATION_DOMAIN ) );
    setApplicationName( QLatin1String( CALAMARES_APPLICATION_NAME ) );
    setApplicationVersion( QLatin1String( CALAMARES_VERSION ) );

    QString startupLocale = QLocale::system().uiLanguages().first();
    CalamaresUtils::installTranslator( startupLocale, this );

    QFont f = font();

    cDebug() << "Default font ====="
             << "\nPixel size:   " << f.pixelSize()
             << "\nPoint size:   " << f.pointSize()
             << "\nPoint sizeF:  " << f.pointSizeF()
             << "\nFont family:  " << f.family()
             << "\nMetric height:" << QFontMetrics( f ).height();
    // The following line blocks for 15s on Qt 5.1.0
    cDebug() << "Font height:" << QFontMetrics( f ).height();
    CalamaresUtils::setDefaultFontSize( f.pointSize() );

    cDebug() << "Available languages:" << QString( CALAMARES_TRANSLATION_LANGUAGES ).split( ';' );
}
Exemplo n.º 4
0
UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSingleApplication(id, argc, argv)
  , mPreferencesController(NULL)
  , mApplicationTranslator(NULL)
  , mQtGuiTranslator(NULL)
{

    staticMemoryCleaner = new QObject(0); // deleted in UBApplication destructor

    setOrganizationName("Sankore");
    setOrganizationDomain("sankore.org");
    setApplicationName("Open-Sankore");

    setApplicationVersion(UBVERSION);

#if defined(Q_WS_MAC) && !defined(QT_NO_DEBUG)
    CFStringRef shortVersion = (CFStringRef)CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), CFSTR("CFBundleShortVersionString"));
    const char *version = CFStringGetCStringPtr(shortVersion, kCFStringEncodingMacRoman);
    Q_ASSERT(version);
    setApplicationVersion(version);
#endif

    QStringList args = arguments();

    mIsVerbose = args.contains("-v")
        || args.contains("-verbose")
        || args.contains("verbose")
        || args.contains("-log")
        || args.contains("log");


    setupTranslators(args);

    UBResources::resources();

    if (!undoStack)
        undoStack = new QUndoStack(staticMemoryCleaner);

    UBPlatformUtils::init();

    UBSettings *settings = UBSettings::settings();

    connect(settings->appToolBarPositionedAtTop, SIGNAL(changed(QVariant)), this, SLOT(toolBarPositionChanged(QVariant)));
    connect(settings->appToolBarDisplayText, SIGNAL(changed(QVariant)), this, SLOT(toolBarDisplayTextChanged(QVariant)));
    updateProtoActionsState();

#ifndef Q_WS_MAC
    setWindowIcon(QIcon(":/images/uniboard.png"));
#endif

    setStyle(new UBStyle()); // Style is owned and deleted by the application

    QString css = UBFileSystemUtils::readTextFile(UBPlatformUtils::applicationResourcesDirectory() + "/etc/Uniboard.css");
    if (css.length() > 0)
        setStyleSheet(css);

    QApplication::setStartDragDistance(8); // default is 4, and is a bit small for tablets

    installEventFilter(this);

}
Exemplo n.º 5
0
AgrosApplication::AgrosApplication(int& argc, char ** argv) : QApplication(argc, argv), m_scriptEngineRemote(NULL)
{
    setWindowIcon(icon("agros2d"));
    setApplicationVersion(versionString());
    setOrganizationName("hpfem.org");
    setOrganizationDomain("hpfem.org");
    setApplicationName("Agros2D-3");

#ifdef Q_WS_MAC
    // don't show icons in menu
    setAttribute(Qt::AA_DontShowIconsInMenus, true);
#endif

    // std::string codec
#if QT_VERSION < 0x050000
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
#endif
    QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));

    // force number format
    QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));

    // init singleton
    Agros2D::createSingleton();
}
Exemplo n.º 6
0
IQmolApplication::IQmolApplication(int &argc, char **argv )
  : QApplication(argc, argv)
{
   setOrganizationDomain("iqmol.org");
   setApplicationName("IQmol");
   // Can't log anything yet as the logger hasn't been initialized
}
Exemplo n.º 7
0
Application::Application(int& argc, char** argv) :
	QtSingleApplication("org.gottcode.FocusWriter", argc, argv),
	m_window(0)
{
	setApplicationName("FocusWriter");
	setApplicationVersion(VERSIONSTR);
	setApplicationDisplayName(Window::tr("FocusWriter"));
	setOrganizationDomain("gottcode.org");
	setOrganizationName("GottCode");
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
	setWindowIcon(QIcon::fromTheme("focuswriter", QIcon(":/focuswriter.png")));
#endif

	setAttribute(Qt::AA_UseHighDpiPixmaps, true);

#ifndef Q_OS_MAC
	setAttribute(Qt::AA_DontUseNativeMenuBar);
#else
	setAttribute(Qt::AA_DontShowIconsInMenus, true);
#endif

#ifdef RTFCLIPBOARD
	new RTF::Clipboard;
#endif

	qputenv("UNICODEMAP_JP", "cp932");

	m_files = arguments().mid(1);
	processEvents();
}
Exemplo n.º 8
0
void NavApp::initApplication()
{
  setWindowIcon(QIcon(":/littlenavmap/resources/icons/littlenavmap.svg"));
  setApplicationName("Little Navmap");
  setOrganizationName("ABarthel");
  setOrganizationDomain("littlenavmap.org");
  setApplicationVersion("2.3.0.develop"); // VERSION_NUMBER - Little Navmap
}
MsmApplication::MsmApplication(int& argc, char* argv[])
    : QApplication(argc, argv),
      m_mainwindow(0)
{
    setOrganizationName("Manjaro");
    setOrganizationDomain("Manjaro");
    setApplicationName("Manjaro Settings Manager");
    setApplicationVersion("0.5.0");
}
NotifierApp::NotifierApp( int& argc, char* argv[] )
    : QApplication( argc, argv )
{
    setOrganizationName( "Manjaro" );
    setOrganizationDomain( "Manjaro" );
    setApplicationName( "MSM Notifier for Plasma5" );
    setApplicationVersion( PROJECT_VERSION );
    setQuitOnLastWindowClosed( false );
}
Exemplo n.º 11
0
UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSingleApplication(id, argc, argv)
  , mPreferencesController(NULL)
  , mApplicationTranslator(NULL)
  , mQtGuiTranslator(NULL)
{

    staticMemoryCleaner = new QObject(0); // deleted in UBApplication destructor

    setOrganizationName("Open Education Foundation");
    setOrganizationDomain("oe-f.org");
    setApplicationName("OpenBoard");

    QString version = UBVERSION;
    if(version.endsWith("."))
        version = version.left(version.length()-1);
    setApplicationVersion(version);

    QStringList args = arguments();

    mIsVerbose = args.contains("-v")
        || args.contains("-verbose")
        || args.contains("verbose")
        || args.contains("-log")
        || args.contains("log");


    setupTranslators(args);

    UBResources::resources();

    if (!undoStack)
        undoStack = new QUndoStack(staticMemoryCleaner);

    UBPlatformUtils::init();

    UBSettings *settings = UBSettings::settings();

    connect(settings->appToolBarPositionedAtTop, SIGNAL(changed(QVariant)), this, SLOT(toolBarPositionChanged(QVariant)));
    connect(settings->appToolBarDisplayText, SIGNAL(changed(QVariant)), this, SLOT(toolBarDisplayTextChanged(QVariant)));
    updateProtoActionsState();

#ifndef Q_OS_OSX
    setWindowIcon(QIcon(":/images/OpenBoard.png"));
#endif

    setStyle("fusion");

    QString css = UBFileSystemUtils::readTextFile(UBPlatformUtils::applicationResourcesDirectory() + "/etc/"+ qApp->applicationName()+".css");
    if (css.length() > 0)
        setStyleSheet(css);

    QApplication::setStartDragDistance(8); // default is 4, and is a bit small for tablets

    installEventFilter(this);

}
Exemplo n.º 12
0
KApplication::KApplication(Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap, const KComponentData &cData)
    : QApplication((KApplicationPrivate::preqapplicationhack(),dpy), KCmdLineArgs::qtArgc(), KCmdLineArgs::qtArgv(), visual, colormap),
    d (new KApplicationPrivate(this, cData))
{
    d->read_app_startup_id();
    setApplicationName(d->componentData.componentName());
    setOrganizationDomain(d->componentData.aboutData()->organizationDomain());
    installSigpipeHandler();
    d->init();
}
Exemplo n.º 13
0
KApplication::KApplication(const KComponentData &cData)
    : QApplication((KApplicationPrivate::preqapplicationhack(),KCmdLineArgs::qtArgc()), KCmdLineArgs::qtArgv(), KAPPLICATION_GUI_TYPE),
    d (new KApplicationPrivate(this, cData))
{
    d->read_app_startup_id();
    setApplicationName(d->componentData.componentName());
    setOrganizationDomain(d->componentData.aboutData()->organizationDomain());
    installSigpipeHandler();
    d->init();
}
Exemplo n.º 14
0
Smirch::Smirch(int &argc, char **argv)
  : QApplication(argc, argv)
{
  setOrganizationName("pillageandplunder");
  setOrganizationDomain("pillageandplunder.net");
  setApplicationName("smirch");

  m_window = new MainWindow();
  m_window->show();
}
Exemplo n.º 15
0
IQmolApplication::IQmolApplication(int &argc, char **argv )
  : QApplication(argc, argv), m_splashScreen(0), 
    m_unhandledException(QMessageBox::Critical, "IQmol", "IQmol encountered an exception.\n"
    "See log file for details.", QMessageBox::Abort)
    
{
   setOrganizationDomain("iqmol.org");
   setApplicationName("IQmol");
   // Can't log anything yet as the logger hasn't been initialized
}
Exemplo n.º 16
0
SystemSettingsApp::SystemSettingsApp(int& argc, char* argv[])
    : QApplication(argc, argv)
    , window(0)
{
    setOrganizationDomain("kde.org");
    KDBusService* service = new KDBusService(KDBusService::Unique, this);
    QObject::connect(service, &KDBusService::activateRequested, this, [=]() {
        KWindowSystem::forceActiveWindow(window->winId());
    } );
}
Exemplo n.º 17
0
/*!
  \class ossimPlanetQtApplication
  \brief The ossimPlanetQtApplication class manages application-wide information.

  This is a subclass of QApplication and should be instantiated in place of
  QApplication. Most methods are static in keeping witn the design of QApplication.

  This class hides platform-specific path information and provides
  a portable way of referencing specific files and directories.
  Ideally, hard-coded paths should appear only here and not in other modules
  so that platform-conditional code is minimized and paths are easier
  to change due to centralization.
*/
ossimPlanetQtApplication::ossimPlanetQtApplication(int & argc, char ** argv, bool guiEnabled)
: QApplication(argc, argv, guiEnabled)
{
   osg::Referenced::setThreadSafeReferenceCounting(true);
   setOrganizationName("OSSIM");
   setOrganizationDomain("planet.ossim.org");
   setApplicationName("OSSIM Planet");
   theSettings = new QSettings("planet.ossim.org");
   theUserSupportDirectory = ossimEnvironmentUtility::instance()->getUserOssimSupportDir();   
   theUserDirectory = ossimEnvironmentUtility::instance()->getUserDir();   
}
Exemplo n.º 18
0
peoplecount::peoplecount(int& argc, char** argv) : app(argc, argv) {
	setObjectName("peoplecount");

	setOrganizationName("KAI Square Pte Ltd");
	setOrganizationDomain("kaisquare.com");
	setApplicationName("peoplecount");
	setApplicationVersion(PC_VERSION);

	parser_ = new QCommandLineParser();
	module_factory_ = new module_factory();
}
Exemplo n.º 19
0
SasiApp::SasiApp(int argc, char *argv[])
	: QApplication(argc,argv)
{
	QCoreApplication::addLibraryPath( QCoreApplication::applicationDirPath() );
	setOrganizationName("SpringLobby");
	setOrganizationDomain("SpringLobby.info");
	setApplicationName("saSi");

//	QIcon icon( wxBitmap(SLcustomizations().GetAppIcon()) );
//	setWindowIcon( icon );
}
Exemplo n.º 20
0
Application::Application(int& argc, char** argv) :
    QApplication(argc, argv)
{
    // Set organization and application name
    setOrganizationName("VPaint");
    setOrganizationDomain("vpaint.org");
    setApplicationName("VPaint");
    setApplicationDisplayName("VPaint");

    // Set application version
    setApplicationVersion(APP_VERSION);
}
Exemplo n.º 21
0
QLuaApplication::QLuaApplication(int &argc, char **argv, 
                                 bool guiEnabled, bool onethread)
  : QApplication(argc, argv, guiEnabled),
    d(new Private(this))
{
  // one thread only
  d->oneThread = onethread;

  // extract program name
  QString cuteName = QFileInfo(applicationFilePath()).baseName();
  d->programNameData = cuteName.toLocal8Bit();
  d->programName = d->programNameData.constData();
  QRegExp re("^(mac(?=qlua)|win(?=qlua)|)(q?)(.*)", Qt::CaseInsensitive);
  cuteName = capitalize(cuteName);
  if (re.indexIn(cuteName) >= 0 && re.numCaptures() == 3)
    cuteName = capitalize(re.cap(2)) + capitalize(re.cap(3));

  // basic setup
  setApplicationName(cuteName);
  setOrganizationName(QLUA_ORG);
  setOrganizationDomain(LUA_DOMAIN);

#ifndef Q_WS_MAC
  if (guiEnabled && windowIcon().isNull())
    setWindowIcon(QIcon(":/qlua.png"));
#else
  extern void qt_mac_set_native_menubar(bool);
  extern void qt_mac_set_menubar_icons(bool);
# ifdef QT_MAC_USE_NATIVE_MENUBAR
  qt_mac_set_native_menubar(true);
# else
  qt_mac_set_native_menubar(false);
# endif
  qt_mac_set_menubar_icons(false);
#endif
  
  // create console
  //   It is important to create this first because
  //   the console code ensures that posix signals are
  //   processed from the console thread.
  d->theConsole = new QLuaConsole(this);
  connect(d->theConsole, SIGNAL(ttyBreak()),
          d, SLOT(consoleBreak()) );
  connect(d->theConsole, SIGNAL(ttyInput(QByteArray)),
          d, SLOT(ttyInput(QByteArray)) );
  connect(d->theConsole, SIGNAL(ttyEndOfFile()),
          d, SLOT(ttyEndOfFile()) );
  connect(d->theConsole, SIGNAL(consoleOutput(QByteArray)),
          this, SIGNAL(luaConsoleOutput(QByteArray)) );
}
Exemplo n.º 22
0
CApplication::CApplication(int& argc, char* argv[])
	: QApplication(argc, argv)
{
	//Icon
	QIcon icon("./bicorem.png");
	setWindowIcon(icon);	
	//Für Settings (Speichern und Laden) benötigt
	setOrganizationName("BiCoRem");
	setOrganizationDomain("DE");
	setApplicationName("BiCoRem");
	setApplicationVersion("BiCoRem v1.1");
	//Lokalisierung und Internationalisierung
	loadTranslations("./lang");
}
Exemplo n.º 23
0
MM_BEGIN_NAMESPACE

MainApplication::MainApplication(int &argc, char *argv[])
  : QApplication(argc, argv)
{
  // Initialize GStreamer.
  gst_init (NULL, NULL);

  // Set application information.
  setApplicationName(MM::APPLICATION_NAME);
  setApplicationVersion(MM::VERSION);
  setOrganizationName(MM::ORGANIZATION_NAME);
  setOrganizationDomain(MM::ORGANIZATION_DOMAIN);
}
Exemplo n.º 24
0
Application::Application(int& argc, char* argv[]) : QApplication(argc, argv)
{
    setApplicationName("Communi");
    setOrganizationName("Communi");
    setApplicationVersion(Irc::version());
    setOrganizationDomain("communi.github.com");

    *originalPalette() = palette();

    QIcon icon;
    icon.addFile(":/resources/icons/16x16/communi.png");
    icon.addFile(":/resources/icons/24x24/communi.png");
    icon.addFile(":/resources/icons/32x32/communi.png");
    icon.addFile(":/resources/icons/48x48/communi.png");
    icon.addFile(":/resources/icons/64x64/communi.png");
    icon.addFile(":/resources/icons/128x128/communi.png");
    setWindowIcon(icon);

    qRegisterMetaTypeStreamOperators<ConnectionInfo>("ConnectionInfo");
    qRegisterMetaTypeStreamOperators<ConnectionInfos>("ConnectionInfos");

    QSettings settings;
    if (arguments().contains("-reset"))
        settings.clear();
    if (arguments().contains("-reset-settings"))
        settings.remove("settings");
    if (arguments().contains("-reset-connections"))
        settings.remove("connections");
    if (arguments().contains("-reset-state")) {
        settings.remove("list");
        settings.remove("tree");
        settings.remove("splitter");
        settings.remove("geometry");
    }

    bool appliedSettings = false;
    if (settings.contains("settings")) {
        QVariant value = settings.value("settings");
        if (value.canConvert<QVariantMap>()) {
            QVariantMap map = value.toMap();
            // cleanup obsolete theme bloat
            foreach (const QString& key, map.keys()) {
                if (key.startsWith("ui.theme") || key.startsWith("themes."))
                    map.remove(key);
            }
            applySettings(map);
            appliedSettings = true;
            Application::settings()->setValues(map);
        }
Exemplo n.º 25
0
Phonion::Phonion(int &argc, char **argv)
  : QApplication(argc, argv)
  , _notifier(new Notifier(this))
  , _view(new QQuickView(this->modalWindow()))
  , _appModel(new AppModel(this))
{
    setApplicationName(QLatin1String("Phonion"));
    setOrganizationName(QLatin1String("Phonion"));
    setOrganizationDomain(QLatin1String("phonion.phonion.co"));

    qmlRegisterType<Notifier>("Phonion", 1, 0, "Notifier");
    qmlRegisterType<AppModel>("Phonion", 1, 0, "AppModel");

    QNetworkProxy proxy;
    proxy.setType(QNetworkProxy::Socks5Proxy);
    proxy.setHostName(PROXY_HOST);
    proxy.setPort(PROXY_PORT);
    //proxy.setUser("");
    //proxy.setPassword("");
    QNetworkProxy::setApplicationProxy(proxy);

    /* Use QFileInfo and also check against security key. */
    QFile f("./apps/message/torchat/torchat/src/Tor/hidden_service/hostname");
    if(!f.open(QIODevice::ReadOnly | QIODevice::Text)) {
        qWarning("Hidden service not found");
    } else {
        _onion = f.read(16);
        qDebug() << "Identified hidden service: " << _onion;
    }

    // set the engines qqmlnetworkaccessmanager here. pass in our phonionnetworkproxy.
    // and return it when create() is called.

    _view->engine()->setIncubationController(new PhonionIncubationController(_view->engine()));
    /* Phonion is the context of the root object. */
    _view->rootContext()->setContextObject(this);
    _view->rootContext()->setContextProperty("Phonion", this);
    _view->setResizeMode(QQuickView::SizeRootObjectToView);
    _view->setSource(QUrl("qrc:/qml/Main.qml"));
    _view->show();

    /* TODO: The home screen grid view should read the
     *       info about each app in it's corresponding
     *       JSON file. The app (plugin) should not be
     *       instantiated until use clicks launch.
     */
    loadApps();
}
L2tpIPsecVpnApplication::L2tpIPsecVpnApplication(int& iArgc, char** ppArgv, APPLICATIONMODE appMode) : QApplication(iArgc, ppArgv, appMode != PASSWORD_CALLBACK && appMode != APPLYSETTINGS && appMode != DELETEALLCONFFILES), m_Mode(appMode), m_pProcess(new QProcess), m_pLocalPeer(new LocalPeer())
{
   setOrganizationName("WernerJaeger");
   setOrganizationDomain("wejaeger.com");
   setApplicationName(APPLICATIONNAME);
   setApplicationVersion("1.0.9");
   setObjectName("L2tpIPsecVpn");
   qRegisterMetaType<NetworkInterface>("NetworkInterface");
   qRegisterMetaType<QAbstractSocket::SocketState>("QAbstractSocket::SocketState");

   connect(m_pLocalPeer, SIGNAL(messageReceived(const QString&)), SLOT(onMessageReceived(const QString&)));
   connect(m_pProcess, SIGNAL(finished(int)), this, SLOT(onConnectionEditorDialogClosed(int)));

   if (mode() == CONNECTION_MANAGER)
      setQuitOnLastWindowClosed(false);
}
Exemplo n.º 27
0
Application::Application( int &argc, char **argv )
:	QtSingleApplication( argc, argv )
,	trayMenu(0)
,	url( UPDATER_URL )
,	w(0)
{
	QTranslator *t = new QTranslator( this );
	t->load(":/idupdater_translation");
	installTranslator( t );
	setQuitOnLastWindowClosed( false );
	setWindowIcon( QIcon( ":/appicon.png" ) );
	setApplicationName( APP );
	setApplicationVersion( VER_STR( FILE_VER_DOT ) );
	setOrganizationDomain( DOMAINURL );
	setOrganizationName( ORG );
}
Exemplo n.º 28
0
QEditor::QEditor(int& argc, char** argv)
: QApplication(argc, argv)
{
    setAttribute(Qt::AA_ShareOpenGLContexts);

    setOrganizationDomain(QString(VER_COMPANYDOMAIN_STR));
    setOrganizationName(QString(VER_COMPANYNAME_STR));
    setApplicationName(QString(VER_PRODUCTNAME_STR));
    setApplicationVersion(QString(VER_FILEVERSION_STR));

    settings = new QSettings(this);

    translator = new QTranslator(this);
    translator->load(getSetting("language", QLocale::system().name()).toString(), ":/languages/", QString(), ".qlg");

    installTranslator(translator);

    qsrand((uint)QTime::currentTime().msec());

    /// CAUSING DISABLING 3D picking
    /*QSurfaceFormat format;
    format.setDepthBufferSize(24);
    format.setMajorVersion(4);
    format.setMinorVersion(3);
    format.setSamples(4);
    format.setProfile(QSurfaceFormat::CoreProfile);
    format.setOption(QSurfaceFormat::DebugContext);

    QSurfaceFormat::setDefaultFormat(format);*/

    qDebug() << "Compiler C++ version:" << __cplusplus;

#if (defined(ENVIRONMENT64))
    qDebug() << "Target architecture: 64-bit";
#else
    qDebug() << "Target architecture: 32-bit";
#endif

#if (defined(_MSC_BUILD) && defined(_MSC_FULL_VER) && defined(_MSC_VER))
    qDebug() << "MSVC build:" << _MSC_BUILD;
    qDebug() << "MSVC full_ver:" << _MSC_FULL_VER;
    qDebug() << "MSVC ver:" << _MSC_VER;
#endif

    mainWindow = new MainWindow();
    mainWindow->showMaximized();
}
Exemplo n.º 29
0
AppDelegate::AppDelegate(int argc, char* argv[]) :
    QApplication(argc, argv),
    _qtReady(false),
    _dsReady(false),
    _dsResourcesReady(false),
    _acReady(false),
    _domainServerProcess(NULL),
    _acMonitorProcess(NULL),
    _domainServerName("localhost")
{
    // be a signal handler for SIGTERM so we can stop child processes if we get it
    signal(SIGTERM, signalHandler);

    // look for command-line options
    parseCommandLine();

    setApplicationName("Stack Manager");
    setOrganizationName("High Fidelity");
    setOrganizationDomain("io.highfidelity.StackManager");

    QFile* logFile = new QFile("last_run_log", this);
    if (!logFile->open(QIODevice::WriteOnly | QIODevice::Truncate)) {
        qDebug() << "Failed to open log file. Will not be able to write STDOUT/STDERR to file.";
    } else {
        outStream = new QTextStream(logFile);
    }


    qInstallMessageHandler(myMessageHandler);
    _domainServerProcess = new BackgroundProcess(GlobalData::getInstance().getDomainServerExecutablePath(), this);
    _acMonitorProcess = new BackgroundProcess(GlobalData::getInstance().getAssignmentClientExecutablePath(), this);

    _manager = new QNetworkAccessManager(this);

    _window = new MainWindow();

    createExecutablePath();
    downloadLatestExecutablesAndRequirements();

    _checkVersionTimer.setInterval(0);
    connect(&_checkVersionTimer, SIGNAL(timeout()), this, SLOT(checkVersion()));
    _checkVersionTimer.start();

    connect(this, &QApplication::aboutToQuit, this, &AppDelegate::stopStack);
}
Exemplo n.º 30
0
XQDEMain::XQDEMain(Display * display, int & argc, char ** argv, Qt::HANDLE visual, Qt::HANDLE colormap): XQUniqueApplication(display, argc, argv, visual,colormap)
{

    setApplicationName("xqde");
    setOrganizationDomain ("www.xiaprojects.com");
    setOrganizationName("XIA Projects 2009");

    //Loading a interface translation, ex: "xqde_it.qm"
    QTranslator appTranslator;
    QString translationFile = ":/translations/xqde_" + QLocale::system().name() + ".ts";
    appTranslator.load(translationFile);
    installTranslator(&appTranslator);
    qWarning()<<"Loaded language is: "<<translationFile;

	DataPath="";
	PluginListWhichWillBeLoaded=new QStringList();
	if(argc)
	{
		qWarning("XQDE=[%s]",argv[0]);
		QString tmpEXEPath=QString(argv[0]);
		int tmpOK=0;
		tmpOK=tmpEXEPath.lastIndexOf("/");
		if(!tmpOK)tmpEXEPath=".";
		else tmpEXEPath=tmpEXEPath.left(tmpOK);
		qWarning("XQDEDIR=[%s]",tmpEXEPath.toAscii().data());
	}

	for(int k=1;k<argc;k++)
	{
		if(strncmp(argv[k],"--localdata",strlen("--localdata"))==0 && k+1<argc)
		{
			k++;
			DataPath=QString(argv[k]);
			qWarning("DataPath=[%s]",DataPath.toAscii().data());
		}
		if(strncmp(argv[k],"--loadplugin",strlen("--loadplugin"))==0 && k+1<argc)
		{
			k++;
			QString PluginToLoad=QString(argv[k]);
			qWarning("Plugin [%s]",PluginToLoad.toAscii().data());
			if(PluginListWhichWillBeLoaded)PluginListWhichWillBeLoaded->append(PluginToLoad);
		}
	}
}