Esempio n. 1
0
File: status.cpp Progetto: j0wl/licq
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);
}
Esempio n. 2
0
File: status.cpp Progetto: j0wl/licq
void Settings::Status::load()
{
  Config::General* generalConfig = Config::General::instance();

  myAutoAwaySpin->setValue(generalConfig->autoAwayTime());
  myAutoNaSpin->setValue(generalConfig->autoNaTime());
  myAutoOfflineSpin->setValue(generalConfig->autoOfflineTime());
  myAutoAwayMessCombo->setCurrentIndex(generalConfig->autoAwayMess());
  myAutoNaMessCombo->setCurrentIndex(generalConfig->autoNaMess());
}
Esempio n. 3
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);
}
Esempio n. 4
0
void Settings::ContactList::load()
{
  Config::Chat* chatConfig = Config::Chat::instance();
  Config::ContactList* contactListConfig = Config::ContactList::instance();
  Config::General* generalConfig = Config::General::instance();
  Config::Shortcuts* shortcutConfig = Config::Shortcuts::instance();

  myManualNewUserCheck->setChecked(chatConfig->manualNewUser());

  myShowGroupIfNoMsgCheck->setChecked(generalConfig->showGroupIfNoMsg());
  myEnableMainwinMouseMovementCheck->setChecked(generalConfig->mainwinDraggable());
  myMainWinStickyCheck->setChecked(generalConfig->mainwinSticky());

  myGridLinesCheck->setChecked(contactListConfig->showGridLines());
  myMode2ViewCheck->setChecked(contactListConfig->mode2View());
  myFontStylesCheck->setChecked(contactListConfig->useFontStyles());
  myShowExtIconsCheck->setChecked(contactListConfig->showExtendedIcons());
  myShowPhoneIconsCheck->setChecked(contactListConfig->showPhoneIcons());
  myShowPhoneIconsCheck->setEnabled(contactListConfig->showExtendedIcons());
  myHeaderCheck->setChecked(contactListConfig->showHeader());
  myShowDividersCheck->setChecked(contactListConfig->showDividers());
  mySortByCombo->setCurrentIndex(contactListConfig->sortByStatus());
  myAlwaysShowONUCheck->setChecked(contactListConfig->alwaysShowONU());
  myShowUserIconsCheck->setChecked(contactListConfig->showUserIcons());
  myScrollBarCheck->setChecked(contactListConfig->allowScrollBar());
  mySysBackCheck->setChecked(contactListConfig->useSystemBackground());
  myDragMovesUserCheck->setChecked(contactListConfig->dragMovesUser());

#ifdef Q_WS_X11
  myHotKeyEdit->setKeySequence(shortcutConfig->getShortcut(Config::Shortcuts::GlobalShowMainwin));
#endif

  int numColumns = contactListConfig->columnCount();
  if(numColumns < 1)
    myColNumberRadio[0]->setChecked(true);
  else if(numColumns > MAX_COLUMNCOUNT)
    myColNumberRadio[MAX_COLUMNCOUNT - 1]->setChecked(true);
  else
    myColNumberRadio[numColumns - 1]->setChecked(true);

  for (int i = 0; i < MAX_COLUMNCOUNT; ++i)
  {
    myColTitleEdit[i]->setText(contactListConfig->columnHeading(i));
    myColFormatEdit[i]->setText(QString(contactListConfig->columnFormat(i)).replace("\n", "\\n"));
    myColWidthSpin[i]->setValue(contactListConfig->columnWidth(i));
    myColAlignCombo[i]->setCurrentIndex(contactListConfig->columnAlignment(i));

    myColTitleEdit[i]->setEnabled(i < numColumns);
    myColFormatEdit[i]->setEnabled(i < numColumns);
    myColWidthSpin[i]->setEnabled(i < numColumns);
    myColAlignCombo[i]->setEnabled(i < numColumns);
  }

  myPopupPictureCheck->setChecked(contactListConfig->popupPicture());
  myPopupAliasCheck->setChecked(contactListConfig->popupAlias());
  myPopupAuthCheck->setChecked(contactListConfig->popupAuth());
  myPopupNameCheck->setChecked(contactListConfig->popupName());
  myPopupEmailCheck->setChecked(contactListConfig->popupEmail());
  myPopupPhoneCheck->setChecked(contactListConfig->popupPhone());
  myPopupFaxCheck->setChecked(contactListConfig->popupFax());
  myPopupCellularCheck->setChecked(contactListConfig->popupCellular());
  myPopupIpCheck->setChecked(contactListConfig->popupIP());
  myPopupLastOnlineCheck->setChecked(contactListConfig->popupLastOnline());
  myPopupOnlineSinceCheck->setChecked(contactListConfig->popupOnlineSince());
  myPopupAwayTimeCheck->setChecked(contactListConfig->popupAwayTime());
  myPopupIdleTimeCheck->setChecked(contactListConfig->popupIdleTime());
  myPopupLocalTimeCheck->setChecked(contactListConfig->popupLocalTime());
  myPopupIdCheck->setChecked(contactListConfig->popupID());

  mySSListCheck->setChecked(gLicqDaemon->UseServerContactList());
  myTransparentCheck->setChecked(Config::Skin::active()->frame.transparent);
  myFrameStyleEdit->setText(QString::number(static_cast<int>(Config::Skin::active()->frame.frameStyle)));

#ifndef USE_KDE
  QString currentStyle = generalConfig->guiStyle();
  for (int i = 0; i < myGuiStyleCombo->count(); ++i)
    if (myGuiStyleCombo->itemText(i).compare(currentStyle, Qt::CaseInsensitive) == 0)
      myGuiStyleCombo->setCurrentIndex(i);
#endif

  myAutoUpdateInfoCheck->setChecked(gLicqDaemon->AutoUpdateInfo());
  myAutoUpdateInfoPluginsCheck->setChecked(gLicqDaemon->AutoUpdateInfoPlugins());
  myAutoUpdateStatusPluginsCheck->setChecked(gLicqDaemon->AutoUpdateStatusPlugins());
}