• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kopete/kopete

  • sources
  • kde-4.12
  • kdenetwork
  • kopete
  • kopete
  • statusmenu
kopetestatusaction.cpp
Go to the documentation of this file.
1 /*
2  kopetestatusaction.cpp - Kopete Status Action
3 
4  Copyright (c) 2008 by Roman Jarosz <kedgedev@centrum.cz>
5  Kopete (c) 2008 by the Kopete developers <kopete-devel@kde.org>
6 
7  *************************************************************************
8  * *
9  * This library is free software; you can redistribute it and/or *
10  * modify it under the terms of the GNU Lesser General Public *
11  * License as published by the Free Software Foundation; either *
12  * version 2 of the License, or (at your option) any later version. *
13  * *
14  *************************************************************************
15 */
16 #include "kopetestatusaction.h"
17 
18 #include <kopeteonlinestatus.h>
19 #include <kopetestatusitems.h>
20 
21 #include "kopetestatusrootaction.h"
22 
23 
24 namespace Kopete {
25 
26 StatusAction::StatusAction( Status::Status *status, StatusRootAction* rootAction, QObject * parent )
27  : KAction( parent ), mStatus(status), mRootAction(rootAction)
28 {
29  connect( this, SIGNAL(triggered(bool)), this, SLOT(triggered()) );
30  connect( mStatus, SIGNAL(changed()), this, SLOT(changed()) );
31  init();
32 }
33 
34 void StatusAction::init()
35 {
36  if ( mRootAction->filter() == StatusRootAction::UseCategory )
37  {
38  this->setIcon( Kopete::OnlineStatusManager::pixmapForCategory( mStatus->category() ) );
39  this->setText( mStatus->title() );
40  }
41  else
42  {
43  this->setIcon( KIcon(mRootAction->onlineStatus().iconFor( mRootAction->account() )) );
44  this->setText( mStatus->title() );
45  }
46 
47  this->setData( mStatus->uid() );
48  this->setToolTip( mStatus->message() );
49 }
50 
51 void StatusAction::triggered()
52 {
53  mRootAction->changeStatus( mStatus );
54 }
55 
56 void StatusAction::changed()
57 {
58 
59 }
60 
61 }
62 
63 #include "kopetestatusaction.moc"
Kopete::StatusAction::StatusAction
StatusAction(Status::Status *status, StatusRootAction *rootAction, QObject *parent)
StatusAction constructor.
Definition: kopetestatusaction.cpp:26
Kopete::StatusRootAction
Definition: kopetestatusrootaction.h:43
QObject
Kopete::StatusRootAction::changeStatus
void changeStatus(uint category, const Kopete::StatusMessage &statusMessage)
Status category and message change request.
kopetestatusrootaction.h
kopetestatusaction.h
KAction
Kopete::StatusRootAction::UseCategory
Definition: kopetestatusrootaction.h:47
Kopete::StatusRootAction::filter
StatusRootAction::Filter filter() const
Returns menu filter used for filtering the status actions.
Definition: kopetestatusrootaction.cpp:214
Kopete::StatusRootAction::onlineStatus
OnlineStatus onlineStatus() const
Returns default online status.
Definition: kopetestatusrootaction.cpp:224
Kopete::StatusRootAction::account
Account * account() const
Get the account this root action was created for.
Definition: kopetestatusrootaction.cpp:229
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/kopete

Skip menu "kopete/kopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal