4
Kscd - A simple cd player for the KDE Project
6
$Id: inexact.cpp,v 1.15 2001/06/10 12:45:37 dfoerste Exp $
8
Copyright (c) 1997 Bernd Johannes Wuebben math.cornell.edu
10
This program is free software; you can redistribute it and/or modify
11
it under the terms of the GNU General Public License as published by
12
the Free Software Foundation; either version 2, or (at your option)
15
This program is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU General Public License for more details.
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31
#include <kmessagebox.h>
38
InexactDialog::InexactDialog(QWidget *parent, const char *name,bool _listbox)
39
: QDialog(parent, name, TRUE)
44
QBoxLayout * lay1 = new QVBoxLayout ( this, 10 );
45
text = new QLabel(this,"textlabel");
46
// text->setAlignment(WordBreak|AlignCenter);
47
lay1->addWidget ( text );
52
list_box = new QListBox(this,"debugwindow");
53
list_box->setColumnMode(QListBox::FitToWidth);
54
lay1->addWidget ( list_box );
55
connect(list_box,SIGNAL(highlighted(int)),SLOT(setStatusBar(int)));
57
edit = new QMultiLineEdit(this,"debugwindow");
58
lay1->addWidget ( edit );
63
text->setText(i18n("No exact match or multiple exact matches found.\nPlease select the appropriate"\
64
" CD from the list of choices presented below."));
66
errorstring = i18n("Please select a Disk Title or press Cancel");
68
statuslabel = new QLabel( this, "statuslabel" );
69
lay1->addWidget ( statuslabel );
70
statuslabel->setFrameStyle( QFrame::Panel | QFrame::Sunken );
71
statuslabel->setText( "" );
72
statuslabel->setAlignment( AlignCenter );
73
//statusPageLabel->setFont( QFont("helvetica",12,QFont::Normal) );
75
QBoxLayout * lay2 = new QHBoxLayout ( lay1 );
76
lay2->addStretch ( 1 );
77
ok_button = new QPushButton(i18n("OK"),this,"ok_button");
78
lay2->addWidget ( ok_button );
79
lay2->addStretch ( 1 );
80
cancel_button = new QPushButton(i18n("Cancel"),this,"cancel_button");
81
lay2->addWidget ( cancel_button );
82
lay2->addStretch ( 1 );
83
cancel_button->setFocus();
85
connect(ok_button,SIGNAL(clicked()),SLOT(checkit()));
86
connect(cancel_button,SIGNAL(clicked()),SLOT(reject()));
92
InexactDialog::~InexactDialog()
97
InexactDialog::setTitle(const QString& t)
104
InexactDialog::setErrorString(const QString& t)
110
InexactDialog::checkit()
114
if(list_box->currentItem() == -1)
116
KMessageBox::information(this, errorstring);
119
returnstring = list_box->text(list_box->currentItem());
121
returnstring = edit->text();
127
InexactDialog::getSelection(QString& string)
129
string = returnstring;
134
InexactDialog::insertList(const QStringList& stringlist)
138
list_box->insertStringList(stringlist,-1);
143
InexactDialog::insertText(const QString& str)
147
edit->setAutoUpdate(FALSE);
149
edit->setAutoUpdate(TRUE);
154
InexactDialog::setStatusBar(int i)
156
returnstring = list_box->text(i);
157
statuslabel->setText(returnstring);
160
#include "inexact.moc"