Hard code copy action for default attributes.

This commit is contained in:
Florian Geyer 2013-12-01 09:43:41 +01:00
parent 3e4811791a
commit 4a3da3abe7
7 changed files with 113 additions and 26 deletions

View file

@ -288,6 +288,21 @@ void DatabaseWidget::deleteEntries()
}
}
void DatabaseWidget::copyTitle()
{
Entry* currentEntry = m_entryView->currentEntry();
if (!currentEntry) {
Q_ASSERT(false);
return;
}
clipboard()->setText(currentEntry->title());
if (config()->get("MinimizeOnCopy").toBool()) {
window()->showMinimized();
}
}
void DatabaseWidget::copyUsername()
{
Entry* currentEntry = m_entryView->currentEntry();
@ -318,6 +333,36 @@ void DatabaseWidget::copyPassword()
}
}
void DatabaseWidget::copyURL()
{
Entry* currentEntry = m_entryView->currentEntry();
if (!currentEntry) {
Q_ASSERT(false);
return;
}
clipboard()->setText(currentEntry->url());
if (config()->get("MinimizeOnCopy").toBool()) {
window()->showMinimized();
}
}
void DatabaseWidget::copyNotes()
{
Entry* currentEntry = m_entryView->currentEntry();
if (!currentEntry) {
Q_ASSERT(false);
return;
}
clipboard()->setText(currentEntry->notes());
if (config()->get("MinimizeOnCopy").toBool()) {
window()->showMinimized();
}
}
void DatabaseWidget::copyAttribute(QAction* action)
{
Entry* currentEntry = m_entryView->currentEntry();