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
|
/***************************************************************************
* Copyright (C) 2012 by Peter Penz <[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. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
* **************************************************************************/
#include "dolphinfacetswidget.h"
#include <KLocale>
#include <QCheckBox>
#include <QRadioButton>
#include <QHBoxLayout>
#include <QVBoxLayout>
DolphinFacetsWidget::DolphinFacetsWidget(QWidget* parent) :
QWidget(parent),
m_documents(0),
m_images(0),
m_audio(0),
m_videos(0),
m_anytime(0),
m_today(0),
m_yesterday(0),
m_thisWeek(0),
m_thisMonth(0),
m_thisYear(0),
m_anyRating(0),
m_oneOrMore(0),
m_twoOrMore(0),
m_threeOrMore(0),
m_fourOrMore(0),
m_maxRating(0)
{
m_documents = new QCheckBox(i18nc("@option:check", "Documents"));
m_images = new QCheckBox(i18nc("@option:check", "Images"));
m_audio = new QCheckBox(i18nc("@option:check", "Audio"));
m_videos = new QCheckBox(i18nc("@option:check", "Videos"));
QVBoxLayout* typeLayout = new QVBoxLayout();
typeLayout->setSpacing(0);
typeLayout->addWidget(m_documents);
typeLayout->addWidget(m_images);
typeLayout->addWidget(m_audio);
typeLayout->addWidget(m_videos);
typeLayout->addStretch();
m_anytime = new QRadioButton(i18nc("@option:option", "Anytime"));
m_today = new QRadioButton(i18nc("@option:option", "Today"));
m_yesterday = new QRadioButton(i18nc("@option:option", "Yesterday"));
m_thisWeek = new QRadioButton(i18nc("@option:option", "This Week"));
m_thisMonth = new QRadioButton(i18nc("@option:option", "This Month"));
m_thisYear = new QRadioButton(i18nc("@option:option", "This Year"));
QVBoxLayout* timespanLayout = new QVBoxLayout();
timespanLayout->setSpacing(0);
timespanLayout->addWidget(m_anytime);
timespanLayout->addWidget(m_today);
timespanLayout->addWidget(m_yesterday);
timespanLayout->addWidget(m_thisWeek);
timespanLayout->addWidget(m_thisMonth);
timespanLayout->addWidget(m_thisYear);
timespanLayout->addStretch();
m_anyRating = new QRadioButton(i18nc("@option:option", "Any Rating"));
m_oneOrMore = new QRadioButton(i18nc("@option:option", "1 or more"));
m_twoOrMore = new QRadioButton(i18nc("@option:option", "2 or more"));
m_threeOrMore = new QRadioButton(i18nc("@option:option", "3 or more"));
m_fourOrMore = new QRadioButton(i18nc("@option:option", "4 or more"));
m_maxRating = new QRadioButton(i18nc("@option:option", "Maximum Rating"));
QVBoxLayout* ratingLayout = new QVBoxLayout();
ratingLayout->setSpacing(0);
ratingLayout->addWidget(m_anyRating);
ratingLayout->addWidget(m_oneOrMore);
ratingLayout->addWidget(m_twoOrMore);
ratingLayout->addWidget(m_threeOrMore);
ratingLayout->addWidget(m_fourOrMore);
ratingLayout->addWidget(m_maxRating);
QHBoxLayout* topLayout = new QHBoxLayout(this);
topLayout->addLayout(typeLayout);
topLayout->addLayout(timespanLayout);
topLayout->addLayout(ratingLayout);
topLayout->addStretch();
// TODO:
m_anytime->setChecked(true);
m_anyRating->setChecked(true);
}
DolphinFacetsWidget::~DolphinFacetsWidget()
{
}
#include "dolphinfacetswidget.moc"
|