Exemple #1
0
void Test::PreparePath()
{
	SettingsManager *settings = SettingsManager::Instance();

	int32 partX = settings->GetLandscapePartitioning().x;
	int32 partY = settings->GetLandscapePartitioning().y;
	
    Landscape *land = GetLandscape();
	AABBox3 boundingBox = land->GetBoundingBox();
	Vector3 min = boundingBox.min;
	Vector3 max = boundingBox.max;
	
	float32 landWidth = max.x - min.x;
	float32 landLength = max.y - min.y;
	
	Vector2 rectSize(landWidth / partX, landLength / partY);
	
	int32 x = 0;
	int32 xDir = 1;
	for(int32 y = 0; y < partY; ++y)
    {
		Rect curRect;
		for(int32 i = 0; i < partX; ++i, x += xDir)
        {
			Vector2 v;
			v.Set(min.x + x * rectSize.x, min.y + y * rectSize.y);
			curRect.SetPosition(v);
			curRect.SetSize(rectSize);
            rectSequence.push_back(curRect);
		}
		x -= xDir;
		xDir = -xDir;
	}
}
Exemple #2
0
void TestCompilerProvider::testStorageBackwardsCompatible()
{
    SettingsManager settings;
    QTemporaryFile file;
    QVERIFY(file.open());
    QTextStream stream(&file);
    stream << "[Buildset]\n" <<
      "BuildItems=@Variant(\\x00\\x00\\x00\\t\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x0b\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x1a\\x00S\\x00i\\x00m\\x00p\\x00l\\x00e\\x00P\\x00r\\x00o\\x00j\\x00e\\x00c\\x00t)\n" <<
      "[CustomBuildSystem]\n" << "CurrentConfiguration=BuildConfig0\n" <<
      "[CustomDefinesAndIncludes][ProjectPath0]\n" <<
      "Defines=\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x0c\\x00_\\x00D\\x00E\\x00B\\x00U\\x00G\\x00\\x00\\x00\\n\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x10\\x00V\\x00A\\x00R\\x00I\\x00A\\x00B\\x00L\\x00E\\x00\\x00\\x00\\n\\x00\\x00\\x00\\x00\\n\\x00V\\x00A\\x00L\\x00U\\x00E\n" <<
      "Includes=\\x00\\x00\\x00\\x01\\x00\\x00\\x00$\\x00/\\x00u\\x00s\\x00r\\x00/\\x00i\\x00n\\x00c\\x00l\\x00u\\x00d\\x00e\\x00/\\x00m\\x00y\\x00d\\x00i\\x00r\n" <<
      "Path=/\n" <<
      "[CustomDefinesAndIncludes][ProjectPath0][Compiler]\nName=GCC\nPath=gcc\nType=GCC\n";
    file.close();
    KConfig config(file.fileName());
    auto entries = settings.readPaths(&config);
    QCOMPARE(entries.size(), 1);
    auto entry = entries.first();
    Defines defines;
    defines["VARIABLE"] = "VALUE";
    defines["_DEBUG"] = QString();
    QCOMPARE(entry.defines, defines);
    QStringList includes = QStringList() << "/usr/include/mydir";
    QCOMPARE(entry.includes, includes);
    QCOMPARE(entry.path, QString("/"));
    QVERIFY(entry.compiler);

    testCompilerEntry(settings, &config);
    testAddingEntry(settings, &config);
}
Exemple #3
0
int main(int argc, char **argv)
{
    QApplication app(argc, argv);
    SettingsManager *manager = new SettingsManager;

    /*
     * Translate QDialog
     */
    QTranslator translator;
    translator.load(":/language/"+manager->generalValue("Language/language",QVariant()).toString()+".qm");
    app.installTranslator(&translator);


    if(!parseArguments(app.arguments()))
    {
        return -1;
    }

    const QString arg1 = argv[1];

    const QString arg3 = argv[3];

    if((arg1.toLower() == "-u" || arg1.toLower() == "--url") && (arg3.toLower() == "-p" || arg3.toLower() == "--package")){
        QWidget *wid= new QWidget;
        update *manager = new update(wid,argv[2],argv[4]);
        manager->show();
    }
    else
    {
        parseArguments(app.arguments() << "-h");
        exit(0);
    }

    return app.exec();
}
//################################################################################################
QString ExportCreateDump::dumpBrowse(QString current_exec)
{

    QString exec;

#ifdef _WIN32
    exec=QFileDialog::getOpenFileName(this,tr("Select \'mysqldump\' Executable"),current_exec,"MySQLDump (mysqldump.exe)");
#endif

#ifdef unix
    exec=QFileDialog::getOpenFileName(this,tr("Select \'mysqldump\' Executable"),current_exec);
#endif

    if(exec.isEmpty()){
        return current_exec;
    }
    else{

#ifdef _WIN32
        exec=QDir::toNativeSeparators(exec);
        SettingsManager m;
        m.Save_Mysqldump_Path(exec);
#endif

        return exec;
    }
}
Exemple #5
0
int App::main(int argc, char **argv)
{
	//Redirection de la sortie standart
	CL_ConsoleWindow console("Pongo");
	console.redirect_stdio();

	try
	{
		std::string nameFirstPlayer = "jojolapin";
		std::string nameSecondPlayer = "BenO";
		
		CL_SetupCore::init();

		if(argc > 1)
		{
			nameFirstPlayer = argv[1];
			if(argc > 2)
				nameSecondPlayer = argv[2];
		}

		try
		{
			Log::open("log.txt");
		}
		catch(CL_Error errlog)
		{
			std::cout << errlog.message.c_str() << std::endl;
			CL_SetupCore::deinit();
			return 0;
		}

		CL_SetupGUI::init();
		CL_SetupGL::init();
		CL_SetupDisplay::init();
		
		SettingsManager *settingsManager = SettingsManager::getInstance();

		//Initialisation graphique
		CL_OpenGLWindow window("Pongo", settingsManager->screenWidth, settingsManager->screenHeight, settingsManager->screenFullscreen);
		CL_Slot slotCloseWindow = window.sig_window_close().connect(this, &App::onClose);

		game = new Game(nameFirstPlayer, nameSecondPlayer);
		game->run();
		delete game;
		
	    settingsManager->dispose();
		
		CL_SetupDisplay::deinit();
		CL_SetupGL::deinit();
		CL_SetupGUI::deinit();
		CL_SetupCore::deinit();
	}
	catch(CL_Error err)
	{
		Log::print(LOG_ERR, "Une exception est survenue : " + err.message + ".");
		console.display_close_message();
	}
    
	return 0;
}
PreferencesDialog::PreferencesDialog(QWidget *parent) :
    QDialog(parent),
    m_ui(new Ui::PreferencesDialog)
{
    m_ui->setupUi(this);

    // Key Settings
    m_ui->ngIDLineEdit->setValidator(new HexValidator(this));
    m_ui->ngKeyIDLineEdit->setValidator(new HexValidator(this));
    m_ui->ngSigPt1LineEdit->setValidator(new HexValidator(this));
    m_ui->ngSigPt2LineEdit->setValidator(new HexValidator(this));
    m_ui->ngPrivLineEdit->setValidator(new HexValidator(this));
    m_ui->macAddrLineEdit->setValidator(new HexValidator(this));
    connect(m_ui->ngSigPt1LineEdit, SIGNAL(textChanged(QString)), this, SLOT(onTextChanged(QString)));
    connect(m_ui->ngSigPt2LineEdit, SIGNAL(textChanged(QString)), this, SLOT(onTextChanged(QString)));
    connect(m_ui->loadKeysBtn, SIGNAL(clicked()), this, SLOT(onLoadKeys()));

    // Region Settings
    SettingsManager* settings = SettingsManager::instance();

    switch(settings->defaultRegion())
    {
        case SettingsManager::NTSCU: m_ui->ntscURB->setChecked(true); break;
        case SettingsManager::NTSCJ: m_ui->ntscJRB->setChecked(true); break;
        case SettingsManager::PAL:   m_ui->palRB  ->setChecked(true); break;
    }

    m_ui->ntscUNameLE->setText(settings->defaultPlayerNameForRegion(SettingsManager::NTSCU));
    m_ui->ntscJNameLE->setText(settings->defaultPlayerNameForRegion(SettingsManager::NTSCJ));
    m_ui->palNameLE  ->setText(settings->defaultPlayerNameForRegion(SettingsManager::PAL  ));
}
Harness::Harness(QObject *parent) : QObject(parent)
{
	settingsManager.loadSavedSettings();

	gui = new MainWindow;
	serialManager = new SerialManager;
	packetReceiver = new PacketReceiver;
	windDataAnalyzer = new WindDataAnalyzer;
	dataLogger = new DataLogger;
	systemTimer = new QTimer;
	batteryChargeCalculator = new BatteryChargeCalculator;
	loggingData = false;

	connect(serialManager, SIGNAL(onNewDataReady(QByteArray)), packetReceiver, SLOT(onNewDataReceived(QByteArray)));
	connect(serialManager, SIGNAL(serialPortError(QString)), this, SLOT(onSerialPortError(QString)));
	connect(packetReceiver, SIGNAL(validPacketReceived()), this, SLOT(onValidPacketReceived()));
	connect(packetReceiver, SIGNAL(invalidPacketReceived()), this, SLOT(onInvalidPacketReceived()));
	connect(gui, SIGNAL(connectSerialButtonClicked(QString)), this, SLOT(onConnectSerialButtonClicked(QString)));
	connect(gui, SIGNAL(saveDataLogButtonClicked()), this, SLOT(onSaveDataLogButtonClicked()));
	connect(gui, SIGNAL(startLoggingButtonClicked()), this, SLOT(onStartLoggingButtonClicked()));
	connect(gui, SIGNAL(clearLogButtonClicked()), this, SLOT(onClearLogButtonClicked()));
	connect(gui, SIGNAL(settingsChanged()), this, SLOT(onSettingsChanged()));
	connect(systemTimer, SIGNAL(timeout()), this, SLOT(onSystemTimerTimeout()));

	compassOffset = settingsManager.getSettings().compassOffset;
	loadGUIDefaultValues();
	gui->show();
	systemTimer->start(SYSTEM_TIMER_INTERVAL_MS);
}
Exemple #8
0
void DockWidget::updateSyncStatusWidgetVisibility()
{
    SettingsManager s;
    if (s.isCloudSyncActive())
        m_syncStatusWidget->show();
    else
        m_syncStatusWidget->hide();
}
int ContentUI::getDiscLength(EPanels panel) const
{
    SettingsManager settingsManager;
    QString disc(settingsManager.accountDisc(settingsManager.currentAccount(static_cast <int> (panel))));

    disc += QString(":");
    disc += QDir::toNativeSeparators("/");

    return disc.length();
}
void QueuePage::write() {
	PropPage::write(handle(), items);
	PropPage::write(optionItems, otherOptions);

	SettingsManager* settings = SettingsManager::getInstance();
	if(SETTING(AUTODROP_INTERVAL) < 1)
		settings->set(SettingsManager::AUTODROP_INTERVAL, 1);
	if(SETTING(AUTODROP_ELAPSED) < 1)
		settings->set(SettingsManager::AUTODROP_ELAPSED, 1);
}
void FdmAppearancePage::write() {
	PropPage::fdmWrite(handle(), items, listItems, ::GetDlgItem(handle(), IDC_FDM_APPEARANCE_BOOLEANS));

	SettingsManager* settings = SettingsManager::getInstance();

	settings->set(SettingsManager::OP_SPOKE_COLOUR, (int)opSpoke);
	settings->set(SettingsManager::NOT_OP_SPOKE_COLOUR, (int)notOpSpoke);
	settings->set(SettingsManager::I_SPOKE_COLOUR, (int)iSpoke);
	settings->set(SettingsManager::MY_NICK_SPOKEN_COLOUR, (int)myNickSpoken);
}
void SettingsDialog::showEvent(QShowEvent *event)
{
    Qt::CheckState state;
    int ratio;

    SettingsManager *mgr = seafApplet->settingsManager();

    state = mgr->hideMainWindowWhenStarted() ? Qt::Checked : Qt::Unchecked;
    mHideMainWinCheckBox->setCheckState(state);

    state = mgr->allowInvalidWorktree() ? Qt::Checked : Qt::Unchecked;
    mAllowInvalidWorktreeCheckBox->setCheckState(state);

    state = mgr->allowRepoNotFoundOnServer() ? Qt::Checked : Qt::Unchecked;
    mAllowRepoNotFoundCheckBox->setCheckState(state);

    state = mgr->autoStart() ? Qt::Checked : Qt::Unchecked;
    mAutoStartCheckBox->setCheckState(state);
    state = mgr->notify() ? Qt::Checked : Qt::Unchecked;
    mNotifyCheckBox->setCheckState(state);

    ratio = mgr->maxDownloadRatio();
    mDownloadSpinBox->setValue(ratio);
    ratio = mgr->maxUploadRatio();
    mUploadSpinBox->setValue(ratio);

    if (isCheckLatestVersionEnabled()) {
        state = mgr->isCheckLatestVersionEnabled() ? Qt::Checked : Qt::Unchecked;
        mCheckLatestVersionBox->setCheckState(state);
    }

    QDialog::showEvent(event);
}
void WebContentManager::update()
{
    SettingsManager settingsManager;
    QString disc;
    QString currentAccountName(settingsManager.currentAccount(panelNum));

    settingsManager.setCurrentPanel(panelNum);

    disc = settingsManager.accountDrive(currentAccountName);
    disc += QString(":");
    disc += QDir::toNativeSeparators("/");

    pathLabel->setText(disc + settingsManager.currentFolderPath(panelNum));
    drivesComboBox->setToolTip(tr("Email: ") + currentAccountName + tr("\nName: ") + settingsManager.name(currentAccountName));

    get(settingsManager.currentFolderUrl(panelNum));

    ComboBoxItem drivesMap;
    QIcon icon(QApplication::style()->standardIcon(QStyle::SP_DriveFDIcon));
    QStringList accounts(settingsManager.accounts());

    foreach(QString account, accounts)
    {
        QString driveLetter (settingsManager.accountDrive(account));
        QMap<QString, QIcon> drivesAdditionalInfo;

        drivesAdditionalInfo[account] = icon;
        drivesMap[driveLetter] = drivesAdditionalInfo;
    }
Exemple #14
0
int main(int argc, const char * argv[]) {
	SettingsManager * settings = new SettingsManager();
	settings->load();
	settings->save();

	delete settings;

	system("pause");
	
	return 0;
}
void PreferencesDialog::accept()
{
    if (m_ui->ngIDLineEdit->hasAcceptableInput() && m_ui->ngIDLineEdit->text().length() == 8)
    {
        quint32 id;
        bool ok;
        id = m_ui->ngIDLineEdit->text().toInt(&ok, 16);
        if (ok)
            WiiKeys::instance()->setNGID(id);
    }
    if (m_ui->ngKeyIDLineEdit->hasAcceptableInput() && m_ui->ngKeyIDLineEdit->text().length() == 8)
    {
        quint32 id;
        bool ok;
        id = m_ui->ngKeyIDLineEdit->text().toInt(&ok, 16);
        if (ok)
            WiiKeys::instance()->setNGKeyID(id);
    }
    if (m_ui->ngSigPt1LineEdit->hasAcceptableInput() && m_ui->ngSigPt2LineEdit->hasAcceptableInput() &&
        m_ui->ngSigPt1LineEdit->text().length() == 60 && m_ui->ngSigPt1LineEdit->text().length() == 60)
    {
        QByteArray ngSig = QByteArray::fromHex(m_ui->ngSigPt1LineEdit->text().toAscii());
        ngSig.append(QByteArray::fromHex(m_ui->ngSigPt2LineEdit->text().toAscii()));
        WiiKeys::instance()->setNGSig(ngSig);
    }

    if (m_ui->ngPrivLineEdit->hasAcceptableInput() && m_ui->ngPrivLineEdit->text().length() == 60)
    {
        QByteArray ngPriv = QByteArray::fromHex(m_ui->ngPrivLineEdit->text().toAscii());
        WiiKeys::instance()->setNGPriv(ngPriv);
    }
    if (m_ui->macAddrLineEdit->hasAcceptableInput() && m_ui->macAddrLineEdit->text().length() == 12)
    {
        QByteArray macAddr = QByteArray::fromHex(m_ui->macAddrLineEdit->text().toAscii());
        WiiKeys::instance()->setMacAddr(macAddr);
    }

    SettingsManager* settings = SettingsManager::instance();

    QString regionBtn = m_ui->regionBtnGrp->checkedButton()->objectName();
    settings->setDefaultRegion(regionBtn == "ntscURB" ? SettingsManager::NTSCU :
                              (regionBtn == "ntscJRB" ? SettingsManager::NTSCJ :
                               SettingsManager::PAL));

    if (m_ui->ntscUNameLE->isModified() && !m_ui->ntscUNameLE->text().isEmpty())
        settings->setDefaultPlayerNameForRegion(SettingsManager::NTSCU, m_ui->ntscUNameLE->text());
    if (m_ui->ntscJNameLE->isModified() && !m_ui->ntscJNameLE->text().isEmpty())
        settings->setDefaultPlayerNameForRegion(SettingsManager::NTSCJ, m_ui->ntscJNameLE->text());
    if (m_ui->palNameLE->isModified() && !m_ui->palNameLE->text().isEmpty())
        settings->setDefaultPlayerNameForRegion(SettingsManager::PAL, m_ui->palNameLE->text());

    QDialog::accept();
}
Exemple #16
0
	bool CSettings::LoadConvertProfile(const CString& name, SimpleXmlNode profileNode)
	{
		SettingsManager mgr;
		ImageConvertingParams params;
		std::string saveTo = profileNode.Attribute("Name");
		if (!name.IsEmpty())
			saveTo = WCstringToUtf8(name);
		SettingsNode& image = mgr["Image"];
		BindConvertProfile(image, params);
		mgr.loadFromXmlNode(profileNode);
		ConvertProfiles[Utf8ToWCstring( saveTo)] = params;
		return true;
	}
Exemple #17
0
void TestCompilerProvider::testRegisterCompiler()
{
    SettingsManager settings;
    auto provider = settings.provider();
    auto cf = provider->compilerFactories();
    for (int i = 0 ; i < cf.size(); ++i) {
        auto compiler = cf[i]->createCompiler(QString::number(i), QString::number(i));
        QVERIFY(provider->registerCompiler(compiler));
        QVERIFY(!provider->registerCompiler(compiler));
        QVERIFY(provider->compilers().contains(compiler));
    }
    QVERIFY(!provider->registerCompiler({}));
}
// Create a new mysql journal (6/1/13)
bool NewJournalCreator::Create_MySQL_Database(){


    // Bugfix for 0.5: Pass a new variable for remote hosts if the journal is not on localhost. --Will Kraft (6/7/14).
    bool remote=false;
    if((hostname != "localhost") && (hostname != "127.0.0.1"))
        remote=true;

    MySQLCore mysql;
    bool success=mysql.CreateDatabase(hostname,root_password,journal_name,port,username,password,remote);

    QMessageBox msg;
    if(success){

        int choice=msg.question(this,"RoboJournal", "RoboJournal has successfully created a new journal called  <b>" +
                                journal_name + "</b> on <b>" + hostname + "</b>.<br><br>Do you want to add <b>" +
                                journal_name + "</b> to your list of favorites?", QMessageBox::Yes | QMessageBox::No,
                                QMessageBox::Yes);

        // Post-setup: Create configuration file with new values if option is checked
        if(ui->SetAsDefault->isChecked()){

            SettingsManager sm;
            sm.NewConfig(hostname,journal_name,port,username);
        }

        // clear firstrun flag if this is the first run and it is active
        if(Buffer::firstrun){
            Buffer::firstrun=false;
        }

        // Add the new database to the list of known databases.
        FavoriteCore f;
        f.Add_to_DB(journal_name,username,hostname);

        //Set the new journal as a favorite if the user indicated so in the choice question box (8/18/13).
        if(choice==QMessageBox::Yes){
            f.setFavoritebyName(journal_name,true);
        }

        return true;
    }

    // journal creation failed...
    else{
        msg.critical(this,"RoboJournal", "Journal creation attempt on <b>" + hostname + "</b> failed. Make sure "
                     "the host is able to accept incoming connections with the settings you provided (the port and/or "
                     "root password may be incorrect).");
        return false;
    }
}
Exemple #19
0
void ExpertsPage::write() {
	PropPage::write(items);

	SettingsManager* settings = SettingsManager::getInstance();
	if(SETTING(SET_MINISLOT_SIZE) < 64)
		settings->set(SettingsManager::SET_MINISLOT_SIZE, 64);
	if(SETTING(AUTO_SEARCH_LIMIT) > 5)
		settings->set(SettingsManager::AUTO_SEARCH_LIMIT, 5);
	else if(SETTING(AUTO_SEARCH_LIMIT) < 1)
		settings->set(SettingsManager::AUTO_SEARCH_LIMIT, 1);

	if(SETTING(AUTO_SEARCH_INTERVAL) < 120)
		settings->set(SettingsManager::AUTO_SEARCH_INTERVAL, 120);
}
void SettingsDialog::loadSettings()
{
    // Region Settings
    SettingsManager* settings = SettingsManager::instance();
    ui->settingsTab->setCurrentIndex(0);
    switch(settings->defaultRegion())
    {
    case Region::NTSCU: ui->ntscURB->setChecked(true); break;
    case Region::NTSCK: ui->ntscKRB->setChecked(true); break;
    case Region::NTSCJ: ui->ntscJRB->setChecked(true); break;
    case Region::PAL:   ui->palRB  ->setChecked(true); break;
    default: break;
    }

    ui->ntscUNameLE      ->setText(settings->defaultPlayerNameForRegion(Region::NTSCU));
    ui->ntscUNameLE      ->setModified(false);
    ui->ntscKNameLE      ->setText(settings->defaultPlayerNameForRegion(Region::NTSCK));
    ui->ntscKNameLE      ->setModified(false);
    ui->ntscJNameLE      ->setText(settings->defaultPlayerNameForRegion(Region::NTSCJ));
    ui->ntscJNameLE      ->setModified(false);
    ui->palNameLE        ->setText(settings->defaultPlayerNameForRegion(Region::PAL  ));
    ui->palNameLE        ->setModified(false);
    ui->updateUrlLineEdit->setText(settings->updateUrl());
    ui->updateUrlLineEdit->setModified(false);
    ui->checkOnStart     ->setChecked(settings->updateCheckOnStart());
}
void CollectionListView::deleteCollection()
{
    int collectionId = MetadataEngine::getInstance().getCurrentCollectionId();

    if ((collectionId == 0) || SyncSession::IS_READ_ONLY) return; //0 stands for invalid

    //ask for confirmation
    QMessageBox box(QMessageBox::Question, tr("Delete Collection"),
                    tr("Are you sure you want to delete the selected collection?"
                       "<br><br><b>Warning:</b> This cannot be undone!"),
                    QMessageBox::Yes | QMessageBox::No,
                    this);
    box.setDefaultButton(QMessageBox::Yes);
    box.setWindowModality(Qt::WindowModal);
    int r = box.exec();
    if (r == QMessageBox::No) return;

    //check all fields for delete triggers
    CollectionFieldCleaner cleaner(this);
    cleaner.cleanCollection(collectionId);

    //delete metadata and tables
    MetadataEngine::getInstance().deleteCollection(collectionId);

    //delete from model
    m_model->removeRow(currentIndex().row());

    //delete settings about collection's column positions in TableView
    SettingsManager s;
    QString settingsKey = QString("collection_") + QString::number(collectionId);
    s.deleteObjectProperties(settingsKey);

    //reset cached id
    m_currentCollectionId = 0;

    //clear undo stack since this action is not undoable
    QUndoStack *stack = MainWindow::getUndoStack();
    if (stack) stack->clear();

    //set first collection as current one
    QModelIndex first = m_model->index(0, 1);
    if (first.isValid())
        setCurrentIndex(first);
    else
        MetadataEngine::getInstance().setCurrentCollectionId(0); //set invalid

    //set local data changed
    SyncSession::LOCAL_DATA_CHANGED = true;
}
void OperationsManager::slotAccountInfoReceived(AccountInfo::Data &data)
{
    SettingsManager settingsManager;

    if(!settingsManager.isAnyAccount())
    {
        settingsManager.setCurrentAccount(static_cast<int> (ELeft), data.email);
        settingsManager.setCurrentAccount(static_cast<int> (ERight), data.email);
    }

    settingsManager.saveAccountInfo(data);

    accountInfo->deleteLater();
    emit signalAccountInfoReadyToUse();
}
Exemple #23
0
	bool CSettings::SaveConvertProfiles(SimpleXmlNode root)
	{
		std::map<CString, ImageConvertingParams>::iterator it;
		for (it = ConvertProfiles.begin(); it != ConvertProfiles.end(); ++it)
		{
			SimpleXmlNode profile = root.CreateChild("Profile");
			ImageConvertingParams& params = it->second;
			profile.SetAttribute("Name", WCstringToUtf8(it->first));
			SettingsManager mgr;
			SettingsNode& image = mgr["Image"];
			BindConvertProfile(image, params);
			mgr.saveToXmlNode(profile);
		}
		return true;
	}
//###########################################################################################################
ExportPreview::~ExportPreview()
{

    // remember size setting
    if(!this->isMaximized()){

        QSize geo=this->size();

        SettingsManager s;
        s.SavePreviewSize(geo);
    }


    delete ui;
}
Exemple #25
0
void ContentUI::setCurrentPanelState(EPanels panel, const QString &url)
{
    SettingsManager settingsManager;

    int panelNum = static_cast <int> (panel);

    settingsManager.setCurrentFolderURL(panelNum, url);

    QString fullPath(getPanelLabel(panel)->text());
    int beginPos = fullPath.indexOf(QDir::toNativeSeparators("/")) + 1;
    int length = fullPath.length() - beginPos;

    settingsManager.setCurrentFolderPath(panelNum, fullPath.mid(beginPos, length));
    settingsManager.setPathesURLs(panelNum, SDriveEngine::inst()->getContentMngr()->getPathesURLs());
}
Exemple #26
0
	bool CSettings::SaveServerProfiles(SimpleXmlNode root)
	{
		for ( ServerProfilesMap::iterator it = ServerProfiles.begin(); it != ServerProfiles.end(); ++it) {
			SimpleXmlNode serverProfileNode = root.CreateChild("ServerProfile");
		
			std::string profileName = WCstringToUtf8(it->first);
			
			//ServerProfile sp = ;
			SettingsManager mgr;
			it->second.bind(mgr.root());
			mgr["@ServerProfileId"].bind(profileName);

			mgr.saveToXmlNode(serverProfileNode);
		}
		return true;
	}
Exemple #27
0
inline Landscape* Test::GetLandscape()
{
	SettingsManager* settings = SettingsManager::Instance();
	Entity* landscapeNode = GetScene()->FindByName(settings->GetLandscapeNodeName());
	Landscape* landscape = NULL;
	if (landscapeNode)
	{
		RenderComponent* renderComponent = cast_if_equal<RenderComponent*>(landscapeNode->GetComponent(Component::RENDER_COMPONENT));
		if (renderComponent)
		{
			landscape = dynamic_cast<Landscape*>(renderComponent->GetRenderObject());
		}
	}

	return landscape;
}
Exemple #28
0
void ToolsDialog::openBase(){
    QString nomFichier = QFileDialog::getExistingDirectory(0, "Répertoire de la base", QDir::homePath());
    if(nomFichier.isEmpty()){
        QMessageBox::critical(this, "Pas de fichier choisi", "<strong>ATTENTION:</strong> vous n'avez pas choisi de fichier de données.  <em>Interrogator</em> ne pourra pas fonctionner normalement!");
        return;
    }
    if(!nomFichier.endsWith("/")){
        nomFichier.append("/");
    }
    nomFichier.append("interrogator.xml");
    SettingsManager manager;
    manager.setSettings(Base, nomFichier);
    emit baseUpdated();
    this->close();
    return;
}
Exemple #29
0
void TestCompilerProvider::testCompilerIncludesAndDefinesForProject()
{
    auto project = ProjectsGenerator::GenerateMultiPathProject();
    Q_ASSERT(project);

    SettingsManager settings;
    auto provider = settings.provider();

    Q_ASSERT(!provider->compilerFactories().isEmpty());
    auto compiler = provider->compilerFactories().first()->createCompiler("name", "path");

    QVERIFY(provider->registerCompiler(compiler));
    QVERIFY(provider->compilers().contains(compiler));

    auto projectCompiler = provider->compilerForItem(project->projectItem());

    QVERIFY(projectCompiler);
    QVERIFY(projectCompiler != compiler);

    ProjectBaseItem* mainfile = nullptr;
    for (const auto& file: project->fileSet() ) {
        for (auto i: project->filesForPath(file)) {
            if( i->text() == "main.cpp" ) {
                mainfile = i;
                break;
            }
        }
    }
    QVERIFY(mainfile);
    auto mainCompiler = provider->compilerForItem(mainfile);
    QVERIFY(mainCompiler);
    QVERIFY(mainCompiler->name() == projectCompiler->name());

    ConfigEntry entry;
    entry.path = "src/main.cpp";
    entry.compiler = compiler;

    auto entries = settings.readPaths(project->projectConfiguration().data());
    entries.append(entry);
    settings.writePaths(project->projectConfiguration().data(), entries);

    mainCompiler = provider->compilerForItem(mainfile);
    QVERIFY(mainCompiler);
    QVERIFY(mainCompiler->name() == compiler->name());

    ICore::self()->projectController()->closeProject(project);
}
void SettingsDialog::load()
{
    SettingsManager * manager = SettingsManager::settingsManager();
    HistoryManager * historyManager = HistoryManager::historyManager();
    DownloadManager * downloadManager = DownloadManager::downloadManager();
    NetworkAccessManager * networkAccessManager = NetworkAccessManager::networkAccessManager();
    TabManager * tabManager = TabManager::tabManager();
    m_imagesCheckBox->setChecked(manager->isImagesEnabled());
    m_javascriptCheckBox->setChecked(manager->isJavascriptEnabled());
    m_javaCheckBox->setChecked(manager->isJavaEnabled());
    m_pluginsCheckBox->setChecked(manager->isPluginsEnabled());
    m_sansFontComboBox->setCurrentFont(QFont(manager->sansFontFamily()));
    m_serifFontComboBox->setCurrentFont(QFont(manager->serifFontFamily()));
    m_monoFontComboBox->setCurrentFont(QFont(manager->monoFontFamily()));
    m_standardFontSpinBox->setValue(manager->standardFontSize());
    m_monoFontSpinBox->setValue(manager->monoFontSize());
    m_privateBrowsingCheckBox->setChecked(historyManager->isPrivateBrowsingEnabled());
    m_historyExpirationComboBox->setCurrentIndex(2);
    for(int i = 0; i < 8; i++)
    {
        if(m_historyExpirationComboBox->itemData(i).toInt() ==
           historyManager->expirationDays())
        {
            m_historyExpirationComboBox->setCurrentIndex(i);
            break;
        }
    }
    QString path = downloadManager->standardPath();
    if(path.isEmpty())
    {
        m_downloadCheckBox->setChecked(false);
    }
    else
    {
        m_downloadCheckBox->setChecked(true);
        m_downloadLineEdit->setText(path);
    }
    m_cacheSizeSpinBox->setValue(networkAccessManager->cacheSize() / 1024 / 1024);
    QUrl url(networkAccessManager->proxy());
    if(!url.isEmpty())
    {
        m_proxyLineEdit->setText(url.host());
        m_proxySpinBox->setValue(url.port());
    }
    m_addTabPolicyComboBox->setCurrentIndex(tabManager->addTabPolicy() == TabManager::AddAfterLast ? 0 : 1);
}