Move category tab widgets to separate widget and hide history category when there is no history

This commit is contained in:
Janek Bevendorff 2017-02-22 01:05:24 +01:00
parent 851c7b891e
commit cee297b218
No known key found for this signature in database
GPG key ID: CFEC2F6850BFFA53
11 changed files with 412 additions and 212 deletions

View file

@ -90,7 +90,7 @@ EditEntryWidget::~EditEntryWidget()
void EditEntryWidget::setupMain()
{
m_mainUi->setupUi(m_mainWidget);
add(tr("Entry"), m_mainWidget);
addPage(tr("Entry"), FilePath::instance()->icon("apps", "keepassxc"), 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);
add(tr("Advanced"), m_advancedWidget);
addPage(tr("Advanced"), FilePath::instance()->icon("apps", "keepassxc"), m_advancedWidget);
m_attachmentsModel->setEntryAttachments(m_entryAttachments);
m_advancedUi->attachmentsView->setModel(m_attachmentsModel);
@ -139,13 +139,13 @@ void EditEntryWidget::setupAdvanced()
void EditEntryWidget::setupIcon()
{
add(tr("Icon"), m_iconsWidget);
addPage(tr("Icon"), FilePath::instance()->icon("apps", "keepassxc"), m_iconsWidget);
}
void EditEntryWidget::setupAutoType()
{
m_autoTypeUi->setupUi(m_autoTypeWidget);
add(tr("Auto-Type"), m_autoTypeWidget);
addPage(tr("Auto-Type"), FilePath::instance()->icon("apps", "keepassxc"), m_autoTypeWidget);
m_autoTypeDefaultSequenceGroup->addButton(m_autoTypeUi->inheritSequenceButton);
m_autoTypeDefaultSequenceGroup->addButton(m_autoTypeUi->customSequenceButton);
@ -177,13 +177,13 @@ void EditEntryWidget::setupAutoType()
void EditEntryWidget::setupProperties()
{
add(tr("Properties"), m_editWidgetProperties);
addPage(tr("Properties"), FilePath::instance()->icon("apps", "keepassxc"), m_editWidgetProperties);
}
void EditEntryWidget::setupHistory()
{
m_historyUi->setupUi(m_historyWidget);
add(tr("History"), m_historyWidget);
addPage(tr("History"), FilePath::instance()->icon("apps", "keepassxc"), m_historyWidget);
m_sortModel->setSourceModel(m_historyModel);
m_sortModel->setDynamicSortFilter(true);
@ -291,8 +291,8 @@ void EditEntryWidget::loadEntry(Entry* entry, bool create, bool history, const Q
setForms(entry);
setReadOnly(m_history);
setCurrentRow(0);
setRowHidden(m_historyWidget, m_history);
setCurrentPage(0);
setPageHidden(m_historyWidget, m_history || m_entry->historyItems().count() < 1);
}
void EditEntryWidget::setForms(const Entry* entry, bool restore)