Skip to content

Commit

Permalink
Feature/toggle groups panel option (keepassxreboot#5247)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesalazar authored Oct 9, 2020
1 parent 34b44e7 commit fa546c4
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/topics/UserInterface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The KeePassXC interface is designed for simplicity and easy access to your infor
.Main database interface
image::main_interface.png[]

*(A) Groups* - Organize your entries into discrete groups to bring order to all of your sensitive information. Groups can be nested under each other to create a hierarchy. Settings from parent groups get applied to their children.
*(A) Groups* - Organize your entries into discrete groups to bring order to all of your sensitive information. Groups can be nested under each other to create a hierarchy. Settings from parent groups get applied to their children. You can hide this panel on the View menu.

*(B) Entries* - Entries contain all the information for each website or application you are storing in KeePassXC. This view shows all the entries in the selected group. Each column can be resized, reordered, and shown or hidden based on your preference. Right click the header row to see all available options.

Expand Down
4 changes: 4 additions & 0 deletions share/translations/keepassx_en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4879,6 +4879,10 @@ Expect some bugs and minor issues, this version is not meant for production use.
<source>Show Toolbar</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show Groups Panel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Show Preview Panel</source>
<translation type="unfinished"></translation>
Expand Down
1 change: 1 addition & 0 deletions src/core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
{Config::GUI_Language, {QS("GUI/Language"), Roaming, QS("system")}},
{Config::GUI_HideToolbar, {QS("GUI/HideToolbar"), Roaming, false}},
{Config::GUI_MovableToolbar, {QS("GUI/MovableToolbar"), Roaming, false}},
{Config::GUI_HideGroupsPanel, {QS("GUI/HideGroupsPanel"), Roaming, false}},
{Config::GUI_HidePreviewPanel, {QS("GUI/HidePreviewPanel"), Roaming, false}},
{Config::GUI_ToolButtonStyle, {QS("GUI/ToolButtonStyle"), Roaming, Qt::ToolButtonIconOnly}},
{Config::GUI_ShowTrayIcon, {QS("GUI/ShowTrayIcon"), Roaming, false}},
Expand Down
1 change: 1 addition & 0 deletions src/core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class Config : public QObject
GUI_Language,
GUI_HideToolbar,
GUI_MovableToolbar,
GUI_HideGroupsPanel,
GUI_HidePreviewPanel,
GUI_ToolButtonStyle,
GUI_ShowTrayIcon,
Expand Down
5 changes: 5 additions & 0 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1792,6 +1792,11 @@ void MainWindow::initViewMenu()
applySettingsChanges();
});

m_ui->actionShowGroupsPanel->setChecked(!config()->get(Config::GUI_HideGroupsPanel).toBool());
connect(m_ui->actionShowGroupsPanel, &QAction::toggled, this, [](bool checked) {
config()->set(Config::GUI_HideGroupsPanel, !checked);
});

m_ui->actionShowPreviewPanel->setChecked(!config()->get(Config::GUI_HidePreviewPanel).toBool());
connect(m_ui->actionShowPreviewPanel, &QAction::toggled, this, [](bool checked) {
config()->set(Config::GUI_HidePreviewPanel, !checked);
Expand Down
12 changes: 12 additions & 0 deletions src/gui/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@
</widget>
<addaction name="menuTheme"/>
<addaction name="actionCompactMode"/>
<addaction name="actionShowGroupsPanel"/>
<addaction name="actionShowPreviewPanel"/>
<addaction name="actionShowToolbar"/>
</widget>
Expand Down Expand Up @@ -961,6 +962,17 @@
<string>Show Toolbar</string>
</property>
</action>
<action name="actionShowGroupsPanel">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>Show Groups Panel</string>
</property>
</action>
<action name="actionShowPreviewPanel">
<property name="checkable">
<bool>true</bool>
Expand Down
8 changes: 8 additions & 0 deletions src/gui/group/GroupView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <QMimeData>
#include <QShortcut>

#include "core/Config.h"
#include "core/Database.h"
#include "core/Group.h"
#include "gui/group/GroupModel.h"
Expand Down Expand Up @@ -52,6 +53,13 @@ GroupView::GroupView(Database* db, QWidget* parent)
viewport()->setAcceptDrops(true);
setDropIndicatorShown(true);
setDefaultDropAction(Qt::MoveAction);
setVisible(!config()->get(Config::GUI_HideGroupsPanel).toBool());

connect(config(), &Config::changed, this, [this](Config::ConfigKey key) {
if (key == Config::GUI_HideGroupsPanel) {
setVisible(!config()->get(Config::GUI_HideGroupsPanel).toBool());
}
});
}

void GroupView::contextMenuShortcutPressed()
Expand Down

0 comments on commit fa546c4

Please sign in to comment.