1 /**************************************************************************
2 * Otter Browser: Web browser controlled by the user, not vice-versa.
3 * Copyright (C) 2018 Michal Dutkiewicz aka Emdek <michal@emdek.pl>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 **************************************************************************/
19 
20 #include "PreferencesContentsWidget.h"
21 #include "../../../core/ThemesManager.h"
22 
23 #include "ui_PreferencesContentsWidget.h"
24 
25 namespace Otter
26 {
27 
PreferencesContentsWidget(const QVariantMap & parameters,Window * window,QWidget * parent)28 PreferencesContentsWidget::PreferencesContentsWidget(const QVariantMap &parameters, Window *window, QWidget *parent) : ContentsWidget(parameters, window, parent),
29 	m_ui(new Ui::PreferencesContentsWidget)
30 {
31 	m_ui->setupUi(this);
32 }
33 
~PreferencesContentsWidget()34 PreferencesContentsWidget::~PreferencesContentsWidget()
35 {
36 	delete m_ui;
37 }
38 
changeEvent(QEvent * event)39 void PreferencesContentsWidget::changeEvent(QEvent *event)
40 {
41 	ContentsWidget::changeEvent(event);
42 
43 	if (event->type() == QEvent::LanguageChange)
44 	{
45 		m_ui->retranslateUi(this);
46 	}
47 }
48 
getTitle() const49 QString PreferencesContentsWidget::getTitle() const
50 {
51 	return tr("Preferences");
52 }
53 
getType() const54 QLatin1String PreferencesContentsWidget::getType() const
55 {
56 	return QLatin1String("preferences");
57 }
58 
getUrl() const59 QUrl PreferencesContentsWidget::getUrl() const
60 {
61 	return QUrl(QLatin1String("about:preferences"));
62 }
63 
getIcon() const64 QIcon PreferencesContentsWidget::getIcon() const
65 {
66 	return ThemesManager::createIcon(QLatin1String("configuration"), false);
67 }
68 
69 }
70