if (!CurrentGroup){ // We must be viewing search results. Add the new entry to the first group.
if (db->groups().size() > 0)
if (!CurrentGroup){ // We must be viewing search results. Add the new entry to the first group.
if (db->groups().size() > 0)
else{
QMessageBox::critical(NULL,tr("Error"),tr("At least one group must exist before adding an entry."),tr("OK"));
}
}
else{
QMessageBox::critical(NULL,tr("Error"),tr("At least one group must exist before adding an entry."),tr("OK"));
}
}
CEditEntryDlg dlg(db,NewEntry,this,true);
if(!dlg.exec()){
db->deleteLastEntry();
CEditEntryDlg dlg(db,NewEntry,this,true);
if(!dlg.exec()){
db->deleteLastEntry();
emit fileModified();
if (header()->isSortIndicatorShown())
sortByColumn(header()->sortIndicatorSection(), header()->sortIndicatorOrder());
emit fileModified();
if (header()->isSortIndicatorShown())
sortByColumn(header()->sortIndicatorSection(), header()->sortIndicatorOrder());
void KeepassEntryView::OnEditCopyUrl(){
if (selectedItems().size() == 0) return;
QString url = ((EntryViewItem*)selectedItems().first())->EntryHandle->url();
void KeepassEntryView::OnEditCopyUrl(){
if (selectedItems().size() == 0) return;
QString url = ((EntryViewItem*)selectedItems().first())->EntryHandle->url();
void KeepassEntryView::OnUsernameToClipboard(){
if (selectedItems().size() == 0) return;
QString username = ((EntryViewItem*)selectedItems().first())->EntryHandle->username();
void KeepassEntryView::OnUsernameToClipboard(){
if (selectedItems().size() == 0) return;
QString username = ((EntryViewItem*)selectedItems().first())->EntryHandle->username();
Clipboard->setText(username, QClipboard::Clipboard);
if(Clipboard->supportsSelection()){
Clipboard->setText(username, QClipboard::Selection);
}
Clipboard->setText(username, QClipboard::Clipboard);
if(Clipboard->supportsSelection()){
Clipboard->setText(username, QClipboard::Selection);
}
Clipboard->setText(password.string(), QClipboard::Clipboard);
if(Clipboard->supportsSelection()){
Clipboard->setText(password.string(), QClipboard::Selection);
}
Clipboard->setText(password.string(), QClipboard::Clipboard);
if(Clipboard->supportsSelection()){
Clipboard->setText(password.string(), QClipboard::Selection);
}