~ubuntu-branches/ubuntu/saucy/kopete/saucy-proposed

« back to all changes in this revision

Viewing changes to protocols/sms/smsaddcontactpage.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-06-21 02:22:39 UTC
  • Revision ID: package-import@ubuntu.com-20130621022239-63l3zc8p0nf26pt6
Tags: upstream-4.10.80
Import upstream version 4.10.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  smsaddcontactpage.cpp  -  SMS Plugin
 
3
 
 
4
  Copyright (c) 2003      by Richard Lärkäng        <nouseforaname@home.se>
 
5
 
 
6
  *************************************************************************
 
7
  *                                                                       *
 
8
  * This program is free software; you can redistribute it and/or modify  *
 
9
  * it under the terms of the GNU General Public License as published by  *
 
10
  * the Free Software Foundation; either version 2 of the License, or     *
 
11
  * (at your option) any later version.                                   *
 
12
  *                                                                       *
 
13
  *************************************************************************
 
14
*/
 
15
 
 
16
#include "smsaddcontactpage.h"
 
17
#include "smsadd.h"
 
18
#include "kopeteaccount.h"
 
19
 
 
20
#include <qlayout.h>
 
21
#include <qlineedit.h>
 
22
 
 
23
 
 
24
 
 
25
SMSAddContactPage::SMSAddContactPage(QWidget *parent)
 
26
                                  : AddContactPage(parent)
 
27
{
 
28
        QVBoxLayout* layout = new QVBoxLayout( this );
 
29
        smsdata = new smsAddUI(this);
 
30
        layout->addWidget( smsdata );
 
31
        smsdata->addNr->setFocus();
 
32
}
 
33
 
 
34
SMSAddContactPage::~SMSAddContactPage()
 
35
{
 
36
 
 
37
}
 
38
 
 
39
bool SMSAddContactPage::apply(Kopete::Account* a, Kopete::MetaContact* m)
 
40
{
 
41
        if ( validateData() )
 
42
        {
 
43
                QString nr = smsdata->addNr->text();
 
44
                QString name = smsdata->addName->text();
 
45
 
 
46
                return a->addContact( nr, m, Kopete::Account::ChangeKABC );
 
47
        }
 
48
 
 
49
        return false;
 
50
}
 
51
 
 
52
 
 
53
bool SMSAddContactPage::validateData()
 
54
{
 
55
        return true;
 
56
}
 
57
 
 
58
#include "smsaddcontactpage.moc"
 
59
/*
 
60
 * Local variables:
 
61
 * c-indentation-style: k&r
 
62
 * c-basic-offset: 8
 
63
 * indent-tabs-mode: t
 
64
 * End:
 
65
 */
 
66
// vim: set noet ts=4 sts=4 sw=4:
 
67