Esempio n. 1
0
bool MainWindow::Stop()
{
	bool stop = true;
	if (Settings().GetConfirmStop())
	{
		// We could pause the game here and resume it if they say no.
		QMessageBox::StandardButton confirm;
		confirm = QMessageBox::question(m_render_widget, tr("Confirm"), tr("Stop emulation?"));
		stop = (confirm == QMessageBox::Yes);
	}

	if (stop)
		ForceStop();

	return stop;
}
Esempio n. 2
0
//---------------------------------------------------------------------------------------
tNdp2kTableDataSources::tNdp2kTableDataSources(
        tQMutex& apiThreadLock,
        tDigitalDataSourceSettings& sourceSettings,
        const char* pName,
        tTableID tableID,
        tTableFormat format,
        const tDataType* pTypes,
        unsigned numTypes )
    : tNDP2kTableSettings(
          apiThreadLock,
          *tGlobal<tISettingsWriterFactory>::Instance(),
          QString("DataSources.") + pName,
          tableID,
          format )
    , m_pSourceSettings( &sourceSettings )
    , m_DefaultFormat( format )
    , m_DefaultFormatRows( numTypes )
    , m_pDefaultFormatTypes( pTypes )
    , m_ExtendedDelay( false )
    , m_ShareChanges( false )
    , m_UpdateGlobalSettings( false )
    , m_SelectionInProgress( false )
    , m_Lock( "tNdp2kTableDataSources" )
{
    Assert( m_DefaultFormatRows <= m_cMaxRows );

    // initialise source selection table
    int version = LoadSettings( Settings() );
    if (version >= 0)
    {
        m_UpdateGlobalSettings = true;
    }
    else
    {
        LoadFromGlobalSettings();
        version = TABLE_VERSION_UNKNOWN;
        SaveSettings();
    }

    m_UpdateTimer.setSingleShot( true );
    Connect( &m_UpdateTimer, SIGNAL(timeout()), this, SLOT(OnUpdateTimeout()) );

    Connect( this, SIGNAL(RowChanged(int)), this, SLOT(OnMyRowChanged(int)), Qt::QueuedConnection );
    Connect( this, SIGNAL(TableChanged()),  this, SLOT(OnMyTableChanged()),  Qt::QueuedConnection );

    Register( ValidVersion( version ), TableShare_Watcher, 0 );
}
	void ConstructL() {
		Settings().NotifyOnChange(SETTING_LAST_CONNECTION_SUCCESS, this);
		Settings().NotifyOnChange(SETTING_LAST_CONNECTION_ATTEMPT, this);
		Settings().NotifyOnChange(SETTING_LAST_CONNECTION_ERROR, this);
		Settings().NotifyOnChange(SETTING_LAST_CONNECTION_REQUEST, this);
		Settings().NotifyOnChange(SETTING_LATEST_CONNECTION_REQUEST, this);
		Settings().NotifyOnChange(SETTING_PRESENCE_ENABLE, this);
		
		iTimer=CTimeOut::NewL(*this, CActive::EPriorityIdle);
		iTimer->Wait(1);
	}
