mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-26 16:25:23 -04:00
Refactored DatabaseWidget::currentEntryHas*()
This commit is contained in:
parent
a599787a25
commit
b45437d502
3 changed files with 16 additions and 16 deletions
|
@ -907,7 +907,7 @@ bool DatabaseWidget::isGroupSelected() const
|
||||||
return m_groupView->currentGroup() != Q_NULLPTR;
|
return m_groupView->currentGroup() != Q_NULLPTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DatabaseWidget::hasTitle()
|
bool DatabaseWidget::currentEntryHasTitle()
|
||||||
{
|
{
|
||||||
Entry* currentEntry = m_entryView->currentEntry();
|
Entry* currentEntry = m_entryView->currentEntry();
|
||||||
if (!currentEntry) {
|
if (!currentEntry) {
|
||||||
|
@ -917,7 +917,7 @@ bool DatabaseWidget::hasTitle()
|
||||||
return !currentEntry->title().isEmpty();
|
return !currentEntry->title().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DatabaseWidget::hasUsername()
|
bool DatabaseWidget::currentEntryHasUsername()
|
||||||
{
|
{
|
||||||
Entry* currentEntry = m_entryView->currentEntry();
|
Entry* currentEntry = m_entryView->currentEntry();
|
||||||
if (!currentEntry) {
|
if (!currentEntry) {
|
||||||
|
@ -927,7 +927,7 @@ bool DatabaseWidget::hasUsername()
|
||||||
return !currentEntry->username().isEmpty();
|
return !currentEntry->username().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DatabaseWidget::hasPassword()
|
bool DatabaseWidget::currentEntryHasPassword()
|
||||||
{
|
{
|
||||||
Entry* currentEntry = m_entryView->currentEntry();
|
Entry* currentEntry = m_entryView->currentEntry();
|
||||||
if (!currentEntry) {
|
if (!currentEntry) {
|
||||||
|
@ -937,7 +937,7 @@ bool DatabaseWidget::hasPassword()
|
||||||
return !currentEntry->password().isEmpty();
|
return !currentEntry->password().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DatabaseWidget::hasUrl()
|
bool DatabaseWidget::currentEntryHasUrl()
|
||||||
{
|
{
|
||||||
Entry* currentEntry = m_entryView->currentEntry();
|
Entry* currentEntry = m_entryView->currentEntry();
|
||||||
if (!currentEntry) {
|
if (!currentEntry) {
|
||||||
|
@ -947,7 +947,7 @@ bool DatabaseWidget::hasUrl()
|
||||||
return !currentEntry->url().isEmpty();
|
return !currentEntry->url().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DatabaseWidget::hasNotes()
|
bool DatabaseWidget::currentEntryHasNotes()
|
||||||
{
|
{
|
||||||
Entry* currentEntry = m_entryView->currentEntry();
|
Entry* currentEntry = m_entryView->currentEntry();
|
||||||
if (!currentEntry) {
|
if (!currentEntry) {
|
||||||
|
|
|
@ -80,11 +80,11 @@ public:
|
||||||
QList<int> entryHeaderViewSizes() const;
|
QList<int> entryHeaderViewSizes() const;
|
||||||
void setEntryViewHeaderSizes(const QList<int>& sizes);
|
void setEntryViewHeaderSizes(const QList<int>& sizes);
|
||||||
void clearAllWidgets();
|
void clearAllWidgets();
|
||||||
bool hasTitle();
|
bool currentEntryHasTitle();
|
||||||
bool hasUsername();
|
bool currentEntryHasUsername();
|
||||||
bool hasPassword();
|
bool currentEntryHasPassword();
|
||||||
bool hasUrl();
|
bool currentEntryHasUrl();
|
||||||
bool hasNotes();
|
bool currentEntryHasNotes();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void closeRequest();
|
void closeRequest();
|
||||||
|
|
|
@ -286,14 +286,14 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode)
|
||||||
m_ui->actionEntryClone->setEnabled(singleEntrySelected && !inSearch);
|
m_ui->actionEntryClone->setEnabled(singleEntrySelected && !inSearch);
|
||||||
m_ui->actionEntryEdit->setEnabled(singleEntrySelected);
|
m_ui->actionEntryEdit->setEnabled(singleEntrySelected);
|
||||||
m_ui->actionEntryDelete->setEnabled(entriesSelected);
|
m_ui->actionEntryDelete->setEnabled(entriesSelected);
|
||||||
m_ui->actionEntryCopyTitle->setEnabled(singleEntrySelected && dbWidget->hasTitle());
|
m_ui->actionEntryCopyTitle->setEnabled(singleEntrySelected && dbWidget->currentEntryHasTitle());
|
||||||
m_ui->actionEntryCopyUsername->setEnabled(singleEntrySelected && dbWidget->hasUsername());
|
m_ui->actionEntryCopyUsername->setEnabled(singleEntrySelected && dbWidget->currentEntryHasUsername());
|
||||||
m_ui->actionEntryCopyPassword->setEnabled(singleEntrySelected && dbWidget->hasPassword());
|
m_ui->actionEntryCopyPassword->setEnabled(singleEntrySelected && dbWidget->currentEntryHasPassword());
|
||||||
m_ui->actionEntryCopyURL->setEnabled(singleEntrySelected && dbWidget->hasUrl());
|
m_ui->actionEntryCopyURL->setEnabled(singleEntrySelected && dbWidget->currentEntryHasUrl());
|
||||||
m_ui->actionEntryCopyNotes->setEnabled(singleEntrySelected && dbWidget->hasUrl());
|
m_ui->actionEntryCopyNotes->setEnabled(singleEntrySelected && dbWidget->currentEntryHasUrl());
|
||||||
m_ui->menuEntryCopyAttribute->setEnabled(singleEntrySelected);
|
m_ui->menuEntryCopyAttribute->setEnabled(singleEntrySelected);
|
||||||
m_ui->actionEntryAutoType->setEnabled(singleEntrySelected);
|
m_ui->actionEntryAutoType->setEnabled(singleEntrySelected);
|
||||||
m_ui->actionEntryOpenUrl->setEnabled(singleEntrySelected && dbWidget->hasUrl());
|
m_ui->actionEntryOpenUrl->setEnabled(singleEntrySelected && dbWidget->currentEntryHasUrl());
|
||||||
m_ui->actionGroupNew->setEnabled(groupSelected);
|
m_ui->actionGroupNew->setEnabled(groupSelected);
|
||||||
m_ui->actionGroupEdit->setEnabled(groupSelected);
|
m_ui->actionGroupEdit->setEnabled(groupSelected);
|
||||||
m_ui->actionGroupDelete->setEnabled(groupSelected && dbWidget->canDeleteCurrentGroup());
|
m_ui->actionGroupDelete->setEnabled(groupSelected && dbWidget->canDeleteCurrentGroup());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue