summaryrefslogtreecommitdiffstats
path: root/bibletime/frontend/searchdialog/searchoptionsform.cpp
blob: 994c94ed8e3fbb8805459299422df6d358c64f7d (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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './searchoptionsform.ui'
**
** Created: Sa Mai 10 13:52:35 2008
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "searchoptionsform.h"

#include <tqvariant.h>
#include <tqgroupbox.h>
#include <tqlabel.h>
#include <tqpushbutton.h>
#include <kcombobox.h>
#include <tqlayout.h>
#include <tqtooltip.h>
#include <tqwhatsthis.h>

/*
 *  Constructs a SearchOptionsForm as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
SearchOptionsForm::SearchOptionsForm( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "SearchOptionsForm" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, sizePolicy().hasHeightForWidth() ) );
    setMinimumSize( TQSize( 260, 130 ) );
    setBaseSize( TQSize( 420, 150 ) );
    SearchOptionsFormLayout = new TQHBoxLayout( this, 0, 3, "SearchOptionsFormLayout"); 

    searchGroupBox = new TQGroupBox( this, "searchGroupBox" );
    searchGroupBox->setMargin( 0 );
    searchGroupBox->setColumnLayout(0, Qt::Vertical );
    searchGroupBox->layout()->setSpacing( 3 );
    searchGroupBox->layout()->setMargin( 6 );
    searchGroupBoxLayout = new TQGridLayout( searchGroupBox->layout() );
    searchGroupBoxLayout->setAlignment( Qt::AlignTop );

    m_searchTextLabel = new TQLabel( searchGroupBox, "m_searchTextLabel" );
    m_searchTextLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, m_searchTextLabel->sizePolicy().hasHeightForWidth() ) );

    searchGroupBoxLayout->addWidget( m_searchTextLabel, 0, 0 );

    m_syntaxButton = new TQPushButton( searchGroupBox, "m_syntaxButton" );

    searchGroupBoxLayout->addWidget( m_syntaxButton, 0, 2 );

    m_chooseModulesButton = new TQPushButton( searchGroupBox, "m_chooseModulesButton" );

    searchGroupBoxLayout->addWidget( m_chooseModulesButton, 1, 2 );

    m_chooseRangeButton = new TQPushButton( searchGroupBox, "m_chooseRangeButton" );

    searchGroupBoxLayout->addWidget( m_chooseRangeButton, 2, 2 );

    m_searchScopeLabel = new TQLabel( searchGroupBox, "m_searchScopeLabel" );
    m_searchScopeLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, m_searchScopeLabel->sizePolicy().hasHeightForWidth() ) );

    searchGroupBoxLayout->addWidget( m_searchScopeLabel, 2, 0 );

    m_rangeChooserCombo = new KComboBox( FALSE, searchGroupBox, "m_rangeChooserCombo" );
    m_rangeChooserCombo->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, m_rangeChooserCombo->sizePolicy().hasHeightForWidth() ) );

    searchGroupBoxLayout->addWidget( m_rangeChooserCombo, 2, 1 );

    m_searchTextCombo = new KHistoryCombo( searchGroupBox, "m_searchTextCombo" );
    m_searchTextCombo->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, m_searchTextCombo->sizePolicy().hasHeightForWidth() ) );
    m_searchTextCombo->setFocusPolicy( KHistoryCombo::WheelFocus );
    m_searchTextCombo->setSizeLimit( 25 );
    m_searchTextCombo->setInsertionPolicy( KHistoryCombo::AtBottom );
    m_searchTextCombo->setDuplicatesEnabled( FALSE );

    searchGroupBoxLayout->addWidget( m_searchTextCombo, 0, 1 );

    m_modulesLabel = new TQLabel( searchGroupBox, "m_modulesLabel" );
    m_modulesLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, m_modulesLabel->sizePolicy().hasHeightForWidth() ) );
    m_modulesLabel->setTextFormat( TQLabel::RichText );
    m_modulesLabel->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter | TQLabel::AlignLeft ) );

    searchGroupBoxLayout->addMultiCellWidget( m_modulesLabel, 1, 1, 0, 1 );
    SearchOptionsFormLayout->addWidget( searchGroupBox );
    languageChange();
    resize( TQSize(648, 130).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

/*
 *  Destroys the object and frees any allocated resources
 */
SearchOptionsForm::~SearchOptionsForm()
{
    // no need to delete child widgets, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void SearchOptionsForm::languageChange()
{
    setCaption( tr2i18n( "Search Options" ) );
    searchGroupBox->setTitle( tr2i18n( "Search parameters" ) );
    m_searchTextLabel->setText( tr2i18n( "Search for:" ) );
    m_syntaxButton->setText( tr2i18n( "&Help" ) );
    m_syntaxButton->setAccel( TQKeySequence( tr2i18n( "Alt+H" ) ) );
    m_chooseModulesButton->setText( tr2i18n( "&Choose" ) );
    m_chooseModulesButton->setAccel( TQKeySequence( tr2i18n( "Alt+C" ) ) );
    m_chooseRangeButton->setText( tr2i18n( "&Setup" ) );
    m_chooseRangeButton->setAccel( TQKeySequence( tr2i18n( "Alt+S" ) ) );
    m_searchScopeLabel->setText( tr2i18n( "Search scope:" ) );
    m_modulesLabel->setText( tr2i18n( "Search in:" ) );
}

#include "searchoptionsform.moc"