summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/oscar/icq/ui/icqauthreplydialog.cpp
blob: 76b56fbab73f655753072ff675f5bbaebd59aba3 (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
   Kopete Oscar Protocol
   icqauthreplydialog.cpp - ICQ authorization reply dialog

   Copyright (c) 2004 Gustavo Pichorim Boiko <gustavo.boiko@kdemail.net>

   Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>

   *************************************************************************
   *                                                                       *
   * This library is free software; you can redistribute it and/or         *
   * modify it under the terms of the GNU Lesser General Public            *
   * License as published by the Free Software Foundation; either          *
   * version 2 of the License, or (at your option) any later version.      *
   *                                                                       *
   *************************************************************************
*/
#include "icqauthreplydialog.h"
#include "icqauthreplyui.h"

#include <klocale.h>

#include <qlabel.h>
#include <qradiobutton.h>
#include <qlineedit.h>

ICQAuthReplyDialog::ICQAuthReplyDialog( QWidget *parent, const char *name, bool wasRequested )
 : KDialogBase( parent, name, true, i18n( "Authorization Reply" ), KDialogBase::Ok | KDialogBase::Cancel )
{
	m_ui = new ICQAuthReplyUI( this );
	setMainWidget( m_ui );
	m_wasRequested = wasRequested;
	
	if ( !m_wasRequested )
	{
		m_ui->lblReqReason->hide();
		m_ui->lblRequestReason->hide();
	}
	else
	{
		this->setWFlags( this->getWFlags() | Qt::WDestructiveClose );
	}
}

ICQAuthReplyDialog::~ICQAuthReplyDialog()
{
}

void ICQAuthReplyDialog::setUser( const QString & user )
{
	if ( m_wasRequested )
		m_ui->lblUserReq->setText( 
			i18n( "<b>%1</b> requested authorization to add you to his/her contact list." ).arg( user ) );
	else
		m_ui->lblUserReq->setText( i18n( "Authorization reply to <b>%1</b>." ).arg( user ) );
}

void ICQAuthReplyDialog::setRequestReason( const QString & reason )
{
	m_ui->lblRequestReason->setText( reason );
}

QString ICQAuthReplyDialog::reason()
{
	return m_ui->leReason->text();
}

bool ICQAuthReplyDialog::grantAuth()
{
	return m_ui->rbGrant->isChecked();
}

#include "icqauthreplydialog.moc"