blob: 396143c2f8a65f3ea7643edfeb5159ee199fc457 (
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
|
/***************************************************************************
listdlg.cpp - description
-------------------
begin : Mon Nov 26 2001
copyright : (C) 2001 by Andras Mantia <amantia@kde.org>
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; version 2 of the License. *
* (at your option) any later version. *
***************************************************************************/
#include "listdlg.h"
//kde include
#include <klistbox.h>
#include <klocale.h>
//qt includes
#include <qpushbutton.h>
#include <qstring.h>
#include <qstringlist.h>
ListDlg::ListDlg(QStringList &entryList,QWidget* parent, const char *name )
:KDialogBase(parent,name), listbox(new KListBox(this))
{
Q_CHECK_PTR(listbox);
setMainWidget(listbox);
showButtonApply(false);
enableButtonSeparator(true);
listbox->clear();
listbox->insertStringList(entryList);
if(entryList.count()>0)
{
listbox->setCurrentItem(0);
}
listbox->setMinimumSize(350,150);
adjustSize();
resize(sizeHint());
connect(listbox,SIGNAL(doubleClicked( QListBoxItem * )), SLOT(slotOk()));
}
ListDlg::~ListDlg(){
}
QString ListDlg::getEntry()
{
return listbox->currentText();
}
int ListDlg::getEntryNum()
{
return listbox->currentItem();
}
#include "listdlg.moc"
|