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

kopete/libkopete

  • Kopete
  • UI
  • AvatarDialog
Signals | Public Member Functions | Static Public Member Functions | Protected Slots | List of all members
Kopete::UI::AvatarDialog Class Reference

#include <avatardialog.h>

Inheritance diagram for Kopete::UI::AvatarDialog:
Inheritance graph
[legend]

Signals

void result ()
 

Public Member Functions

 AvatarDialog (QWidget *parent=0)
 
virtual ~AvatarDialog ()
 
QString selectedAvatarPath () const
 

Static Public Member Functions

static QString getAvatar (QWidget *parent=0, const QString &currentAvatar=QString(), bool *ok=0)
 

Protected Slots

virtual void slotButtonClicked (int button)
 

Detailed Description

Dialog to manage and select user avatar.

Using AvatarDialog is very simple, if you only want to retrieve an avatar, use the AvatarDialog::getAvatar() static method.

If you want the operation to be asynchronous, you can use it like the following example:

Kopete::UI::AvatarDialog *avatarDialog = new Kopete::UI::AvatarDialog(parent);
connect(avatarDialog, SIGNAL(result(Kopete::UI::AvatarDialog*)), this, SLOT(avatarDialogResult(Kopete::UI::AvatarDialog*)));
avatarDialog->show();

then in the resulting slot, retrieve the path of the selected avatar:

void SpamEgg::avatarDialogResult(Kopete::UI::AvatarDialog *dialog)
{
// Set avatar to Myself metacontact
Kopete::ContactList::self()->myself()->setPhoto( KUrl(dialog->selectedAvatarPath()) );
}
Author
Michaƫl Larouche larou.nosp@m.che@.nosp@m.kde.o.nosp@m.rg

Definition at line 58 of file avatardialog.h.

Constructor & Destructor Documentation

Kopete::UI::AvatarDialog::AvatarDialog ( QWidget *  parent = 0)

Create a new AvatarDialog.

Parameters
parentParent widget

Definition at line 49 of file avatardialog.cpp.

Kopete::UI::AvatarDialog::~AvatarDialog ( )
virtual

Clean-up resource of AvatarDialog.

Definition at line 60 of file avatardialog.cpp.

Member Function Documentation

QString Kopete::UI::AvatarDialog::getAvatar ( QWidget *  parent = 0,
const QString &  currentAvatar = QString(),
bool *  ok = 0 
)
static

Gets an avatar from the AvatarManager.

This method will open the avatar dialog for the user to choose an avatar.

Parameters
parentParent widget
Returns
The path of the selected avatar, or QString() if no avatar was chosen or if the Cancel button was pressed.

Definition at line 70 of file avatardialog.cpp.

void Kopete::UI::AvatarDialog::result ( )
signal

This signal is emitted when Ok has been clicked before the dialog is closed.

QString Kopete::UI::AvatarDialog::selectedAvatarPath ( ) const

Get the selected avatar in dialog.

This method return the path of the selected avatar in dialog. Call this method in the resulting slot of signal result().

Returns
the absolute path to the avatar

Definition at line 65 of file avatardialog.cpp.

void Kopete::UI::AvatarDialog::slotButtonClicked ( int  button)
protectedvirtualslot

A button has been clicked. Reimplemented from KDialog::slotButtonClicked()

Definition at line 94 of file avatardialog.cpp.


The documentation for this class was generated from the following files:
  • avatardialog.h
  • avatardialog.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/libkopete

Skip menu "kopete/libkopete"
  • 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