Logo Search packages:      
Sourcecode: kmess version File versions  Download package

void ChatStylePage::loadSettings ( const Account account  ) 

Load the widget state from an account.

Reads an Account's info and sets our internal widgets accordingly

Parameters:
account The account where to pick settings from

Definition at line 223 of file chatstylepage.cpp.

References Account::getChatStyle(), Account::getContactFont(), Account::getContactFontColor(), Account::getFont(), Account::getFontColor(), Account::getGroupFollowupMessages(), Account::getShakeNudge(), Account::getShowChatUserPicture(), Account::getShowMessageTime(), Account::getShowWinks(), Account::getTabbedChatMode(), Account::getTimestampShowDate(), Account::getTimestampShowSeconds(), Account::getUseChatFormatting(), Account::getUseContactFont(), Account::getUseEmoticons(), Account::getUseFontEffects(), ChatMessageStyle::setContactFont(), and ChatMessageStyle::setContactFontColor().

{
  userFont_    = account->getFont();
  contactFont_ = account->getContactFont();
  userColor_   .setNamedColor( account->getFontColor()        );
  contactColor_.setNamedColor( account->getContactFontColor() );

  fontButton_->setText( userFont_.family().replace( '&', "&&" ) );
  fontButton_->setFont( userFont_ );
  fontButton_->setShortcut( QKeySequence() );
  fontColorButton_->setColor( userColor_ );

  contactFontButton_->setText( contactFont_.family().replace( '&', "&&" ) );
  contactFontButton_->setFont( contactFont_ );
  contactFontButton_->setShortcut( QKeySequence() );
  contactFontColorButton_->setColor( contactColor_ );

  useContactFontCheckBox_->setChecked( account->getUseContactFont() );
  useContactFontToggled( account->getUseContactFont() );
  useEmoticonsCheckBox_->setChecked( account->getUseEmoticons() );
  showWinksCheckBox_->setChecked( account->getShowWinks() );
  showTimeCheckbox_->setChecked( account->getShowMessageTime() );
  showDateCheckbox_->setChecked( account->getTimestampShowDate() );
  showSecondsCheckbox_->setChecked( account->getTimestampShowSeconds() );
  useFontEffectsCheckBox_->setChecked( account->getUseFontEffects() );
  groupFollowupCheckbox_->setChecked( account->getGroupFollowupMessages() );
  tabbedChatMode_->setCurrentIndex( account->getTabbedChatMode() );
  shakeNudgeCheckBox_->setChecked( account->getShakeNudge() );
  enableChatFormattingCheckBox_->setChecked( account->getUseChatFormatting() );
  displayChatUserPictureCheckBox_->setChecked( account->getShowChatUserPicture() );

  // Select the correct chat style,
  int item = chatStyle_->findText( account->getChatStyle(), Qt::MatchExactly | Qt::MatchCaseSensitive );
  if( item == -1 )
  {
    kWarning() << "Current chat style was not found, attempting to revert to the default setting.";
    item = chatStyle_->findText( "Default", Qt::MatchExactly | Qt::MatchCaseSensitive );
  }

  if( item != -1 )
  {
    chatStyle_->setCurrentIndex( item );
    slotChatStyleChanged( chatStyle_->currentText() );
  }

  // Also load contact font settings into the chatStyle object,
  // other settings are set in updatePreview()
  chatStyleTransform_->setContactFont( contactFont_ );
  chatStyleTransform_->setContactFontColor( contactColor_.name() );
}


Generated by  Doxygen 1.6.0   Back to index