void GameStateConfigBase::logicAccept() {
	delete msg;
	msg = new MessageEngine();
	inpt->saveKeyBindings();
	inpt->setKeybindNames();
	if (setMods()) {
		reload_music = true;
		delete mods;
		mods = new ModManager();
		loadTilesetSettings();
		SharedResources::loadIcons();
		delete curs;
		curs = new CursorManager();
	}
	loadMiscSettings();
	refreshFont();
	if ((ENABLE_JOYSTICK) && (SDL_NumJoysticks() > 0)) {
		SDL_JoystickClose(joy);
		joy = SDL_JoystickOpen(JOYSTICK_DEVICE);
	}
	cleanup();
	render_device->createContext();
	saveSettings();
	delete requestedGameState;
	requestedGameState = new GameStateTitle();
}
void GameStateConfigBase::logicAccept() {
	if (setMods()) {
		snd->unloadMusic();
		reload_music = true;
		reload_backgrounds = true;
		delete mods;
		mods = new ModManager(NULL);
		loadTilesetSettings();
		PREV_SAVE_SLOT = -1;
	}
	delete msg;
	msg = new MessageEngine();
	inpt->saveKeyBindings();
	inpt->setKeybindNames();
	loadMiscSettings();
	setStatNames();
	refreshFont();
	if ((ENABLE_JOYSTICK) && (inpt->getNumJoysticks() > 0)) {
		inpt->initJoystick();
	}
	cleanup();

	showLoading();
	// need to delete the "Loading..." message here, as we're recreating our render context
	if (loading_tip) {
		delete loading_tip;
		loading_tip = NULL;
	}

	render_device->createContext();
	saveSettings();
	setRequestedGameState(new GameStateTitle());
}
void GameStateConfigBase::logicCancel() {
	inpt->lock[CANCEL] = true;
	loadSettings();
	loadMiscSettings();
	inpt->loadKeyBindings();
	delete msg;
	msg = new MessageEngine();
	update();
	cleanup();
	render_device->updateTitleBar();
	delete requestedGameState;
	requestedGameState = new GameStateTitle();
}
void GameStateConfigBase::logicDefaults() {
	defaults_confirm->logic();
	if (defaults_confirm->confirmClicked) {
		FULLSCREEN = false;
		loadDefaults();
		loadMiscSettings();
		inpt->defaultQwertyKeyBindings();
		inpt->defaultJoystickBindings();
		update();
		defaults_confirm->visible = false;
		defaults_confirm->confirmClicked = false;
	}
}
Beispiel #5
0
GeneralSettings::GeneralSettings(QWidget *parent) :
    QWidget(parent),
    _ui(new Ui::GeneralSettings)
{
    _ui->setupUi(this);

    connect(_ui->desktopNotificationsCheckBox, SIGNAL(toggled(bool)),
            SLOT(slotToggleOptionalDesktopNotifications(bool)));

    _ui->autostartCheckBox->setChecked(Utility::hasLaunchOnStartup(Theme::instance()->appName()));
    connect(_ui->autostartCheckBox, SIGNAL(toggled(bool)), SLOT(slotToggleLaunchOnStartup(bool)));

    // setup about section
    QString about = Theme::instance()->about();
    if (about.isEmpty()) {
        _ui->aboutGroupBox->hide();
    } else {
        _ui->aboutLabel->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextBrowserInteraction);
        _ui->aboutLabel->setText(about);
        _ui->aboutLabel->setWordWrap(true);
        _ui->aboutLabel->setOpenExternalLinks(true);
    }

    loadMiscSettings();
    slotUpdateInfo();

    // misc
    connect(_ui->monoIconsCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));
    connect(_ui->crashreporterCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));
    connect(_ui->newFolderLimitCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));
    connect(_ui->newFolderLimitSpinBox, SIGNAL(valueChanged(int)), SLOT(saveMiscSettings()));

#ifndef WITH_CRASHREPORTER
    _ui->crashreporterCheckBox->setVisible(false);
