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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
/*
**************************************************************************
description
--------------------
copyright : (C) 2002 by Luis Carvalho
email : [email protected]
**************************************************************************
**************************************************************************
* *
* 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; either version 2 of the License, or *
* (at your option) any later version. *
* *
**************************************************************************/
#include "pmlibraryobject.h"
#include "pmlibraryentrypreview.h"
#include "pmlibraryobjectsearch.h"
#include "pmdialogeditbase.h"
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qpixmap.h>
#include <qimage.h>
#include <qframe.h>
#include <kurl.h>
#include <klocale.h>
#include <kdialog.h>
#include <klistview.h>
PMLibraryObjectSearch::PMLibraryObjectSearch( QWidget* parent ) :
QWidget( parent, "" )
{
setMinimumSize( 780, 300 );
setMaximumSize( 800, 400 );
QVBoxLayout* vl = new QVBoxLayout( this, KDialog::spacingHint( ) );
// Search parameters
QFrame* frame = new QFrame( this );
QHBoxLayout* fhl = new QHBoxLayout( frame, KDialog::spacingHint( ) );
QGridLayout* grid = new QGridLayout( fhl, 3, 2 );
QLabel *lbl = new QLabel( i18n( "Search for:" ), frame );
m_pSearch = new QLineEdit( frame );
grid->addWidget( lbl, 0, 0 );
grid->addWidget( m_pSearch, 0, 1 );
QVBoxLayout* fvl = new QVBoxLayout( fhl );
m_pSearchButton = new QPushButton( i18n( "&Search" ), frame );
fvl->addWidget( m_pSearchButton );
fvl->addStretch( 1 );
vl->addWidget( frame );
// Search results
frame = new QFrame( this );
QHBoxLayout* hl = new QHBoxLayout( frame, KDialog::spacingHint( ) );
m_pFileList = new KListView( frame );
m_pFileList->addColumn( i18n( "File" ) );
m_pFileList->addColumn( i18n( "Path" ) );
m_pFileList->setFullWidth( true );
m_pPreview = new PMLibraryEntryPreview( frame );
hl->addWidget( m_pFileList, 1 );
hl->addWidget( m_pPreview );
vl->addWidget( frame );
// Connect signals and slots
connect( m_pSearchButton, SIGNAL( clicked( ) ), SLOT( slotSearchButtonPressed( ) ) );
}
void PMLibraryObjectSearch::slotSearchButtonPressed( )
{
// QStringList::Iterator it( s_libraryPath );
// For each of the defined libraries
//
// Open recursively each library file
// Check if any of the strings contains the search words
// If it does add to the list
}
#include "pmlibraryobjectsearch.moc"
|