2 xtrazicqstatusdialog.cpp - Xtraz ICQ Status Dialog
4 Copyright (c) 2007 by Roman Jarosz <kedgedev@centrum.cz>
5 Kopete (c) 2007 by the Kopete developers <kopete-devel@kde.org>
7 *************************************************************************
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
14 *************************************************************************
17 #include "xtrazicqstatusdialog.h"
19 #include "ui_xtrazicqstatusui.h"
21 #include "oscartypes.h"
26 ICQStatusDialog::ICQStatusDialog( QWidget
*parent
)
29 setCaption( i18n( "Set Xtraz Status" ) );
30 setButtons( KDialog::Ok
| KDialog::Cancel
);
32 mXtrazStatusUI
= new Ui::XtrazICQStatusUI();
33 QWidget
*w
= new QWidget( this );
34 mXtrazStatusUI
->setupUi( w
);
38 for ( int i
= 0; i
< Oscar::XSTAT_LAST
; ++i
)
39 icons
<< KIcon( QString( "icq_xstatus%1" ).arg( i
) );
41 mXtrazStatusUI
->iconsWidget
->setColumnCount( 11 );
42 mXtrazStatusUI
->iconsWidget
->setIcons( icons
);
43 mXtrazStatusUI
->iconsWidget
->setSelectedIndex( 0 );
44 mXtrazStatusUI
->iconsWidget
->setTabKeyNavigation( false );
45 mXtrazStatusUI
->iconsWidget
->setFocus();
48 ICQStatusDialog::~ICQStatusDialog()
50 delete mXtrazStatusUI
;
53 void ICQStatusDialog::setXtrazStatus( Xtraz::Status status
)
55 mXtrazStatusUI
->iconsWidget
->setSelectedIndex( status
.status() );
56 mXtrazStatusUI
->descriptionEdit
->setText( status
.description() );
57 mXtrazStatusUI
->messageEdit
->setText( status
.message() );
60 Xtraz::Status
ICQStatusDialog::xtrazStatus() const
64 status
.setStatus( mXtrazStatusUI
->iconsWidget
->selectedIndex() );
65 status
.setDescription( mXtrazStatusUI
->descriptionEdit
->text() );
66 status
.setMessage( mXtrazStatusUI
->messageEdit
->text() );
71 bool ICQStatusDialog::append() const
73 return mXtrazStatusUI
->checkAppend
->isChecked();