Show invite menu in wlm chat window immediately
[kdenetwork.git] / kopete / protocols / skype / skypedetails.cpp
blobdb2634a5cf90f6069562a55f572a57de31e58650
1 /* This file is part of the KDE project
2 Copyright (C) 2005 Michal Vaner <michal.vaner@kdemail.net>
3 Copyright (C) 2008-2009 Pali Rohár <pali.rohar@gmail.com>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
21 #include "skypedetails.h"
22 #include "skypeaccount.h"
24 #include <kdebug.h>
25 #include <klocale.h>
26 #include <qlineedit.h>
27 #include <qcombobox.h>
29 SkypeDetails::SkypeDetails() : KDialog() {
30 kDebug() << k_funcinfo << endl;
32 setButtons( KDialog::Close ); //add only close button
33 setDefaultButton( KDialog::Close );
35 QWidget* w = new QWidget( this );
36 dialog = new Ui::SkypeDetailsBase();//create the insides
37 dialog->setupUi( w );
38 setMainWidget( w );
40 connect(dialog->authorCombo, SIGNAL(activated(int)), this, SLOT(changeAuthor(int)));
44 SkypeDetails::~SkypeDetails() {
45 kDebug() << k_funcinfo << endl;
46 delete dialog;
49 void SkypeDetails::closeEvent(QCloseEvent *) {
50 kDebug() << k_funcinfo << endl;
51 deleteLater();
54 void SkypeDetails::changeAuthor(int item) {
55 kDebug() << k_funcinfo << endl;
56 switch (item) {
57 case 0:
58 account->authorizeUser(dialog->idEdit->text());
59 break;
60 case 1:
61 account->disAuthorUser(dialog->idEdit->text());
62 break;
63 case 2:
64 account->blockUser(dialog->idEdit->text());
65 break;
69 SkypeDetails &SkypeDetails::setNames(const QString &id, const QString &nick, const QString &name) {
70 kDebug() << k_funcinfo << endl;
71 setCaption(i18n("Details for User %1", id));
72 dialog->idEdit->setText(id);
73 dialog->nickEdit->setText(nick);
74 dialog->nameEdit->setText(name);
75 return *this;
78 SkypeDetails &SkypeDetails::setPhones(const QString &priv, const QString &mobile, const QString &work) {
79 kDebug() << k_funcinfo << endl;
80 dialog->privatePhoneEdit->setText(priv);
81 dialog->mobilePhoneEdit->setText(mobile);
82 dialog->workPhoneEdit->setText(work);
83 return *this;
86 SkypeDetails &SkypeDetails::setHomepage(const QString &homepage) {
87 kDebug() << k_funcinfo << endl;
88 dialog->homepageEdit->setText(homepage);
89 return *this;
92 SkypeDetails &SkypeDetails::setAuthor(int author, SkypeAccount *account) {
93 kDebug() << k_funcinfo << endl;
94 dialog->authorCombo->setCurrentIndex(author);
95 this->account = account;
96 return *this;
99 SkypeDetails &SkypeDetails::setSex(const QString &sex) {
100 kDebug() << k_funcinfo << endl;
101 dialog->sexEdit->setText(sex);
102 return *this;
105 #include "skypedetails.moc"