diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt index 37e4bdd68..e57cdb3c7 100644 --- a/share/CMakeLists.txt +++ b/share/CMakeLists.txt @@ -22,10 +22,10 @@ install(FILES ${DATABASE_ICONS} DESTINATION ${DATA_INSTALL_DIR}/icons/database) if(UNIX AND NOT APPLE) install(DIRECTORY icons/application/ DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor FILES_MATCHING PATTERN "keepassx*.png" PATTERN "keepassx*.svgz" - PATTERN "status" EXCLUDE PATTERN "actions" EXCLUDE) + PATTERN "status" EXCLUDE PATTERN "actions" EXCLUDE PATTERN "categories" EXCLUDE) install(DIRECTORY icons/application/ DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor FILES_MATCHING PATTERN "application-x-keepassxc.png" PATTERN "application-x-keepassxc.svgz" - PATTERN "status" EXCLUDE PATTERN "actions" EXCLUDE) + PATTERN "status" EXCLUDE PATTERN "actions" EXCLUDE PATTERN "categories" EXCLUDE) install(FILES linux/keepassxc.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) install(FILES linux/keepassxc.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages) endif(UNIX AND NOT APPLE) diff --git a/share/icons/application/32x32/actions/document-edit.png b/share/icons/application/32x32/actions/document-edit.png new file mode 100644 index 000000000..eb327b0a1 Binary files /dev/null and b/share/icons/application/32x32/actions/document-edit.png differ diff --git a/share/icons/application/32x32/actions/document-properties.png b/share/icons/application/32x32/actions/document-properties.png new file mode 100644 index 000000000..a6d13863d Binary files /dev/null and b/share/icons/application/32x32/actions/document-properties.png differ diff --git a/share/icons/application/32x32/actions/key-enter.png b/share/icons/application/32x32/actions/key-enter.png new file mode 100644 index 000000000..60d11e2f1 Binary files /dev/null and b/share/icons/application/32x32/actions/key-enter.png differ diff --git a/share/icons/application/32x32/actions/view-history.png b/share/icons/application/32x32/actions/view-history.png new file mode 100644 index 000000000..a67c689ac Binary files /dev/null and b/share/icons/application/32x32/actions/view-history.png differ diff --git a/share/icons/application/32x32/apps/internet-web-browser.png b/share/icons/application/32x32/apps/internet-web-browser.png new file mode 100644 index 000000000..b4106a58b Binary files /dev/null and b/share/icons/application/32x32/apps/internet-web-browser.png differ diff --git a/share/icons/application/32x32/apps/preferences-desktop-icons.png b/share/icons/application/32x32/apps/preferences-desktop-icons.png new file mode 100644 index 000000000..dcd605b25 Binary files /dev/null and b/share/icons/application/32x32/apps/preferences-desktop-icons.png differ diff --git a/share/icons/application/32x32/categories/preferences-other.png b/share/icons/application/32x32/categories/preferences-other.png new file mode 100644 index 000000000..acafe44c6 Binary files /dev/null and b/share/icons/application/32x32/categories/preferences-other.png differ diff --git a/share/icons/application/32x32/status/security-high.png b/share/icons/application/32x32/status/security-high.png new file mode 100644 index 000000000..7178893c2 Binary files /dev/null and b/share/icons/application/32x32/status/security-high.png differ diff --git a/share/icons/svg/document-properties.svgz b/share/icons/svg/document-properties.svgz new file mode 100644 index 000000000..7f166d7f2 Binary files /dev/null and b/share/icons/svg/document-properties.svgz differ diff --git a/share/icons/svg/internet-web-browser.svgz b/share/icons/svg/internet-web-browser.svgz new file mode 100644 index 000000000..f48f1415c Binary files /dev/null and b/share/icons/svg/internet-web-browser.svgz differ diff --git a/share/icons/svg/key-enter.svgz b/share/icons/svg/key-enter.svgz new file mode 100644 index 000000000..7176b5acb Binary files /dev/null and b/share/icons/svg/key-enter.svgz differ diff --git a/share/icons/svg/preferences-desktop-icons.svgz b/share/icons/svg/preferences-desktop-icons.svgz new file mode 100644 index 000000000..1cd0a0526 Binary files /dev/null and b/share/icons/svg/preferences-desktop-icons.svgz differ diff --git a/share/icons/svg/preferences-other.svgz b/share/icons/svg/preferences-other.svgz new file mode 100644 index 000000000..4abeca376 Binary files /dev/null and b/share/icons/svg/preferences-other.svgz differ diff --git a/share/icons/svg/security-high.svgz b/share/icons/svg/security-high.svgz new file mode 100644 index 000000000..5edee3734 Binary files /dev/null and b/share/icons/svg/security-high.svgz differ diff --git a/share/icons/svg/view-history.svgz b/share/icons/svg/view-history.svgz new file mode 100644 index 000000000..fff230f66 Binary files /dev/null and b/share/icons/svg/view-history.svgz differ diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 7225c4c5a..cf6ae0401 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -54,34 +54,47 @@ #ifdef WITH_XC_HTTP class HttpPlugin: public ISettingsPage { - public: - HttpPlugin(DatabaseTabWidget * tabWidget) { - m_service = new Service(tabWidget); - } - virtual ~HttpPlugin() { - //delete m_service; - } - virtual QString name() { - return QObject::tr("Browser Integration"); - } - virtual QWidget * createWidget() { - OptionDialog * dlg = new OptionDialog(); - QObject::connect(dlg, SIGNAL(removeSharedEncryptionKeys()), m_service, SLOT(removeSharedEncryptionKeys())); - QObject::connect(dlg, SIGNAL(removeStoredPermissions()), m_service, SLOT(removeStoredPermissions())); - return dlg; - } - virtual void loadSettings(QWidget * widget) { - qobject_cast(widget)->loadSettings(); - } - virtual void saveSettings(QWidget * widget) { - qobject_cast(widget)->saveSettings(); - if (HttpSettings::isEnabled()) - m_service->start(); - else - m_service->stop(); - } - private: - Service *m_service; +public: + HttpPlugin(DatabaseTabWidget * tabWidget) + { + m_service = new Service(tabWidget); + } + + ~HttpPlugin() = default; + + QString name() override + { + return QObject::tr("Browser Integration"); + } + + QIcon icon() override + { + return FilePath::instance()->icon("apps", "internet-web-browser"); + } + + QWidget * createWidget() override + { + OptionDialog * dlg = new OptionDialog(); + QObject::connect(dlg, SIGNAL(removeSharedEncryptionKeys()), m_service, SLOT(removeSharedEncryptionKeys())); + QObject::connect(dlg, SIGNAL(removeStoredPermissions()), m_service, SLOT(removeStoredPermissions())); + return dlg; + } + + void loadSettings(QWidget * widget) override + { + qobject_cast(widget)->loadSettings(); + } + + void saveSettings(QWidget * widget) override + { + qobject_cast(widget)->saveSettings(); + if (HttpSettings::isEnabled()) + m_service->start(); + else + m_service->stop(); + } +private: + Service *m_service; }; #endif diff --git a/src/gui/SettingsWidget.cpp b/src/gui/SettingsWidget.cpp index ef153c123..660d5a864 100644 --- a/src/gui/SettingsWidget.cpp +++ b/src/gui/SettingsWidget.cpp @@ -58,8 +58,8 @@ SettingsWidget::SettingsWidget(QWidget* parent) m_secUi->setupUi(m_secWidget); m_generalUi->setupUi(m_generalWidget); - addPage(tr("General"), FilePath::instance()->icon("apps", "keepassxc"), m_generalWidget); - addPage(tr("Security"), FilePath::instance()->icon("apps", "keepassxc"), m_secWidget); + addPage(tr("General"), FilePath::instance()->icon("categories", "preferences-other"), m_generalWidget); + addPage(tr("Security"), FilePath::instance()->icon("status", "security-high"), m_secWidget); m_generalUi->autoTypeShortcutWidget->setVisible(autoType()->isAvailable()); m_generalUi->autoTypeShortcutLabel->setVisible(autoType()->isAvailable()); @@ -88,12 +88,12 @@ SettingsWidget::~SettingsWidget() { } -void SettingsWidget::addSettingsPage(ISettingsPage *page) +void SettingsWidget::addSettingsPage(ISettingsPage* page) { - QWidget * widget = page->createWidget(); + QWidget* widget = page->createWidget(); widget->setParent(this); m_extraPages.append(ExtraPage(page, widget)); - addPage(page->name(), FilePath::instance()->icon("apps", "keepassxc"), widget); + addPage(page->name(), page->icon(), widget); } void SettingsWidget::loadSettings() diff --git a/src/gui/SettingsWidget.h b/src/gui/SettingsWidget.h index 236206299..e94f48767 100644 --- a/src/gui/SettingsWidget.h +++ b/src/gui/SettingsWidget.h @@ -29,6 +29,7 @@ class ISettingsPage { public: virtual ~ISettingsPage() {} virtual QString name() = 0; + virtual QIcon icon() = 0; virtual QWidget * createWidget() = 0; virtual void loadSettings(QWidget * widget) = 0; virtual void saveSettings(QWidget * widget) = 0; diff --git a/src/gui/entry/EditEntryWidget.cpp b/src/gui/entry/EditEntryWidget.cpp index ff75540af..51e0bb735 100644 --- a/src/gui/entry/EditEntryWidget.cpp +++ b/src/gui/entry/EditEntryWidget.cpp @@ -90,7 +90,7 @@ EditEntryWidget::~EditEntryWidget() void EditEntryWidget::setupMain() { m_mainUi->setupUi(m_mainWidget); - addPage(tr("Entry"), FilePath::instance()->icon("apps", "keepassxc"), m_mainWidget); + addPage(tr("Entry"), FilePath::instance()->icon("actions", "document-edit"), m_mainWidget); m_mainUi->togglePasswordButton->setIcon(filePath()->onOffIcon("actions", "password-show")); m_mainUi->togglePasswordGeneratorButton->setIcon(filePath()->icon("actions", "password-generator", false)); @@ -115,7 +115,7 @@ void EditEntryWidget::setupMain() void EditEntryWidget::setupAdvanced() { m_advancedUi->setupUi(m_advancedWidget); - addPage(tr("Advanced"), FilePath::instance()->icon("apps", "keepassxc"), m_advancedWidget); + addPage(tr("Advanced"), FilePath::instance()->icon("categories", "preferences-other"), m_advancedWidget); m_attachmentsModel->setEntryAttachments(m_entryAttachments); m_advancedUi->attachmentsView->setModel(m_attachmentsModel); @@ -139,13 +139,13 @@ void EditEntryWidget::setupAdvanced() void EditEntryWidget::setupIcon() { - addPage(tr("Icon"), FilePath::instance()->icon("apps", "keepassxc"), m_iconsWidget); + addPage(tr("Icon"), FilePath::instance()->icon("apps", "preferences-desktop-icons"), m_iconsWidget); } void EditEntryWidget::setupAutoType() { m_autoTypeUi->setupUi(m_autoTypeWidget); - addPage(tr("Auto-Type"), FilePath::instance()->icon("apps", "keepassxc"), m_autoTypeWidget); + addPage(tr("Auto-Type"), FilePath::instance()->icon("actions", "key-enter"), m_autoTypeWidget); m_autoTypeDefaultSequenceGroup->addButton(m_autoTypeUi->inheritSequenceButton); m_autoTypeDefaultSequenceGroup->addButton(m_autoTypeUi->customSequenceButton); @@ -177,13 +177,13 @@ void EditEntryWidget::setupAutoType() void EditEntryWidget::setupProperties() { - addPage(tr("Properties"), FilePath::instance()->icon("apps", "keepassxc"), m_editWidgetProperties); + addPage(tr("Properties"), FilePath::instance()->icon("actions", "document-properties"), m_editWidgetProperties); } void EditEntryWidget::setupHistory() { m_historyUi->setupUi(m_historyWidget); - addPage(tr("History"), FilePath::instance()->icon("apps", "keepassxc"), m_historyWidget); + addPage(tr("History"), FilePath::instance()->icon("actions", "view-history"), m_historyWidget); m_sortModel->setSourceModel(m_historyModel); m_sortModel->setDynamicSortFilter(true);