lot of changes
git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@140 b624d157-de02-0410-bad0-e51aec6abb33
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 898 B After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 754 B |
After Width: | Height: | Size: 818 B |
|
@ -55,6 +55,8 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
|
|||
setupUi(this);
|
||||
ModFlag=false;
|
||||
QMenu *ExpirePresetsMenu=new QMenu();
|
||||
|
||||
connect(Edit_Title, SIGNAL(textChanged(const QString&)), this, SLOT( OnTitleTextChanged(const QString&)));
|
||||
connect(Edit_Password_w, SIGNAL(editingFinished()), this, SLOT(OnPasswordwLostFocus()));
|
||||
connect(Edit_Password_w, SIGNAL(textChanged(const QString&)), this, SLOT( OnPasswordwTextChanged(const QString&)));
|
||||
connect(Edit_Password, SIGNAL(textChanged(const QString&)), this, SLOT( OnPasswordTextChanged(const QString&)));
|
||||
|
@ -66,7 +68,7 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
|
|||
connect(ButtonGenPw, SIGNAL(clicked()), this, SLOT( OnButtonGenPw()));
|
||||
connect(buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()),this,SLOT(OnButtonOK()));
|
||||
connect(CheckBox_ExpiresNever,SIGNAL(stateChanged(int)),this,SLOT(OnCheckBoxExpiresNeverChanged(int)));
|
||||
connect(Button_CustomIcons,SIGNAL(clicked()),this,SLOT(OnCustomIcons()));
|
||||
connect(Button_Icons,SIGNAL(clicked()),this,SLOT(OnButtonIcons()));
|
||||
connect(ExpirePresetsMenu,SIGNAL(triggered(QAction*)),this,SLOT(OnExpirePreset(QAction*)));
|
||||
connect(ButtonExpirePresets,SIGNAL(triggered(QAction*)),this,SLOT(OnCalendar(QAction*)));
|
||||
|
||||
|
@ -78,21 +80,23 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
|
|||
ExpirePresetsMenu->addAction(tr("3 Weeks"))->setData(21);
|
||||
ExpirePresetsMenu->addSeparator();
|
||||
ExpirePresetsMenu->addAction(tr("1 Month"))->setData(30);
|
||||
ExpirePresetsMenu->addAction(tr("3 Months"))->setData(60);
|
||||
ExpirePresetsMenu->addAction(tr("3 Months"))->setData(90);
|
||||
ExpirePresetsMenu->addAction(tr("6 Months"))->setData(180);
|
||||
ExpirePresetsMenu->addSeparator();
|
||||
ExpirePresetsMenu->addAction(tr("1 Year"))->setData(365);
|
||||
ButtonExpirePresets->setMenu(ExpirePresetsMenu);
|
||||
ButtonExpirePresets->setDefaultAction(new QAction(tr("Calendar..."),ButtonExpirePresets));
|
||||
|
||||
IconIndex = entry->image();
|
||||
Button_Icons->setIcon(db->icon(IconIndex));
|
||||
|
||||
ButtonOpenAttachment->setIcon(getIcon("fileopen"));
|
||||
ButtonDeleteAttachment->setIcon(getIcon("filedelete"));
|
||||
ButtonSaveAttachment->setIcon(getIcon("filesave"));
|
||||
ButtonExpirePresets->setIcon(getIcon("clock"));
|
||||
|
||||
|
||||
setWindowTitle(entry->title());
|
||||
setWindowIcon(db->icon(entry->image()));
|
||||
OnTitleTextChanged(entry->title());
|
||||
setWindowIcon(db->icon(IconIndex));
|
||||
Edit_Title->setText(entry->title());
|
||||
Edit_UserName->setText(entry->username());
|
||||
Edit_URL->setText(entry->url());
|
||||
|
@ -103,6 +107,10 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
|
|||
Password.lock();
|
||||
if(!config->showPasswords())
|
||||
ChangeEchoMode();
|
||||
else
|
||||
ButtonEchoMode->setIcon(getIcon("pwd_show"));
|
||||
|
||||
// MX-COMMENT: This call is not needed. Both Passwords fields will always have the same value
|
||||
OnPasswordwLostFocus();
|
||||
int bits=(Password.length()*8);
|
||||
Label_Bits->setText(tr("%1 Bit").arg(QString::number(bits)));
|
||||
|
@ -112,7 +120,10 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
|
|||
Edit_Attachment->setText(entry->binaryDesc());
|
||||
Edit_Comment->setPlainText(entry->comment());
|
||||
InitGroupComboBox();
|
||||
|
||||
/* MX-TO-DO: After approval, remove this invokation
|
||||
InitIconComboBox();
|
||||
*/
|
||||
|
||||
if(!entry->binarySize()){
|
||||
ButtonSaveAttachment->setDisabled(true);
|
||||
|
@ -154,7 +165,7 @@ if(event->spontaneous()==false){
|
|||
}
|
||||
|
||||
void CEditEntryDlg::resizeEvent(QResizeEvent *event){
|
||||
createBanner(&BannerPixmap,getPixmap("keepassx_large"),tr("Test 2"),width());
|
||||
createBanner(&BannerPixmap,getPixmap("keepassx_large"),tr("Edit Entry"),width());
|
||||
QDialog::resizeEvent(event);
|
||||
}
|
||||
|
||||
|
@ -167,19 +178,21 @@ void CEditEntryDlg::paintEvent(QPaintEvent *event){
|
|||
painter.drawPixmap(QPoint(0,0),BannerPixmap);
|
||||
}
|
||||
|
||||
/* MX-TO-DO: After approval, remove this implementation
|
||||
|
||||
void CEditEntryDlg::InitIconComboBox(){
|
||||
for(int i=0;i<db->numIcons();i++){
|
||||
Combo_IconPicker->insertItem(i,db->icon(i),"");
|
||||
}
|
||||
Combo_IconPicker->setCurrentIndex(entry->image());
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
void CEditEntryDlg::InitGroupComboBox(){
|
||||
QString Space;
|
||||
groups=db->sortedGroups();
|
||||
for(int i=0;i<groups.size();i++){
|
||||
Space.fill(' ',2*groups[i]->level());
|
||||
Space.fill(' ', 2 * (groups[i]->level() - 1));
|
||||
Combo_Group->insertItem(i,db->icon(groups[i]->image()),Space+groups[i]->title());
|
||||
if(groups[i]==entry->group()){
|
||||
Combo_Group->setCurrentIndex(i);
|
||||
|
@ -217,7 +230,7 @@ void CEditEntryDlg::OnButtonOK()
|
|||
ModFlag=true;
|
||||
pw.lock();
|
||||
password.fill('X');
|
||||
if(entry->image()!=Combo_IconPicker->currentIndex())
|
||||
if(entry->image()!=IconIndex)
|
||||
ModFlag=true;
|
||||
|
||||
if(ModFlag){
|
||||
|
@ -237,7 +250,8 @@ void CEditEntryDlg::OnButtonOK()
|
|||
db->moveEntry(entry,groups[Combo_Group->currentIndex()]);
|
||||
EntryMoved=true; ModFlag=true;
|
||||
}
|
||||
entry->setImage(Combo_IconPicker->currentIndex());
|
||||
// MX-COMMENT: Should not this line go inside the if(Modflag) block?
|
||||
entry->setImage(IconIndex);
|
||||
|
||||
if(ModFlag&&EntryMoved)done(2);
|
||||
else if(ModFlag)done(1);
|
||||
|
@ -256,16 +270,23 @@ void CEditEntryDlg::ChangeEchoMode()
|
|||
if(Edit_Password->echoMode()==QLineEdit::Normal){
|
||||
Edit_Password->setEchoMode(QLineEdit::Password);
|
||||
Edit_Password_w->setEchoMode(QLineEdit::Password);
|
||||
ButtonEchoMode->setIcon(getIcon("pwd_hide"));
|
||||
}
|
||||
else
|
||||
{
|
||||
Edit_Password->setEchoMode(QLineEdit::Normal);
|
||||
Edit_Password_w->setEchoMode(QLineEdit::Normal);
|
||||
ButtonEchoMode->setIcon(getIcon("pwd_show"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void CEditEntryDlg::OnTitleTextChanged(const QString& txt)
|
||||
{
|
||||
setWindowTitle((txt=="") ? tr("[Untitled Entry]") : txt);
|
||||
}
|
||||
|
||||
void CEditEntryDlg::OnPasswordTextChanged(const QString& txt)
|
||||
{
|
||||
Edit_Password_w->setText(QString());
|
||||
|
@ -323,13 +344,35 @@ void CEditEntryDlg::OnNewAttachment()
|
|||
entry->setBinaryDesc(info.fileName());
|
||||
Edit_Attachment->setText(entry->binaryDesc());
|
||||
QString unit;
|
||||
int faktor;
|
||||
uint faktor;
|
||||
int prec;
|
||||
if(entry->binarySize()<1000){unit=" Byte";faktor=1;prec=0;}
|
||||
else {if(entry->binarySize()<1000000){unit=" kB";faktor=1000;prec=1;}
|
||||
else{unit=" MB";faktor=1000000;prec=1;}
|
||||
if (entry->binarySize() < 1024)
|
||||
{
|
||||
unit = "Bytes";
|
||||
faktor = 1;
|
||||
prec = 0;
|
||||
}
|
||||
Label_AttachmentSize->setText(QString::number((float)entry->binarySize()/(float)faktor,'f',prec)+unit);
|
||||
else
|
||||
{
|
||||
if (entry->binarySize() < 1048576)
|
||||
{
|
||||
unit = "kB";
|
||||
faktor = 1024;
|
||||
}
|
||||
else
|
||||
if (entry->binarySize() < 1073741824)
|
||||
{
|
||||
unit = "MB";
|
||||
faktor = 1048576;
|
||||
}
|
||||
else
|
||||
{
|
||||
unit = "GB";
|
||||
faktor = 1073741824;
|
||||
}
|
||||
prec = 1;
|
||||
}
|
||||
Label_AttachmentSize->setText(QString::number((float)entry->binarySize()/(float)faktor,'f',prec) + " " + unit);
|
||||
ButtonOpenAttachment->setEnabled(true);
|
||||
ButtonSaveAttachment->setEnabled(true);
|
||||
ButtonDeleteAttachment->setEnabled(true);
|
||||
|
@ -404,14 +447,15 @@ void CEditEntryDlg::OnCheckBoxExpiresNeverChanged(int state){
|
|||
DateTime_Expire->setDisabled(true);
|
||||
}
|
||||
|
||||
void CEditEntryDlg::OnCustomIcons(){
|
||||
CSelectIconDlg dlg(db,Combo_IconPicker->currentIndex(),this);
|
||||
void CEditEntryDlg::OnButtonIcons(){
|
||||
// CSelectIconDlg dlg(db,Combo_IconPicker->currentIndex(),this);
|
||||
CSelectIconDlg dlg(db, IconIndex, this);
|
||||
int r=dlg.exec();
|
||||
if(r!=-1){
|
||||
Combo_IconPicker->clear();
|
||||
for(int i=0;i<db->numIcons();i++)
|
||||
Combo_IconPicker->insertItem(i,db->icon(i),"");
|
||||
Combo_IconPicker->setCurrentIndex(r);
|
||||
if (r!=-1)
|
||||
{
|
||||
IconIndex=r;
|
||||
Button_Icons->setIcon(db->icon(IconIndex));
|
||||
setWindowIcon(db->icon(IconIndex));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,9 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
|
|||
CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* parent = 0, bool modal = FALSE, Qt::WFlags fl = 0);
|
||||
~CEditEntryDlg();
|
||||
void InitGroupComboBox();
|
||||
/* MX-TO-DO: Remove this declaration
|
||||
void InitIconComboBox();
|
||||
*/
|
||||
static void saveAttachment(IEntryHandle* pEntry, QWidget* ParentWidget=NULL);
|
||||
|
||||
IEntryHandle* entry;
|
||||
|
@ -44,6 +46,7 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
|
|||
QPixmap BannerPixmap;
|
||||
|
||||
public slots:
|
||||
void OnTitleTextChanged(const QString&);
|
||||
void OnPasswordwLostFocus();
|
||||
void OnPasswordwTextChanged(const QString&);
|
||||
void OnPasswordTextChanged(const QString&);
|
||||
|
@ -54,7 +57,7 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
|
|||
void OnSaveAttachment();
|
||||
void OnButtonGenPw();
|
||||
void OnCheckBoxExpiresNeverChanged(int state);
|
||||
void OnCustomIcons();
|
||||
void OnButtonIcons();
|
||||
void OnButtonOK();
|
||||
void OnExpirePreset(QAction*);
|
||||
void OnCalendar(QAction*);
|
||||
|
@ -64,6 +67,7 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
|
|||
virtual void paintEvent(QPaintEvent*);
|
||||
virtual void resizeEvent(QResizeEvent *);
|
||||
|
||||
int IconIndex;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -51,7 +51,7 @@ void ExpiredEntriesDialog::paintEvent(QPaintEvent* event){
|
|||
}
|
||||
|
||||
void ExpiredEntriesDialog::resizeEvent(QResizeEvent* event){
|
||||
createBanner(&BannerPixmap,getPixmap("alarmclock"),tr("Expried Entries of the Database"),width());
|
||||
createBanner(&BannerPixmap,getPixmap("alarmclock"),tr("Expired Entries in the Database"),width());
|
||||
QDialog::resizeEvent(event);
|
||||
}
|
||||
|
||||
|
|
|
@ -86,6 +86,12 @@
|
|||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QToolButton" name="ButtonEchoMode" >
|
||||
<property name="iconSize" >
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
|
@ -106,9 +112,6 @@
|
|||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
|
@ -280,7 +283,11 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1" >
|
||||
<widget class="QTextEdit" name="Edit_Comment" />
|
||||
<widget class="QTextEdit" name="Edit_Comment" >
|
||||
<property name="tabChangesFocus" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0" colspan="2" >
|
||||
<widget class="Line" name="line1" >
|
||||
|
@ -326,6 +333,12 @@
|
|||
<property name="icon" >
|
||||
<iconset/>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -336,6 +349,12 @@
|
|||
<property name="icon" >
|
||||
<iconset/>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -346,6 +365,12 @@
|
|||
<property name="icon" >
|
||||
<iconset/>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -364,7 +389,13 @@
|
|||
<item>
|
||||
<widget class="QToolButton" name="ButtonExpirePresets" >
|
||||
<property name="text" >
|
||||
<string>...</string>
|
||||
<string/>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="popupMode" >
|
||||
<enum>QToolButton::MenuButtonPopup</enum>
|
||||
|
@ -434,7 +465,32 @@
|
|||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QComboBox" name="Combo_Group" />
|
||||
<widget class="QComboBox" name="Combo_Group" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>3</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="textLabel1" >
|
||||
|
@ -447,12 +503,12 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="Combo_IconPicker" />
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="Button_CustomIcons" >
|
||||
<property name="text" >
|
||||
<string>></string>
|
||||
<widget class="QToolButton" name="Button_Icons" >
|
||||
<property name="iconSize" >
|
||||
<size>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -488,20 +544,24 @@
|
|||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<tabstops>
|
||||
<tabstop>Combo_Group</tabstop>
|
||||
<tabstop>Combo_IconPicker</tabstop>
|
||||
<tabstop>Edit_Title</tabstop>
|
||||
<tabstop>Edit_UserName</tabstop>
|
||||
<tabstop>Edit_URL</tabstop>
|
||||
<tabstop>Edit_Password</tabstop>
|
||||
<tabstop>Edit_Password_w</tabstop>
|
||||
<tabstop>Edit_Comment</tabstop>
|
||||
<tabstop>DateTime_Expire</tabstop>
|
||||
<tabstop>ButtonExpirePresets</tabstop>
|
||||
<tabstop>CheckBox_ExpiresNever</tabstop>
|
||||
<tabstop>Edit_Attachment</tabstop>
|
||||
<tabstop>ButtonOpenAttachment</tabstop>
|
||||
<tabstop>ButtonSaveAttachment</tabstop>
|
||||
<tabstop>ButtonDeleteAttachment</tabstop>
|
||||
<tabstop>ButtonEchoMode</tabstop>
|
||||
<tabstop>ButtonGenPw</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
<tabstop>Combo_Group</tabstop>
|
||||
<tabstop>Button_Icons</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
|
|
@ -168,8 +168,8 @@
|
|||
<addaction name="EditEditGroupAction" />
|
||||
<addaction name="EditDeleteGroupAction" />
|
||||
<addaction name="separator" />
|
||||
<addaction name="EditPasswordToClipboardAction" />
|
||||
<addaction name="EditUsernameToClipboardAction" />
|
||||
<addaction name="EditPasswordToClipboardAction" />
|
||||
<addaction name="EditOpenUrlAction" />
|
||||
<addaction name="EditSaveAttachmentAction" />
|
||||
<addaction name="separator" />
|
||||
|
@ -225,11 +225,11 @@
|
|||
<property name="title" >
|
||||
<string>E&xtras</string>
|
||||
</property>
|
||||
<addaction name="ExtrasSettingsAction" />
|
||||
<addaction name="ExtrasPasswordGenAction" />
|
||||
<addaction name="separator" />
|
||||
<addaction name="ExtrasShowExpiredEntriesAction" />
|
||||
<addaction name="ExtrasTrashCanAction" />
|
||||
<addaction name="separator" />
|
||||
<addaction name="ExtrasSettingsAction" />
|
||||
</widget>
|
||||
<addaction name="menuDatei" />
|
||||
<addaction name="menuBearbeiten" />
|
||||
|
@ -267,6 +267,11 @@
|
|||
<string>Change &Master Key...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="FileUnLockWorkspaceAction" >
|
||||
<property name="text" >
|
||||
<string>&Lock Workspace</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="FileExitAction" >
|
||||
<property name="text" >
|
||||
<string>E&xit</string>
|
||||
|
@ -329,12 +334,12 @@
|
|||
</action>
|
||||
<action name="EditSearchAction" >
|
||||
<property name="text" >
|
||||
<string>Search In Database...</string>
|
||||
<string>Search in Database...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="EditGroupSearchAction" >
|
||||
<property name="text" >
|
||||
<string>Search in this group...</string>
|
||||
<string>Search in this Group...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="ViewShowEntryDetailsAction" >
|
||||
|
@ -533,23 +538,12 @@
|
|||
<property name="text" >
|
||||
<string>Show Expired Entries...</string>
|
||||
</property>
|
||||
<property name="iconText" >
|
||||
<string>Show Expired Entries...</string>
|
||||
</property>
|
||||
<property name="toolTip" >
|
||||
<string>Show Expired Entries</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="ExtrasTrashCanAction" >
|
||||
<property name="text" >
|
||||
<string>Recycle Bin...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="FileUnLockWorkspaceAction" >
|
||||
<property name="text" >
|
||||
<string>Lock Workspace</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include <QIcon>
|
||||
#include <QFile>
|
||||
|
||||
#define APP_NAME "KeePassX"
|
||||
#define APP_FUNC "Password Manager"
|
||||
#define KEEPASS_VERSION "0.2.3"
|
||||
#define BUILTIN_ICONS 62
|
||||
|
||||
|
|
|
@ -77,6 +77,7 @@ Export_KeePassX_Xml export_KeePassX_Xml;
|
|||
KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,QWidget *parent, Qt::WFlags flags):QMainWindow(parent,flags){
|
||||
Start=true;
|
||||
ShutingDown=false;
|
||||
IsLocked=false;
|
||||
setupUi(this);
|
||||
#ifdef QT_WS_MAC
|
||||
setUnifiedTitleAndToolBarOnMac(true);
|
||||
|
@ -100,7 +101,6 @@ KeepassMainWindow::KeepassMainWindow(const QString& ArgFile,QWidget *parent, Qt:
|
|||
LockedCentralWidget=new QWidget(this);
|
||||
WorkspaceLockedWidget.setupUi(LockedCentralWidget);
|
||||
LockedCentralWidget->setVisible(false);
|
||||
IsLocked=false;
|
||||
|
||||
setupConnections();
|
||||
|
||||
|
@ -211,8 +211,10 @@ void KeepassMainWindow::setupToolbar(){
|
|||
toolBar->addAction(EditEditEntryAction);
|
||||
toolBar->addAction(EditDeleteEntryAction);
|
||||
toolBar->addSeparator();
|
||||
toolBar->addAction(EditPasswordToClipboardAction);
|
||||
toolBar->addAction(EditUsernameToClipboardAction);
|
||||
toolBar->addAction(EditPasswordToClipboardAction);
|
||||
toolBar->addSeparator();
|
||||
toolBar->addAction(FileUnLockWorkspaceAction);
|
||||
toolBar->addSeparator();
|
||||
QuickSearchEdit=new QLineEdit(toolBar);
|
||||
QuickSearchEdit->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);
|
||||
|
@ -227,12 +229,13 @@ void KeepassMainWindow::setupIcons(){
|
|||
FileSaveAsAction->setIcon(getIcon("filesaveas"));
|
||||
FileCloseAction->setIcon(getIcon("fileclose"));
|
||||
FileSettingsAction->setIcon(getIcon("dbsettings"));
|
||||
FileUnLockWorkspaceAction->setIcon(getIcon("lock"));
|
||||
FileExitAction->setIcon(getIcon("exit"));
|
||||
EditNewEntryAction->setIcon(getIcon("newentry"));
|
||||
EditEditEntryAction->setIcon(getIcon("editentry"));
|
||||
EditDeleteEntryAction->setIcon(getIcon("deleteentry"));
|
||||
EditPasswordToClipboardAction->setIcon(getIcon("copypwd"));
|
||||
EditUsernameToClipboardAction->setIcon(getIcon("copyusername"));
|
||||
EditPasswordToClipboardAction->setIcon(getIcon("copypwd"));
|
||||
EditCloneEntryAction->setIcon(getIcon("cloneentry"));
|
||||
EditOpenUrlAction->setIcon(getIcon("openurl"));
|
||||
EditSaveAttachmentAction->setIcon(getIcon("filesave"));
|
||||
|
@ -241,10 +244,10 @@ void KeepassMainWindow::setupIcons(){
|
|||
EditDeleteGroupAction->setIcon(getIcon("deletegroup"));
|
||||
EditSearchAction->setIcon(getIcon("dbsearch"));
|
||||
EditGroupSearchAction->setIcon(getIcon("groupsearch"));
|
||||
ExtrasSettingsAction->setIcon(getIcon("appsettings"));
|
||||
ExtrasShowExpiredEntriesAction->setIcon(getIcon("expired"));
|
||||
ExtrasPasswordGenAction->setIcon(getIcon("generator"));
|
||||
ExtrasTrashCanAction->setIcon(getIcon("trashcan"));
|
||||
ExtrasSettingsAction->setIcon(getIcon("appsettings"));
|
||||
EditAutoTypeAction->setIcon(getIcon("autotype"));
|
||||
HelpHandbookAction->setIcon(getIcon("manual"));
|
||||
HelpAboutAction->setIcon(getIcon("help"));
|
||||
|
@ -263,8 +266,8 @@ void KeepassMainWindow::setupMenus(){
|
|||
GroupView->ContextMenu->addAction(EditGroupSearchAction);
|
||||
GroupView->ContextMenuSearchGroup->addAction(HideSearchResultsAction);
|
||||
|
||||
EntryView->ContextMenu->addAction(EditPasswordToClipboardAction);
|
||||
EntryView->ContextMenu->addAction(EditUsernameToClipboardAction);
|
||||
EntryView->ContextMenu->addAction(EditPasswordToClipboardAction);
|
||||
EntryView->ContextMenu->addAction(EditOpenUrlAction);
|
||||
EntryView->ContextMenu->addAction(EditSaveAttachmentAction);
|
||||
EntryView->ContextMenu->addAction(EditAutoTypeAction);
|
||||
|
@ -300,8 +303,11 @@ void KeepassMainWindow::setupMenus(){
|
|||
}
|
||||
|
||||
SysTrayMenu = new QMenu(tr("KeePassX"),this);
|
||||
SysTrayMenu->addAction(FileUnLockWorkspaceAction);
|
||||
SysTrayMenu->addSeparator();
|
||||
SysTrayMenu->addAction(FileExitAction);
|
||||
SysTray->setContextMenu(SysTrayMenu);
|
||||
SysTray->setToolTip(tr("%1 %2").arg(APP_NAME, APP_FUNC) + " - " + tr((IsLocked) ? "Locked" : "Unlocked"));
|
||||
|
||||
#define _add_import(name){\
|
||||
QAction* import=new QAction(this);\
|
||||
|
@ -324,6 +330,8 @@ void KeepassMainWindow::setupMenus(){
|
|||
//FileNewMenu->setShortcut(tr("Ctrl+N"));
|
||||
FileOpenAction->setShortcut(tr("Ctrl+O"));
|
||||
FileSaveAction->setShortcut(tr("Ctrl+S"));
|
||||
FileUnLockWorkspaceAction->setShortcut(tr("Ctrl+L"));
|
||||
FileExitAction->setShortcut(tr("Ctrl+X"));
|
||||
EditNewGroupAction->setShortcut(tr("Ctrl+G"));
|
||||
EditPasswordToClipboardAction->setShortcut(tr("Ctrl+C"));
|
||||
EditUsernameToClipboardAction->setShortcut(tr("Ctrl+B"));
|
||||
|
@ -580,7 +588,7 @@ void KeepassMainWindow::updateDetailView(){
|
|||
if(entry->expire()!=Date_Never){
|
||||
int secs=QDateTime::currentDateTime().secsTo(entry->expire());
|
||||
if(secs < 0)
|
||||
templ.replace("%expire-timeleft%",tr("expired"));
|
||||
templ.replace("%expire-timeleft%",tr("Expired"));
|
||||
else{
|
||||
int years=0;
|
||||
int months=0;
|
||||
|
@ -618,7 +626,7 @@ void KeepassMainWindow::updateDetailView(){
|
|||
if(!days && !years && !months)
|
||||
out=tr("less than 1 day");
|
||||
|
||||
templ.replace("%expire-timeleft%",out);
|
||||
templ.replace("%expire-timeleft%","in " + out);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -673,8 +681,8 @@ switch(EntrySelection){
|
|||
else if(GroupSelection == SEARCHGROUP)
|
||||
switch(EntrySelection){
|
||||
case NONE:
|
||||
EditPasswordToClipboardAction->setEnabled(false);
|
||||
EditUsernameToClipboardAction->setEnabled(false);
|
||||
EditPasswordToClipboardAction->setEnabled(false);
|
||||
EditOpenUrlAction->setEnabled(false);
|
||||
EditSaveAttachmentAction->setEnabled(false);
|
||||
EditEditEntryAction->setEnabled(false);
|
||||
|
@ -685,8 +693,8 @@ switch(EntrySelection){
|
|||
EditAutoTypeAction->setEnabled(false);
|
||||
break;
|
||||
case SINGLE:
|
||||
EditPasswordToClipboardAction->setEnabled(true);
|
||||
EditUsernameToClipboardAction->setEnabled(true);
|
||||
EditPasswordToClipboardAction->setEnabled(true);
|
||||
EditOpenUrlAction->setEnabled(true);
|
||||
EditSaveAttachmentAction->setEnabled(true);
|
||||
EditEditEntryAction->setEnabled(true);
|
||||
|
@ -697,8 +705,8 @@ switch(EntrySelection){
|
|||
EditAutoTypeAction->setEnabled(true);
|
||||
break;
|
||||
case MULTIPLE:
|
||||
EditPasswordToClipboardAction->setEnabled(false);
|
||||
EditUsernameToClipboardAction->setEnabled(false);
|
||||
EditPasswordToClipboardAction->setEnabled(false);
|
||||
EditOpenUrlAction->setEnabled(false);
|
||||
EditSaveAttachmentAction->setEnabled(false);
|
||||
EditEditEntryAction->setEnabled(false);
|
||||
|
@ -1005,12 +1013,18 @@ void KeepassMainWindow::OnUnLockWorkspace(){
|
|||
LockedCentralWidget->setParent(NULL);
|
||||
setCentralWidget(NormalCentralWidget);
|
||||
NormalCentralWidget->setVisible(true);
|
||||
SysTray->setIcon(getIcon("keepassx_large"));
|
||||
SysTray->setToolTip(tr("%1 %2").arg(APP_NAME, APP_FUNC) + " - " + tr("Unlocked"));
|
||||
FileUnLockWorkspaceAction->setText(tr("&Lock Workspace"));
|
||||
IsLocked=false;
|
||||
} else {
|
||||
NormalCentralWidget->setVisible(false);
|
||||
NormalCentralWidget->setParent(NULL);
|
||||
setCentralWidget(LockedCentralWidget);
|
||||
LockedCentralWidget->setVisible(true);
|
||||
SysTray->setIcon(getIcon("keepassx_locked"));
|
||||
SysTray->setToolTip(tr("%1 %2").arg(APP_NAME, APP_FUNC) + " - " + tr("Locked"));
|
||||
FileUnLockWorkspaceAction->setText(tr("Un&lock Workspace"));
|
||||
IsLocked=true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Verdana'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Group:</span> %group% <span style=" font-weight:600;">Title:</span> %title% <span style=" font-weight:600;">Username:</span> %username% <span style=" font-weight:600;">Password:</span> %password% <span style=" font-weight:600;">URL:</span> %url% <span style=" font-weight:600; color:#000000;">Creation:</span> %creation% <span style=" font-weight:600;">Last Access:</span> %lastaccess% <span style=" font-weight:600;">Last Modification:</span> %lastmod% <span style=" font-weight:600;">Expiration:</span> %expire% <span style=" font-weight:600;"><br>Comment:</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%comment%</p></body></html>
|
|
@ -1,5 +1,62 @@
|
|||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Verdana'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Group:</span> %group% <span style=" font-weight:600;">Title:</span> %title% <span style=" font-weight:600;">Username:</span> %username% <span style=" font-weight:600;">Password:</span> %password% <span style=" font-weight:600;">URL:</span> %url% <span style=" font-weight:600; color:#000000;">Creation:</span> %creation% <span style=" font-weight:600;">Last Access:</span> %lastaccess% <span style=" font-weight:600;">Last Modification:</span> %lastmod% <span style=" font-weight:600;">Expiration:</span> %expire% <span style=" font-weight:600;"><br>Comment:</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">%comment%</p></body></html>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
.headertitle {
|
||||
color : #ffffff;
|
||||
font-family : Tahoma, Verdana, Arial;
|
||||
font-size : 14px;
|
||||
font-weight : bold;
|
||||
}
|
||||
.fieldname {
|
||||
font-family : Tahoma, Verdana, Arial;
|
||||
font-size : 10px;
|
||||
font-weight : bold;
|
||||
}
|
||||
.fieldvalue {
|
||||
font-family : Tahoma, Verdana, Arial;
|
||||
font-size : 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table width="100%" align="left" border="0" cellspacing="0" cellpadding="3">
|
||||
<tr><td bgcolor="#808080" class="headertitle">%title%</td></tr>
|
||||
</table>
|
||||
<table width="100%" align="left" border="0" cellspacing="3" cellpadding="0">
|
||||
<tr>
|
||||
<td width="10%" class="fieldname">Group:</td>
|
||||
<td width="40%" class="fieldvalue">%group%</td>
|
||||
<td width="10%" class="fieldname">Creation:</td>
|
||||
<td width="40%" class="fieldvalue">%creation%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="10%" class="fieldname">Username:</td>
|
||||
<td width="40%" class="fieldvalue">%username%</td>
|
||||
<td width="10%" class="fieldname">Access:</td>
|
||||
<td width="40%" class="fieldvalue">%lastaccess%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="10%" class="fieldname">Password:</td>
|
||||
<td width="40%" class="fieldvalue">%password%</td>
|
||||
<td width="10%" class="fieldname">Modification:</td>
|
||||
<td width="40%" class="fieldvalue">%creation%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="10%" class="fieldname">Attachment:</td>
|
||||
<td width="40%" class="fieldvalue">%attachment%</td>
|
||||
<td width="10%" class="fieldname">Expiration:</td>
|
||||
<td width="40%" class="fieldvalue">%expire% [%expire-timeleft%]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="10%" class="fieldname">URL:</td>
|
||||
<td width="90%" colspan="3" class="fieldvalue"><a href="%url%">%url%</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="10%" class="fieldname">Comment:</td>
|
||||
<td width="90%" colspan="3" class="fieldvalue">%comment%</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
|