void ProfileEditor::onOkClicked() { m_tableModel->submitAll(); emit updateProfile(); this->hide(); }
void ProfileManager::updateCurrentProfile() { QDir profileDir(DataPaths::currentProfilePath()); if (!profileDir.exists()) { QDir newDir(profileDir.path().remove(profileDir.dirName())); newDir.mkdir(profileDir.dirName()); } QFile versionFile(profileDir.filePath(QLatin1String("version"))); // If file exists, just update the profile to current version if (versionFile.exists()) { versionFile.open(QFile::ReadOnly); QString profileVersion = versionFile.readAll(); versionFile.close(); updateProfile(Qz::VERSION, profileVersion.trimmed()); } else { copyDataToProfile(); } versionFile.open(QFile::WriteOnly); versionFile.write(Qz::VERSION); versionFile.close(); }
void ProfileUpdater::checkProfile() { QDir profileDir(m_profilePath); if (!profileDir.exists()) { QDir newDir(profileDir.path().remove(profileDir.dirName())); newDir.mkdir(profileDir.dirName()); } QFile versionFile(m_profilePath + "version"); if (versionFile.exists()) { versionFile.open(QFile::ReadOnly); QString profileVersion = versionFile.readAll(); versionFile.close(); versionFile.remove(); updateProfile(QupZilla::VERSION, profileVersion.trimmed()); } else { copyDataToProfile(); } versionFile.open(QFile::WriteOnly); versionFile.write(QupZilla::VERSION.toUtf8()); versionFile.close(); }
/*! \fn OptionsDialog::changeProfile() */ void OptionsDialog::changeProfile() { QList<QListWidgetItem*> selection = profilesList->selectedItems(); if(!selection.isEmpty()) { QString name = selection.first()->text(); updateProfile(getGroupSetting("profile", name).toHash(), name); } }
void Program::loadProfile() { // Load profile p.loadProfile(c.getProfileFileName()); // Update UI emit updateProfile(p.getProfileName(), createProfileData()); }
void ChangeRouterPasswordOp::onTimeout1() { m_op->abort(); delete m_op; m_op = NULL; updateProfile(); }
void FCharacterInfoDialog::setDisplayedCharacter(FCharacter *c) { QString name = QString("<b>%1</b> (%2)").arg(c->name()).arg(c->statusString()); ui->name->setText(name); ui->status->setText(c->statusMsg()); updateProfile(c); updateKinks(c); }
void regionProfile(WiggleIterator * wig, double * profile, int profile_width, int region_width, bool stranded) { double compression = profile_width / (double) region_width; int pos; for (pos = 0; pos < profile_width; pos++) profile[pos] = 0; for (; !wig->done; pop(wig)) updateProfile(wig, compression, profile, profile_width, stranded); }
/*! \fn OptionsDialog::addProfile() */ void OptionsDialog::addProfile() { bool ok; QString name = QInputDialog::getText(this, tr("Profile name"), tr("Profile Name:"), QLineEdit::Normal, "", &ok); if(ok && !name.isEmpty()) { QStringList profiles = getSetting("profiles").toStringList(); profiles << name; setSetting("profiles", profiles); loadProfiles(); updateProfile(QHash<QString, QVariant>(), name); } }
void PrinterSettings::addProfile() { updateProfile(); ProfileItem *item = new ProfileItem(*(currentItem()->profile())); item->setText(tr("Profile %1", "Defaul name for created printer profile in the Printer Settings diaog").arg(ui->profilesList->count() + 1)); item->profile()->setName(item->text()); ui->profilesList->addItem(item); ui->profilesList->setCurrentItem(item); ui->profilesList->editItem(item); }
void Small::setVariable(int type, int no, QCString value, int position) { switch(type){ case INSTANCE: updateInstance(no,value); break; case PROFILE: updateProfile(no,value); break; case CONTEXT: updateContext(no,value, position); break; } }
void Prefs_PreflightVerifier::setProfile(const QString& name) { if (checkerProfile.contains(name)) { putProfile(); updateProfile(name); tempNewProfileName=""; addProfilePushButton->setEnabled(false); } else { tempNewProfileName=name; addProfilePushButton->setEnabled(true); } }
void TabCheckDoc::setProfile(const QString& name) { if (checkerProfile.contains(name)) { putProfile(); updateProfile(name); tempNewProfileName=""; addProfile->setEnabled(false); } else { tempNewProfileName=name; addProfile->setEnabled(true); } }
void TabCheckDoc::delProf() { disconnect(curCheckProfile, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&))); disconnect(curCheckProfile, SIGNAL(editTextChanged(const QString&)), this, SLOT(setProfile(const QString&))); checkerProfile.remove(currentProfile); updateProfile(checkerProfile.begin().key()); curCheckProfile->clear(); CheckerPrefsList::Iterator it; CheckerPrefsList::Iterator itend=checkerProfile.end(); for (it = checkerProfile.begin(); it != itend; ++it) curCheckProfile->addItem(it.key()); setCurrentComboItem(curCheckProfile, currentProfile); connect(curCheckProfile, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&))); connect(curCheckProfile, SIGNAL(editTextChanged(const QString&)), this, SLOT(setProfile(const QString&))); if (checkerProfile.count() == 1) removeProfile->setEnabled(false); }
void Prefs_PreflightVerifier::delProf() { disconnect(currentProfileComboBox, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&))); disconnect(currentProfileComboBox, SIGNAL(textChanged(const QString&)), this, SLOT(setProfile(const QString&))); checkerProfile.remove(currentProfile); updateProfile(checkerProfile.begin().key()); currentProfileComboBox->clear(); CheckerPrefsList::Iterator it; CheckerPrefsList::Iterator itend=checkerProfile.end(); for (it = checkerProfile.begin(); it != itend; ++it) currentProfileComboBox->addItem(it.key()); setCurrentComboItem(currentProfileComboBox, currentProfile); connect(currentProfileComboBox, SIGNAL(activated(const QString&)), this, SLOT(setProfile(const QString&))); connect(currentProfileComboBox, SIGNAL(textChanged(const QString&)), this, SLOT(setProfile(const QString&))); if (checkerProfile.count() == 1) removeProfilePushButton->setEnabled(false); }
void ChangeRouterPasswordOp::onConfigOutFinished() { m_timer1.stop(); AsyncOp *op = m_op; m_op->deleteLater(); m_op = NULL; if (op->isAborted()) { return; } if (isAborted()) { return; } int result = op->result(); if (result != NoError) { return notifyFinished(result); } QVariant varResponseCode = op->value("responseCode"); if (!varResponseCode.isValid()) { return notifyFinished(UnknownError); } bool ok; int responseCode = varResponseCode.toInt(&ok); if (!ok) { return notifyFinished(UnknownError); } // if (responseCode != 0) { // return notifyFinished(UnknownError); // } // notifyFinished(NoError); updateProfile(); }
void Elevator::setElevatorGoalPosition(float position) { if (position > kSoftUpperLimit) { position = kSoftUpperLimit; //Stop large queues of goal position } if (position < kSoftLowerLimit) { position = kSoftLowerLimit; //stop large queues of goal position } //m_elevatorControl->SetSetpoint(position); m_desiredSetPoint = position; updateProfile(); }
ProfileWidget::ProfileWidget (LJProfile *profile, QWidget *parent) : QWidget (parent) , Profile_ (profile) , FriendsModel_ (new QStandardItemModel (this)) , CommunitiesModel_ (new QStandardItemModel (this)) { Ui_.setupUi (this); Ui_.FriendsView_->setModel (FriendsModel_); FriendItemDelegate *friendDelegate = new FriendItemDelegate (Ui_.FriendsView_); connect (this, SIGNAL (coloringItemChanged ()), friendDelegate, SLOT (handleColoringItemChanged ())); Ui_.FriendsView_->setItemDelegate (friendDelegate); Ui_.CommunitiesView_->setModel (CommunitiesModel_); Ui_.ColoringFriendsList_->setChecked (XmlSettingsManager::Instance () .Property ("ColoringFriendsList", true).toBool ()); updateProfile (); }
ContentBlockingDialog::ContentBlockingDialog(QWidget *parent) : Dialog(parent), m_ui(new Ui::ContentBlockingDialog) { m_ui->setupUi(this); const QStringList globalProfiles(SettingsManager::getValue(SettingsManager::ContentBlocking_ProfilesOption).toStringList()); m_ui->profilesViewWidget->setModel(ContentBlockingManager::createModel(this, globalProfiles)); m_ui->profilesViewWidget->setItemDelegateForColumn(1, new ContentBlockingIntervalDelegate(this)); m_ui->profilesViewWidget->setViewMode(ItemViewWidget::TreeViewMode); m_ui->profilesViewWidget->header()->setSectionResizeMode(0, QHeaderView::Stretch); m_ui->profilesViewWidget->expandAll(); m_ui->cosmeticFiltersComboBox->addItem(tr("All"), QLatin1String("all")); m_ui->cosmeticFiltersComboBox->addItem(tr("Domain specific only"), QLatin1String("domainOnly")); m_ui->cosmeticFiltersComboBox->addItem(tr("None"), QLatin1String("none")); const int cosmeticFiltersIndex(m_ui->cosmeticFiltersComboBox->findData(SettingsManager::getValue(SettingsManager::ContentBlocking_CosmeticFiltersModeOption).toString())); m_ui->cosmeticFiltersComboBox->setCurrentIndex((cosmeticFiltersIndex < 0) ? 0 : cosmeticFiltersIndex); m_ui->enableCustomRulesCheckBox->setChecked(globalProfiles.contains(QLatin1String("custom"))); QStandardItemModel *customRulesModel(new QStandardItemModel(this)); QFile file(SessionsManager::getWritableDataPath("contentBlocking/custom.txt")); if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { QTextStream stream(&file); if (stream.readLine().trimmed().startsWith(QLatin1String("[Adblock Plus"), Qt::CaseInsensitive)) { while (!stream.atEnd()) { customRulesModel->appendRow(new QStandardItem(stream.readLine().trimmed())); } } else { Console::addMessage(QCoreApplication::translate("main", "Failed to load custom rules: invalid adblock header"), Console::OtherCategory, Console::ErrorLevel, file.fileName()); } file.close(); } m_ui->customRulesViewWidget->setModel(customRulesModel); m_ui->enableWildcardsCheckBox->setChecked(SettingsManager::getValue(SettingsManager::ContentBlocking_EnableWildcardsOption).toBool()); connect(ContentBlockingManager::getInstance(), SIGNAL(profileModified(QString)), this, SLOT(updateProfile(QString))); connect(m_ui->profilesViewWidget->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(updateProfilesActions())); connect(m_ui->updateProfileButton, SIGNAL(clicked(bool)), this, SLOT(updateProfile())); connect(m_ui->addProfileButton, SIGNAL(clicked(bool)), this, SLOT(addProfile())); connect(m_ui->editProfileButton, SIGNAL(clicked(bool)), this, SLOT(editProfile())); connect(m_ui->confirmButtonBox, SIGNAL(accepted()), this, SLOT(save())); connect(m_ui->confirmButtonBox, SIGNAL(rejected()), this, SLOT(close())); connect(m_ui->enableCustomRulesCheckBox, SIGNAL(toggled(bool)), this, SLOT(updateRulesActions())); connect(m_ui->customRulesViewWidget, SIGNAL(needsActionsUpdate()), this, SLOT(updateRulesActions())); connect(m_ui->addRuleButton, SIGNAL(clicked(bool)), this, SLOT(addRule())); connect(m_ui->editRuleButton, SIGNAL(clicked(bool)), this, SLOT(editRule())); connect(m_ui->removeRuleButton, SIGNAL(clicked(bool)), this, SLOT(removeRule())); updateRulesActions(); }
PrinterSettings::PrinterSettings(QWidget *parent) : QDialog(parent), ui(new Ui::PrinterSettings), mPrinter(0), mUnit(UnitMillimeter) { setAttribute(Qt::WA_DeleteOnClose); ui->setupUi(this); ui->leftMarginSpin->installEventFilter(this); ui->rightMarginSpin->installEventFilter(this); ui->topMarginSpin->installEventFilter(this); ui->bottomMarginSpin->installEventFilter(this); ui->internalMarginSpin->installEventFilter(this); ui->duplexTypeComboBox->addItem(tr("Printer has duplexer"), DuplexAuto); ui->duplexTypeComboBox->addItem(tr("Manual with reverse (suitable for most printers)"), DuplexManualReverse); ui->duplexTypeComboBox->addItem(tr("Manual without reverse"), DuplexManual); QPalette pal(palette()); pal.setColor(QPalette::Background, QColor(105, 101, 98)); ui->marginsPereview->setPalette(pal); ui->marginsPereview->setAutoFillBackground(true); int n = qMax(ui->addProfileButton->minimumSizeHint().width(), ui->addProfileButton->minimumSizeHint().height()); ui->addProfileButton->setMinimumSize(n, n); ui->delProfileButton->setMinimumSize(n, n); connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(btnClicked(QAbstractButton*))); connect(ui->borderCbx, SIGNAL(toggled(bool)), this, SLOT(updatePreview())); connect(ui->profilesList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(selectProfile(QListWidgetItem*,QListWidgetItem*))); connect(ui->profilesList->itemDelegate(), SIGNAL(closeEditor(QWidget*,QAbstractItemDelegate::EndEditHint)), this, SLOT(profileRenamed(QWidget*,QAbstractItemDelegate::EndEditHint))); connect(ui->addProfileButton, SIGNAL(clicked()), this, SLOT(addProfile())); connect(ui->delProfileButton, SIGNAL(clicked()), this, SLOT(delProfile())); connect(ui->leftMarginSpin, SIGNAL(editingFinished()), this, SLOT(updateProfile())); connect(ui->rightMarginSpin, SIGNAL(editingFinished()), this, SLOT(updateProfile())); connect(ui->topMarginSpin, SIGNAL(editingFinished()), this, SLOT(updateProfile())); connect(ui->bottomMarginSpin, SIGNAL(editingFinished()), this, SLOT(updateProfile())); connect(ui->internalMarginSpin, SIGNAL(editingFinished()), this, SLOT(updateProfile())); connect(ui->duplexTypeComboBox, SIGNAL(activated(int)), this, SLOT(updateProfile())); connect(ui->reverseOrderCbx, SIGNAL(clicked()), this, SLOT(updateProfile())); connect(ui->borderCbx, SIGNAL(clicked()), this, SLOT(updateProfile())); connect(ui->resetButton, SIGNAL(clicked()), this, SLOT(resetToDefault())); restoreGeometry(settings->value(Settings::PrinterSettingsDialog_Geometry).toByteArray()); }
void PrinterSettings::save() { updateProfile(); applyUpdates(); emit accepted(); }
void Dialog::setupDevice() { delete di; //! [createdi] di = new QSystemDeviceInfo(this); //! [createdi] //! [batteryLevel] batteryLevelBar->setValue(di->batteryLevel()); //! [batteryLevel] //! [sig batteryLevelChanged] connect(di,SIGNAL(batteryLevelChanged(int)), this,SLOT(updateBatteryStatus(int))); //! [sig batteryLevelChanged] connect(di,SIGNAL(batteryStatusChanged(QSystemDeviceInfo::BatteryStatus)), this,SLOT(displayBatteryStatus(QSystemDeviceInfo::BatteryStatus))); connect(di,SIGNAL(powerStateChanged(QSystemDeviceInfo::PowerState)), this,SLOT(updatePowerState(QSystemDeviceInfo::PowerState))); ImeiLabel->setText(di->imei()); imsiLabel->setText(di->imsi()); //! [manuf-id] manufacturerLabel->setText(di->manufacturer()); //! [manuf-id] modelLabel->setText(di->model()); //! [productName] productLabel->setText(di->productName()); //! [productName] deviceLockPushButton->setChecked(di->isDeviceLocked()); updateSimStatus(); updateProfile(); connect(di, SIGNAL(currentProfileChanged(QSystemDeviceInfo::Profile)), this, SLOT(updateProfile(QSystemDeviceInfo::Profile))); if(di->currentPowerState() == QSystemDeviceInfo::BatteryPower) { radioButton_2->setChecked(true); } else if(di->currentPowerState() == QSystemDeviceInfo::WallPower) { radioButton_3->setChecked(true); } else if(di->currentPowerState() == QSystemDeviceInfo::WallPowerChargingBattery) { radioButton_4->setChecked(true); } else { radioButton->setChecked(true); } //! [inputMethod flags] QSystemDeviceInfo::InputMethodFlags methods = di->inputMethodType(); QStringList inputs; if((methods & QSystemDeviceInfo::Keys)){ inputs << "Keys"; } if((methods & QSystemDeviceInfo::Keypad)) { inputs << "Keypad"; } //! [inputMethod flags] if((methods & QSystemDeviceInfo::Keyboard)) { inputs << "Keyboard"; } if((methods & QSystemDeviceInfo::SingleTouch)) { inputs << "Touch Screen"; } if((methods & QSystemDeviceInfo::MultiTouch)) { inputs << "Multi touch"; } if((methods & QSystemDeviceInfo::Mouse)){ inputs << "Mouse"; } inputMethodLabel->setText(inputs.join(" ")); }
void Dialog::updateProfile(QSystemDeviceInfo::Profile /*profile*/) { updateProfile(); }