Example #1
0
void GeneralPage::save(QSettings &s)
{
    m_identitiesModel->saveToSettings(s);
    s.setValue(Common::SettingsNames::appLoadHomepage, showHomepageCheckbox->isChecked());
    s.setValue(Common::SettingsNames::guiPreferPlaintextRendering, preferPlaintextCheckbox->isChecked());
    s.setValue(Common::SettingsNames::guiShowSystray, guiSystrayCheckbox->isChecked());
}
void MainWindow::uploadDirectories()
{
	QSettings settings;
	QFileDialog d(this);
	{
		QVariant ld = settings.value("the-latest-directory");
		if (ld.isValid())
			d.setDirectory(ld.toString());
	}

	d.setAcceptMode(QFileDialog::AcceptOpen);
	d.setFileMode(QFileDialog::Directory);
	d.setOption(QFileDialog::ShowDirsOnly, true);
	d.setOption(QFileDialog::ReadOnly, true);
	restoreGeometry("upload-directories", d);
	if (!d.exec())
		return;

	saveGeometry("upload-directories", d);
	settings.setValue("the-latest-directory", d.directory().absolutePath());

	QStringList dirs(d.selectedFiles());
	if (dirs.isEmpty())
		return;

	uploadFiles(dirs);
}
Example #3
0
int MainWindow::set_amplifier(struct amp_settings amp_settings)
{
    QSettings settings;

    if(!connected)
        return 0;

    if(settings.value("Settings/oneSetToSetThemAll").toBool())
    {
        struct fx_pedal_settings pedal;

        if(effect1->get_changed())
        {
            effect1->get_settings(pedal);
            amp_ops->set_effect(pedal);
        }
        if(effect2->get_changed())
        {
            effect2->get_settings(pedal);
            amp_ops->set_effect(pedal);
        }
        if(effect3->get_changed())
        {
            effect3->get_settings(pedal);
            amp_ops->set_effect(pedal);
        }
        if(effect4->get_changed())
        {
            effect4->get_settings(pedal);
            amp_ops->set_effect(pedal);
        }
    }

    return amp_ops->set_amplifier(amp_settings);
}
void MainWindow::restoreGeometry(const QString &name, QWidget &widget)
{
	QSettings settings;
	QVariant geometry = settings.value("geometry/" + name);
	if (geometry.isValid())
		widget.restoreGeometry(geometry.toByteArray());
}
void MainWindow::showEvent(QShowEvent *)
{
	if (!_device)
	{
		if (!reconnectToDevice())
			return;

		QSettings settings;
		restoreGeometry("main-window", *this);
		restoreState(settings.value("state/main-window").toByteArray());

		qDebug() << "device found, opening session...";
		mtp::SessionPtr session;
		static const int MaxAttempts = 3;
		for(int attempt = 0; attempt < MaxAttempts; ++attempt)
		{
			try
			{
				session = _device->OpenSession(1);
				mtp::msg::DeviceInfo di = session->GetDeviceInfo();
				qDebug() << "device info" << fromUtf8(di.Manufacturer) << " " << fromUtf8(di.Model);
				break;
			}
			catch(const mtp::usb::TimeoutException &ex)
			{
				qDebug() << "timed out getting device info: " << fromUtf8(ex.what()) << ", retrying...";
				if (attempt + 1 == MaxAttempts)
				{
					QMessageBox::critical(this, tr("MTP"), tr("MTP device does not respond"));
					_device.reset();
					return;
				}
			}
			catch(const mtp::usb::DeviceNotFoundException &ex)
			{
				qDebug() << "device disconnected, retrying...";
				if (!reconnectToDevice())
					return;
			}
		}

		_storageModel = new MtpStoragesModel(this);
		while (!_storageModel->update(session))
		{
			int r = QMessageBox::warning(this, tr("No MTP Storages"),
				tr("No MTP storage found, your device might be locked.\nPlease unlock and press Retry to continue or Abort to exit."),
				QMessageBox::Retry | QMessageBox::Abort);
			if (r & QMessageBox::Abort)
			{
				_device.reset();
				return;
			}
		}
		_ui->storageList->setModel(_storageModel);
		_objectModel->setSession(session);
		onStorageChanged(_ui->storageList->currentIndex());
		qDebug() << "session opened, starting";
		_proxyModel->setSourceModel(_objectModel);
	}
}
Example #6
0
int main(int argc, char* argv[])
{
    QApplication application(argc, argv);
    QCoreApplication::setOrganizationName(ORG_KEY);
    QCoreApplication::setApplicationName(APP_KEY);

    /* On Windows msysgit exec directory is set up
     * during installation so to always find git.exe
     * also if not in PATH
     */
    QSettings set;
    GIT_DIR = set.value(GIT_DIR_KEY).toString();

    initMimePix();

    MainImpl *mainWindow = new MainImpl;
    mainWindow->show();

    QObject::connect(&application, SIGNAL(lastWindowClosed()),
                     &application, SLOT(quit()));

    bool ret = application.exec();

    freeMimePix();
    return ret;
}
Example #7
0
QgsBrowserDockWidget::~QgsBrowserDockWidget()
{
  QSettings settings;
  settings.setValue( settingsSection() + "/propertiesWidgetEnabled", mPropertiesWidgetEnabled );
  //settings.setValue(settingsSection() + "/propertiesWidgetHeight", mPropertiesWidget->size().height() );
  settings.setValue( settingsSection() + "/propertiesWidgetHeight", mPropertiesWidgetHeight );
}
void ReportGridOptions::setSnap(bool yes) {
    snap_grid = yes;
    QSettings settings;
    settings.setPath("OpenMFG.com", "OpenReports", QSettings::UserScope);
    settings.writeEntry("/OpenMFG/rwSnapGrid", snap_grid);
    emit gridOptionsChanged();
}
Example #9
0
void MainWindow::doFileReopen() {
    QSettings settings;
    if (settings.contains("latestModelFile"))
        openFile(settings.value("latestModelFile").toString());
    else
        doFileOpen();
}
Example #10
0
void MainWindow::activateTool(Tool * tool)
{
    bool first_time = (currentTool == 0);

    if (tool == 0)
        tool = static_cast<Tool*>(sender());

    if (currentTool)
        currentTool->deactivate();

    sidebarContents->setCurrentWidget(tool);
    sidebar->setWindowTitle(tool->windowTitle());

    currentTool = tool;
    tool->activate();

    if (sidebar->isVisible())
        tool->action()->setChecked(true);

    // Save current tool in settings

    QSettings settings;
    prepare_settings(settings, model());

    QString toolName = (sidebar->isVisible() || first_time) ?
        tool->objectName() : "none";
    settings.setValue("current_tool", toolName);
}
Example #11
0
void ReportGridOptions::setVisible(bool v) {
    show_grid = v;
    QSettings settings;
    settings.setPath("OpenMFG.com", "OpenReports", QSettings::UserScope);
    settings.writeEntry("/OpenMFG/rwShowGrid", show_grid);
    emit gridOptionsChanged();
}
Example #12
0
int main( int argc, char *argv[] )
{
    bool need_config_sync = false;
    int timeout = 3000;
    int timezone = 0;

    QApplication a(argc, argv);

    QTextCodec *codec = QTextCodec::codecForName("utf8");
    QTextCodec::setCodecForTr( codec );

    QCoreApplication::setOrganizationName("KamertonUberSoft");
    QCoreApplication::setApplicationName("telemetry");
    QSettings *config = new QSettings(QSettings::IniFormat, QSettings::UserScope,
                                      QCoreApplication::organizationName(),
                                      QCoreApplication::applicationName());
    if (!config->contains("port"))
        need_config_sync = true;

    QString portname = config->value("port", DEFAULT_PORT_NAME).toString();
    config->setValue("port", portname);

    if (need_config_sync)
        config->sync();

    QextSerialPort *p = new QextSerialPort(portname);
    p->open(QextSerialPort::ReadWrite);
    p->setBaudRate(BAUD115200);

    HUD2 *window = new HUD2(p, timeout, timezone);

    window->show();
    return a.exec();
}
void GridLinesMgr::init()
{
	QSettings* conf = StelApp::getInstance().getSettings();
	Q_ASSERT(conf);

	setFlagAzimuthalGrid(conf->value("viewing/flag_azimuthal_grid").toBool());
	setFlagEquatorGrid(conf->value("viewing/flag_equatorial_grid").toBool());
	setFlagEquatorJ2000Grid(conf->value("viewing/flag_equatorial_J2000_grid").toBool());
	setFlagEclipticJ2000Grid(conf->value("viewing/flag_ecliptic_J2000_grid").toBool());
	setFlagGalacticGrid(conf->value("viewing/flag_galactic_grid").toBool());
	setFlagEquatorLine(conf->value("viewing/flag_equator_line").toBool());
	setFlagEclipticLine(conf->value("viewing/flag_ecliptic_line").toBool());
	setFlagMeridianLine(conf->value("viewing/flag_meridian_line").toBool());
	setFlagHorizonLine(conf->value("viewing/flag_horizon_line").toBool());
	setFlagGalacticEquatorLine(conf->value("viewing/flag_galactic_equator_line").toBool());
	
	StelApp& app = StelApp::getInstance();
	connect(&app, SIGNAL(colorSchemeChanged(const QString&)), this, SLOT(setStelStyle(const QString&)));
	connect(&app, SIGNAL(languageChanged()), this, SLOT(updateLineLabels()));
	
	QString displayGroup = N_("Display Options");
	addAction("actionShow_Equatorial_Grid", displayGroup, N_("Equatorial grid"), "equatorGridDisplayed", "E");
	addAction("actionShow_Azimuthal_Grid", displayGroup, N_("Azimuthal grid"), "azimuthalGridDisplayed", "Z");
	addAction("actionShow_Ecliptic_Line", displayGroup, N_("Ecliptic line"), "eclipticLineDisplayed", ",");
	addAction("actionShow_Equator_Line", displayGroup, N_("Equator line"), "equatorLineDisplayed", ".");
	addAction("actionShow_Meridian_Line", displayGroup, N_("Meridian line"), "meridianLineDisplayed", ";");
	addAction("actionShow_Horizon_Line", displayGroup, N_("Horizon line"), "horizonLineDisplayed", "H");
	addAction("actionShow_Equatorial_J2000_Grid", displayGroup, N_("Equatorial J2000 grid"), "equatorJ2000GridDisplayed");
	addAction("actionShow_Ecliptic_J2000_Grid", displayGroup, N_("Ecliptic J2000 grid"), "eclipticJ2000GridDisplayed");
	addAction("actionShow_Galactic_Grid", displayGroup, N_("Galactic grid"), "galacticGridDisplayed");
	addAction("actionShow_Galactic_Equator_Line", displayGroup, N_("Galactic equator"), "galacticEquatorLineDisplayed");
}
void MainWindow::closeEvent(QCloseEvent *event)
{
    QSettings settings;
    settings.setValue("geometry", saveGeometry());
    settings.setValue("windowState", saveState());
    QMainWindow::closeEvent(event);
}
Example #15
0
QSetDlg::QSetDlg(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::QSetDlg)
{
    ui->setupUi(this);
    setWindowTitle(QString::fromLocal8Bit("高级设置"));
    bool bcheck;
    bcheck = connect(ui->pushButtonApply,SIGNAL(clicked()),this,SLOT(onApplyClick()));
    Q_ASSERT(bcheck);

    //bcheck = connect(ui->pushButtonExit,SIGNAL(clicked()),
    //                 MainDialog::Instance()->getFloatDlg(),SLOT(onSoftUpdate()));
    //Q_ASSERT(bcheck);

    bcheck = connect(ui->pushButtonExit,SIGNAL(clicked()),
                     this,SLOT(onUpdateClick()));
    Q_ASSERT(bcheck);

    bcheck = connect(ui->lineEditIP,SIGNAL(textEdited(QString)),this,SLOT(textEdited(QString)));
    Q_ASSERT(bcheck);

    QSettings set;
    QString ip;
    ip = set.value("ip","10.77.1.114").toString();
    //port = set.value("file_port","7000").toString();
    ui->lineEditIP->setText(ip);
    //ui->lineEditPort->setText(port);
}
Example #16
0
void DefinitionManager::removeDefinition(QString path) {
  // find the definition and remove it from disk
  Definition &def = definitions[path];
  if (def.path == path) {
    switch (def.type) {
      case Definition::Block:
        blockManager.disableDefinitions(def.id);
        break;
      case Definition::Biome:
        biomeManager.disableDefinitions(def.id);
        break;
      case Definition::Dimension:
        dimensionManager.disableDefinitions(def.id);
        break;
      case Definition::Entity:
        entityManager.disableDefinitions(def.id);
        break;
      case Definition::Pack:
        blockManager.disableDefinitions(def.blockid);
        biomeManager.disableDefinitions(def.biomeid);
        dimensionManager.disableDefinitions(def.dimensionid);
        entityManager.disableDefinitions(def.entityid);
        break;
    }
    definitions.remove(path);
    QFile::remove(path);
    sorted.removeOne(path);
    QSettings settings;
    settings.setValue("packs", sorted);
    emit packsChanged();
    refresh();
  }
}
bool ApplicationList::LoadSettings()
{
    QSettings settings;
    QStringList names = settings.value(SETTINGS_APPLICATION_NAMES, QStringList()).toStringList();
    QStringList paths = settings.value(SETTINGS_APPLICATION_PATHS, QStringList()).toStringList();
    QStringList params = settings.value(SETTINGS_APPLICATION_PARAMS, QStringList()).toStringList();
    int defapp = settings.value(SETTINGS_APPLICATION_DEFAULT, -1).toInt();

    // Params will be empty first time starting with the new setting.
    // Return false and inform user about problem with application settings.
    bool succeeded = true;
    if (!names.empty() && !paths.empty() && params.empty()) {
        for (int i = 0; i < paths.length(); i++)
            params << "";
        succeeded = false;
    }

    if (names.empty() && paths.empty() && params.empty()) {
#ifndef _WIN32
        // use as default for gnome environments
        if (QFileInfo("/usr/bin/gedit").isExecutable()) {
            Application app;
            app.setName("gedit");
            app.setPath("/usr/bin/gedit");
            app.setParameters("+(line) (file)");
            AddApplication(app);
            defapp = 0;
        }
        CheckAndAddApplication("/usr/bin/geany","geany","+(line) (file)");
        CheckAndAddApplication("/usr/bin/qtcreator","Qt Creator","-client (file):(line)");
        // use as default for kde environments
        if (QFileInfo("/usr/bin/kate").isExecutable()) {
            Application app;
            app.setName("kate");
            app.setPath("/usr/bin/kate");
            app.setParameters("-l(line) (file)");
            AddApplication(app);
            defapp = 0;
        }
#else
        if (FindDefaultWindowsEditor()) {
            defapp = 0;
        }
#endif
    } else if (names.size() == paths.size()) {
        for (int i = 0; i < names.size(); i++) {
            const Application app(names[i], paths[i], params[i]);
            AddApplication(app);
        }
    }

    if (defapp == -1)
        mDefaultApplicationIndex = 0;
    else if (defapp < names.size())
        mDefaultApplicationIndex = defapp;
    else
        mDefaultApplicationIndex = 0;

    return succeeded;
}
Example #18
0
void OlaIO::setServerEmbedded(bool embedServer)
{
    if (embedServer != m_embedServer)
    {
        if (m_thread != NULL)
        {
            m_thread->stop();
            delete m_thread;
        }

        m_embedServer = embedServer;
        if (m_embedServer)
        {
            qWarning() << "olaout: running as embedded";
            m_thread = new OlaEmbeddedServer();
        }
        else
        {
            m_thread = new OlaStandaloneClient();
        }

        if (!m_thread->start())
            qWarning() << "olaout: start thread failed";

        QSettings settings;
        settings.setValue(SETTINGS_EMBEDDED, m_embedServer);
    }
}
Example #19
0
void DiveHeartrateItem::settingsChanged()
{
	QSettings s;
	s.beginGroup("TecDetails");
	visible = s.value(visibilityKey).toBool();
	setVisible(visible);
}
QgsStatisticalSummaryDockWidget::QgsStatisticalSummaryDockWidget( QWidget *parent )
    : QgsDockWidget( parent )
    , mLayer( nullptr )
{
  setupUi( this );

  mFieldExpressionWidget->registerExpressionContextGenerator( this );

  mLayerComboBox->setFilters( QgsMapLayerProxyModel::VectorLayer );
  mFieldExpressionWidget->setFilters( QgsFieldProxyModel::Numeric |
                                      QgsFieldProxyModel::String |
                                      QgsFieldProxyModel::Date );

  mLayerComboBox->setLayer( mLayerComboBox->layer( 0 ) );
  mFieldExpressionWidget->setLayer( mLayerComboBox->layer( 0 ) );

  connect( mLayerComboBox, SIGNAL( layerChanged( QgsMapLayer* ) ), this, SLOT( layerChanged( QgsMapLayer* ) ) );
  connect( mFieldExpressionWidget, SIGNAL( fieldChanged( QString ) ), this, SLOT( refreshStatistics() ) );
  connect( mSelectedOnlyCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( refreshStatistics() ) );
  connect( mButtonRefresh, SIGNAL( clicked( bool ) ), this, SLOT( refreshStatistics() ) );
  connect( QgsProject::instance(), SIGNAL( layersWillBeRemoved( QStringList ) ), this, SLOT( layersRemoved( QStringList ) ) );

  QSettings settings;
  Q_FOREACH ( QgsStatisticalSummary::Statistic stat, mDisplayStats )
  {
    QAction* action = new QAction( QgsStatisticalSummary::displayName( stat ), mOptionsToolButton );
    action->setCheckable( true );
    bool checked = settings.value( QStringLiteral( "/StatisticalSummaryDock/checked_%1" ).arg( stat ), true ).toBool();
    action->setChecked( checked );
    action->setData( stat );
    mStatsActions.insert( stat, action );
    connect( action, SIGNAL( triggered( bool ) ), this, SLOT( statActionTriggered( bool ) ) );
    mOptionsToolButton->addAction( action );
  }
Example #21
0
CNetwork::CNetwork(QObject *parent) :
    QObject(parent)
{
    QSettings* pSystem = CCommonFunction::GetSettings( CommonDataType::CfgSystem );
    bMultiCast = !pSystem->value( "CommonCfg/BroadCastData", false ).toBool( );
    if ( bMultiCast ) {
        GetTargetHostIP( );
    }

    QString strFile = "sensapi.dll";
    WCHAR* pPath = ( WCHAR* ) strFile.utf16( );
    hDllMod = ::LoadLibrary( pPath );
    MyIsNetworkAlive = NULL;

    // IsDestinationReachable
    if ( NULL != hDllMod ) {
        MyIsNetworkAlive = ( IsNetworkAlive )::GetProcAddress( hDllMod, "IsNetworkAlive" );
    }

    pParent = qobject_cast< MainWindow* >( parent );
    pCodec = CCommonFunction::GetTextCodec( );
    connect( this, SIGNAL( OnReceiveDatagram( QStringList& ) ), pParent, SLOT( ProcessDatagram( QStringList& ) ) );
    InitBroadcastSocket( );
    Server( );
}
Example #22
0
void DrawpileApp::openUrl(QUrl url)
{
    // See if there is an existing replacable window
    MainWindow *win = nullptr;
    for(QWidget *widget : topLevelWidgets()) {
        MainWindow *mw = qobject_cast<MainWindow*>(widget);
        if(mw && mw->canReplace()) {
            win = mw;
            break;
        }
    }

    // No? Create a new one
    if(!win)
        win = new MainWindow;

    if(url.scheme() == "drawpile") {
        // Our own protocol: connect to a session

        if(url.userName().isEmpty()) {
            // Set username if not specified
            QSettings cfg;
            url.setUserName(cfg.value("history/username").toString());
        }
        win->joinSession(url);

    } else {
        // Other protocols: load image
        win->openUrl(url);
    }
}
void MainWindow::closeEvent(QCloseEvent *event)
{
	QSettings settings;
	saveGeometry("main-window", *this);
	settings.setValue("state/main-window", saveState());
	QMainWindow::closeEvent(event);
}
void LastFMService::AuthenticateReplyFinished() {
  QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
  if (!reply) {
    emit AuthenticationComplete(false);
    return;
  }
  reply->deleteLater();

  // Parse the reply
  lastfm::XmlQuery lfm(lastfm::compat::EmptyXmlQuery());
  if (lastfm::compat::ParseQuery(reply->readAll(), &lfm)) {
    lastfm::ws::Username = lfm["session"]["name"].text();
    lastfm::ws::SessionKey = lfm["session"]["key"].text();
    QString subscribed = lfm["session"]["subscriber"].text();
    const bool is_subscriber = (subscribed.toInt() == 1);

    // Save the session key
    QSettings settings;
    settings.beginGroup(kSettingsGroup);
    settings.setValue("Username", lastfm::ws::Username);
    settings.setValue("Session", lastfm::ws::SessionKey);
    settings.setValue("Subscriber", is_subscriber);
  } else {
    emit AuthenticationComplete(false);
    return;
  }

  // Invalidate the scrobbler - it will get recreated later
  delete scrobbler_;
  scrobbler_ = NULL;

  emit AuthenticationComplete(true);
}
void MainWindow::downloadFiles(const QVector<mtp::ObjectId> &objects)
{
	if (objects.isEmpty())
		return;

	QFileDialog d(this);
	QSettings settings;
	{
		QVariant ld = settings.value("the-latest-download-directory");
		if (ld.isValid())
			d.setDirectory(ld.toString());
	}

	d.setAcceptMode(QFileDialog::AcceptSave);
	d.setFileMode(QFileDialog::Directory);
	d.setOption(QFileDialog::ShowDirsOnly, true);
	restoreGeometry("download-files", d);
	if (!d.exec())
		return;

	QStringList selected = d.selectedFiles();
	if (selected.isEmpty())
		return;

	QString path = selected.at(0);
	saveGeometry("download-files", d);
	settings.setValue("the-latest-download-directory", path);
	downloadFiles(path, objects);
}
Example #26
0
QgsComposerLabel::QgsComposerLabel( QgsComposition *composition ):
    QgsComposerItem( composition ), mHtmlState( 0 ), mHtmlUnitsToMM( 1.0 ),
    mHtmlLoaded( false ), mMargin( 1.0 ), mFontColor( QColor( 0, 0, 0 ) ),
    mHAlignment( Qt::AlignLeft ), mVAlignment( Qt::AlignTop ),
    mExpressionFeature( 0 ), mExpressionLayer( 0 )
{
  mHtmlUnitsToMM = htmlUnitsToMM();

  //get default composer font from settings
  QSettings settings;
  QString defaultFontString = settings.value( "/Composer/defaultFont" ).toString();
  if ( !defaultFontString.isEmpty() )
  {
    mFont.setFamily( defaultFontString );
  }

  //default to a 10 point font size
  mFont.setPointSizeF( 10 );

  //default to no background
  setBackgroundEnabled( false );

  if ( mComposition && mComposition->atlasMode() == QgsComposition::PreviewAtlas )
  {
    //a label added while atlas preview is enabled needs to have the expression context set,
    //otherwise fields in the label aren't correctly evaluated until atlas preview feature changes (#9457)
    setExpressionContext( mComposition->atlasComposition().currentFeature(), mComposition->atlasComposition().coverageLayer() );
  }

  //connect to atlas feature changes
  //to update the expression context
  connect( &mComposition->atlasComposition(), SIGNAL( featureChanged( QgsFeature* ) ), this, SLOT( refreshExpressionContext() ) );

}
void MainWindow::uploadAlbum()
{
	QFileDialog d(this);
	QSettings settings;
	{
		QVariant ld = settings.value("the-latest-directory");
		if (ld.isValid())
			d.setDirectory(ld.toString());
	}

	d.setAcceptMode(QFileDialog::AcceptOpen);
	d.setFileMode(QFileDialog::Directory);
	d.setOption(QFileDialog::ShowDirsOnly, true);
	d.setOption(QFileDialog::ReadOnly, true);
	restoreGeometry("upload-albums", d);
	if (!d.exec())
		return;

	saveGeometry("upload-albums", d);
	settings.setValue("the-latest-directory", d.directory().absolutePath());
	QStringList selected = d.selectedFiles();
	if (selected.isEmpty())
		return;

	for(const auto &path : selected)
	{
		uploadAlbum(path);
		back();
	}
}
Example #28
0
/*
void QSetDlg::onUpdate()
{
    QSettings   set;
    QString     ip;
    ip = ui->lineEditIP->text();
    set.setValue("ip",ip);
    if ( FTAPI::Instance()->getSock()->isconnected())
    {
        FTAPI::Instance()->close();
    }else
        FTAPI::Instance()->login(QHostInfo::localHostName().toLocal8Bit().data(),ip.toUtf8().data(),7000);
    MainDialog::Instance()->getFloatDlg()->onSoftUpdate();
}
*/
void QSetDlg::textEdited(const QString &text)
{
    QSettings   set;
    QString     ip;
    ip = ui->lineEditIP->text();
    set.setValue("ip",ip);
}
Example #29
0
void MainWindow::load_presets9()
{
    QSettings settings;

    if(settings.contains("DefaultPresets/Preset9"))
        load_from_amp(settings.value("DefaultPresets/Preset9").toInt());
}
Example #30
0
qGoBoardLocalInterface::qGoBoardLocalInterface(BoardWindow *bw, Tree * t, GameData *gd)
    : qGoBoard(bw, t, gd)
{
    this->setObjectName("qGoBoardLocalInterface");
    boardwindow->getUi()->board->clearData();

    // If we have handicap, but not from a loaded file, we have to set the handicap move
    if (gameData->handicap && gameData->fileName.isEmpty())
        setHandicap(gameData->handicap);

    QSettings settings;
    // value 1 = no sound, 0 all games, 2 my games
    playSound = (settings.value("SOUND") != 1);

    // Set up computer interface.
    gtp = new QGtp() ;

    connect (gtp, SIGNAL(signal_computerPlayed(int, int)), SLOT(slot_playComputer(int, int)));
    connect (gtp, SIGNAL(computerResigned()), SLOT(slot_resignComputer()));
    connect (gtp, SIGNAL(computerPassed()), SLOT(slot_passComputer()));

    if (gtp->openGtpSession(settings.value("COMPUTER_PATH").toString(),
                gameData->board_size,
                gameData->komi,
                gameData->handicap,
                GNUGO_LEVEL)==FAIL)
    {
        throw QString(QObject::tr("Error opening program: %1")).arg(gtp->getLastMessage());
    }

    tree->setCurrent(tree->findLastMoveInMainBranch());
    boardwindow->getBoardHandler()->updateMove(tree->getCurrent());

    feedPositionThroughGtp();
}