AutoType: GUI connections,
Added French translation git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@71 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
parent
9e8f6a336a
commit
079f3c8ace
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
|
@ -60,9 +60,24 @@ switch(mods){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AutoType::perform(const QString& string){
|
void AutoType::perform(CEntry* entry, QString& err){
|
||||||
QString str=string;
|
QString str;
|
||||||
//replace all {..} string templates
|
int c=entry->Additional.count("Auto-Type:");
|
||||||
|
if(c>1){
|
||||||
|
err=tr("More than one 'Auto-Type:' key sequence found.\nAllowed is only one per entry.");
|
||||||
|
return;}
|
||||||
|
if(c==1){
|
||||||
|
int start=entry->Additional.indexOf("Auto-Type:")+10;
|
||||||
|
int len;
|
||||||
|
if(entry->Additional.size()==10)return;
|
||||||
|
for(len=0;len<entry->Additional.size();len++){
|
||||||
|
if(entry->Additional.size()==(start+len))break;
|
||||||
|
if(entry->Additional.at(start+len)==QChar('\n'))break;}
|
||||||
|
if(!len)return;
|
||||||
|
str=entry->Additional.mid(start,len);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
str="{USERNAME}{TAB}{PASSWORD}{ENTER}";
|
||||||
|
|
||||||
QList<Q_UINT16> Keys;
|
QList<Q_UINT16> Keys;
|
||||||
for(int i=0;i<str.length();i++){
|
for(int i=0;i<str.length();i++){
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#ifndef _AUTOTYPE_H_
|
#ifndef _AUTOTYPE_H_
|
||||||
#define _AUTOTYPE_H_
|
#define _AUTOTYPE_H_
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
|
@ -30,16 +31,17 @@
|
||||||
#include <X11/keysymdef.h>
|
#include <X11/keysymdef.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include "Database.h"
|
||||||
|
|
||||||
typedef struct tKeysymMap{
|
typedef struct tKeysymMap{
|
||||||
Q_UINT16 keysym;
|
Q_UINT16 keysym;
|
||||||
Q_UINT16 unicode;
|
Q_UINT16 unicode;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AutoType{
|
class AutoType:public QObject{
|
||||||
public:
|
public:
|
||||||
static QWidget* MainWin;
|
static QWidget* MainWin;
|
||||||
static void perform(const QString& KeePassAutoTypeString);
|
static void perform(CEntry* entry,QString& errors);
|
||||||
private:
|
private:
|
||||||
static tKeysymMap KeysymMap[];
|
static tKeysymMap KeysymMap[];
|
||||||
static Q_UINT16 getKeysym(const QChar& unicode);
|
static Q_UINT16 getKeysym(const QChar& unicode);
|
||||||
|
|
|
@ -72,7 +72,7 @@ QIcon *Icon_EditOpenUrl;
|
||||||
QIcon *Icon_EditSearch;
|
QIcon *Icon_EditSearch;
|
||||||
QIcon *Icon_Configure;
|
QIcon *Icon_Configure;
|
||||||
QIcon *Icon_Help;
|
QIcon *Icon_Help;
|
||||||
|
QIcon *Icon_AutoType;
|
||||||
|
|
||||||
inline void loadImages();
|
inline void loadImages();
|
||||||
inline void parseCmdLineArgs(int argc, char** argv,QString &ArgFile,QString& ArgCfg);
|
inline void parseCmdLineArgs(int argc, char** argv,QString &ArgFile,QString& ArgCfg);
|
||||||
|
@ -280,6 +280,7 @@ _loadIcon(Icon_EditOpenUrl,"/actions/run.png");
|
||||||
_loadIcon(Icon_EditSearch,"/actions/find.png");
|
_loadIcon(Icon_EditSearch,"/actions/find.png");
|
||||||
_loadIcon(Icon_Configure,"/actions/configure.png");
|
_loadIcon(Icon_Configure,"/actions/configure.png");
|
||||||
_loadIcon(Icon_Help,"/actions/help.png");
|
_loadIcon(Icon_Help,"/actions/help.png");
|
||||||
|
_loadIcon(Icon_AutoType,"/apps/ktouch.png");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,7 @@ extern QIcon *Icon_EditOpenUrl;
|
||||||
extern QIcon *Icon_EditSearch;
|
extern QIcon *Icon_EditSearch;
|
||||||
extern QIcon *Icon_Configure;
|
extern QIcon *Icon_Configure;
|
||||||
extern QIcon *Icon_Help;
|
extern QIcon *Icon_Help;
|
||||||
|
extern QIcon *Icon_AutoType;
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -113,6 +113,7 @@ void KeepassMainWindow::setupConnections(){
|
||||||
connect(EditSaveAttachmentAction, SIGNAL(triggered()), this, SLOT(OnEditSaveAttachment()));
|
connect(EditSaveAttachmentAction, SIGNAL(triggered()), this, SLOT(OnEditSaveAttachment()));
|
||||||
connect(EditSearchAction, SIGNAL(triggered()), this, SLOT(OnEditSearch()));
|
connect(EditSearchAction, SIGNAL(triggered()), this, SLOT(OnEditSearch()));
|
||||||
connect(EditGroupSearchAction, SIGNAL(triggered()), this, SLOT(OnEditGroupSearch()));
|
connect(EditGroupSearchAction, SIGNAL(triggered()), this, SLOT(OnEditGroupSearch()));
|
||||||
|
connect(EditAutoTypeAction,SIGNAL(triggered()),this,SLOT(OnEditAutoType()));
|
||||||
|
|
||||||
connect(ViewShowToolbarAction,SIGNAL(toggled(bool)),this,SLOT(OnViewShowToolbar(bool)));
|
connect(ViewShowToolbarAction,SIGNAL(toggled(bool)),this,SLOT(OnViewShowToolbar(bool)));
|
||||||
connect(ViewShowEntryDetailsAction,SIGNAL(toggled(bool)),this,SLOT(OnViewShowEntryDetails(bool)));
|
connect(ViewShowEntryDetailsAction,SIGNAL(toggled(bool)),this,SLOT(OnViewShowEntryDetails(bool)));
|
||||||
|
@ -194,6 +195,7 @@ EditDeleteGroupAction->setIcon(*Icon_EditDelete);
|
||||||
EditSearchAction->setIcon(*Icon_EditSearch);
|
EditSearchAction->setIcon(*Icon_EditSearch);
|
||||||
EditGroupSearchAction->setIcon(*Icon_EditSearch);
|
EditGroupSearchAction->setIcon(*Icon_EditSearch);
|
||||||
ExtrasSettingsAction->setIcon(*Icon_Configure);
|
ExtrasSettingsAction->setIcon(*Icon_Configure);
|
||||||
|
EditAutoTypeAction->setIcon(*Icon_AutoType);
|
||||||
HelpHandbookAction->setIcon(*Icon_Help);
|
HelpHandbookAction->setIcon(*Icon_Help);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,6 +213,7 @@ void KeepassMainWindow::setupMenus(){
|
||||||
EntryView->ContextMenu->addAction(EditUsernameToClipboardAction);
|
EntryView->ContextMenu->addAction(EditUsernameToClipboardAction);
|
||||||
EntryView->ContextMenu->addAction(EditOpenUrlAction);
|
EntryView->ContextMenu->addAction(EditOpenUrlAction);
|
||||||
EntryView->ContextMenu->addAction(EditSaveAttachmentAction);
|
EntryView->ContextMenu->addAction(EditSaveAttachmentAction);
|
||||||
|
EntryView->ContextMenu->addAction(EditAutoTypeAction);
|
||||||
EntryView->ContextMenu->addSeparator();
|
EntryView->ContextMenu->addSeparator();
|
||||||
EntryView->ContextMenu->addAction(EditNewEntryAction);
|
EntryView->ContextMenu->addAction(EditNewEntryAction);
|
||||||
EntryView->ContextMenu->addAction(EditEditEntryAction);
|
EntryView->ContextMenu->addAction(EditEditEntryAction);
|
||||||
|
@ -245,6 +248,7 @@ void KeepassMainWindow::setupMenus(){
|
||||||
EditDeleteEntryAction->setShortcut(tr("Ctrl+D"));
|
EditDeleteEntryAction->setShortcut(tr("Ctrl+D"));
|
||||||
EditCloneEntryAction->setShortcut(tr("Ctrl+K"));
|
EditCloneEntryAction->setShortcut(tr("Ctrl+K"));
|
||||||
EditSearchAction->setShortcut(tr("Ctrl+F"));
|
EditSearchAction->setShortcut(tr("Ctrl+F"));
|
||||||
|
EditAutoTypeAction->setShortcut(tr("Ctrl+V"));
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
FileCloseAction->setShortcut(tr("Ctrl+W"));
|
FileCloseAction->setShortcut(tr("Ctrl+W"));
|
||||||
FileSaveAsAction->setShortcut(tr("Shift+Ctrl+S"));
|
FileSaveAsAction->setShortcut(tr("Shift+Ctrl+S"));
|
||||||
|
@ -502,6 +506,7 @@ switch(EntrySelection){
|
||||||
EditCloneEntryAction->setText(tr("Clone Entry"));
|
EditCloneEntryAction->setText(tr("Clone Entry"));
|
||||||
EditDeleteEntryAction->setEnabled(false);
|
EditDeleteEntryAction->setEnabled(false);
|
||||||
EditDeleteEntryAction->setText(tr("Delete Entry"));
|
EditDeleteEntryAction->setText(tr("Delete Entry"));
|
||||||
|
EditAutoTypeAction->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
case SINGLE:
|
case SINGLE:
|
||||||
EditPasswordToClipboardAction->setEnabled(true);
|
EditPasswordToClipboardAction->setEnabled(true);
|
||||||
|
@ -513,6 +518,7 @@ switch(EntrySelection){
|
||||||
EditCloneEntryAction->setText(tr("Clone Entry"));
|
EditCloneEntryAction->setText(tr("Clone Entry"));
|
||||||
EditDeleteEntryAction->setEnabled(true);
|
EditDeleteEntryAction->setEnabled(true);
|
||||||
EditDeleteEntryAction->setText(tr("Delete Entry"));
|
EditDeleteEntryAction->setText(tr("Delete Entry"));
|
||||||
|
EditAutoTypeAction->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
case MULTIPLE:
|
case MULTIPLE:
|
||||||
EditPasswordToClipboardAction->setEnabled(false);
|
EditPasswordToClipboardAction->setEnabled(false);
|
||||||
|
@ -524,6 +530,7 @@ switch(EntrySelection){
|
||||||
EditCloneEntryAction->setText(tr("Clone Entries"));
|
EditCloneEntryAction->setText(tr("Clone Entries"));
|
||||||
EditDeleteEntryAction->setEnabled(true);
|
EditDeleteEntryAction->setEnabled(true);
|
||||||
EditDeleteEntryAction->setText(tr("Delete Entries"));
|
EditDeleteEntryAction->setText(tr("Delete Entries"));
|
||||||
|
EditAutoTypeAction->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
default: Q_ASSERT(false);
|
default: Q_ASSERT(false);
|
||||||
}
|
}
|
||||||
|
@ -539,6 +546,7 @@ switch(EntrySelection){
|
||||||
EditCloneEntryAction->setText(tr("Clone Entry"));
|
EditCloneEntryAction->setText(tr("Clone Entry"));
|
||||||
EditDeleteEntryAction->setEnabled(false);
|
EditDeleteEntryAction->setEnabled(false);
|
||||||
EditDeleteEntryAction->setText(tr("Delete Entry"));
|
EditDeleteEntryAction->setText(tr("Delete Entry"));
|
||||||
|
EditAutoTypeAction->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
case SINGLE:
|
case SINGLE:
|
||||||
EditPasswordToClipboardAction->setEnabled(true);
|
EditPasswordToClipboardAction->setEnabled(true);
|
||||||
|
@ -550,6 +558,7 @@ switch(EntrySelection){
|
||||||
EditCloneEntryAction->setText(tr("Clone Entry"));
|
EditCloneEntryAction->setText(tr("Clone Entry"));
|
||||||
EditDeleteEntryAction->setEnabled(true);
|
EditDeleteEntryAction->setEnabled(true);
|
||||||
EditDeleteEntryAction->setText(tr("Delete Entry"));
|
EditDeleteEntryAction->setText(tr("Delete Entry"));
|
||||||
|
EditAutoTypeAction->setEnabled(true);
|
||||||
break;
|
break;
|
||||||
case MULTIPLE:
|
case MULTIPLE:
|
||||||
EditPasswordToClipboardAction->setEnabled(false);
|
EditPasswordToClipboardAction->setEnabled(false);
|
||||||
|
@ -561,6 +570,7 @@ switch(EntrySelection){
|
||||||
EditCloneEntryAction->setText(tr("Clone Entries"));
|
EditCloneEntryAction->setText(tr("Clone Entries"));
|
||||||
EditDeleteEntryAction->setEnabled(true);
|
EditDeleteEntryAction->setEnabled(true);
|
||||||
EditDeleteEntryAction->setText(tr("Delete Entries"));
|
EditDeleteEntryAction->setText(tr("Delete Entries"));
|
||||||
|
EditAutoTypeAction->setEnabled(false);
|
||||||
break;
|
break;
|
||||||
default: Q_ASSERT(false);
|
default: Q_ASSERT(false);
|
||||||
}
|
}
|
||||||
|
@ -1003,3 +1013,8 @@ void KeepassMainWindow::OnItemCollaped(QTreeWidgetItem* item){
|
||||||
((GroupViewItem*)item)->pGroup->UI_ItemIsExpanded=false;
|
((GroupViewItem*)item)->pGroup->UI_ItemIsExpanded=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void KeepassMainWindow::OnEditAutoType(){
|
||||||
|
Q_ASSERT(EntryView->selectedItems().size()==1);
|
||||||
|
QString error;
|
||||||
|
AutoType::perform(((EntryViewItem*)(EntryView->selectedItems()[0]))->pEntry,error);
|
||||||
|
}
|
||||||
|
|
|
@ -80,6 +80,7 @@ private slots:
|
||||||
void OnEditOpenUrl();
|
void OnEditOpenUrl();
|
||||||
void OnEditSearch();
|
void OnEditSearch();
|
||||||
void OnEditGroupSearch();
|
void OnEditGroupSearch();
|
||||||
|
void OnEditAutoType();
|
||||||
void OnViewShowToolbar(bool);
|
void OnViewShowToolbar(bool);
|
||||||
void OnViewShowEntryDetails(bool);
|
void OnViewShowEntryDetails(bool);
|
||||||
void OnCurrentGroupChanged(QTreeWidgetItem*,QTreeWidgetItem*);
|
void OnCurrentGroupChanged(QTreeWidgetItem*,QTreeWidgetItem*);
|
||||||
|
|
|
@ -36,6 +36,7 @@ FORMS += forms/EditGroupDlg.ui \
|
||||||
TRANSLATIONS += translations/keepass-de_DE.ts \
|
TRANSLATIONS += translations/keepass-de_DE.ts \
|
||||||
translations/keepass-ru_RU.ts \
|
translations/keepass-ru_RU.ts \
|
||||||
translations/keepass-es_ES.ts \
|
translations/keepass-es_ES.ts \
|
||||||
|
translations/keepass-fr_FR.ts \
|
||||||
translations/keepass-xx_XX.ts
|
translations/keepass-xx_XX.ts
|
||||||
HEADERS += lib/IniReader.h \
|
HEADERS += lib/IniReader.h \
|
||||||
lib/UrlLabel.h \
|
lib/UrlLabel.h \
|
||||||
|
|
|
@ -45,6 +45,14 @@ General Public License (GPL) Version 2.</translation>
|
||||||
<translation>http://keepass.berlios.de/</translation>
|
<translation>http://keepass.berlios.de/</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>AutoType</name>
|
||||||
|
<message>
|
||||||
|
<source>More than one 'Auto-Type:' key sequence found.
|
||||||
|
Allowed is only one per entry.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>CAboutDialog</name>
|
<name>CAboutDialog</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -904,6 +912,10 @@ die Änderungen speichern?</translation>
|
||||||
<source>Unknown error in PwDatabase::openDatabase()</source>
|
<source>Unknown error in PwDatabase::openDatabase()</source>
|
||||||
<translation>Unbekannter Fehler in PwDatabase::openDatabase()</translation>
|
<translation>Unbekannter Fehler in PwDatabase::openDatabase()</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Ctrl+V</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MainWindow</name>
|
<name>MainWindow</name>
|
||||||
|
|
|
@ -43,6 +43,14 @@ General Public License (GPL) version 2.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>AutoType</name>
|
||||||
|
<message>
|
||||||
|
<source>More than one 'Auto-Type:' key sequence found.
|
||||||
|
Allowed is only one per entry.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>CAboutDialog</name>
|
<name>CAboutDialog</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -899,6 +907,10 @@ to save the changes?</source>
|
||||||
<source>Unknown error in PwDatabase::openDatabase()</source>
|
<source>Unknown error in PwDatabase::openDatabase()</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Ctrl+V</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MainWindow</name>
|
<name>MainWindow</name>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -43,6 +43,14 @@ General Public License (GPL) version 2.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>AutoType</name>
|
||||||
|
<message>
|
||||||
|
<source>More than one 'Auto-Type:' key sequence found.
|
||||||
|
Allowed is only one per entry.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>CAboutDialog</name>
|
<name>CAboutDialog</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -884,6 +892,10 @@ to save the changes?</source>
|
||||||
<source>Unknown error in PwDatabase::openDatabase()</source>
|
<source>Unknown error in PwDatabase::openDatabase()</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Ctrl+V</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MainWindow</name>
|
<name>MainWindow</name>
|
||||||
|
|
|
@ -43,6 +43,14 @@ General Public License (GPL) version 2.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>AutoType</name>
|
||||||
|
<message>
|
||||||
|
<source>More than one 'Auto-Type:' key sequence found.
|
||||||
|
Allowed is only one per entry.</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>CAboutDialog</name>
|
<name>CAboutDialog</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -884,6 +892,10 @@ to save the changes?</source>
|
||||||
<source>Unknown error in PwDatabase::openDatabase()</source>
|
<source>Unknown error in PwDatabase::openDatabase()</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Ctrl+V</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MainWindow</name>
|
<name>MainWindow</name>
|
||||||
|
|
Loading…
Reference in New Issue