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
29
30#include <QtCore>
31#include <QtWidgets>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38class Theme;
39class ThemeColor;
40class Workspace;
41class WorkspaceSettings;
42
43namespace editor {
44
45class KeyboardShortcutsModel;
46
47namespace Ui {
48class WorkspaceSettingsDialog;
49}
50
51/*******************************************************************************
52 * Class WorkspaceSettingsDialog
53 ******************************************************************************/
54
58class WorkspaceSettingsDialog final : public QDialog {
59 Q_OBJECT
60
65
67 QPointer<WorkspaceSettingsItem_GenericValueList<QStringList>> setting;
70 QVector<std::pair<QString, QString>> placeholders;
71 QStringList currentValue;
72 };
73
74public:
75 // Constructors / Destructor
78 explicit WorkspaceSettingsDialog(Workspace& workspace,
79 QWidget* parent = nullptr);
81
82 // Operator Overloadings
84 delete;
85
86signals:
88
89private:
90 void buttonBoxClicked(QAbstractButton* button) noexcept;
91 void keyPressEvent(QKeyEvent* event) noexcept override;
92 void externalApplicationListIndexChanged(int index) noexcept;
93 void updateThemesList(const Uuid& selectedTheme) noexcept;
94 void themeIndexChanged(int index) noexcept;
95 void initColorTreeWidgetItem(QTreeWidgetItem& item,
96 const ThemeColor& color) noexcept;
97 Theme* getCurrentTheme() noexcept;
98 void updateDismissedMessagesCount() noexcept;
99 void updateDesktopIntegrationStatus() noexcept;
100 void loadSettings() noexcept;
101 void saveSettings() noexcept;
102
103private:
110 QScopedPointer<QSortFilterProxyModel> mKeyboardShortcutsFilterModel;
111 QScopedPointer<Ui::WorkspaceSettingsDialog> mUi;
112
113 // Cached settings
116};
117
118/*******************************************************************************
119 * End of File
120 ******************************************************************************/
121
122} // namespace editor
123} // namespace librepcb
124
125#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
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:58
QScopedPointer< KeyboardShortcutsModel > mKeyboardShortcutsModel
Definition workspacesettingsdialog.h:109
void saveSettings() noexcept
Definition workspacesettingsdialog.cpp:693
QScopedPointer< ApiEndpointModel > mApiEndpointModel
Definition workspacesettingsdialog.h:108
WorkspaceSettings & mSettings
Reference to the Workspace object.
Definition workspacesettingsdialog.h:105
void updateDismissedMessagesCount() noexcept
Definition workspacesettingsdialog.cpp:604
QScopedPointer< LibraryNormOrderModel > mLibNormOrderModel
Definition workspacesettingsdialog.h:107
void externalApplicationListIndexChanged(int index) noexcept
Definition workspacesettingsdialog.cpp:462
void loadSettings() noexcept
Definition workspacesettingsdialog.cpp:641
WorkspaceSettingsDialog & operator=(const WorkspaceSettingsDialog &rhs)=delete
QMap< Uuid, Theme > mThemes
Definition workspacesettingsdialog.h:115
~WorkspaceSettingsDialog()
Definition workspacesettingsdialog.cpp:400
QVector< ExternalApplication > mExternalApplications
Definition workspacesettingsdialog.h:114
QScopedPointer< LibraryLocaleOrderModel > mLibLocaleOrderModel
Definition workspacesettingsdialog.h:106
void initColorTreeWidgetItem(QTreeWidgetItem &item, const ThemeColor &color) noexcept
Definition workspacesettingsdialog.cpp:579
void updateThemesList(const Uuid &selectedTheme) noexcept
Definition workspacesettingsdialog.cpp:539
Workspace & mWorkspace
Definition workspacesettingsdialog.h:104
void keyPressEvent(QKeyEvent *event) noexcept override
Definition workspacesettingsdialog.cpp:450
EditableListModel< QStringList, EditableListModelType::LOCALE > LibraryLocaleOrderModel
Definition workspacesettingsdialog.h:62
EditableListModel< QStringList > LibraryNormOrderModel
Definition workspacesettingsdialog.h:63
QScopedPointer< QSortFilterProxyModel > mKeyboardShortcutsFilterModel
Definition workspacesettingsdialog.h:110
WorkspaceSettingsDialog(const WorkspaceSettingsDialog &other)=delete
void updateDesktopIntegrationStatus() noexcept
Definition workspacesettingsdialog.cpp:616
void themeIndexChanged(int index) noexcept
Definition workspacesettingsdialog.cpp:550
QScopedPointer< Ui::WorkspaceSettingsDialog > mUi
Definition workspacesettingsdialog.h:111
EditableListModel< QList< QUrl > > ApiEndpointModel
Definition workspacesettingsdialog.h:64
void buttonBoxClicked(QAbstractButton *button) noexcept
Definition workspacesettingsdialog.cpp:411
Theme * getCurrentTheme() noexcept
Definition workspacesettingsdialog.cpp:597
Definition occmodel.cpp:76
QStringList currentValue
Definition workspacesettingsdialog.h:71
QString exampleExecutable
Definition workspacesettingsdialog.h:68
QString defaultArgument
Definition workspacesettingsdialog.h:69
QVector< std::pair< QString, QString > > placeholders
Definition workspacesettingsdialog.h:70
QPointer< WorkspaceSettingsItem_GenericValueList< QStringList > > setting
Definition workspacesettingsdialog.h:67