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

void AccountsManagerPage::accountSelected (  )  [private, slot]

Update the buttons status when accounts get selected

Definition at line 81 of file accountsmanagerpage.cpp.

References KMessApplication::getContactListWindow(), Account::getHandle(), and KMess::isConnected().

Referenced by AccountsManagerPage(), and readProperties().

{
  bool hasSelection = ( ! accountsList_->selectedItems().isEmpty() );

  configureAccountButton_->setEnabled( hasSelection );
  removeAccountButton_   ->setEnabled( hasSelection );

  // Disallow removal of the currently connected account.
  if( hasSelection )
  {
    const KMessApplication *kmessApp = static_cast<KMessApplication*>( kapp );
    const QListWidgetItem *selection = accountsList_->selectedItems().first();

    const QString &handle( selection->data( Qt::UserRole ).toString() );

    if( kmessApp->getContactListWindow()->isConnected()
    &&  CurrentAccount::instance()->getHandle() == handle )
    {
      removeAccountButton_->setEnabled( false );
    }
  }
}


Generated by  Doxygen 1.6.0   Back to index