merged sniperbeamer's patches

fixed bug #1828965


git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@149 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
tarek_saidi
2008-02-15 11:04:38 +00:00
parent 5a210a8e30
commit 01ac6b3544
87 changed files with 7154 additions and 8429 deletions

View File

@@ -17,7 +17,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <qmessagebox.h>
#include <QMessageBox>
#include <QPainter>
#include "AboutDlg.h"
@@ -26,41 +26,42 @@
AboutDialog::AboutDialog(QWidget* parent):QDialog(parent)
{
setupUi(this);
createBanner(&BannerPixmap,getPixmap("keepassx_large"),tr("%1 %2").arg(APP_DISPLAY_NAME, APP_VERSION),width());
createBanner(&BannerPixmap,getPixmap("keepassx_large"),QString("%1 %2").arg(APP_DISPLAY_NAME, APP_VERSION),width());
loadLicFromFile();
labelAppName->setText(tr(APP_DISPLAY_NAME));
labelAppFunc->setText(tr(" - %1").arg(APP_LONG_FUNC));
labelAppName->setText(APP_DISPLAY_NAME);
labelAppFunc->setText(QString(" - ").append(APP_LONG_FUNC));
QString AboutTr=tr("<b>Current Translation: None</b><br><br>","Please replace 'None' with the language of your translation");
if(TrActive){
AboutTr+=tr("<b>Author:</b> %1<br>").arg(tr("$TRANSLATION_AUTHOR"));
QString mail=tr("$TRANSLATION_AUTHOR_EMAIL","Here you can enter your email or homepage if you want.");
if(mail!=QString()){
if(!mail.isEmpty()){
AboutTr+=mail+"<br>";
}
AboutTr+="<br>";
}
Edit_Translation->setHtml(AboutTr+tr("\
Information on how to translate KeePassX can be found under:\n\
http://keepassx.sourceforge.net/"));
Edit_Translation->setHtml(AboutTr+tr("Information on how to translate KeePassX can be found under:")
+"<br>http://keepassx.sourceforge.net/");
QString str;
str+="<b>"+tr("Team")+"</b><br>";
str+="<div style='margin-left:10px;'>";
str+="<u>"+tr("Tarek Saidi")+"</u><br>"+tr("Developer, Project Admin")+"<br>"+tr("tarek_saidi@users.sf.net")+"<br>";
str+="<u>Tarek Saidi</u><br>"+tr("Developer, Project Admin")+"<br>tarek_saidi@users.sf.net<br>";
str+="<br>";
str+="<u>"+tr("Eugen Gorschenin")+"</u><br>"+tr("Web Designer")+"<br>"+tr("geugen@users.sf.de")+"<br>";
str+="<u>Eugen Gorschenin</u><br>"+tr("Web Designer")+"<br>geugen@users.sf.de<br>";
str+="<br>";
str+="<u>"+tr("Juan J Gonz&aacute;lez C&aacute;rdenas [Jota Jota]")+"</u><br>"+tr("Developer")+"<br>"+tr("myxelf@users.sf.net")+"<br>";
str+="<u>Juan J Gonz&aacute;lez C&aacute;rdenas [Jota Jota]</u><br>"+tr("Developer")+"<br>myxelf@users.sf.net<br>";
str+="</div><br><div style='margin-left:0px;'>";
str+="<b>"+tr("Thanks To")+"</b><br>";
str+="</div><div style='margin-left:10px;'>";
str+="<u>"+tr("Matthias Miller")+"</u><br>"+tr("Patches for better MacOS X support")+"<br>"+tr("www.outofhanwell.com")+"<br></div>";
str+="<u>Matthias Miller</u><br>"+tr("Patches for better MacOS X support")+"<br>www.outofhanwell.com<br></div>";
str+="<br>";
str+="<u>"+tr("James Nicholls")+"</u><br>"+tr("Main Application Icon")/*+"<br>"+tr("mailto:???")*/+"<br></div>";
str+="<u>James Nicholls</u><br>"+tr("Main Application Icon")/*+"<br>"+tr("mailto:???")*/+"<br></div>";
str+="<br>";
str+="<u>"+tr("Constantin Makshin")+"</u><br>"+tr("Various fixes and improvements")+"<br>"+tr("dinosaur-rus@users.sourceforge.net")+"<br></div>";
str+="<u>Constantin Makshin</u><br>"+tr("Various fixes and improvements")+"<br>dinosaur-rus@users.sourceforge.net<br></div>";
Edit_Thanks->setHtml(str);
connect(ButtonBox, SIGNAL(accepted()), SLOT(close()));
}
void AboutDialog::paintEvent(QPaintEvent *event){
@@ -87,7 +88,7 @@ return;
if(!gpl.open(QIODevice::ReadOnly)){
QMessageBox::critical(this,tr("Error"),tr("Could not open file '%1'")
.arg("'license.txt'")+tr("The following error occured:\n%1").arg(gpl.errorString())
.arg("'license.txt'")+"\n"+tr("The following error occured:")+"\n"+gpl.errorString()
,tr("OK"),0,0,2,1);
return;
}
@@ -100,7 +101,7 @@ delete buffer;
}
void AboutDialog::OnHomepageClicked(){
openBrowser(tr("http://keepassx.sf.net"));
openBrowser("http://keepassx.sf.net");
}
void AboutDialog::OnEMailClicked(){

View File

@@ -35,7 +35,7 @@ AddBookmarkDlg::AddBookmarkDlg(QWidget* parent, QString DefaultFilename, int _It
if(ItemID==-1){
createBanner(&BannerPixmap,getPixmap("bookmark_add"),tr("Add Bookmark"),width());
if(DefaultFilename==QString())
if(DefaultFilename.isEmpty())
OnButtonBrowse();
else
Edit_Filename->setText(DefaultFilename);

View File

@@ -0,0 +1,84 @@
/***************************************************************************
* Copyright (C) 2005-2008 by Felix Geyer *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "AutoTypeDlg.h"
#include "KpxConfig.h"
#include <QDesktopWidget>
#include <QPainter>
#include <QPaintEvent>
AutoTypeDlg::AutoTypeDlg(QList<IEntryHandle*> entries, QList<int> numbers){
setupUi(this);
createBanner(&BannerPixmap,getPixmap("keepassx_large"),tr("Auto-Type"),width());
setAttribute(Qt::WA_DeleteOnClose);
setWindowFlags(windowFlags()|Qt::WindowStaysOnTopHint);
setGeometry( QRect(QApplication::desktop()->screenGeometry(QCursor::pos()).center() - rect().center(), size()) );
setWindowIcon(getIcon("keepassx"));
entryList->setAlternatingRowColors(config->alternatingRowColors());
QList<QTreeWidgetItem*> itemList;
AutoTypeEntry autoTypeEntry;
for (int i=0; i<entries.size(); i++){
QStringList cols;
cols << entries[i]->group()->title() << entries[i]->title();
if (config->hideUsernames())
cols << "****";
else
cols << entries[i]->username();
QTreeWidgetItem* widgetItem = new QTreeWidgetItem(cols);
itemList.append(widgetItem);
autoTypeEntry.dbHandle = entries[i];
autoTypeEntry.nr = numbers[i];
itemToEntry.insert(widgetItem, autoTypeEntry);
}
qSort(itemList.begin(), itemList.end(), itemLessThan);
for (int i=0; i<itemList.size(); i++)
entryList->addTopLevelItem(itemList[i]);
entryList->resizeColumnToContents(0);
entryList->resizeColumnToContents(1);
entryList->resizeColumnToContents(2);
connect(ButtonBox, SIGNAL(rejected()), SLOT(close()));
connect(entryList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), SLOT(itemSelected(QTreeWidgetItem*)));
}
bool AutoTypeDlg::itemLessThan(QTreeWidgetItem* i1, QTreeWidgetItem* i2){
if (i1->text(0) != i2->text(0))
return i1->text(0) < i2->text(0);
else if (i1->text(1) != i2->text(1))
return i1->text(1) < i2->text(1);
else
return i1->text(2) < i2->text(2);
}
void AutoTypeDlg::paintEvent(QPaintEvent* event){
QWidget::paintEvent(event);
QPainter painter(this);
painter.setClipRegion(event->region());
painter.drawPixmap(QPoint(0,0),BannerPixmap);
}
void AutoTypeDlg::itemSelected(QTreeWidgetItem* item){
close();
QString err;
AutoType::perform(itemToEntry[item].dbHandle,err,false,itemToEntry[item].nr);
}

44
src/dialogs/AutoTypeDlg.h Normal file
View File

@@ -0,0 +1,44 @@
/***************************************************************************
* Copyright (C) 2005-2008 by Felix Geyer *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; version 2 of the License. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "ui_AutoTypeDlg.h"
#include "Database.h"
class AutoTypeDlg : public QWidget, private Ui::AutoTypeDlg
{
Q_OBJECT
public:
AutoTypeDlg(QList<IEntryHandle*> entries, QList<int> numbers);
protected:
void paintEvent(QPaintEvent* event);
private slots:
void itemSelected(QTreeWidgetItem* item);
private:
struct AutoTypeEntry {
IEntryHandle* dbHandle;
int nr;
};
static bool itemLessThan(QTreeWidgetItem* i1, QTreeWidgetItem* i2);
QHash<QTreeWidgetItem*,AutoTypeEntry> itemToEntry;
QPixmap BannerPixmap;
};

View File

@@ -27,6 +27,7 @@
#include <QMenu>
#include "main.h"
#include "CustomizeDetailViewDlg.h"
#include "KpxConfig.h"
bool DisableButtonSlots=false;
@@ -59,14 +60,14 @@ CustomizeDetailViewDialog::CustomizeDetailViewDialog(QWidget* parent):QDialog(pa
connect(BtnBold,SIGNAL(toggled(bool)),this,SLOT(OnBtnBold(bool)));
connect(BtnItalic,SIGNAL(toggled(bool)),this,SLOT(OnBtnItalic(bool)));
connect(BtnUnderline,SIGNAL(toggled(bool)),this,SLOT(OnBtnUnderline(bool)));
connect(BtnAlignLeft,SIGNAL(toggled(bool)),this,SLOT(OnBtnAlignLeft(bool)));
connect(BtnAlignRight,SIGNAL(toggled(bool)),this,SLOT(OnBtnAlignRight(bool)));
connect(BtnAlignCenter,SIGNAL(toggled(bool)),this,SLOT(OnBtnAlignCenter(bool)));
connect(BtnAlignBlock,SIGNAL(toggled(bool)),this,SLOT(OnBtnAlignBlock(bool)));
connect(BtnAlignLeft,SIGNAL(toggled(bool)),this,SLOT(OnBtnAlignLeft()));
connect(BtnAlignRight,SIGNAL(toggled(bool)),this,SLOT(OnBtnAlignRight()));
connect(BtnAlignCenter,SIGNAL(toggled(bool)),this,SLOT(OnBtnAlignCenter()));
connect(BtnAlignBlock,SIGNAL(toggled(bool)),this,SLOT(OnBtnAlignBlock()));
connect(BtnColor,SIGNAL(clicked()),this,SLOT(OnBtnColor()));
connect(ButtonSave,SIGNAL(clicked()),this,SLOT(OnSave()));
connect(ButtonCancel,SIGNAL(clicked()),this,SLOT(OnCancel()));
connect(ButtonRestore,SIGNAL(clicked()),this,SLOT(OnRestoreDefault()));
connect(ButtonBox,SIGNAL(accepted()),this,SLOT(OnSave()));
connect(ButtonBox,SIGNAL(rejected()),this,SLOT(OnCancel()));
connect(ButtonBox,SIGNAL(clicked(QAbstractButton*)),this,SLOT(OnRestoreDefault(QAbstractButton*)));
connect(tmplmenu,SIGNAL(triggered(QAction*)),this,SLOT(OnInsertTemplate(QAction*)));
connect(RichEdit,SIGNAL(cursorPositionChanged()),this,SLOT(OnCursorPositionChanged()));
connect(TabWidget,SIGNAL(currentChanged(int)),this,SLOT(OnTabChanged(int)));
@@ -160,25 +161,25 @@ void CustomizeDetailViewDialog::OnBtnUnderline(bool toggled){
}
void CustomizeDetailViewDialog::OnBtnAlignLeft(bool toggled){
void CustomizeDetailViewDialog::OnBtnAlignLeft(){
if(DisableButtonSlots)return;
RichEdit->setAlignment(Qt::AlignLeft);
OnCursorPositionChanged();
}
void CustomizeDetailViewDialog::OnBtnAlignRight(bool toggled){
void CustomizeDetailViewDialog::OnBtnAlignRight(){
if(DisableButtonSlots)return;
RichEdit->setAlignment(Qt::AlignRight);
OnCursorPositionChanged();
}
void CustomizeDetailViewDialog::OnBtnAlignCenter(bool toggled){
void CustomizeDetailViewDialog::OnBtnAlignCenter(){
if(DisableButtonSlots)return;
RichEdit->setAlignment(Qt::AlignHCenter);
OnCursorPositionChanged();
}
void CustomizeDetailViewDialog::OnBtnAlignBlock(bool toggled){
void CustomizeDetailViewDialog::OnBtnAlignBlock(){
if(DisableButtonSlots)return;
RichEdit->setAlignment(Qt::AlignJustify);
OnCursorPositionChanged();
@@ -203,6 +204,8 @@ void CustomizeDetailViewDialog::OnSave(){
else if(TabWidget->currentIndex()==1)
DetailViewTemplate=HtmlEdit->toPlainText();
config->setDetailViewTemplate(DetailViewTemplate);
done(1);
}
@@ -210,8 +213,10 @@ void CustomizeDetailViewDialog::OnCancel(){
done(0);
}
void CustomizeDetailViewDialog::OnRestoreDefault(){
loadDefaultDetailViewTemplate();
HtmlEdit->setPlainText(DetailViewTemplate);
RichEdit->setHtml(DetailViewTemplate);
void CustomizeDetailViewDialog::OnRestoreDefault(QAbstractButton* button){
if (button==ButtonBox->button(QDialogButtonBox::RestoreDefaults)){
DetailViewTemplate = config->defaultDetailViewTemplate();
HtmlEdit->setPlainText(DetailViewTemplate);
RichEdit->setHtml(DetailViewTemplate);
}
}

View File

@@ -20,7 +20,7 @@
#ifndef _CUSTOMIZE_DETAIL_VIEW_H_
#define _CUSTOMIZE_DETAIL_VIEW_H_
#include "ui_CustomizeDetailViewDlg.h";
#include "ui_CustomizeDetailViewDlg.h"
#include <QColor>
#include <QAction>
@@ -33,14 +33,14 @@ class CustomizeDetailViewDialog : public QDialog, public Ui_CustomizeDetailViewD
void OnBtnBold(bool);
void OnBtnItalic(bool);
void OnBtnUnderline(bool);
void OnBtnAlignLeft(bool);
void OnBtnAlignRight(bool);
void OnBtnAlignCenter(bool);
void OnBtnAlignBlock(bool);
void OnBtnAlignLeft();
void OnBtnAlignRight();
void OnBtnAlignCenter();
void OnBtnAlignBlock();
void OnBtnColor();
void OnSave();
void OnCancel();
void OnRestoreDefault();
void OnRestoreDefault(QAbstractButton* button);
void OnInsertTemplate(QAction*);
void OnCursorPositionChanged();
void OnTabChanged(int index);

View File

@@ -37,8 +37,8 @@ CDbSettingsDlg::CDbSettingsDlg(QWidget* parent,IDatabase* db, bool modal, Qt::W
ComboAlgo->insertItem(1,tr("Twofish: 256 Bit"));
ComboAlgo->setCurrentIndex(database->cryptAlgorithm()); //Achtung: AlgoID muss gleich dem ComboBox Index sein!
EditRounds->setText(QString::number(database->keyTransfRounds()));
connect( ButtonOK, SIGNAL( clicked() ), this, SLOT( OnOK() ) );
connect( ButtonCancel, SIGNAL( clicked() ), this, SLOT( OnCancel() ) );
connect( ButtonBox, SIGNAL( accepted() ), this, SLOT( OnOK() ) );
connect( ButtonBox, SIGNAL( rejected() ), this, SLOT( OnCancel() ) );
}
CDbSettingsDlg::~CDbSettingsDlg()

View File

@@ -26,7 +26,7 @@
#include "Database.h"
#include <QPaintEvent>
class CDbSettingsDlg : public QDialog, public Ui_dbsettingdlg_base
class CDbSettingsDlg : public QDialog, public Ui_DatabaseSettingsDlg
{
Q_OBJECT
public:

View File

@@ -20,21 +20,16 @@
#include "main.h"
#include "KpxConfig.h"
#include <qpushbutton.h>
#include <qpalette.h>
#include <qfont.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <QPalette>
#include <QFont>
#include <QProgressBar>
#include <QTextEdit>
#include <qpixmap.h>
#include <qcolor.h>
#include <qcombobox.h>
#include <qpainter.h>
#include <qpen.h>
#include <QPixmap>
#include <QColor>
#include <QPainter>
#include <QPen>
#include <QFileDialog>
#include <qmessagebox.h>
#include <qtoolbutton.h>
#include <QMessageBox>
#include <QToolButton>
#include <QShowEvent>
#include <QResizeEvent>
#include <math.h>
@@ -59,8 +54,8 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
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&)));
connect(Edit_Password_w, SIGNAL(textChanged(const QString&)), this, SLOT( OnPasswordwTextChanged()));
connect(Edit_Password, SIGNAL(textChanged(const QString&)), this, SLOT( OnPasswordTextChanged()));
connect(ButtonEchoMode, SIGNAL(clicked()), this, SLOT( ChangeEchoMode()));
connect(buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT( OnButtonCancel()));
connect(ButtonOpenAttachment, SIGNAL(clicked()), this, SLOT( OnNewAttachment()));
@@ -71,7 +66,7 @@ CEditEntryDlg::CEditEntryDlg(IDatabase* _db, IEntryHandle* _entry,QWidget* paren
connect(CheckBox_ExpiresNever,SIGNAL(stateChanged(int)),this,SLOT(OnCheckBoxExpiresNeverChanged(int)));
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*)));
connect(ButtonExpirePresets,SIGNAL(triggered(QAction*)),this,SLOT(OnCalendar()));
// QAction::data() contains the time until expiration in days.
ExpirePresetsMenu->addAction(tr("Today"))->setData(0);
@@ -281,7 +276,7 @@ void CEditEntryDlg::OnTitleTextChanged(const QString& txt)
setWindowTitle((txt=="") ? tr("[Untitled Entry]") : txt);
}
void CEditEntryDlg::OnPasswordTextChanged(const QString& txt)
void CEditEntryDlg::OnPasswordTextChanged()
{
Edit_Password_w->setText(QString());
int bits=(Edit_Password->text().length()*8);
@@ -290,7 +285,7 @@ if(bits>128)bits=128;
Progress_Quali->setValue(100*bits/128);
}
void CEditEntryDlg::OnPasswordwTextChanged(const QString& w)
void CEditEntryDlg::OnPasswordwTextChanged()
{
if(QString::compare(Edit_Password_w->text(),Edit_Password->text().mid(0,(Edit_Password_w->text().length())))!=0){
@@ -430,7 +425,7 @@ void CEditEntryDlg::OnExpirePreset(QAction* action){
DateTime_Expire->setTime(QTime(0,0,0));
}
void CEditEntryDlg::OnCalendar(QAction* action){
void CEditEntryDlg::OnCalendar(){
CalendarDialog dlg(this);
if(dlg.exec()==QDialog::Accepted){
CheckBox_ExpiresNever->setChecked(false);

View File

@@ -48,8 +48,8 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
public slots:
void OnTitleTextChanged(const QString&);
void OnPasswordwLostFocus();
void OnPasswordwTextChanged(const QString&);
void OnPasswordTextChanged(const QString&);
void OnPasswordwTextChanged();
void OnPasswordTextChanged();
void ChangeEchoMode();
void OnButtonCancel();
void OnNewAttachment();
@@ -60,7 +60,7 @@ class CEditEntryDlg : public QDialog, public Ui_EditEntryDialog
void OnButtonIcons();
void OnButtonOK();
void OnExpirePreset(QAction*);
void OnCalendar(QAction*);
void OnCalendar();
private:
virtual void showEvent(QShowEvent *);

View File

@@ -20,8 +20,6 @@
#include "main.h"
#include <qcombobox.h>
#include <qlineedit.h>
#include <QShowEvent>
#include "EditGroupDlg.h"
#include "SelectIconDlg.h"
@@ -35,8 +33,8 @@ CEditGroupDialog::CEditGroupDialog(IDatabase* database,IGroupHandle* Handle,QWid
group=new CGroup();
group->Title=handle->title();
group->Image=handle->image();
connect( ButtonOK, SIGNAL( clicked() ), this, SLOT( OnOK() ) );
connect( ButtonCancel, SIGNAL( clicked() ), this, SLOT( OnCancel() ) );
connect( ButtonBox, SIGNAL( accepted() ), this, SLOT( OnOK() ) );
connect( ButtonBox, SIGNAL( rejected() ), this, SLOT( OnCancel() ) );
connect( Button_Icon, SIGNAL( clicked() ), this, SLOT( OnIconDlg() ));
}
@@ -48,8 +46,8 @@ CEditGroupDialog::CEditGroupDialog(IDatabase* database,CGroup* Group,QWidget* pa
db=database;
group=Group;
handle=NULL;
connect( ButtonOK, SIGNAL( clicked() ), this, SLOT( OnOK() ) );
connect( ButtonCancel, SIGNAL( clicked() ), this, SLOT( OnCancel() ) );
connect( ButtonBox, SIGNAL( accepted() ), this, SLOT( OnOK() ) );
connect( ButtonBox, SIGNAL( rejected() ), this, SLOT( OnCancel() ) );
connect( Button_Icon, SIGNAL( clicked() ), this, SLOT( OnIconDlg() ));
}

View File

@@ -22,7 +22,7 @@
#define EDITGROUPDLG_H
#include "ui_EditGroupDlg.h"
#include <qstring.h>
#include <QString>
#include <QShowEvent>
#include "Database.h"

View File

@@ -39,7 +39,7 @@ ExpiredEntriesDialog::ExpiredEntriesDialog(QWidget* parent,IDatabase* database,c
item->setIcon(1,database->icon(Entries[i]->image()));
}
connect(treeWidget,SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(OnItemDoubleClicked(QTreeWidgetItem*,int)));
connect(treeWidget,SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(OnItemDoubleClicked(QTreeWidgetItem*)));
}
@@ -55,7 +55,7 @@ void ExpiredEntriesDialog::resizeEvent(QResizeEvent* event){
QDialog::resizeEvent(event);
}
void ExpiredEntriesDialog::OnItemDoubleClicked(QTreeWidgetItem* item, int column){
void ExpiredEntriesDialog::OnItemDoubleClicked(QTreeWidgetItem* item){
SelectedEntry=Entries[item->data(0,Qt::UserRole).toInt()];
accept();
}

View File

@@ -38,7 +38,7 @@ class ExpiredEntriesDialog:public QDialog, public Ui_ExpiredEntriesDialog{
virtual void resizeEvent(QResizeEvent *);
private slots:
void OnItemDoubleClicked(QTreeWidgetItem*,int);
void OnItemDoubleClicked(QTreeWidgetItem*);
};

View File

@@ -128,4 +128,4 @@ void ManageBookmarksDlg::closeEvent(QCloseEvent * event){
}
KpxBookmarks::resort(Order);
event->accept();
}
}

View File

@@ -25,7 +25,6 @@
#include <QComboBox>
#include <QPushButton>
#include <QMessageBox>
#include <QStringList>
#include <QPainter>
#include <QPalette>
#include <QMenu>
@@ -56,7 +55,7 @@ CPasswordDialog::CPasswordDialog(QWidget* parent,QString filename,IDatabase* DB,
}
Combo_Dirs->setEditText(QString());
if(config->rememberLastKey() && !ChangeKeyMode){
if(config->rememberLastKey() && config->openLastFile() && !ChangeKeyMode){
switch(config->lastKeyType()){
case KEYFILE:
setStateKeyFileOnly();
@@ -101,24 +100,22 @@ CPasswordDialog::CPasswordDialog(QWidget* parent,QString filename,IDatabase* DB,
}
connect(Combo_Dirs, SIGNAL( editTextChanged(const QString&) ),this, SLOT( OnComboTextChanged(const QString&)));
connect(ButtonCancel, SIGNAL( clicked() ), this, SLOT( OnCancel() ) );
connect(ButtonBox, SIGNAL( rejected() ), this, SLOT( OnCancel() ) );
connect(Edit_Password, SIGNAL( textChanged(const QString&) ), this, SLOT( OnPasswordChanged(const QString&) ) );
connect(CheckBox_Both, SIGNAL( stateChanged(int) ), this, SLOT( OnCheckBox_BothChanged(int) ) );
connect(ButtonChangeEchoMode, SIGNAL( clicked() ), this, SLOT( ChangeEchoModeDatabaseKey() ) );
connect(Edit_Password, SIGNAL( returnPressed() ), this, SLOT( OnOK() ) );
connect(Edit_PasswordRep, SIGNAL( returnPressed() ), this, SLOT( OnOK() ) );
connect(ButtonExit, SIGNAL( clicked()),this,SLOT(OnButtonExit()));
connect(BookmarkMenu,SIGNAL(triggered(QAction*)),this,SLOT(OnBookmarkTriggered(QAction*)));
ButtonExit->setVisible(IsAuto);
Mode_Set=ChangeKeyMode;
if(!ChangeKeyMode){
Edit_PasswordRep->hide();
Label_PasswordRep->hide();
connect( ButtonOK, SIGNAL( clicked() ), this, SLOT( OnOK() ) );
connect( ButtonBox, SIGNAL( accepted() ), this, SLOT( OnOK() ) );
connect( ButtonBrowse, SIGNAL( clicked() ), this, SLOT( OnButtonBrowse() ) );
}else{
connect( ButtonOK, SIGNAL( clicked() ), this, SLOT( OnOK_Set() ) );
connect( ButtonBox, SIGNAL( accepted() ), this, SLOT( OnOK_Set() ) );
connect( ButtonBrowse, SIGNAL( clicked() ), this, SLOT( OnButtonBrowse_Set() ) );
}
@@ -168,7 +165,7 @@ void CPasswordDialog::setStateBoth(){
void CPasswordDialog::OnButtonBrowse()
{
QString filename=KpxFileDialogs::openExistingFile(this,"PasswordDlg",tr("Select a Key File"),
QStringList() << tr("All Files (*)") << tr("Key Files (*.key)"));
QStringList() << tr("Key Files (*.key)") << tr("All Files (*)"));
if(filename!=QString()){
Combo_Dirs->setEditText(filename);
}
@@ -178,7 +175,7 @@ void CPasswordDialog::OnButtonBrowse()
void CPasswordDialog::OnButtonBrowse_Set()
{
QString filename=KpxFileDialogs::saveFile(this,"PasswordDlg",tr("Select a Key File"),
QStringList() << tr("All Files (*)") << tr("Key Files (*.key)"),
QStringList() << tr("Key Files (*.key)") << tr("All Files (*)"),
false);
if(filename!=QString()){
Combo_Dirs->setEditText(filename);
@@ -307,14 +304,14 @@ bool CPasswordDialog::doAuth(){
if(!password.isEmpty() && keyfile.isEmpty()){
DbAuth->authByPwd(password);
}
if(password.isEmpty() && !keyfile.isEmpty()){
else if(password.isEmpty() && !keyfile.isEmpty()){
if(!DbAuth->authByFile(keyfile))return false;
}
if(!password.isEmpty() && !keyfile.isEmpty()){
if(!DbAuth->authByFile(keyfile))return false;
else if(!password.isEmpty() && !keyfile.isEmpty()){
if(!DbAuth->authByFileAndPwd(password, keyfile))return false;
}
if(config->rememberLastKey()){
if(config->rememberLastKey() && config->openLastFile()){
QString KeyLocation=keyfile;
if(config->saveRelativePaths()){
KeyLocation=KeyLocation.left(KeyLocation.lastIndexOf("/"));
@@ -371,11 +368,6 @@ else{
Edit_PasswordRep->setEchoMode(QLineEdit::Normal);}
}
void CPasswordDialog::OnButtonExit(){
done(2);
}
void CPasswordDialog::paintEvent(QPaintEvent* event){
QDialog::paintEvent(event);
QPainter painter(this);

View File

@@ -48,15 +48,14 @@ class CPasswordDialog : public QDialog, public Ui_PasswordDlg
QString BookmarkFilename;
tKeyType KeyType;
bool OverwriteKeyFile;
CPasswordDialog(QWidget* parent,QString filename,IDatabase* DB,bool ShowExitButton = false, bool KeyMode_Set=false);
CPasswordDialog(QWidget* parent,QString filename,IDatabase* DB,bool IsAuto=false,bool ChangeKeyMode=false);
public slots:
private slots:
void OnOK();
void OnOK_Set();
void OnCancel();
void OnButtonBrowse();
void OnButtonBrowse_Set();
void OnButtonExit();
void OnPasswordChanged(const QString &txt);
void OnCheckBox_BothChanged(int state);
void ChangeEchoModeDatabaseKey();

View File

@@ -58,12 +58,12 @@ CGenPwDialog::CGenPwDialog(QWidget* parent, bool StandAloneMode,Qt::WFlags fl)
connect(Edit_chars,SIGNAL(textEdited(const QString&)),this,SLOT(OnCharsChanged(const QString&)));
if(!StandAloneMode){
AcceptButton=DialogButtons->addButton(tr("Accept"),QDialogButtonBox::AcceptRole);
AcceptButton=DialogButtons->addButton(QDialogButtonBox::Ok);
AcceptButton->setDisabled(true);
DialogButtons->addButton(QDialogButtonBox::Cancel);
}
else{
DialogButtons->addButton(tr("OK"),QDialogButtonBox::AcceptRole);
DialogButtons->addButton(QDialogButtonBox::Close);
AcceptButton=NULL;
}
@@ -259,7 +259,7 @@ void CGenPwDialog::estimateQuality(){
Progress_Quali->setFormat(tr("%1 Bits").arg((int)bits));
Progress_Quali->update();
if(bits>128)bits=128;
Progress_Quali->setValue(bits);
Progress_Quali->setValue((int)bits);
}
void CGenPwDialog::OnCharsChanged(const QString& str){

View File

@@ -21,6 +21,7 @@
#include <QLineEdit>
#include <QCheckBox>
#include <QPushButton>
#include <QRegExp>
#include <QMessageBox>
#include <QPainter>
@@ -32,8 +33,9 @@
SearchDialog::SearchDialog(IDatabase* database,IGroupHandle* Group,QWidget* parent):QDialog(parent)
{
setupUi(this);
QPushButton* Button_Search = ButtonBox->addButton(tr("Search"),QDialogButtonBox::ActionRole);
connect( Button_Search, SIGNAL( clicked() ), this, SLOT( OnSearch() ) );
connect( Button_Close, SIGNAL( clicked() ), this, SLOT( OnClose() ) );
connect( ButtonBox, SIGNAL( rejected() ), this, SLOT( OnClose() ) );
db=database;
group=Group;
createBanner(&BannerPixmap,getPixmap("search"),tr("Search"),width());

View File

@@ -22,12 +22,12 @@
#include <QDir>
#include <QFile>
#include <QPixmap>
#include <QPushButton>
#include <QMessageBox>
#include <QShowEvent>
#include "SelectIconDlg.h"
CSelectIconDlg::CSelectIconDlg(IDatabase* database,int CurrentId,QWidget* parent, bool modal, Qt::WFlags fl):QDialog(parent,fl){
setupUi(this);
db=database;
@@ -35,12 +35,14 @@ CSelectIconDlg::CSelectIconDlg(IDatabase* database,int CurrentId,QWidget* parent
CtxMenu=new QMenu(this);
ReplaceAction=CtxMenu->addAction(getIcon("swap"),tr("Replace..."));
DeleteAction=CtxMenu->addAction(getIcon("delete"),tr("Delete"));
QPushButton* Button_AddIcon = ButtonBox->addButton(tr("Add Custom Icon"), QDialogButtonBox::ActionRole);
Button_PickIcon = ButtonBox->addButton(tr("Pick"), QDialogButtonBox::AcceptRole);
connect(Button_AddIcon, SIGNAL(clicked()), this, SLOT(OnAddIcon()));
connect(Button_PickIcon, SIGNAL(clicked()), this, SLOT(OnPickIcon()));
connect(Button_Cancel, SIGNAL(clicked()), this, SLOT(OnCancel()));
connect(ButtonBox, SIGNAL(rejected()), this, SLOT(OnCancel()));
connect(DeleteAction,SIGNAL(triggered()),this,SLOT(OnDelete()));
connect(ReplaceAction,SIGNAL(triggered()),this,SLOT(OnReplace()));
connect(List,SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),this,SLOT(OnSelectionChanged(QListWidgetItem*,QListWidgetItem*)));
connect(List,SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),this,SLOT(OnSelectionChanged(QListWidgetItem*)));
}
void CSelectIconDlg::updateView(){
@@ -64,12 +66,12 @@ void CSelectIconDlg::OnAddIcon(){
for(int i=0;i<filenames.size();i++){
QPixmap icon;
if(!icon.load(filenames[i])){
errors+=tr("%1: File could not be loaded.\n").arg(filenames[i].section("/",-1));
errors+=tr("%1: File could not be loaded.").arg(filenames[i].section("/",-1)).append("\n");
continue;}
dynamic_cast<ICustomIcons*>(db)->addIcon(icon.scaled(16,16,Qt::KeepAspectRatio,Qt::SmoothTransformation));
}
if(errors.size())
QMessageBox::warning(this,tr("Error"),tr("An error occured while loading the icon(s):\n%1").arg(errors));
QMessageBox::warning(this,tr("Error"),tr("An error occured while loading the icon(s):").append("\n").append(errors));
updateView();
List->setCurrentItem(List->item(List->count()-1));
}
@@ -96,7 +98,7 @@ void CSelectIconDlg::OnDelete(){
void CSelectIconDlg::OnReplace(){
QString filename=QFileDialog::getOpenFileName(this,tr("Add Icons..."),QDir::homePath(),tr("Images (%1)")
.arg("*.png *.jpeg *.jpg *.bmp *.gif *.bpm *.pgm *.ppm *.xbm *xpm"));
if(filename==QString())return;
if(filename.isEmpty())return;
QPixmap icon;
if(!icon.load(filename)){
QMessageBox::warning(this,tr("Error"),tr("An error occured while loading the icon."));
@@ -114,7 +116,7 @@ void CSelectIconDlg::OnCancel(){
done(-1);
}
void CSelectIconDlg::OnSelectionChanged(QListWidgetItem* cur,QListWidgetItem* prev){
void CSelectIconDlg::OnSelectionChanged(QListWidgetItem* cur){
Button_PickIcon->setEnabled(cur);
}

View File

@@ -39,7 +39,7 @@ public slots:
void OnCancel();
void OnDelete();
void OnReplace();
void OnSelectionChanged(QListWidgetItem*,QListWidgetItem*);
void OnSelectionChanged(QListWidgetItem*);
private:
int Id;
@@ -48,6 +48,7 @@ private:
QMenu* CtxMenu;
QAction* DeleteAction;
QAction* ReplaceAction;
QPushButton* Button_PickIcon;
protected:
virtual void contextMenuEvent(QContextMenuEvent *event);

View File

@@ -19,11 +19,8 @@
#include "main.h"
#include "KpxConfig.h"
#include <qpixmap.h>
#include <qcheckbox.h>
#include <qspinbox.h>
#include <qcolordialog.h>
#include <qlineedit.h>
#include <QPixmap>
#include <QColorDialog>
#include <QFileDialog>
#include <QDir>
#include <QPainter>
@@ -40,29 +37,49 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
connect(DialogButtons, SIGNAL( accepted() ), this, SLOT( OnOK() ) );
connect(DialogButtons, SIGNAL( rejected() ), this, SLOT( OnCancel() ) );
connect(DialogButtons, SIGNAL( clicked(QAbstractButton*)), this, SLOT(OnOtherButton(QAbstractButton*)));
connect(CheckBox_ShowSysTrayIcon, SIGNAL( toggled(bool) ), CheckBox_CloseToTray, SLOT( setEnabled(bool) ) );
connect(CheckBox_ShowSysTrayIcon, SIGNAL( toggled(bool) ), CheckBox_MinimizeTray, SLOT( setEnabled(bool) ) );
connect(CheckBox_OpenLast, SIGNAL( toggled(bool) ), CheckBox_RememberLastKey, SLOT( setEnabled(bool) ) );
connect(CheckBox_OpenLast, SIGNAL( toggled(bool) ), CheckBox_StartMinimized, SLOT( setEnabled(bool) ) );
connect(CheckBox_OpenLast, SIGNAL( toggled(bool) ), CheckBox_StartLocked, SLOT( setEnabled(bool) ) );
connect(Button_ClearFileDlgHistory, SIGNAL(clicked()), &fileDlgHistory, SLOT(clear()));
connect(ButtonColor1, SIGNAL( clicked() ), this, SLOT( OnColor1() ) );
connect(ButtonColor2, SIGNAL( clicked() ), this, SLOT( OnColor2() ) );
connect(ButtonTextColor, SIGNAL( clicked() ), this, SLOT( OnTextColor() ) );
connect(CheckBox_OpenLast,SIGNAL(stateChanged(int)),this,SLOT(OnCheckBoxOpenLastChanged(int)));
connect(Button_MountDirBrowse,SIGNAL(clicked()),this,SLOT(OnMountDirBrowse()));
connect(Button_BrowserCmdBrowse,SIGNAL(clicked()),this,SLOT(OnBrowserCmdBrowse()));
connect(Radio_IntPlugin_None,SIGNAL(toggled(bool)),this,SLOT(OnIntPluginNone(bool)));
connect(Radio_IntPlugin_Gnome,SIGNAL(toggled(bool)),this,SLOT(OnIntPluginGnome(bool)));
connect(Radio_IntPlugin_Kde,SIGNAL(toggled(bool)),this,SLOT(OnIntPluginKde(bool)));
connect(Radio_IntPlugin_None,SIGNAL(toggled(bool)),this,SLOT(OnIntPluginNone()));
connect(Radio_IntPlugin_Gnome,SIGNAL(toggled(bool)),this,SLOT(OnIntPluginGnome()));
connect(Radio_IntPlugin_Kde,SIGNAL(toggled(bool)),this,SLOT(OnIntPluginKde()));
connect(CheckBox_BrowserDefault,SIGNAL(stateChanged(int)),this,SLOT(OnCheckBoxBrowserDefaultChanged(int)));
connect(Button_CustomizeEntryDetails,SIGNAL(clicked()),this,SLOT(OnCustomizeEntryDetails()));
#if !defined(AUTOTYPE)
Box_AutoType->setVisible(false);
#endif
#if !defined(GLOBAL_AUTOTYPE)
Label_GlobalShortcut->setVisible(false);
Edit_GlobalShortcut->setVisible(false);
#endif
#ifdef GLOBAL_AUTOTYPE
pShortcut = AutoType::shortcut;
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());
checkBox_ShowSysTrayIcon->setChecked(config->showSysTrayIcon());
checkBox_MinimizeToTray->setChecked(config->minimizeToTray());
CheckBox_ShowSysTrayIcon->setChecked(config->showSysTrayIcon());
CheckBox_CloseToTray->setChecked(config->minimizeToTray());
CheckBox_MinimizeTray->setChecked(config->minimizeTray());
CheckBox_StartMinimized->setChecked(config->startMinimized());
CheckBox_StartLocked->setChecked(config->startLocked());
checkBox_SaveFileDlgHistory->setChecked(config->saveFileDlgHistory());
checkBox_AskBeforeDelete->setChecked(config->askBeforeDelete());
@@ -103,13 +120,15 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
SpinBox_ClipboardTime->setValue(config->clipboardTimeOut());
CheckBox_ShowPasswords->setChecked(config->showPasswords());
CheckBox_ShowPasswords_PasswordDlg->setChecked(config->showPasswordsPasswordDlg());
CheckBox_LockMinimize->setChecked(config->lockOnMinimize());
//Features
CheckBox_FeatureBookmarks->setChecked(config->featureBookmarks());
//Desktop Integration
if(PluginLoadError==QString())
// TODO Desktop Integration
tabWidgetSettings->removeTab(tabWidgetSettings->indexOf(tabIntegration));
/*if(PluginLoadError==QString())
Label_IntPlugin_Error->hide();
else
Label_IntPlugin_Error->setText(QString("<html><p style='font-weight:600; color:#8b0000;'>%1</p></body></html>")
@@ -126,24 +145,23 @@ CSettingsDlg::CSettingsDlg(QWidget* parent):QDialog(parent,Qt::Dialog)
Radio_IntPlugin_None->setChecked(true);
}
if(!PluginsModified)
Label_IntPlugin_Info->hide();
Label_IntPlugin_Info->hide();*/
//Advanced
QString BrowserCmd=config->urlCmd();
if(BrowserCmd.isEmpty()){
CheckBox_BrowserDefault->setChecked(true);
Edit_BrowserCmd->setDisabled(true);
}
else{
Edit_BrowserCmd->setText(BrowserCmd);
CheckBox_BrowserDefault->setChecked(false);
}
Box_BrowserCmd->setChecked(!config->urlCmdDef());
Edit_BrowserCmd->setText(config->urlCmd());
Edit_MountDir->setText(config->mountDir());
CheckBox_SaveRelativePaths->setChecked(config->saveRelativePaths());
#ifdef AUTOTYPE
SpinBox_AutoTypePreGap->setValue(config->autoTypePreGap());
SpinBox_AutoTypeKeyStrokeDelay->setValue(config->autoTypeKeyStrokeDelay());
#endif
#ifdef GLOBAL_AUTOTYPE
Edit_GlobalShortcut->setShortcut(config->globalShortcut());
CheckBox_EntryTitlesMatch->setChecked(config->entryTitlesMatch());
#endif
}
CSettingsDlg::~CSettingsDlg()
@@ -157,16 +175,6 @@ void CSettingsDlg::paintEvent(QPaintEvent *event){
painter.drawPixmap(QPoint(0,0),BannerPixmap);
}
void CSettingsDlg::OnCheckBoxBrowserDefaultChanged(int state){
if(state==Qt::Checked){
Edit_BrowserCmd->setDisabled(true);
Edit_BrowserCmd->setText(QString());
}
else{
Edit_BrowserCmd->setDisabled(false);
}
}
void CSettingsDlg::OnOK()
{
apply();
@@ -184,10 +192,13 @@ void CSettingsDlg::OnOtherButton(QAbstractButton* button){
}
void CSettingsDlg::apply(){
//General
config->setShowSysTrayIcon(checkBox_ShowSysTrayIcon->isChecked());
config->setMinimizeToTray(checkBox_MinimizeToTray->isChecked());
config->setShowSysTrayIcon(CheckBox_ShowSysTrayIcon->isChecked());
config->setMinimizeToTray(CheckBox_CloseToTray->isChecked());
config->setMinimizeTray(CheckBox_MinimizeTray->isChecked());
config->setStartMinimized(CheckBox_StartMinimized->isChecked());
config->setStartLocked(CheckBox_StartLocked->isChecked());
config->setSaveFileDlgHistory(checkBox_SaveFileDlgHistory->isChecked());
if(Radio_GroupTreeRestore->isChecked())config->setGroupTreeState(KpxConfig::RestoreLast);
else if(Radio_GroupTreeExpand->isChecked())config->setGroupTreeState(KpxConfig::ExpandAll);
@@ -206,27 +217,32 @@ void CSettingsDlg::apply(){
config->setClipboardTimeOut(SpinBox_ClipboardTime->value());
config->setShowPasswords(CheckBox_ShowPasswords->isChecked());
config->setShowPasswordsPasswordDlg(CheckBox_ShowPasswords_PasswordDlg->isChecked());
config->setLockOnMinimize(CheckBox_LockMinimize->isChecked());
//Features
config->setFeatureBookmarks(CheckBox_FeatureBookmarks->isChecked());
//Desktop Integration
PluginsModified=Label_IntPlugin_Info->isVisible();
//TODO Desktop Integration
/*PluginsModified=Label_IntPlugin_Info->isVisible();
if(Radio_IntPlugin_Kde->isChecked())config->setIntegrPlugin(KpxConfig::KDE);
else if(Radio_IntPlugin_Gnome->isChecked())config->setIntegrPlugin(KpxConfig::Gnome);
else config->setIntegrPlugin(KpxConfig::NoIntegr);
else config->setIntegrPlugin(KpxConfig::NoIntegr);*/
//Advanced
config->setUrlCmdDef(!Box_BrowserCmd->isChecked());
config->setUrlCmd(Edit_BrowserCmd->text());
config->setMountDir(Edit_MountDir->text());
if(!config->mountDir().isEmpty() && config->mountDir().right(1)!="/")
config->setMountDir(config->mountDir()+"/");
if(CheckBox_BrowserDefault->isChecked())config->setUrlCmd(QString());
else config->setUrlCmd(Edit_BrowserCmd->text());
config->setSaveRelativePaths(CheckBox_SaveRelativePaths->isChecked());
#ifdef AUTOTYPE
config->setAutoTypePreGap(SpinBox_AutoTypePreGap->value());
config->setAutoTypeKeyStrokeDelay(SpinBox_AutoTypeKeyStrokeDelay->value());
#endif
#ifdef GLOBAL_AUTOTYPE
config->setGlobalShortcut(Edit_GlobalShortcut->shortcut());
config->setEntryTitlesMatch(CheckBox_EntryTitlesMatch->isChecked());
#endif
}
void CSettingsDlg::OnTextColor()
@@ -270,31 +286,29 @@ void CSettingsDlg::OnColor1()
}
}
void CSettingsDlg::OnCheckBoxOpenLastChanged(int state){
if(state==Qt::Checked){
CheckBox_RememberLastKey->setEnabled(true);
}else{
CheckBox_RememberLastKey->setEnabled(false);
CheckBox_RememberLastKey->setChecked(false);
}
}
void CSettingsDlg::OnMountDirBrowse(){
QString dir=QFileDialog::getExistingDirectory(this,tr("Select a directory..."),"/");
if(dir!=QString()){
Edit_MountDir->setText(dir);
}
QString dir=QFileDialog::getExistingDirectory(this,tr("Select a directory..."));
if(!dir.isEmpty()){
Edit_MountDir->setText(dir);
}
}
void CSettingsDlg::OnIntPluginNone(bool toggled){
void CSettingsDlg::OnBrowserCmdBrowse(){
QString filename=QFileDialog::getOpenFileName(this,tr("Select an executable..."));
if(!filename.isEmpty()){
Edit_BrowserCmd->setText(filename);
}
}
void CSettingsDlg::OnIntPluginNone(){
Label_IntPlugin_Info->show();
}
void CSettingsDlg::OnIntPluginGnome(bool toggled){
void CSettingsDlg::OnIntPluginGnome(){
Label_IntPlugin_Info->show();
}
void CSettingsDlg::OnIntPluginKde(bool toggled){
void CSettingsDlg::OnIntPluginKde(){
Label_IntPlugin_Info->show();
}
@@ -303,3 +317,10 @@ void CSettingsDlg::OnCustomizeEntryDetails(){
CustomizeDetailViewDialog dlg(this);
dlg.exec();
}
#ifdef GLOBAL_AUTOTYPE
void CSettingsDlg::resetGlobalShortcut(){
AutoType::unregisterGlobalShortcut();
AutoType::registerGlobalShortcut(pShortcut);
}
#endif

View File

@@ -27,6 +27,7 @@
#include <QPaintEvent>
#include "ui_SettingsDlg.h"
#include "main.h"
#include "lib/AutoType.h"
class CSettingsDlg : public QDialog, public Ui_SettingsDialog
{
@@ -42,19 +43,27 @@ class CSettingsDlg : public QDialog, public Ui_SettingsDialog
virtual void OnColor2();
virtual void OnColor1();
void OnOtherButton(QAbstractButton*);
void OnIntPluginNone(bool);
void OnIntPluginGnome(bool);
void OnIntPluginKde(bool);
void OnCheckBoxOpenLastChanged(int state);
void OnCheckBoxBrowserDefaultChanged(int state);
void OnIntPluginNone();
void OnIntPluginGnome();
void OnIntPluginKde();
void OnMountDirBrowse();
void OnBrowserCmdBrowse();
void OnCustomizeEntryDetails();
#ifdef GLOBAL_AUTOTYPE
private slots:
void resetGlobalShortcut();
#endif
private:
virtual void paintEvent(QPaintEvent*);
void apply();
QColor color1,color2,textcolor;
QPixmap BannerPixmap;
#ifdef GLOBAL_AUTOTYPE
Shortcut pShortcut;
#endif
static bool PluginsModified;
};

View File

@@ -41,7 +41,7 @@ SimplePasswordDialog::~SimplePasswordDialog()
}
void SimplePasswordDialog::OnTextChanged(const QString& txt){
if(txt==QString())
if(txt.isEmpty())
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
else
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);

View File

@@ -39,7 +39,7 @@ TrashCanDialog::TrashCanDialog(QWidget* parent,IDatabase* database,const QList<I
item->setIcon(1,database->icon(Entries[i]->image()));
}
connect(treeWidget,SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(OnItemDoubleClicked(QTreeWidgetItem*,int)));
connect(treeWidget,SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(OnItemDoubleClicked(QTreeWidgetItem*)));
connect(treeWidget,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(OnContextMenu(const QPoint&)));
ContextMenu=new QMenu(this);
ContextMenu->addAction(getIcon("restore"),"Restore");
@@ -59,7 +59,7 @@ void TrashCanDialog::resizeEvent(QResizeEvent* event){
QDialog::resizeEvent(event);
}
void TrashCanDialog::OnItemDoubleClicked(QTreeWidgetItem* item, int column){
void TrashCanDialog::OnItemDoubleClicked(QTreeWidgetItem* item){
SelectedEntry=Entries[item->data(0,Qt::UserRole).toInt()];
accept();
}

View File

@@ -41,7 +41,7 @@ class TrashCanDialog:public QDialog, public Ui_TrashCanDialog{
virtual void resizeEvent(QResizeEvent *);
private slots:
void OnItemDoubleClicked(QTreeWidgetItem*,int);
void OnItemDoubleClicked(QTreeWidgetItem*);
void OnContextMenu(const QPoint&);