Size of the EntryEdit dialog is saved

Some small GUI improvements

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@157 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
sniperbeamer
2008-02-19 22:55:40 +00:00
parent 619eaa1552
commit 8b08b321a5
13 changed files with 216 additions and 200 deletions

View File

@@ -71,11 +71,6 @@ void AboutDialog::paintEvent(QPaintEvent *event){
painter.drawPixmap(QPoint(0,0),BannerPixmap);
}
void AboutDialog::OnClose()
{
close();
}
void AboutDialog::loadLicFromFile(){
QString filename;
filename = AppDir+"/../share/keepass/license.html";

View File

@@ -26,23 +26,21 @@
#include "main.h"
class AboutDialog : public QDialog, public Ui_AboutDlg
{
Q_OBJECT
public:
AboutDialog(QWidget* parent);
Q_OBJECT
public:
AboutDialog(QWidget* parent);
public slots:
virtual void OnClose();
void OnHomepageClicked();
void OnEMailClicked();
private:
QPixmap BannerPixmap;
inline void loadLicFromFile();
virtual void paintEvent(QPaintEvent*);
private slots:
void OnHomepageClicked();
void OnEMailClicked();
private:
QPixmap BannerPixmap;
inline void loadLicFromFile();
virtual void paintEvent(QPaintEvent*);
};
#endif

View File

@@ -41,16 +41,19 @@
CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* parent, bool modal, Qt::WFlags fl)
: QDialog(parent,fl)
CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* parent, bool modal, bool newEntry)
: QDialog(parent)
{
Q_ASSERT(_db);
Q_ASSERT(_entry);
entry=_entry;
db=_db;
pNewEntry=newEntry;
setupUi(this);
ModFlag=false;
QMenu *ExpirePresetsMenu=new QMenu();
setGeometry( config->dialogGeometry(this) );
connect(Edit_Title, SIGNAL(textChanged(const QString&)), this, SLOT( OnTitleTextChanged(const QString&)));
connect(Edit_Password_w, SIGNAL(editingFinished()), this, SLOT(OnPasswordwLostFocus()));
@@ -67,6 +70,7 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
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()));
connect(this, SIGNAL(finished(int)), this, SLOT(OnClose()));
// QAction::data() contains the time until expiration in days.
ExpirePresetsMenu->addAction(tr("Today"))->setData(0);
@@ -144,17 +148,8 @@ CEditEntryDlg::~CEditEntryDlg()
}
void CEditEntryDlg::showEvent(QShowEvent *event){
if(event->spontaneous()==false){
}
}
void CEditEntryDlg::resizeEvent(QResizeEvent *event){
createBanner(&BannerPixmap,getPixmap("keepassx_large"),tr("Edit Entry"),width());
createBanner(&BannerPixmap,getPixmap("keepassx_large"),pNewEntry?tr("New Entry"):tr("Edit Entry"),width());
QDialog::resizeEvent(event);
}
@@ -434,3 +429,6 @@ void CEditEntryDlg::OnCalendar(){
}
}
void CEditEntryDlg::OnClose(){
config->setDialogGeometry(this);
}

View File

@@ -30,7 +30,7 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
{
Q_OBJECT
public:
CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* parent = 0, bool modal = FALSE, Qt::WFlags fl = 0);
CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* parent = 0, bool modal = FALSE, bool newEntry = FALSE);
~CEditEntryDlg();
void InitGroupComboBox();
/* MX-TO-DO: Remove this declaration
@@ -45,7 +45,7 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
QList<IGroupHandle*> groups;
QPixmap BannerPixmap;
public slots:
private slots:
void OnTitleTextChanged(const QString&);
void OnPasswordwLostFocus();
void OnPasswordwTextChanged();
@@ -61,13 +61,14 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
void OnButtonOK();
void OnExpirePreset(QAction*);
void OnCalendar();
void OnClose();
private:
virtual void showEvent(QShowEvent *);
virtual void paintEvent(QPaintEvent*);
virtual void resizeEvent(QResizeEvent *);
int IconIndex;
bool pNewEntry;
};
#endif

View File

@@ -44,7 +44,10 @@ CPasswordDialog::CPasswordDialog(QWidget* parent,QString filename,IDatabase* DB,
Button_Bookmarks->setIcon(getIcon("bookmark"));
db=DB;
LastFile=filename;
setWindowTitle(LastFile);
if (ChangeKeyMode)
setWindowTitle(tr("Change Master Key"));
else
setWindowTitle(LastFile);
QString mountDir=config->mountDir();
QDir media(mountDir);
if(media.exists()){

View File

@@ -70,8 +70,6 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
connect(this,SIGNAL(rejected()),SLOT(resetGlobalShortcut()));
#endif
createBanner(&BannerPixmap,getPixmap("appsettings"),tr("Settings"),width());
//General
CheckBox_OpenLast->setChecked(config->openLastFile());
CheckBox_RememberLastKey->setChecked(config->rememberLastKey());
@@ -178,6 +176,11 @@ void CSettingsDlg::paintEvent(QPaintEvent *event){
painter.drawPixmap(QPoint(0,0),BannerPixmap);
}
void CSettingsDlg::resizeEvent(QResizeEvent* event){
createBanner(&BannerPixmap,getPixmap("appsettings"),tr("Settings"),width());
QDialog::resizeEvent(event);
}
void CSettingsDlg::OnOK()
{
apply();

View File

@@ -36,7 +36,7 @@ class CSettingsDlg : public QDialog, public Ui_SettingsDialog
CSettingsDlg(QWidget* parent);
~CSettingsDlg();
public slots:
private slots:
virtual void OnCancel();
virtual void OnOK();
virtual void OnTextColor();
@@ -58,6 +58,7 @@ class CSettingsDlg : public QDialog, public Ui_SettingsDialog
private:
virtual void paintEvent(QPaintEvent*);
virtual void resizeEvent(QResizeEvent*);
void apply();
QColor color1,color2,textcolor;
QPixmap BannerPixmap;