LibrePCB Developers Documentation
Loading...
Searching...
No Matches
workspacesettingsdialog.h
Go to the documentation of this file.
1/*
2 * LibrePCB - Professional EDA for everyone!
3 * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4 * https://librepcb.org/
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef LIBREPCB_EDITOR_WORKSPACESETTINGSDIALOG_H
21#define LIBREPCB_EDITOR_WORKSPACESETTINGSDIALOG_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../modelview/editablelistmodel.h"
27
30
31#include <QtCore>
32#include <QtWidgets>
33
34/*******************************************************************************
35 * Namespace / Forward Declarations
36 ******************************************************************************/
37namespace librepcb {
38
39class Theme;
40class ThemeColor;
41class Workspace;
42class WorkspaceSettings;
43
44namespace editor {
45
46class ApiEndpointListModelLegacy;
47class KeyboardShortcutsModel;
48
49namespace Ui {
50class WorkspaceSettingsDialog;
51}
52
53/*******************************************************************************
54 * Class WorkspaceSettingsDialog
55 ******************************************************************************/
56
60class WorkspaceSettingsDialog final : public QDialog {
61 Q_OBJECT
62
66
68 QPointer<WorkspaceSettingsItem_GenericValueList<QStringList>> setting;
71 QVector<std::pair<QString, QString>> placeholders;
72 QStringList currentValue;
73 };
74
75public:
76 // Constructors / Destructor
79 explicit WorkspaceSettingsDialog(Workspace& workspace,
80 QWidget* parent = nullptr);
82
83 // Operator Overloadings
85 delete;
86
87signals:
89
90private:
91 void buttonBoxClicked(QAbstractButton* button) noexcept;
92 void keyPressEvent(QKeyEvent* event) noexcept override;
93 void externalApplicationListIndexChanged(int index) noexcept;
94 void updateThemesList(const Uuid& selectedTheme) noexcept;
95 void themeIndexChanged(int index) noexcept;
96 void initColorTreeWidgetItem(QTreeWidgetItem& item,
97 const ThemeColor& color) noexcept;
98 Theme* getCurrentTheme() noexcept;
99 void updateDismissedMessagesCount() noexcept;
100 void updateDesktopIntegrationStatus() noexcept;
101 void loadSettings() noexcept;
102 void saveSettings() noexcept;
103
104private:
111 QScopedPointer<QSortFilterProxyModel> mKeyboardShortcutsFilterModel;
112 QScopedPointer<Ui::WorkspaceSettingsDialog> mUi;
113
114 // Cached settings
117};
118
119/*******************************************************************************
120 * End of File
121 ******************************************************************************/
122
123} // namespace editor
124} // namespace librepcb
125
126#endif
Color settings as used by librepcb::Theme.
Definition themecolor.h:43
Theme class as used by librepcb::WorkspaceSettingsItem_Themes.
Definition theme.h:44
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition uuid.h:56
The Workspace class represents a workspace with all its data (library, projects, settings,...
Definition workspace.h:54
Container for all workspace related settings.
Definition workspacesettings.h:60
The ApiEndpointListModelLegacy class.
Definition apiendpointlistmodellegacy.h:43
A generic QAbstractTableModel subclass to view and edit list of various data types.
Definition editablelistmodel.h:73
A QAbstractItemModel to represent keyboard shortcut workspace settings.
Definition keyboardshortcutsmodel.h:44
Dialog (GUI) to view and modify workspace settings.
Definition workspacesettingsdialog.h:60
QScopedPointer< KeyboardShortcutsModel > mKeyboardShortcutsModel
Definition workspacesettingsdialog.h:110
void saveSettings() noexcept
Definition workspacesettingsdialog.cpp:694
WorkspaceSettings & mSettings
Reference to the Workspace object.
Definition workspacesettingsdialog.h:106
void updateDismissedMessagesCount() noexcept
Definition workspacesettingsdialog.cpp:605
QScopedPointer< LibraryNormOrderModel > mLibNormOrderModel
Definition workspacesettingsdialog.h:108
void externalApplicationListIndexChanged(int index) noexcept
Definition workspacesettingsdialog.cpp:463
void loadSettings() noexcept
Definition workspacesettingsdialog.cpp:642
WorkspaceSettingsDialog & operator=(const WorkspaceSettingsDialog &rhs)=delete
QMap< Uuid, Theme > mThemes
Definition workspacesettingsdialog.h:116
~WorkspaceSettingsDialog()
Definition workspacesettingsdialog.cpp:403
QVector< ExternalApplication > mExternalApplications
Definition workspacesettingsdialog.h:115
QScopedPointer< LibraryLocaleOrderModel > mLibLocaleOrderModel
Definition workspacesettingsdialog.h:107
QScopedPointer< ApiEndpointListModelLegacy > mApiEndpointModel
Definition workspacesettingsdialog.h:109
void initColorTreeWidgetItem(QTreeWidgetItem &item, const ThemeColor &color) noexcept
Definition workspacesettingsdialog.cpp:580
void updateThemesList(const Uuid &selectedTheme) noexcept
Definition workspacesettingsdialog.cpp:540
Workspace & mWorkspace
Definition workspacesettingsdialog.h:105
void keyPressEvent(QKeyEvent *event) noexcept override
Definition workspacesettingsdialog.cpp:451
EditableListModel< QStringList, EditableListModelType::LOCALE > LibraryLocaleOrderModel
Definition workspacesettingsdialog.h:64
EditableListModel< QStringList > LibraryNormOrderModel
Definition workspacesettingsdialog.h:65
QScopedPointer< QSortFilterProxyModel > mKeyboardShortcutsFilterModel
Definition workspacesettingsdialog.h:111
WorkspaceSettingsDialog(const WorkspaceSettingsDialog &other)=delete
void updateDesktopIntegrationStatus() noexcept
Definition workspacesettingsdialog.cpp:617
void themeIndexChanged(int index) noexcept
Definition workspacesettingsdialog.cpp:551
QScopedPointer< Ui::WorkspaceSettingsDialog > mUi
Definition workspacesettingsdialog.h:112
void buttonBoxClicked(QAbstractButton *button) noexcept
Definition workspacesettingsdialog.cpp:412
Theme * getCurrentTheme() noexcept
Definition workspacesettingsdialog.cpp:598
Definition occmodel.cpp:77
QStringList currentValue
Definition workspacesettingsdialog.h:72
QString exampleExecutable
Definition workspacesettingsdialog.h:69
QString defaultArgument
Definition workspacesettingsdialog.h:70
QVector< std::pair< QString, QString > > placeholders
Definition workspacesettingsdialog.h:71
QPointer< WorkspaceSettingsItem_GenericValueList< QStringList > > setting
Definition workspacesettingsdialog.h:68