2 KNode, the KDE newsreader
3 Copyright (c) 1999-2005 the KNode authors.
4 See file AUTHORS for details
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10 You should have received a copy of the GNU General Public License
11 along with this program; if not, write to the Free Software Foundation,
12 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
18 #include <kiconloader.h>
21 #include "knfilterconfigwidget.h"
22 #include "knarticlefilter.h"
23 #include "utilities.h"
24 #include "knsearchdialog.h"
26 using namespace KNode
;
28 KNode::SearchDialog::SearchDialog( searchType type
, QWidget
*parent
) :
32 setCaption( i18n("Find Articles") );
33 setButtons( User1
| User2
| Close
);
35 setDefaultButton( User1
);
37 setWindowIcon( KIcon("knode") );
38 setButtonsOrientation( Qt::Vertical
);
39 setButtonGuiItem( User1
, KGuiItem( i18n("&Search"), "edit-find" ) );
40 setButtonGuiItem( User2
, KGuiItem( i18n("C&lear"), "edit-clear" ) );
42 connect( this, SIGNAL(closeClicked()), SLOT(slotClose()) );
43 connect( this, SIGNAL(user1Clicked()), SLOT(slotUser1()) );
44 connect( this, SIGNAL(user2Clicked()), SLOT(slotUser2()) );
46 KVBox
*filterBox
= new KVBox( this );
47 setMainWidget( filterBox
);
49 completeThreads
= new QCheckBox( i18n("Sho&w complete threads"), filterBox
);
50 fcw
= new KNFilterConfigWidget( filterBox
);
53 f_ilter
= new KNArticleFilter();
54 f_ilter
->setLoaded( true );
55 f_ilter
->setSearchFilter( true );
57 setFixedHeight( sizeHint().height() );
58 KNHelper::restoreWindowSize( "searchDlg", this, sizeHint() );
64 KNode::SearchDialog::~SearchDialog()
67 KNHelper::saveWindowSize("searchDlg", size());
71 void KNode::SearchDialog::slotUser1()
73 f_ilter
->status
=fcw
->status
->filter();
74 f_ilter
->score
=fcw
->score
->filter();
75 f_ilter
->age
=fcw
->age
->filter();
76 f_ilter
->lines
=fcw
->lines
->filter();
77 f_ilter
->subject
=fcw
->subject
->filter();
78 f_ilter
->from
=fcw
->from
->filter();
79 f_ilter
->messageId
=fcw
->messageId
->filter();
80 f_ilter
->references
=fcw
->references
->filter();
81 f_ilter
->setApplyOn(completeThreads
->isChecked()? 1:0);
82 emit
doSearch(f_ilter
);
87 void KNode::SearchDialog::slotUser2()
94 void KNode::SearchDialog::slotClose()
100 void KNode::SearchDialog::closeEvent( QCloseEvent
* )
106 #include "knsearchdialog.moc"