Esempio n. 1
0
//=================
//    PRIVATE SLOTS
//=================
void page_session_options::sessionChangeUserIcon(){
  //Prompt for a new image file
  QStringList imgformats;
  QList<QByteArray> fmts = QImageReader::supportedImageFormats();
  for(int i=0; i<fmts.length(); i++){
    imgformats << "*."+QString(fmts[i]);
  }
  QString filepath = QFileDialog::getOpenFileName(this, tr("Select an image"), QDir::homePath(), \
				tr("Images")+" ("+imgformats.join(" ")+")");
  if(filepath.isEmpty()){
    //User cancelled the operation
    if(QFile::exists(QDir::homePath()+"/.loginIcon.png")){
      if(QMessageBox::Yes == QMessageBox::question(this,tr("Reset User Image"), tr("Would you like to reset the user image to the system default?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) ){
	//QFile::remove(QDir::homePath()+"/.loginIcon.png");
	ui->push_session_setUserIcon->setWhatsThis("reset");
      }else{
	return;
      }
    }
  }else{
    ui->push_session_setUserIcon->setWhatsThis(filepath);	
  }
  //Now re-load the icon in the UI
  QString path = ui->push_session_setUserIcon->whatsThis();
  if(path.isEmpty()){ path = QDir::homePath()+"/.loginIcon.png"; }
  if(path=="reset"){ path.clear(); }
  ui->push_session_setUserIcon->setIcon( LXDG::findIcon(path, "user-identity") );
  settingChanged();
}
void SettingsManager::setValue(const QString &key, int value, int defaultValue) {
	
	if (m_d->settings->value(key, defaultValue).toInt() != value) {
		m_d->settings->setValue(key, value);
		emit settingChanged(key);
	}
}
Esempio n. 3
0
//=================
//    PRIVATE SLOTS
//=================
void page_interface_desktop::deskplugadded(){
  GetPluginDialog dlg(this);
    dlg.LoadPlugins("desktop", PINFO);
    dlg.exec();
  if( !dlg.selected ){ return; } //cancelled
  QString newplug = dlg.plugID;
  QListWidgetItem *it = new QListWidgetItem();
  if(newplug=="applauncher"){
    //Prompt for the application to add
    XDGDesktop app = getSysApp();
    if(app.filePath.isEmpty()){ return; } //cancelled
    newplug.append("::"+app.filePath);
    //Now fill the item with the necessary info
    it->setWhatsThis(newplug);
    it->setText(app.name);
    it->setIcon(LXDG::findIcon(app.icon,"") );
    it->setToolTip(app.comment);
  }else{
    //Load the info for this plugin
    LPI info = PINFO->desktopPluginInfo(newplug);
    if( info.ID.isEmpty() ){ return; } //invalid plugin for some reason (should never happen)
    it->setWhatsThis(newplug);
    it->setText(info.name);
    it->setToolTip(info.description);
    it->setIcon( LXDG::findIcon(info.icon,"") );
  }
  ui->list_desktop_plugins->addItem(it);
  ui->list_desktop_plugins->scrollToItem(it);
  settingChanged();
}
void SettingsManager::setVariantValue(const QString &key, const QVariant &value, const QVariant &defaultValue) {
	
	if (m_d->settings->value(key).toByteArray() != value) {
		m_d->settings->setValue(key, value);
		emit settingChanged(key);
	}
}
void SettingsManager::setValue(const QString &key, bool value, bool defaultValue) {
	
	if (m_d->settings->value(key, defaultValue).toBool() != value) {
		m_d->settings->setValue(key, value);
		emit settingChanged(key);
	}
}
void SettingsManager::setValue(const QString &key, const QString &value) {
	
	if (m_d->settings->value(key).toString() != value) {
		m_d->settings->setValue(key, value);
		emit settingChanged(key);
	}
}
Esempio n. 7
0
void page_session_options::sessionLoadDateSample(){
  if(ui->line_session_date->text().simplified().isEmpty()){
    ui->label_session_datesample->setText( QDate::currentDate().toString(Qt::DefaultLocaleShortDate) );
  }else{
    ui->label_session_datesample->setText( QDate::currentDate().toString( ui->line_session_date->text() ) );
  }
  settingChanged();
}
Esempio n. 8
0
void page_interface_desktop::deskplugremoved(){
  QList<QListWidgetItem*> sel = ui->list_desktop_plugins->selectedItems();
  if(sel.isEmpty()){ return; } //nothing to do
  for(int i=0; i<sel.length(); i++){
    delete sel[i];
  }
  settingChanged();
}
Esempio n. 9
0
void SettingsWidget::on_doubleSpinBox_changed(double value)
{
	QString name = sender()->objectName();
	options[name] = value;

	Settings::saveSetting(getSettingCategory(name),getSettingName(name), value);
	emit settingChanged();
}
Esempio n. 10
0
//==========
//    PUBLIC
//==========
page_interface_desktop::page_interface_desktop(QWidget *parent) : PageWidget(parent), ui(new Ui::page_interface_desktop()){
  ui->setupUi(this);
  PINFO = new LPlugins();
  connect(ui->tool_desktop_addplugin, SIGNAL(clicked()), this, SLOT(deskplugadded()) );
  connect(ui->tool_desktop_rmplugin, SIGNAL(clicked()), this, SLOT(deskplugremoved()) );
  connect(ui->check_desktop_autolaunchers, SIGNAL(clicked()), this, SLOT(settingChanged()) );
  updateIcons();
}
Esempio n. 11
0
void
OptionDlg::updateSettings()
{
  g_cfg->apply(m_cfg);
  g_cfg->sync();
  emit settingChanged();
  emit endDialog();
}
Esempio n. 12
0
void SettingsWidget::on_checkBox_changed(bool checked)
{
	QString name = sender()->objectName();
	options[name] = checked;

	Settings::saveSetting(getSettingCategory(name),getSettingName(name),checked);
	emit settingChanged();
}
Esempio n. 13
0
void SettingsWidget::on_lineEdit_changed(const QString &text)
{
	QString name = sender()->objectName();
	options[name] = text;

	Settings::saveSetting(getSettingCategory(name),getSettingName(name),text);
	emit settingChanged();
}
Esempio n. 14
0
QVariant Eyes::setting(QString key, QString value)
{
    if( ! value.isEmpty() )
    {
        m_settings.setValue(key, value);
        if( key.contains(QString("preferences/")) )
            emit settingChanged(key);
    }

    return m_settings.value(key);
}
Esempio n. 15
0
//=================
//    PRIVATE SLOTS
//=================
void page_fluxbox_settings::sessionthemechanged(){
  //Update the Fluxbox Theme preview
  QString previewfile = ui->combo_session_wtheme->itemData( ui->combo_session_wtheme->currentIndex() ).toString();
  previewfile.append( (previewfile.endsWith("/") ? "preview.jpg": "/preview.jpg") );
  if(QFile::exists(previewfile)){
    ui->label_session_wpreview->setPixmap(QPixmap(previewfile));
  }else{
    ui->label_session_wpreview->setText(tr("No Preview Available"));
  }
  settingChanged();
}
Esempio n. 16
0
void page_autostart::addsessionstartfile(){
  QString chkpath = QDir::homePath();
  QString bin = QFileDialog::getOpenFileName(this, tr("Select File"), chkpath, tr("All Files (*)") );
  if( bin.isEmpty() || !QFile::exists(bin) ){ return; } //cancelled
  QListWidgetItem *it = new QListWidgetItem( LXDG::findMimeIcon(bin), bin.section("/",-1) );
    it->setWhatsThis(bin); //file to be saved/run
    it->setToolTip(bin);
    it->setCheckState(Qt::Checked);
  ui->list_session_start->addItem(it);
  ui->list_session_start->setCurrentItem(it);
    settingChanged();
}
Esempio n. 17
0
//==========
//    PUBLIC
//==========
page_fluxbox_settings::page_fluxbox_settings(QWidget *parent) : PageWidget(parent), ui(new Ui::page_fluxbox_settings()){
  ui->setupUi(this);
  loading= false;
  ui->radio_simple->setChecked(true);
  ui->radio_advanced->setChecked(false);
  connect(ui->combo_session_wfocus, SIGNAL(currentIndexChanged(int)), this, SLOT(settingChanged()) );
  connect(ui->combo_session_wloc, SIGNAL(currentIndexChanged(int)), this, SLOT(settingChanged()) );
  connect(ui->combo_session_wtheme, SIGNAL(currentIndexChanged(int)), this, SLOT(sessionthemechanged()) );
  connect(ui->spin_session_wkspaces, SIGNAL(valueChanged(int)), this, SLOT(settingChanged()) );
  connect(ui->text_file, SIGNAL(textChanged()), this, SLOT(settingChanged()) );
  connect(ui->radio_simple, SIGNAL(toggled(bool)), this, SLOT(switchEditor()) );
  updateIcons();
}
Esempio n. 18
0
void page_autostart::addsessionstartapp(){
  //Prompt for the application to start
  QString app = getSysApp(false); //no reset
  if(app.isEmpty()){ return; } //cancelled
  XDGDesktop desk(app);
  QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon(desk.icon,""), desk.name );
    it->setWhatsThis(desk.filePath);
    it->setToolTip(desk.comment);
    it->setCheckState(Qt::Checked);
  
  ui->list_session_start->addItem(it);
  ui->list_session_start->setCurrentItem(it);
    settingChanged();
}
Esempio n. 19
0
void BleSetting::onApplyClicked()
{
    MOption *option = MOption::instance();

    // audio group
    int audioDevID = ui->audioDevice->itemData(ui->audioDevice->currentIndex()).toInt();
    QString audioFormat = ui->audioFormat->currentText();
    QString audioChannels = ui->audioChannels->currentText();
    QString audioSampleRate = ui->audioSampleRate->currentText();
    QString audioBitrate = ui->audioBitrate->currentText();

    option->setOption(audioDevID, "dev_id", "audio");
    option->setOption(audioFormat, "format", "audio");
    option->setOption(audioChannels, "channels", "audio");
    option->setOption(audioSampleRate, "sample_rate", "audio");
    option->setOption(audioBitrate, "bitrate", "audio");

    QString format      = ui->format->currentText();
    QVariant res        = ui->res->itemData(ui->res->currentIndex());
    QString fps         = ui->fps->currentText();
    QString bitrate     = ui->bitrate->currentText();
    QString x264Preset  = ui->x264Preset->currentText();
    QString x264Tune    = ui->x264Tune->currentText();
    QString x264Profile = ui->x264Profile->currentText();
    QString address     = ui->address->text().trimmed();
    QString bitrateMode = ui->bitrateMode->currentText();
    QString keyFrameInterval = ui->keyFrameInterval->currentText();
    QString threadCount = ui->threadCount->currentText();
    QString enableBFrame = ui->enableBFrame->isChecked() ? "true" : "false";
    QString quality             = QString::number(ui->qualityBar->value());

    // save
    option->setOption(format, "format", "encoder");
    option->setOption(res, "res", "encoder");
    option->setOption(fps, "fps", "encoder");
    option->setOption(bitrate, "bitrate", "encoder");

    option->setOption(x264Preset, "preset", "x264");
    option->setOption(x264Tune, "tune", "x264");
    option->setOption(x264Profile, "profile", "x264");
    option->setOption(bitrateMode, "BitrateMode", "x264");
    option->setOption(keyFrameInterval, "KeyFrameInterval", "x264");
    option->setOption(threadCount, Key_Thread_Count, Group_X264);
    option->setOption(enableBFrame, Key_Enable_B_Frame, Group_X264);
    option->setOption(quality, "quality", "x264");

    option->setOption(address, "address", "network");

    emit settingChanged();
}
Esempio n. 20
0
void
UBBoardView::init ()
{
  connect (UBSettings::settings ()->boardPenPressureSensitive, SIGNAL (changed (QVariant)),
           this, SLOT (settingChanged (QVariant)));

  connect (UBSettings::settings ()->boardMarkerPressureSensitive, SIGNAL (changed (QVariant)),
           this, SLOT (settingChanged (QVariant)));

  connect (UBSettings::settings ()->boardUseHighResTabletEvent, SIGNAL (changed (QVariant)),
           this, SLOT (settingChanged (QVariant)));

  setWindowFlags (Qt::FramelessWindowHint);
  setFrameStyle (QFrame::NoFrame);
  setRenderHints (QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing);
  setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
  setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
  setAcceptDrops (true);

  setOptimizationFlag (QGraphicsView::IndirectPainting); // enable UBBoardView::drawItems filter

  mTabletStylusIsPressed = false;
  mMouseButtonIsPressed = false;
  mPendingStylusReleaseEvent = false;

  setCacheMode (QGraphicsView::CacheBackground);

  mUsingTabletEraser = false;
  mIsCreatingTextZone = false;
  mRubberBand = 0;

  mVirtualKeyboardActive = false;

  settingChanged (QVariant ());

  unsetCursor();
}
Esempio n. 21
0
int DBSettingChanged(WPARAM wParam,LPARAM lParam)
{
	DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
	HANDLE hContact = (HANDLE)wParam;
	char *setting;
	SettingListInfo* info;

	if (hwnd2mainWindow) {
		HWND hwnd2Settings = GetDlgItem(hwnd2mainWindow, IDC_SETTINGS);
		if (info = (SettingListInfo*)GetWindowLongPtr(hwnd2Settings, GWLP_USERDATA)) {
			if ((hContact == info->hContact) && !mir_strcmp(info->module, cws->szModule)) {
				setting = mir_strdup(cws->szSetting);
				if (cws->value.type == DBVT_DELETED) {
					LVFINDINFO lvfi;
					int index;
					lvfi.flags = LVFI_STRING;
					lvfi.psz = setting;
					lvfi.vkDirection = VK_DOWN;
					index = ListView_FindItem(hwnd2Settings, -1, &lvfi);
					if (index > -1)
						ListView_DeleteItem(hwnd2Settings, index);
					mir_free(setting);
					return 0;
				}
				settingChanged(hwnd2Settings, hContact, info->module, setting);
				mir_free(setting);
			}
		}
	}
	
	// watch list
	if (!hwnd2watchedVarsWindow && !usePopups)
		return 0;

	for (int i = 0; i < WatchListArray.count; i++) {
		if (WatchListArray.item[i].module && (hContact == WatchListArray.item[i].hContact)) {
			if (!mir_strcmp(cws->szModule, WatchListArray.item[i].module)) {
				if (!WatchListArray.item[i].setting || !mir_strcmp(cws->szSetting, WatchListArray.item[i].setting)) {
					if (usePopups)
						popupWatchedVar(hContact, cws->szModule, cws->szSetting);
					if (hwnd2watchedVarsWindow)
						PopulateWatchedWindow(GetDlgItem(hwnd2watchedVarsWindow, IDC_VARS));
					break;
				}
			}
		}
	}
	return 0;
}
Esempio n. 22
0
void page_autostart::addsessionstartbin(){
  QString chkpath = LOS::AppPrefix() + "bin";
  if(!QFile::exists(chkpath)){ chkpath = QDir::homePath(); }
  QString bin = QFileDialog::getOpenFileName(this, tr("Select Binary"), chkpath, tr("Application Binaries (*)") );
  if( bin.isEmpty() || !QFile::exists(bin) ){ return; } //cancelled
  if( !QFileInfo(bin).isExecutable() ){
    QMessageBox::warning(this, tr("Invalid Binary"), tr("The selected file is not executable!"));
    return;
  }
  QListWidgetItem *it = new QListWidgetItem( LXDG::findIcon("application-x-executable",""), bin.section("/",-1) );
    it->setWhatsThis(bin); //command to be saved/run
    it->setToolTip(bin);
    it->setCheckState(Qt::Checked);
  ui->list_session_start->addItem(it);
  ui->list_session_start->setCurrentItem(it);
  settingChanged();
}
Esempio n. 23
0
void preferenceDialog::on_chScDir_clicked()
{
    QDesktopServices mycomputer;
    QString picfolder=mycomputer.storageLocation(QDesktopServices::PicturesLocation);
    QString root=_settings->value("Video/CaptureDir",picfolder).toString();


    QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
                                                    root,
                                                    QFileDialog::ShowDirsOnly
                                                    | QFileDialog::DontResolveSymlinks);

    if (!dir.isEmpty())
    {
        ui->lineEditSc->setText( dir);
        emit settingChanged("Video","CaptureDir",dir);
    }
}
Esempio n. 24
0
int DBSettingChanged(WPARAM hContact, LPARAM lParam)
{
	DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lParam;

	// setting list
	if (hwnd2mainWindow)
		settingChanged(hContact, cws->szModule, cws->szSetting, &(cws->value));

	// watch list
	if (!hwnd2watchedVarsWindow && !g_bUsePopups)
		return 0;

	if (WatchedArrayIndex(hContact, cws->szModule, cws->szSetting, 0) >= 0) {
		if (g_bUsePopups) popupWatchedVar(hContact, cws->szModule, cws->szSetting);
		PopulateWatchedWindow();
	}

	return 0;
}
Esempio n. 25
0
// --------------------------------------------------------------------------
void ctkSettingsPanel::setSetting(const QString& key, const QVariant& newVal)
{
  Q_D(ctkSettingsPanel);
  QSettings* settings = d->settings(key);
  if (!settings)
    {
    return;
    }
  QVariant oldVal = settings->value(key);
  settings->setValue(key, newVal);
  d->Properties[key].setValue(newVal);
  if (settings->status() != QSettings::NoError)
    {
    logger.warn( QString("Error #%1 while writing setting \"%2\"")
      .arg(static_cast<int>(settings->status()))
      .arg(key));
    }
  if (oldVal != newVal)
    {
    emit settingChanged(key, newVal);
    }
}
Esempio n. 26
0
void CSMPrefs::State::update (const Setting& setting)
{
    emit (settingChanged (&setting));
}
Esempio n. 27
0
//=================
//    PRIVATE SLOTS
//=================
void page_autostart::rmsessionstartitem(){
  if(ui->list_session_start->currentRow() < 0){ return; } //no item selected
  delete ui->list_session_start->takeItem(ui->list_session_start->currentRow());
    settingChanged();
}
Esempio n. 28
0
void Settings::setSetting(const QString &k, const QVariant &v)
{
	settings->setValue(k, v);
	Q_EMIT settingChanged(k, v);
}
void DialogVideoPlayer::handleError() {
    mediaPlayer->stop();
    ui->checkBoxMovie->setChecked(false);
    ui->checkBoxMovie->setEnabled(false);
    settingChanged();
}
Esempio n. 30
0
//=================
//    PRIVATE SLOTS
//=================
void page_interface_panels::panelValChanged() {
    ui->tool_panels_add->setEnabled(panelnumber < 12);
    if(!loading) {
        settingChanged();
    }
}