#endif

    /* Set the left contents margin of the layout to zero to make the checkboxes
     * align properly vertically , fixes bug #3758
     */
    int m0, m1, m2, m3;
    _ui->horizontalLayout_3->getContentsMargins( &m0, &m1, &m2, &m3 );
    _ui->horizontalLayout_3->setContentsMargins(0, m1, m2, m3 );

    // OEM themes are not obliged to ship mono icons, so there
    // is no point in offering an option
    QString themeDir = QString::fromLatin1(":/client/theme/%1/")
            .arg(Theme::instance()->systrayIconFlavor(true));
    _ui->monoIconsCheckBox->setVisible(QDir(themeDir).exists());

    connect(_ui->ignoredFilesButton, SIGNAL(clicked()), SLOT(slotIgnoreFilesEditor()));
}
void GameStateConfigBase::logicCancel() {
	inpt->lock[CANCEL] = true;
	loadSettings();
	inpt->loadKeyBindings();
	delete msg;
	msg = new MessageEngine();
	loadMiscSettings();
	setStatNames();
	update();
	cleanup();
	render_device->windowResize();
	render_device->updateTitleBar();
	showLoading();
	setRequestedGameState(new GameStateTitle());
}
Beispiel #7
0
GeneralSettings::GeneralSettings(QWidget *parent) :
    QWidget(parent),
    _ui(new Ui::GeneralSettings)
{
    _ui->setupUi(this);

    connect(_ui->desktopNotificationsCheckBox, SIGNAL(toggled(bool)),
            SLOT(slotToggleOptionalDesktopNotifications(bool)));

    _ui->autostartCheckBox->setChecked(Utility::hasLaunchOnStartup(Theme::instance()->appName()));
    connect(_ui->autostartCheckBox, SIGNAL(toggled(bool)), SLOT(slotToggleLaunchOnStartup(bool)));

    // setup about section
    QString about = Theme::instance()->about();
    if (about.isEmpty()) {
        _ui->aboutGroupBox->hide();
    } else {
        _ui->aboutLabel->setText(about);
        _ui->aboutLabel->setWordWrap(true);
        _ui->aboutLabel->setOpenExternalLinks(true);
    }

    loadMiscSettings();
    slotUpdateInfo();

    // misc
    connect(_ui->monoIconsCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));
    connect(_ui->crashreporterCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));
    connect(_ui->newFolderLimitCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));
    connect(_ui->newFolderLimitSpinBox, SIGNAL(valueChanged(int)), SLOT(saveMiscSettings()));

#ifndef WITH_CRASHREPORTER
    _ui->crashreporterCheckBox->setVisible(false);
#endif

    // OEM themes are not obliged to ship mono icons, so there
    // is no point in offering an option
    QString themeDir = QString::fromLatin1(":/client/theme/%1/")
            .arg(Theme::instance()->systrayIconFlavor(true));
    _ui->monoIconsCheckBox->setVisible(QDir(themeDir).exists());

    connect(_ui->ignoredFilesButton, SIGNAL(clicked()), SLOT(slotIgnoreFilesEditor()));
    connect(_ui->addAccountButton, SIGNAL(clicked()), SLOT(slotOpenAccountWizard()));
}
Beispiel #8
0
void Prefs::loadSettings()
{
  // Load CallRecords although not settings per se!
  loadCallRecords();
  
  loadAccounts();
  
  // load device settings
  loadDeviceSettings();
  
  // load filter settings
  loadFilterSettings();
  
  // load miscellaneous settings
  loadMiscSettings();
  
  // load session settings
  loadSessionSettings();
}
Beispiel #9
0
GeneralSettings::GeneralSettings(QWidget *parent) :
    QWidget(parent),
    _ui(new Ui::GeneralSettings)
{
    _ui->setupUi(this);

    connect(_ui->desktopNotificationsCheckBox, SIGNAL(toggled(bool)),
            SLOT(slotToggleOptionalDesktopNotifications(bool)));

    _ui->autostartCheckBox->setChecked(Utility::hasLaunchOnStartup(Theme::instance()->appName()));
    connect(_ui->autostartCheckBox, SIGNAL(toggled(bool)), SLOT(slotToggleLaunchOnStartup(bool)));

    // setup about section
    QString about = Theme::instance()->about();
    if (about.isEmpty()) {
        _ui->aboutGroupBox->hide();
    } else {
        _ui->aboutLabel->setText(about);
        _ui->aboutLabel->setOpenExternalLinks(true);
    }

    loadMiscSettings();

    // misc
    connect(_ui->monoIconsCheckBox, SIGNAL(toggled(bool)), SLOT(saveMiscSettings()));

    // OEM themes are not obliged to ship mono icons, so there
    // is no point in offering an option
    QString themeDir = QString::fromLatin1(":/mirall/theme/1%1/")
            .arg(Theme::instance()->systrayIconFlavor(true));
    if (QDir(themeDir).exists())
    {
        _ui->monoIconsCheckBox->setVisible(false);
    }

}