Esempio n. 4
0
GameTracker::GameTracker(QObject* parent) : QFileSystemWatcher(parent)
{
  m_loader = new GameLoader;
  m_loader->moveToThread(&m_loader_thread);

  qRegisterMetaType<QSharedPointer<GameFile>>();
  connect(&m_loader_thread, &QThread::finished, m_loader, &QObject::deleteLater);
  connect(this, &QFileSystemWatcher::directoryChanged, this, &GameTracker::UpdateDirectory);
  connect(this, &QFileSystemWatcher::fileChanged, this, &GameTracker::UpdateFile);
  connect(this, &GameTracker::PathChanged, m_loader, &GameLoader::LoadGame);
  connect(m_loader, &GameLoader::GameLoaded, this, &GameTracker::GameLoaded);

  m_loader_thread.start();

  for (QString dir : Settings().GetPaths())
    AddDirectory(dir);
}
Esempio n. 5
0
QGridLayout* PathDialog::MakePathsLayout()
{
  QGridLayout* layout = new QGridLayout;
  layout->setColumnStretch(1, 1);

  m_game_edit = new QLineEdit(Settings().GetDefaultGame());
  connect(m_game_edit, &QLineEdit::editingFinished,
          [=] { Settings().SetDefaultGame(m_game_edit->text()); });
  QPushButton* game_open = new QPushButton;
  connect(game_open, &QPushButton::clicked, this, &PathDialog::BrowseDefaultGame);
  layout->addWidget(new QLabel(tr("Default Game")), 0, 0);
  layout->addWidget(m_game_edit, 0, 1);
  layout->addWidget(game_open, 0, 2);

  m_dvd_edit = new QLineEdit(Settings().GetDVDRoot());
  connect(m_dvd_edit, &QLineEdit::editingFinished,
          [=] { Settings().SetDVDRoot(m_dvd_edit->text()); });
  QPushButton* dvd_open = new QPushButton;
  connect(dvd_open, &QPushButton::clicked, this, &PathDialog::BrowseDVDRoot);
  layout->addWidget(new QLabel(tr("DVD Root")), 1, 0);
  layout->addWidget(m_dvd_edit, 1, 1);
  layout->addWidget(dvd_open, 1, 2);

  m_app_edit = new QLineEdit(Settings().GetApploader());
  connect(m_app_edit, &QLineEdit::editingFinished,
          [=] { Settings().SetApploader(m_app_edit->text()); });
  QPushButton* app_open = new QPushButton;
  connect(app_open, &QPushButton::clicked, this, &PathDialog::BrowseApploader);
  layout->addWidget(new QLabel(tr("Apploader")), 2, 0);
  layout->addWidget(m_app_edit, 2, 1);
  layout->addWidget(app_open, 2, 2);

  m_nand_edit = new QLineEdit(Settings().GetWiiNAND());
  connect(m_nand_edit, &QLineEdit::editingFinished,
          [=] { Settings().SetWiiNAND(m_nand_edit->text()); });
  QPushButton* nand_open = new QPushButton;
  connect(nand_open, &QPushButton::clicked, this, &PathDialog::BrowseWiiNAND);
  layout->addWidget(new QLabel(tr("Wii NAND Root")), 3, 0);
  layout->addWidget(m_nand_edit, 3, 1);
  layout->addWidget(nand_open, 3, 2);

  return layout;
}
Esempio n. 6
0
SHAPE_LINE_CHAIN PNS_MEANDER_SHAPE::circleQuad( VECTOR2D aP, VECTOR2D aDir, bool aSide )
{
    SHAPE_LINE_CHAIN lc;

    if( aDir.EuclideanNorm( ) == 0.0f )
    {
        lc.Append( aP );
        return lc;
    }

    VECTOR2D dir_u( aDir );
    VECTOR2D dir_v( aDir.Perpendicular( ) );

    const int ArcSegments = Settings().m_cornerArcSegments;

    double radius = (double) aDir.EuclideanNorm();
    double angleStep = M_PI / 2.0 / (double) ArcSegments;

    double correction = 12.0 * radius * ( 1.0 - cos( angleStep / 2.0 ) );

    if( !m_dual )
        correction = 0.0;
    else if( radius < m_meanCornerRadius )
        correction = 0.0;

    VECTOR2D p = aP;
    lc.Append( ( int ) p.x, ( int ) p.y );

    VECTOR2D dir_uu = dir_u.Resize( radius - correction );
    VECTOR2D dir_vv = dir_v.Resize( radius - correction );

    VECTOR2D shift = dir_u.Resize( correction );

    for( int i = ArcSegments - 1; i >= 0; i-- )
    {
        double alpha = (double) i / (double) ( ArcSegments - 1 ) * M_PI / 2.0;
        p = aP + shift + dir_uu * cos( alpha ) + dir_vv * ( aSide ? -1.0 : 1.0 ) * ( 1.0 - sin( alpha ) );
        lc.Append( ( int ) p.x, ( int ) p.y );
    }

    p = aP + dir_u + dir_v * ( aSide ? -1.0 : 1.0 );
    lc.Append( ( int ) p.x, ( int ) p.y );

    return lc;
}
Esempio n. 7
0
void MainWindow::StartGame(const QString& path)
{
	// If we're running, only start a new game once we've stopped the last.
	if (Core::GetState() != Core::CORE_UNINITIALIZED)
	{
		if (!Stop())
			return;
	}
	// Boot up, show an error if it fails to load the game.
	if (!BootManager::BootCore(path.toStdString()))
	{
		QMessageBox::critical(this, tr("Error"), tr("Failed to init core"), QMessageBox::Ok);
		return;
	}
	Settings().SetLastGame(path);
	ShowRenderWidget();
	emit EmulationStarted();
}
Esempio n. 8
0
void ofFbo::destroy() {
	unbind();

	if(fbo) glDeleteFramebuffers(1, &fbo);
	if(depthBuffer) glDeleteFramebuffers(1, &depthBuffer);
	if(stencilBuffer) glDeleteFramebuffers(1, &stencilBuffer);

	if(settings.numSamples && fboTextures) glDeleteFramebuffers(1, &fboTextures);

	for(int i=0; i<(int)textures.size(); i++) delete textures[i];
	textures.clear();

	for(int i=0; i<(int)colorBuffers.size(); i++) glDeleteFramebuffers(1, &colorBuffers[i]);
	colorBuffers.clear();


	settings = Settings();
}
Esempio n. 9
0
 void write_config
 (
     const std::basic_string<Ch>&    a_filename,
     const basic_variant_tree<Ch>&   a_tree,
     config_format                   a_format,
     const Settings&                 a_settings = Settings(),
     const std::locale &             a_loc      = std::locale()
 ) {
     std::basic_ofstream<Ch> stream(a_filename.c_str());
     if (!stream) {
         throw variant_tree_parser_error(
             "Cannot open file for writing", a_filename, 0);
     }
     stream.imbue(a_loc);
     write_config(stream, a_tree, a_format, a_settings);
     if (!stream.good())
         throw variant_tree_parser_error("Write error", a_filename, 0);
 }
