]>
cloud.milkyroute.net Git - dolphin.git/blob - src/search/dolphinfacetswidget.cpp
1 /***************************************************************************
2 * Copyright (C) 2012 by Peter Penz <peter.penz19@gmail.com> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (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 *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 * **************************************************************************/
20 #include "dolphinfacetswidget.h"
24 #include <QRadioButton>
25 #include <QHBoxLayout>
26 #include <QVBoxLayout>
28 DolphinFacetsWidget::DolphinFacetsWidget(QWidget
* parent
) :
47 m_documents
= new QCheckBox(i18nc("@option:check", "Documents"));
48 m_images
= new QCheckBox(i18nc("@option:check", "Images"));
49 m_audio
= new QCheckBox(i18nc("@option:check", "Audio"));
50 m_videos
= new QCheckBox(i18nc("@option:check", "Videos"));
52 QVBoxLayout
* typeLayout
= new QVBoxLayout();
53 typeLayout
->setSpacing(0);
54 typeLayout
->addWidget(m_documents
);
55 typeLayout
->addWidget(m_images
);
56 typeLayout
->addWidget(m_audio
);
57 typeLayout
->addWidget(m_videos
);
58 typeLayout
->addStretch();
60 m_anytime
= new QRadioButton(i18nc("@option:option", "Anytime"));
61 m_today
= new QRadioButton(i18nc("@option:option", "Today"));
62 m_yesterday
= new QRadioButton(i18nc("@option:option", "Yesterday"));
63 m_thisWeek
= new QRadioButton(i18nc("@option:option", "This Week"));
64 m_thisMonth
= new QRadioButton(i18nc("@option:option", "This Month"));
65 m_thisYear
= new QRadioButton(i18nc("@option:option", "This Year"));
67 QVBoxLayout
* timespanLayout
= new QVBoxLayout();
68 timespanLayout
->setSpacing(0);
69 timespanLayout
->addWidget(m_anytime
);
70 timespanLayout
->addWidget(m_today
);
71 timespanLayout
->addWidget(m_yesterday
);
72 timespanLayout
->addWidget(m_thisWeek
);
73 timespanLayout
->addWidget(m_thisMonth
);
74 timespanLayout
->addWidget(m_thisYear
);
75 timespanLayout
->addStretch();
77 m_anyRating
= new QRadioButton(i18nc("@option:option", "Any Rating"));
78 m_oneOrMore
= new QRadioButton(i18nc("@option:option", "1 or more"));
79 m_twoOrMore
= new QRadioButton(i18nc("@option:option", "2 or more"));
80 m_threeOrMore
= new QRadioButton(i18nc("@option:option", "3 or more"));
81 m_fourOrMore
= new QRadioButton(i18nc("@option:option", "4 or more"));
82 m_maxRating
= new QRadioButton(i18nc("@option:option", "Maximum Rating"));
84 QVBoxLayout
* ratingLayout
= new QVBoxLayout();
85 ratingLayout
->setSpacing(0);
86 ratingLayout
->addWidget(m_anyRating
);
87 ratingLayout
->addWidget(m_oneOrMore
);
88 ratingLayout
->addWidget(m_twoOrMore
);
89 ratingLayout
->addWidget(m_threeOrMore
);
90 ratingLayout
->addWidget(m_fourOrMore
);
91 ratingLayout
->addWidget(m_maxRating
);
93 QHBoxLayout
* topLayout
= new QHBoxLayout(this);
94 topLayout
->addLayout(typeLayout
);
95 topLayout
->addLayout(timespanLayout
);
96 topLayout
->addLayout(ratingLayout
);
97 topLayout
->addStretch();
100 m_anytime
->setChecked(true);
101 m_anyRating
->setChecked(true);
104 DolphinFacetsWidget::~DolphinFacetsWidget()
108 #include "dolphinfacetswidget.moc"