mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-15 01:07:27 -05:00
Small refactoring in EditWidget and EditEntryWidget.
This commit is contained in:
parent
25f15073cc
commit
b0280e9d93
@ -46,9 +46,12 @@ void EditWidget::add(const QString& labelText, QWidget* widget)
|
|||||||
m_ui->stackedWidget->addWidget(widget);
|
m_ui->stackedWidget->addWidget(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditWidget::setRowHidden(int row, bool hide)
|
void EditWidget::setRowHidden(QWidget* widget, bool hide)
|
||||||
{
|
{
|
||||||
|
int row = m_ui->stackedWidget->indexOf(widget);
|
||||||
|
if (row != -1) {
|
||||||
m_ui->categoryList->item(row)->setHidden(hide);
|
m_ui->categoryList->item(row)->setHidden(hide);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditWidget::setCurrentRow(int index)
|
void EditWidget::setCurrentRow(int index)
|
||||||
|
@ -37,7 +37,7 @@ public:
|
|||||||
~EditWidget();
|
~EditWidget();
|
||||||
|
|
||||||
void add(const QString& labelText, QWidget* widget);
|
void add(const QString& labelText, QWidget* widget);
|
||||||
void setRowHidden(int row, bool hide);
|
void setRowHidden(QWidget *widget, bool hide);
|
||||||
void setCurrentRow(int index);
|
void setCurrentRow(int index);
|
||||||
void setHeadline(const QString& text);
|
void setHeadline(const QString& text);
|
||||||
QLabel* headlineLabel();
|
QLabel* headlineLabel();
|
||||||
|
@ -73,7 +73,6 @@ EditEntryWidget::EditEntryWidget(QWidget* parent)
|
|||||||
setupIcon();
|
setupIcon();
|
||||||
setupAutoType();
|
setupAutoType();
|
||||||
setupProperties();
|
setupProperties();
|
||||||
// when adding a new row, update setRowHidden() call
|
|
||||||
setupHistory();
|
setupHistory();
|
||||||
|
|
||||||
connect(this, SIGNAL(accepted()), SLOT(saveEntry()));
|
connect(this, SIGNAL(accepted()), SLOT(saveEntry()));
|
||||||
@ -280,7 +279,7 @@ void EditEntryWidget::loadEntry(Entry* entry, bool create, bool history, const Q
|
|||||||
setForms(entry);
|
setForms(entry);
|
||||||
|
|
||||||
setCurrentRow(0);
|
setCurrentRow(0);
|
||||||
setRowHidden(6, m_history);
|
setRowHidden(m_historyWidget, m_history);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditEntryWidget::setForms(const Entry* entry, bool restore)
|
void EditEntryWidget::setForms(const Entry* entry, bool restore)
|
||||||
|
Loading…
Reference in New Issue
Block a user