1 // Copyright (C) 2004 Pino Toscano <toscano.pino@tiscali.it>
2 // Copyright (C) 2004 Dominique Devriese <devriese@kde.org>
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 #include "drgeo-filter-chooser.h"
20 #include "drgeo-filter-chooser.moc"
24 #include <kmessagebox.h>
25 #include <kpushbutton.h>
26 #include <kstdguiitem.h>
28 KigFilterDrgeoChooser::KigFilterDrgeoChooser( const QStringList
& l
)
29 : KigFilterDrgeoChooserBase( 0, "drgeo_filter", true )
31 OKButton
->setGuiItem( KStdGuiItem::ok() );
32 CancelButton
->setGuiItem( KStdGuiItem::cancel() );
34 FigureListBox
->insertStringList( l
);
36 connect( OKButton
, SIGNAL( clicked() ), SLOT( slotOKPressed() ) );
37 connect( CancelButton
, SIGNAL( clicked() ), SLOT( slotCancelPressed() ) );
38 connect( FigureListBox
, SIGNAL( executed( QListBoxItem
* ) ), SLOT( slotExecuted( QListBoxItem
* ) ) );
41 void KigFilterDrgeoChooser::slotOKPressed()
43 const int r
= FigureListBox
->currentItem();
46 KMessageBox::sorry( 0, i18n( "Please select a figure." ) );
52 void KigFilterDrgeoChooser::slotCancelPressed()
57 KigFilterDrgeoChooser::~KigFilterDrgeoChooser()
62 void KigFilterDrgeoChooser::slotExecuted( QListBoxItem
* i
)
64 done( FigureListBox
->index( i
) );