Some code cleanup
git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@278 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
parent
5944e2620f
commit
df17d76ce7
|
@ -42,8 +42,7 @@ CDbSettingsDlg::CDbSettingsDlg(QWidget* parent,IDatabase* db, bool modal, Qt::W
|
||||||
connect( ButtonBench, SIGNAL( clicked() ), this, SLOT( OnBenchmark() ) );
|
connect( ButtonBench, SIGNAL( clicked() ), this, SLOT( OnBenchmark() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
CDbSettingsDlg::~CDbSettingsDlg()
|
CDbSettingsDlg::~CDbSettingsDlg(){
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbSettingsDlg::paintEvent(QPaintEvent *event){
|
void CDbSettingsDlg::paintEvent(QPaintEvent *event){
|
||||||
|
|
|
@ -249,8 +249,6 @@ Edit_Password->setEchoMode(QLineEdit::Normal);
|
||||||
Edit_Password_w->setEchoMode(QLineEdit::Normal);
|
Edit_Password_w->setEchoMode(QLineEdit::Normal);
|
||||||
ButtonEchoMode->setIcon(getIcon("pwd_show"));
|
ButtonEchoMode->setIcon(getIcon("pwd_show"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEditEntryDlg::OnTitleTextChanged(const QString& txt)
|
void CEditEntryDlg::OnTitleTextChanged(const QString& txt)
|
||||||
|
@ -269,18 +267,14 @@ Progress_Quali->setValue(100*bits/128);
|
||||||
|
|
||||||
void CEditEntryDlg::OnPasswordwTextChanged()
|
void CEditEntryDlg::OnPasswordwTextChanged()
|
||||||
{
|
{
|
||||||
|
|
||||||
if(QString::compare(Edit_Password_w->text(),Edit_Password->text().mid(0,(Edit_Password_w->text().length())))!=0){
|
if(QString::compare(Edit_Password_w->text(),Edit_Password->text().mid(0,(Edit_Password_w->text().length())))!=0){
|
||||||
QPalette palette;
|
QPalette palette;
|
||||||
palette.setColor(Edit_Password_w->backgroundRole(),QColor(255,125,125));
|
palette.setColor(Edit_Password_w->backgroundRole(),QColor(255,125,125));
|
||||||
Edit_Password_w->setPalette(palette);
|
Edit_Password_w->setPalette(palette);
|
||||||
}else
|
}
|
||||||
{
|
else {
|
||||||
Edit_Password_w->setPalette(QApplication::palette());
|
Edit_Password_w->setPalette(QApplication::palette());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEditEntryDlg::OnPasswordwLostFocus()
|
void CEditEntryDlg::OnPasswordwLostFocus()
|
||||||
|
@ -290,12 +284,9 @@ if(QString::compare(Edit_Password_w->text(),Edit_Password->text())!=0){
|
||||||
palette.setColor(Edit_Password_w->backgroundRole(),QColor(255,125,125));
|
palette.setColor(Edit_Password_w->backgroundRole(),QColor(255,125,125));
|
||||||
Edit_Password_w->setPalette(palette);
|
Edit_Password_w->setPalette(palette);
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
Edit_Password_w->setPalette(QApplication::palette ());
|
Edit_Password_w->setPalette(QApplication::palette ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEditEntryDlg::OnNewAttachment()
|
void CEditEntryDlg::OnNewAttachment()
|
||||||
|
@ -303,7 +294,7 @@ void CEditEntryDlg::OnNewAttachment()
|
||||||
QString filename=QFileDialog::getOpenFileName(this,tr("Add Attachment..."),QDir::homePath());
|
QString filename=QFileDialog::getOpenFileName(this,tr("Add Attachment..."),QDir::homePath());
|
||||||
if(filename=="")return;
|
if(filename=="")return;
|
||||||
QFile file(filename);
|
QFile file(filename);
|
||||||
if(file.open(QIODevice::ReadOnly)==false){
|
if(!file.open(QIODevice::ReadOnly)){
|
||||||
file.close();
|
file.close();
|
||||||
QMessageBox::warning(NULL,tr("Error"),tr("Could not open file."),tr("OK"));
|
QMessageBox::warning(NULL,tr("Error"),tr("Could not open file."),tr("OK"));
|
||||||
return;
|
return;
|
||||||
|
@ -353,12 +344,13 @@ void CEditEntryDlg::saveAttachment(IEntryHandle* pEntry, QWidget* ParentWidget)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEditEntryDlg::OnDeleteAttachment()
|
void CEditEntryDlg::OnDeleteAttachment()
|
||||||
{
|
{
|
||||||
int r=QMessageBox::warning(this,tr("Delete Attachment?"),tr("You are about to delete the attachment of this entry.\nAre you sure?"),tr("Yes"),tr("No, Cancel"),NULL,1,1);
|
int r=QMessageBox::warning(this,tr("Delete Attachment?"),
|
||||||
|
tr("You are about to delete the attachment of this entry.\nAre you sure?"),
|
||||||
|
tr("Yes"),tr("No, Cancel"),NULL,1,1);
|
||||||
if(r==0){
|
if(r==0){
|
||||||
ModFlag=true;
|
ModFlag=true;
|
||||||
entry->setBinary(QByteArray());
|
entry->setBinary(QByteArray());
|
||||||
|
|
|
@ -52,8 +52,7 @@ CEditGroupDialog::CEditGroupDialog(IDatabase* database,CGroup* Group,QWidget* pa
|
||||||
connect( Button_Icon, SIGNAL( clicked() ), this, SLOT( OnIconDlg() ));
|
connect( Button_Icon, SIGNAL( clicked() ), this, SLOT( OnIconDlg() ));
|
||||||
}
|
}
|
||||||
|
|
||||||
CEditGroupDialog::~CEditGroupDialog()
|
CEditGroupDialog::~CEditGroupDialog(){
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEditGroupDialog::showEvent(QShowEvent *event){
|
void CEditGroupDialog::showEvent(QShowEvent *event){
|
||||||
|
|
|
@ -90,6 +90,3 @@ void SearchDialog::paintEvent(QPaintEvent *event){
|
||||||
painter.setClipRegion(event->region());
|
painter.setClipRegion(event->region());
|
||||||
painter.drawPixmap(QPoint(0,0),BannerPixmap);
|
painter.drawPixmap(QPoint(0,0),BannerPixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,8 @@
|
||||||
#include "UrlLabel.h"
|
#include "UrlLabel.h"
|
||||||
|
|
||||||
LinkLabel::LinkLabel(QWidget *parent,const QString& text, int x, int y,Qt::WFlags f) : QLabel(parent,f){
|
LinkLabel::LinkLabel(QWidget *parent,const QString& text, int x, int y,Qt::WFlags f) : QLabel(parent,f){
|
||||||
QFont font(parentWidget()->font()); font.setUnderline(true);
|
QFont font(parentWidget()->font());
|
||||||
|
font.setUnderline(true);
|
||||||
setFont(font);
|
setFont(font);
|
||||||
QPalette palette;
|
QPalette palette;
|
||||||
palette.setColor(foregroundRole(),QColor(20,20,255));
|
palette.setColor(foregroundRole(),QColor(20,20,255));
|
||||||
|
@ -33,14 +34,15 @@ setPos(x,y);
|
||||||
}
|
}
|
||||||
|
|
||||||
LinkLabel::~LinkLabel(){
|
LinkLabel::~LinkLabel(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString LinkLabel::url(){
|
QString LinkLabel::url(){
|
||||||
if(URL!=QString())return URL;
|
if(URL!=QString())
|
||||||
if(text().contains("@"))
|
return URL;
|
||||||
|
else if(text().contains("@"))
|
||||||
return QString("mailto:")+text();
|
return QString("mailto:")+text();
|
||||||
else return text();
|
else
|
||||||
|
return text();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinkLabel::mouseReleaseEvent(QMouseEvent* event){
|
void LinkLabel::mouseReleaseEvent(QMouseEvent* event){
|
||||||
|
|
Loading…
Reference in New Issue