Пример #1
0
void Settings::Status::apply()
{
  Config::General* generalConfig = Config::General::instance();
  generalConfig->blockUpdates(true);

  generalConfig->setAutoAwayTime(myAutoAwaySpin->value());
  generalConfig->setAutoNaTime(myAutoNaSpin->value());
  generalConfig->setAutoOfflineTime(myAutoOfflineSpin->value());

  generalConfig->setAutoAwayMess(myAutoAwayMessCombo->currentIndex());
  generalConfig->setAutoNaMess(myAutoNaMessCombo->currentIndex());

  generalConfig->blockUpdates(false);
}
Пример #2
0
void Settings::ContactList::apply()
{
  Config::Chat* chatConfig = Config::Chat::instance();
  Config::ContactList* contactListConfig = Config::ContactList::instance();
  Config::General* generalConfig = Config::General::instance();
  Config::Shortcuts* shortcutConfig = Config::Shortcuts::instance();
  chatConfig->blockUpdates(true);
  contactListConfig->blockUpdates(true);
  generalConfig->blockUpdates(true);

  chatConfig->setManualNewUser(myManualNewUserCheck->isChecked());

  generalConfig->setShowGroupIfNoMsg(myShowGroupIfNoMsgCheck->isChecked());
  generalConfig->setMainwinDraggable(myEnableMainwinMouseMovementCheck->isChecked());
  generalConfig->setMainwinSticky(myMainWinStickyCheck->isChecked());

  contactListConfig->setShowGridLines(myGridLinesCheck->isChecked());
  contactListConfig->setMode2View(myMode2ViewCheck->isChecked());
  contactListConfig->setUseFontStyles(myFontStylesCheck->isChecked());
  contactListConfig->setShowExtendedIcons(myShowExtIconsCheck->isChecked());
  contactListConfig->setShowPhoneIcons(myShowPhoneIconsCheck->isChecked());
  contactListConfig->setShowHeader(myHeaderCheck->isChecked());
  contactListConfig->setShowDividers(myShowDividersCheck->isChecked());
  contactListConfig->setSortByStatus(mySortByCombo->currentIndex());
  contactListConfig->setAlwaysShowONU(myAlwaysShowONUCheck->isChecked());
  contactListConfig->setShowUserIcons(myShowUserIconsCheck->isChecked());
  contactListConfig->setAllowScrollBar(myScrollBarCheck->isChecked());
  contactListConfig->setUseSystemBackground(mySysBackCheck->isChecked());
  contactListConfig->setDragMovesUser(myDragMovesUserCheck->isChecked());

#ifdef Q_WS_X11
  shortcutConfig->setShortcut(Config::Shortcuts::GlobalShowMainwin, myHotKeyEdit->keySequence());
#endif

  for (int i = 0; i < MAX_COLUMNCOUNT; ++i)
  {
    contactListConfig->setColumn(i,
        myColTitleEdit[i]->text(),
        myColFormatEdit[i]->text().replace("\\n", "\n"),
        myColWidthSpin[i]->value(),
        static_cast<Config::ContactList::AlignmentMode>(myColAlignCombo[i]->currentIndex()));

    if (myColNumberRadio[i]->isChecked())
      contactListConfig->setColumnCount(i + 1);
  }

  contactListConfig->setPopupPicture(myPopupPictureCheck->isChecked());
  contactListConfig->setPopupAlias(myPopupAliasCheck->isChecked());
  contactListConfig->setPopupAuth(myPopupAuthCheck->isChecked());
  contactListConfig->setPopupName(myPopupNameCheck->isChecked());
  contactListConfig->setPopupEmail(myPopupEmailCheck->isChecked());
  contactListConfig->setPopupPhone(myPopupPhoneCheck->isChecked());
  contactListConfig->setPopupFax(myPopupFaxCheck->isChecked());
  contactListConfig->setPopupCellular(myPopupCellularCheck->isChecked());
  contactListConfig->setPopupIP(myPopupIpCheck->isChecked());
  contactListConfig->setPopupLastOnline(myPopupLastOnlineCheck->isChecked());
  contactListConfig->setPopupOnlineSince(myPopupOnlineSinceCheck->isChecked());
  contactListConfig->setPopupAwayTime(myPopupAwayTimeCheck->isChecked());
  contactListConfig->setPopupIdleTime(myPopupIdleTimeCheck->isChecked());
  contactListConfig->setPopupLocalTime(myPopupLocalTimeCheck->isChecked());
  contactListConfig->setPopupID(myPopupIdCheck->isChecked());

  gLicqDaemon->SetUseServerContactList(mySSListCheck->isChecked());
  Config::Skin::active()->setFrameTransparent(myTransparentCheck->isChecked());
  Config::Skin::active()->setFrameStyle(myFrameStyleEdit->text().toUShort());

#ifndef USE_KDE
  generalConfig->setGuiStyle(myGuiStyleCombo->currentText());
#endif

  gLicqDaemon->SetAutoUpdateInfo(myAutoUpdateInfoCheck->isChecked());
  gLicqDaemon->SetAutoUpdateInfoPlugins(myAutoUpdateInfoPluginsCheck->isChecked());
  gLicqDaemon->SetAutoUpdateStatusPlugins(myAutoUpdateStatusPluginsCheck->isChecked());

  chatConfig->blockUpdates(false);
  contactListConfig->blockUpdates(false);
  generalConfig->blockUpdates(false);
}