Esempio n. 10
0
void SettingsDialog::getSettings(Settings& result)
{
	result = Settings();
	result.host = m_UI->cbOllyIP->currentText().toStdString();
	result.port = static_cast<short>(m_UI->sbOllyPort->value());
	bool ok = false;
	QString remoteModBase = m_UI->leRemoteModuleBase->text().trimmed();
	result.remoteModBase = remoteModBase.toULongLong(&ok, 16);
	
	result.enabled = m_UI->gbEnabledSync->isChecked();
	result.demangle = m_UI->chDemangleNames->isChecked();
	result.localLabels = m_UI->chLocalLabels->isChecked();
	result.nonCodeNames = m_UI->chNonCodeNames->isChecked();
	result.analysePEHeader = m_UI->chPerformPEAnalysis->isChecked();
	result.postProcessFixCallJumps = m_UI->chPostProcessFixCallJumps->isChecked();
	result.overwriteWarning = static_cast<Settings::OverwriteWarning>(m_UI->cbOverwriteWarning->currentIndex());
	result.commentsSync = static_cast<Settings::CommentsSync>(m_UI->cbCommentsSync->currentIndex());
}
Esempio n. 11
0
void LocationBar::focusInEvent(QFocusEvent* event)
{
    if (m_webView) {
        const QString stringUrl = convertUrlToText(m_webView->url());

        // Text has been edited, let's show go button
        if (stringUrl != text()) {
            setGoIconVisible(true);
        }
    }

    clearTextFormat();
    LineEdit::focusInEvent(event);

    if (Settings().value("Browser-View-Settings/instantBookmarksToolbar").toBool()) {
        m_window->bookmarksToolbar()->show();
    }
}
Esempio n. 12
0
void MenuBar::AddStateSlotMenu(QMenu* emu_menu)
{
    m_state_slot_menu = emu_menu->addMenu(tr("Select State Slot"));
    m_state_slots = new QActionGroup(this);

    for (int i = 1; i <= 10; i++)
    {
        QAction* action = m_state_slot_menu->addAction(QStringLiteral(""));
        action->setCheckable(true);
        action->setActionGroup(m_state_slots);
        if (Settings().GetStateSlot() == i)
            action->setChecked(true);

        connect(action, &QAction::triggered, this, [=]() {
            emit SetStateSlot(i);
        });
    }
}
Esempio n. 13
0
void CNetworkClient::login()
{
    QStringList LoginArguments;
    int MHz = 0;

#ifdef Q_OS_UNIX
    quint64 cpuHz;
    size_t size = sizeof(quint64);
    if(sysctlbyname("hw.cpufrequency_max", &cpuHz, &size, 0, 0))
    {
        QFile CPUClockFile("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq");
        if(CPUClockFile.exists())   //Linux with correct sysfs (on some machines cpuX/cpufreq doesn't exists)
        {
            CPUClockFile.open(QIODevice::ReadOnly);
            MHz = CPUClockFile.readAll().trimmed().toInt() / 1000;
            CPUClockFile.close();
        }
        else //Other *unix
        {
            CPUClockFile.setFileName("/proc/cpuinfo");
            CPUClockFile.open(QIODevice::ReadOnly);
            QString CPUInfo = QString(CPUClockFile.readAll());
            QRegExp RegExp("cpu MHz\\s+: (\\d+)");
            RegExp.indexIn(CPUInfo);
            MHz = RegExp.cap(1).toInt();
            CPUClockFile.close();
        }
    }
    else
        MHz = cpuHz/1000000;
#else
#ifdef Q_OS_WIN32
    QSettings Settings("HKEY_LOCAL_MACHINE\\HARDWARE\\Description\\System\\CentralProcessor\\0", QSettings::NativeFormat);
    MHz = Settings.value("~MHz").toInt();
#else
#endif
#endif

    qDebug("Detected CPU clock : %d MHz", MHz);

    LoginArguments << Username << Password << QString::number(MHz)
            << Socket.localAddress().toString() << QString("HoSpLo ") + VERSION << "\t0" << "\tsp";
    execCommand("LOGIN", LoginArguments);
}
void CWebForm::ConstructL()
{
	TInt ap;
	bool ap_set=Settings().GetSettingL(SETTING_IP_AP, ap);
	
	


	if (ap_set) {
		// fire and forget
#ifndef __WINS__
		iOpener.MakeConnectionL(ap);
#endif
	}
	iDb=CDb::NewL(AppContext(), _L("WEB"),EFileRead|EFileWrite);
	iPoints=CSavedPoints::NewL(AppContext(), iDb->Db());

	CAknForm::ConstructL();
}
Esempio n. 15
0
void MenuBar::AddGameListTypeSection(QMenu* view_menu)
{
    QAction* table_view = view_menu->addAction(tr("Table"));
    table_view->setCheckable(true);

    QAction* list_view = view_menu->addAction(tr("List"));
    list_view->setCheckable(true);

    QActionGroup* list_group = new QActionGroup(this);
    list_group->addAction(table_view);
    list_group->addAction(list_view);

    bool prefer_table = Settings().GetPreferredView();
    table_view->setChecked(prefer_table);
    list_view->setChecked(!prefer_table);

    connect(table_view, &QAction::triggered, this, &MenuBar::ShowTable);
    connect(list_view, &QAction::triggered, this, &MenuBar::ShowList);
}
Esempio n. 16
0
void PNS_ROUTER::updateView( PNS_NODE* aNode, PNS_ITEMSET& aCurrent )
{
    PNS_NODE::ITEM_VECTOR removed, added;
    PNS_NODE::OBSTACLES obstacles;

    if( !aNode )
        return;

    if( Settings().Mode() == RM_MarkObstacles )
        markViolations( aNode, aCurrent, removed );

    aNode->GetUpdatedItems( removed, added );

	for ( auto item : added )
        m_iface->DisplayItem( item );

    for ( auto item : removed )
        m_iface->HideItem ( item );
}
Esempio n. 17
0
void configure_intfc::on_pushButton_Save_clicked()
{

    QString IniFile = ConfigPath + "/intfc.ini";
    QSettings Settings(IniFile, QSettings::IniFormat);
    switch(ui->tabWidget->currentIndex())
    {
    case 0: //Log
        Settings.beginGroup("Logger");
        Settings.setValue("Hours", ui->spinBox_Logger_Hours->text());
        Settings.setValue("Days", ui->spinBox_Logger_Days->text());
        Settings.setValue("Changes", QString::number(ui->comboBox_Logger_Changes->currentIndex()));
        Settings.setValue("MinTime", QString::number(ui->spinBox_Logger_MinTime->value()));
        Settings.setValue("MaxTime", QString::number(ui->spinBox_Logger_MaxTime->value()));
        Settings.endGroup();
        break;
    case 1: //Paths
        break;
    case 2: //Options
        Settings.beginGroup("Options");
        Settings.setValue("DefaultPage", ui->comboBox_Options_DefaultPage->currentText());
        Settings.setValue("WindowMode", ui->comboBox_Options_WindowMode->currentText());
        Settings.setValue("EnableSound", QString::number(ui->comboBox_Options_EnableSound->currentIndex()));
        Settings.endGroup();
        break;
    case 3: //Page Names
        Settings.beginGroup("PageNames");
        Settings.setValue("0", ui->lineEdit_Page0Name->text());
        Settings.setValue("1", ui->lineEdit_Page1Name->text());
        Settings.setValue("2", ui->lineEdit_Page2Name->text());
        Settings.setValue("3", ui->lineEdit_Page3Name->text());
        Settings.setValue("4", ui->lineEdit_Page4Name->text());
        Settings.setValue("5", ui->lineEdit_Page5Name->text());
        Settings.setValue("6", ui->lineEdit_Page6Name->text());
        Settings.setValue("7", ui->lineEdit_Page7Name->text());
        Settings.setValue("8", ui->lineEdit_Page8Name->text());
        Settings.setValue("9", ui->lineEdit_Page9Name->text());
        Settings.endGroup();
        break;
    }
    Settings.disconnect();
}
Esempio n. 18
0
void PRC::Init(QString Path, int PrcNum)
{
    QString Filename = Path + "/" + QString::number(PrcNum) + ".prc.ini";
    QSettings Settings(Filename, QSettings::IniFormat);
    for(int i = 0; i < NUMBER_OF_REGISTERS; i++)
    {
        Settings.beginGroup("R" + QString::number(i));
        if(Settings.value("Name").toString().length() > 0)
        {
            R[i].Name = Settings.value("Name").toString();
            R[i].Description = Settings.value("Description").toString();
            R[i].Units = Settings.value("Units").toString();
            R[i].Page = Settings.value("Page").toString();
            R[i].PrcLow = Settings.value("PrcLow").toDouble();
            R[i].PrcHigh = Settings.value("PrcHigh").toDouble();
            R[i].IntfcLow = Settings.value("IntfcLow").toDouble();
            R[i].IntfcHigh = Settings.value("IntfcHigh").toDouble();
            R[i].IntfcMin = Settings.value("IntfcMin").toDouble();
            R[i].IntfcMax = Settings.value("IntfcMax").toDouble();
            R[i].LogFilter = Settings.value("LogFilter").toDouble();
            R[i].IsLogged = Settings.value("IsLogged").toInt();
            R[i].IsConfigured = ( R[i].PrcHigh > R[i].PrcLow && R[i].IntfcHigh > R[i].IntfcLow );
        }
        Settings.endGroup();
    }
    for(int i = 0; i < NUMBER_OF_COILS; i++)
    {
        Settings.beginGroup("C" + QString::number(i));
        if(Settings.value("Name").toString().length() > 0)
        {
            C[i].Name = Settings.value("Name").toString();
            C[i].Description = Settings.value("Description").toString();
            C[i].Page = Settings.value("Page").toString();
            C[i].IsLogged = Settings.value("IsLogged").toInt();
            C[i].AlertIf = Settings.value("AlertIf").toInt();
            C[i].IsConfigured = true;
        }
        Settings.endGroup();
    }
    Active = true;
    Settings.disconnect();
}
void CContextLocaAppUi::SettingChanged(TInt Setting)
{
	if (Setting==SETTING_LOGGING_ENABLE) {
		TApaTaskList tl(Ws());
		TApaTask booktask=tl.FindApp(KUidcontextbook);
		if (booktask.Exists()) {
			booktask.SendSystemEvent(EApaSystemEventShutdown);
		}
		TBool logging;
		Settings().GetSettingL(SETTING_LOGGING_ENABLE, logging);
		if (iLoggingRunning) {	
			if (!logging) {
				iLoggingRunning->SetCurrentState( EMbmContextlocaL_not, EMbmContextlocaL_not );
			} else {
				iLoggingRunning->SetCurrentState( EMbmContextlocaL, EMbmContextlocaL );
			}
		}

	}
}
Esempio n. 20
0
int main(int argc, char *argv[]) {
    int returnCode = 0;
    do {
        QApplication app(argc, argv);
        QCoreApplication::setOrganizationName(organizationName);
        QCoreApplication::setApplicationName(appName);
        QCoreApplication::setApplicationVersion(appVersion);
        const QString language = Settings().value("language", QLocale::system().name())
                .toString().left(2);
        const QString translation_path = QDir::currentPath() + "/minesweeper_" + language + ".qm";
        QTranslator* translator = new QTranslator();
        translator->load(translation_path);
        app.installTranslator(translator);
        MainWindow w;
        w.show();
        returnCode = app.exec();
    } while (returnCode == changeLanguageReturnCode);

    return returnCode;
}
Esempio n. 21
0
OwNetInstallation::OwNetInstallation(QObject *parent) :
    QObject(parent)
{
    // read <resources>/version.json
    QDir dir;
    dir.setPath(Settings().value("application/resources_folder_path").toString());
    QFile file(dir.absoluteFilePath("version.json"));
    file.open(QIODevice::ReadOnly | QIODevice::Text);
    QByteArray json = file.readAll();

    // parse json
    bool ok = false;
    QVariantMap currentMetadata = JsonDocument::fromJson(json, &ok).toVariant().toMap();
    if (ok)
    {
        m_currentVersion = currentMetadata.value("current_version").toString();
    }
    else
        qDebug() << "Problem reading <resources_folder_path>/version.json";
}
Esempio n. 22
0
JsExtender::JsExtender( MainWindow *main )
:	QObject( main )
,	m_mainWindow( main )
,	m_loading( 0 )
{
	QString deflang;
	switch( QLocale().language() )
	{
	case QLocale::English: deflang = "en"; break;
	case QLocale::Russian: deflang = "ru"; break;
	case QLocale::Estonian:
	default: deflang = "et"; break;
	}
	m_locale = Settings().value( "Main/Language", deflang ).toString();
	if ( m_locale.isEmpty() )
		m_locale = QLocale::system().name().left( 2 );
	setLanguage( m_locale );

	connect( m_mainWindow->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()),
            this, SLOT(javaScriptWindowObjectCleared()));
}
void CContextLocaAppUi::TimeSynced(TBool aSuccess)
{
	TTime t; t=GetTime();
	if (aSuccess) {
		delete iNtpTimeOut; iNtpTimeOut=0;
		Settings().WriteSettingL(SETTING_LAST_TIMESYNC, t);
		if (!bbl) {
			LogAppEvent(_L("Starting 1.6"));
			bbl=CBBLogger::NewL(AppContext(),this);
		}
	}
	if (!iSensorRunner) {
		if (aSuccess) {
			iSensorRunner=CSensorRunner::NewL(
				AppContext(), smsh, EFalse, *this);
		} else {
			if (! iNtpTimeOut ) iNtpTimeOut=CTimeOut::NewL(*this);
			iNtpTimeOut->Wait(5);
		}
	}
}
Esempio n. 24
0
ItemsWidget::ItemsWidget(QWidget *parent) :
    QScrollArea(parent)
{
    isCompareView = Settings().flag(SettingKey::GUI::CompareView);

    itemHeight = QFontMetrics(font()).height() * 7;
    if (itemHeight < 120)
        itemHeight = 120;

    m_contentWidget = new QWidget(this);
    m_lay = new QVBoxLayout(m_contentWidget);
    m_lay->setContentsMargins(4,0,4,4);
    m_lay->setSpacing(4);
    m_lay->addStretch();

    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setFrameShape(QFrame::NoFrame);
    setWidget(m_contentWidget);
    setWidgetResizable(true);
}
Esempio n. 25
0
myGaussian::myGaussian(RooRealVar* pmB, std::string m,std::string p, std::string c, std::string t, std::string a, std::string fileName)
{
  _mB=pmB;
  _name="myGaussian_"+m+"_"+p+"_"+c+"_"+t+"_"+a;

  // Make a settings object to find the relevant parameters
  Settings mySettings = Settings("myGaussian_"+m+"_"+p+"_"+c+"_"+t+"_"+a);
  mySettings.readPairStringsToMap(fileName);

  // Read in the relevant parameters
  /*
  _mean=mySettings.getD(m+"_"+p+"_"+t+"_gaussian_mean");
  _width=mySettings.getD(m+"_"+p+"_"+t+"_gaussian_width");
  std::cout << "myGaussian" << std::endl;
  std::cout << " mean: " << _mean <<  " width: " << _width << std::endl;
  */

  // Create any RooRealVars you'll need
  _intVars["mean"]=0;
  _intVars["width"]=0;
}
Esempio n. 26
0
bool Updater::Start(const QStringList& Arguments)
{
    this->Arguments = Arguments;
    if(!this->Arguments.isEmpty())
        this->Arguments.removeAt(0);
    if(this->Arguments.contains("--close"))
    {
        Skip();
        return false;
    }
    Progress = new UpdateProgress();
    connect(Progress,SIGNAL(Skip()),this,SLOT(Skip()));
    connect(Progress,SIGNAL(Update()),this,SLOT(Update()));
    Progress->SetStageCheckForUpdates();
    Client->Connect(this,SLOT(DoneLatestQuery()));
    Timer->start();
    QSettings Settings("settings.ini",QSettings::IniFormat);
    Settings.sync();
    QString Server = Settings.value("ApiEndpoint").toString();
    Client->Get(Server);
    return true;
}
Esempio n. 27
0
void Common::showHelp( const QString &msg, int code )
{
	QUrl u;

	if( code > 0 )
	{
		u.setUrl( "http://www.sk.ee/digidoc/support/errorinfo/" );
		u.addQueryItem( "app", qApp->applicationName() );
		u.addQueryItem( "appver", qApp->applicationVersion() );
		u.addQueryItem( "l", Settings().value("Main/Language", "et" ).toString() );
		u.addQueryItem( "code", QString::number( code ) );
	}
	else
	{
		u.setUrl( helpUrl() );
		u.addQueryItem( "searchquery", msg );
		u.addQueryItem( "searchtype", "all" );
		u.addQueryItem( "_m", "core" );
		u.addQueryItem( "_a", "searchclient" );
	}
	QDesktopServices::openUrl( u );
}
Esempio n. 28
0
void LocationBar::focusOutEvent(QFocusEvent* event)
{
    // Context menu or completer popup were opened
    // Let's block focusOutEvent to trick QLineEdit and paint cursor properly
    if (event->reason() == Qt::PopupFocusReason) {
        return;
    }

    LineEdit::focusOutEvent(event);

    setGoIconVisible(false);

    if (text().trimmed().isEmpty()) {
        clear();
    }

    refreshTextFormat();

    if (Settings().value("Browser-View-Settings/instantBookmarksToolbar").toBool()) {
        m_window->bookmarksToolbar()->hide();
    }
}
Esempio n. 29
0
void
Controller::EncodeMovie()
{
	BAutolock _(this);
	
	int32 numFrames = fFileList->CountItems();
	if (numFrames <= 0) {
		std::cout << "Aborted" << std::endl;
		_EncodingFinished(B_ERROR);
		return;
	}
	
	_DumpSettings();
			
	BString fileName;
	Settings().GetOutputFileName(fileName);
	BEntry entry(fileName.String());
	if (entry.Exists()) {
		// file exists.
		fileName = GetUniqueFileName(fileName, MediaFileFormat().file_extension);
	}
	
	fEncoder->SetOutputFile(fileName);
	
	SendNotices(kMsgControllerEncodeStarted);
		 
	BMessage message(kMsgControllerEncodeProgress);
	message.AddInt32("num_files", numFrames);
	
	SendNotices(kMsgControllerEncodeProgress, &message);
	
	fEncoder->SetSource(fFileList);
	
	BMessenger messenger(this);
	fEncoder->SetMessenger(messenger);

	fEncoderThread = fEncoder->EncodeThreaded();
}
Esempio n. 30
0
void
MixerCore::_UpdateResamplers(const media_multi_audio_format& format)
{
	ASSERT_LOCKED();

	if (fResampler != NULL) {
		for (int i = 0; i < fMixBufferChannelCount; i++)
			delete fResampler[i];
		delete[] fResampler;
	}

	fResampler = new Resampler*[fMixBufferChannelCount];
	for (int i = 0; i < fMixBufferChannelCount; i++) {
		switch (Settings()->ResamplingAlgorithm()) {
			case 2:
				fResampler[i] = new Interpolate(
					media_raw_audio_format::B_AUDIO_FLOAT, format.format);
				break;
			default:
				fResampler[i] = new Resampler(
					media_raw_audio_format::B_AUDIO_FLOAT, format.format);
		}
	}
}