-
Notifications
You must be signed in to change notification settings - Fork 5
/
facebookeditaccountwidget.cpp
55 lines (45 loc) · 1.53 KB
/
facebookeditaccountwidget.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "facebookeditaccountwidget.h"
#include <qlayout.h>
#include <qlineedit.h>
//Added by qt3to4:
#include <QVBoxLayout>
#include <kdebug.h>
#include "kopeteaccount.h"
#include "kopetecontact.h"
#include "ui_facebookaccountpreferences.h"
#include "facebookaccount.h"
#include "facebookprotocol.h"
FacebookEditAccountWidget::FacebookEditAccountWidget( QWidget* parent, Kopete::Account* account)
: QWidget( parent ), KopeteEditAccountWidget( account )
{
QVBoxLayout *layout = new QVBoxLayout( this );
kDebug(FBDBG) ;
QWidget *widget = new QWidget( this );
m_preferencesWidget = new Ui::FacebookAccountPreferences();
m_preferencesWidget->setupUi( widget );
layout->addWidget( widget );
}
FacebookEditAccountWidget::~FacebookEditAccountWidget()
{
delete m_preferencesWidget;
}
Kopete::Account* FacebookEditAccountWidget::apply()
{
QString accountName;
if ( m_preferencesWidget->m_acctName->text().isEmpty() )
accountName = "Facebook Account";
else
accountName = m_preferencesWidget->m_acctName->text();
if ( account() )
// FIXME: ? account()->setAccountLabel(accountName);
account()->myself()->setProperty( Kopete::Global::Properties::self()->nickName(), accountName );
else
setAccount( new FacebookAccount( FacebookProtocol::protocol(), accountName ) );
return account();
}
bool FacebookEditAccountWidget::validateData()
{
//return !( m_preferencesWidget->m_acctName->text().isEmpty() );
return true;
}
#include "facebookeditaccountwidget.moc"