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

« back to all changes in this revision

Viewing changes to protocols/oscar/oscarlistnonservercontacts.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
// oscarlistnonservercontacts.cpp
 
2
 
 
3
// Copyright (C)  2005  Matt Rogers <mattr@kde.org>
 
4
 
 
5
// This program is free software; you can redistribute it and/or
 
6
// modify it under the terms of the GNU General Public License
 
7
// as published by the Free Software Foundation; either version 2
 
8
// of the License, or (at your option) any later version.
 
9
 
 
10
// This program is distributed in the hope that it will be useful,
 
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
// GNU General Public License for more details.
 
14
 
 
15
// You should have received a copy of the GNU General Public License
 
16
// along with this program; if not, write to the Free Software
 
17
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
18
// 02110-1301, USA.
 
19
 
 
20
 
 
21
#include "oscarlistnonservercontacts.h"
 
22
#include "ui_oscarlistcontactsbase.h"
 
23
#include <qstringlist.h>
 
24
#include <qcheckbox.h>
 
25
#include <klocale.h>
 
26
 
 
27
OscarListNonServerContacts::OscarListNonServerContacts(QWidget* parent)
 
28
    : KDialog( parent )
 
29
{
 
30
    setCaption( i18n( "Add Contacts to Server List" ) );
 
31
    setButtons( KDialog::Yes | KDialog::Cancel | KDialog::No );
 
32
 
 
33
    QWidget* w = new QWidget( this );
 
34
    m_contactsList = new Ui::OscarListContactsBase;
 
35
    m_contactsList->setupUi( w );
 
36
    setMainWidget( w );
 
37
 
 
38
    setButtonText( Yes, i18n( "&Add" ) );
 
39
    setButtonText( Cancel, i18n( "Do &Not Add" ) );
 
40
    setButtonText( No, i18n( "&Delete" ) );
 
41
}
 
42
 
 
43
OscarListNonServerContacts::~OscarListNonServerContacts()
 
44
{
 
45
    delete m_contactsList;
 
46
}
 
47
 
 
48
void OscarListNonServerContacts::addContacts( const QStringList& contactList )
 
49
{
 
50
    m_nonServerContacts = contactList;
 
51
    m_contactsList->notServerContacts->addItems( contactList );
 
52
}
 
53
 
 
54
QStringList OscarListNonServerContacts::nonServerContactList() const
 
55
{
 
56
    return m_nonServerContacts;
 
57
}
 
58
 
 
59
bool OscarListNonServerContacts::onlyShowOnce()
 
60
{
 
61
    return m_contactsList->doNotShowAgain->isChecked();
 
62
}
 
63
 
 
64
 
 
65
void OscarListNonServerContacts::slotButtonClicked( int buttonCode )
 
66
{
 
67
        KDialog::slotButtonClicked(buttonCode);
 
68
 
 
69
        if( buttonCode == KDialog::Cancel ||
 
70
            buttonCode == KDialog::Yes ||
 
71
            buttonCode == KDialog::No )
 
72
        emit closing();
 
73
}
 
74
 
 
75
#include "oscarlistnonservercontacts.moc"