From 5469666a08e4d057e679cc36767ef261335b6d9f Mon Sep 17 00:00:00 2001 From: sniperbeamer Date: Sun, 22 Mar 2009 13:58:59 +0000 Subject: [PATCH] Fix: "Show Toolbar" menu entry not being retranslated Fix: Selecting entry opens for editing (Bug #2703031) Improve .desktop file to make openSUSE happy git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@298 b624d157-de02-0410-bad0-e51aec6abb33 --- share/applications/keepassx.desktop | 3 ++- src/lib/EntryView.cpp | 9 ++++++--- src/lib/EntryView.h | 1 + src/mainwindow.cpp | 2 ++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/share/applications/keepassx.desktop b/share/applications/keepassx.desktop index 260ce3e..a66c60e 100644 --- a/share/applications/keepassx.desktop +++ b/share/applications/keepassx.desktop @@ -12,5 +12,6 @@ Comment[es]=Gestor de contraseñas multiplataforma Comment[fr]=Gestionnaire de mot de passe Terminal=false Type=Application -Categories=Qt;Utility; +Categories=Qt;Utility;Security; MimeType=application/x-keepass; +X-SuSE-translate=true diff --git a/src/lib/EntryView.cpp b/src/lib/EntryView.cpp index ce34208..c4844b2 100644 --- a/src/lib/EntryView.cpp +++ b/src/lib/EntryView.cpp @@ -276,10 +276,9 @@ void KeepassEntryView::OnNewEntry(){ } void KeepassEntryView::OnEntryActivated(QTreeWidgetItem* item,int Column){ + Q_UNUSED(item); + switch (columnListIndex(Column)){ - case 0: - editEntry((EntryViewItem*)item); - break; case 1: OnUsernameToClipboard(); break; @@ -290,7 +289,11 @@ void KeepassEntryView::OnEntryActivated(QTreeWidgetItem* item,int Column){ OnPasswordToClipboard(); break; } +} +void KeepassEntryView::OnEntryDblClicked(QTreeWidgetItem* item,int Column){ + if (columnListIndex(Column) == 0) + editEntry((EntryViewItem*)item); } void KeepassEntryView::OnEditEntry(){ diff --git a/src/lib/EntryView.h b/src/lib/EntryView.h index 9842b6c..7b0781b 100644 --- a/src/lib/EntryView.h +++ b/src/lib/EntryView.h @@ -78,6 +78,7 @@ class KeepassEntryView:public QTreeWidget{ void OnGroupChanged(IGroupHandle* group); void OnShowSearchResults(); void OnEntryActivated(QTreeWidgetItem*,int); + void OnEntryDblClicked(QTreeWidgetItem*,int); void OnNewEntry(); void OnItemsChanged(); void updateIcons(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2afa592..5c90d96 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -190,6 +190,7 @@ void KeepassMainWindow::setupConnections(){ connect(HelpAboutAction,SIGNAL(triggered()),this,SLOT(OnHelpAbout())); connect(EntryView,SIGNAL(itemActivated(QTreeWidgetItem*,int)),EntryView,SLOT(OnEntryActivated(QTreeWidgetItem*,int))); + connect(EntryView,SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),EntryView,SLOT(OnEntryDblClicked(QTreeWidgetItem*,int))); connect(QuickSearchEdit,SIGNAL(returnPressed()), this, SLOT(OnQuickSearch())); connect(GroupView,SIGNAL(groupChanged(IGroupHandle*)),EntryView,SLOT(OnGroupChanged(IGroupHandle*))); connect(GroupView,SIGNAL(groupChanged(IGroupHandle*)),this,SLOT(OnGroupSelectionChanged(IGroupHandle*))); @@ -1101,6 +1102,7 @@ void KeepassMainWindow::OnExtrasSettings(){ if (config->language() != oldLang){ retranslateUi(this); WorkspaceLockedWidget.retranslateUi(LockedCentralWidget); + ViewShowToolbarAction->setText(tr("Show &Toolbar")); EntryView->updateColumns(); if (FileOpen) { if (db->file())