Reduced height of password generator dialog (Bug #2831504)
Escape HTML chars in detail view (Bug #2836096) Don't call QT_REQUIRE_VERSION as it produces a compiler warning/error (Bug #2815290) git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@329 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
parent
29ded0a62b
commit
0a2733a992
|
@ -33,13 +33,9 @@ CGenPwDialog::CGenPwDialog(QWidget* parent, bool StandAloneMode,Qt::WFlags fl)
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
connect(ButtonGenerate, SIGNAL(clicked()), SLOT(OnGeneratePw()));
|
connect(ButtonGenerate, SIGNAL(clicked()), SLOT(OnGeneratePw()));
|
||||||
connect(Radio_1, SIGNAL(toggled(bool)), SLOT(OnRadio1StateChanged(bool)));
|
|
||||||
connect(Radio_2, SIGNAL(toggled(bool)), SLOT(OnRadio2StateChanged(bool)));
|
|
||||||
connect(DialogButtons, SIGNAL(rejected()), SLOT(OnCancel()));
|
connect(DialogButtons, SIGNAL(rejected()), SLOT(OnCancel()));
|
||||||
connect(DialogButtons, SIGNAL(accepted()), SLOT(OnAccept()));
|
connect(DialogButtons, SIGNAL(accepted()), SLOT(OnAccept()));
|
||||||
connect(tabCategory, SIGNAL(currentChanged(int)), SLOT(estimateQuality()));
|
connect(tabCategory, SIGNAL(currentChanged(int)), SLOT(estimateQuality()));
|
||||||
connect(Radio_1, SIGNAL(toggled(bool)), SLOT(estimateQuality()));
|
|
||||||
connect(Radio_2, SIGNAL(toggled(bool)), SLOT(estimateQuality()));
|
|
||||||
connect(checkBox1, SIGNAL(toggled(bool)), SLOT(estimateQuality()));
|
connect(checkBox1, SIGNAL(toggled(bool)), SLOT(estimateQuality()));
|
||||||
connect(checkBox2, SIGNAL(toggled(bool)), SLOT(estimateQuality()));
|
connect(checkBox2, SIGNAL(toggled(bool)), SLOT(estimateQuality()));
|
||||||
connect(checkBox3, SIGNAL(toggled(bool)), SLOT(estimateQuality()));
|
connect(checkBox3, SIGNAL(toggled(bool)), SLOT(estimateQuality()));
|
||||||
|
@ -57,8 +53,6 @@ CGenPwDialog::CGenPwDialog(QWidget* parent, bool StandAloneMode,Qt::WFlags fl)
|
||||||
connect(Check_CollectEntropy, SIGNAL(stateChanged(int)), SLOT(OnCollectEntropyChanged(int)));
|
connect(Check_CollectEntropy, SIGNAL(stateChanged(int)), SLOT(OnCollectEntropyChanged(int)));
|
||||||
connect(ButtonChangeEchoMode, SIGNAL(clicked()), SLOT(SwapEchoMode()));
|
connect(ButtonChangeEchoMode, SIGNAL(clicked()), SLOT(SwapEchoMode()));
|
||||||
connect(tabCategory, SIGNAL(currentChanged(int)), SLOT(setGenerateEnabled()));
|
connect(tabCategory, SIGNAL(currentChanged(int)), SLOT(setGenerateEnabled()));
|
||||||
connect(Radio_1, SIGNAL(toggled(bool)), SLOT(setGenerateEnabled()));
|
|
||||||
connect(Radio_2, SIGNAL(toggled(bool)), SLOT(setGenerateEnabled()));
|
|
||||||
connect(checkBox1, SIGNAL(toggled(bool)), SLOT(setGenerateEnabled()));
|
connect(checkBox1, SIGNAL(toggled(bool)), SLOT(setGenerateEnabled()));
|
||||||
connect(checkBox2, SIGNAL(toggled(bool)), SLOT(setGenerateEnabled()));
|
connect(checkBox2, SIGNAL(toggled(bool)), SLOT(setGenerateEnabled()));
|
||||||
connect(checkBox3, SIGNAL(toggled(bool)), SLOT(setGenerateEnabled()));
|
connect(checkBox3, SIGNAL(toggled(bool)), SLOT(setGenerateEnabled()));
|
||||||
|
@ -87,8 +81,8 @@ CGenPwDialog::CGenPwDialog(QWidget* parent, bool StandAloneMode,Qt::WFlags fl)
|
||||||
|
|
||||||
tabCategory->setCurrentIndex(config->pwGenCategory());
|
tabCategory->setCurrentIndex(config->pwGenCategory());
|
||||||
QBitArray pwGenOptions=config->pwGenOptions();
|
QBitArray pwGenOptions=config->pwGenOptions();
|
||||||
Radio_1->setChecked(pwGenOptions.at(0));
|
//Radio_1->setChecked(pwGenOptions.at(0));
|
||||||
Radio_2->setChecked(!pwGenOptions.at(0));
|
//Radio_2->setChecked(!pwGenOptions.at(0));
|
||||||
checkBox1->setChecked(pwGenOptions.at(1));
|
checkBox1->setChecked(pwGenOptions.at(1));
|
||||||
checkBox2->setChecked(pwGenOptions.at(2));
|
checkBox2->setChecked(pwGenOptions.at(2));
|
||||||
checkBox3->setChecked(pwGenOptions.at(3));
|
checkBox3->setChecked(pwGenOptions.at(3));
|
||||||
|
@ -98,8 +92,8 @@ CGenPwDialog::CGenPwDialog(QWidget* parent, bool StandAloneMode,Qt::WFlags fl)
|
||||||
checkBox7->setChecked(pwGenOptions.at(7));
|
checkBox7->setChecked(pwGenOptions.at(7));
|
||||||
Check_CollectEntropy->setChecked(pwGenOptions.at(8));
|
Check_CollectEntropy->setChecked(pwGenOptions.at(8));
|
||||||
Check_CollectOncePerSession->setChecked(pwGenOptions.at(9));
|
Check_CollectOncePerSession->setChecked(pwGenOptions.at(9));
|
||||||
OnRadio1StateChanged(pwGenOptions.at(0));
|
//OnRadio1StateChanged(pwGenOptions.at(0));
|
||||||
OnRadio2StateChanged(!pwGenOptions.at(0));
|
//OnRadio2StateChanged(!pwGenOptions.at(0));
|
||||||
if (pwGenOptions.size()>=14){
|
if (pwGenOptions.size()>=14){
|
||||||
checkBoxPU->setChecked(pwGenOptions.at(10));
|
checkBoxPU->setChecked(pwGenOptions.at(10));
|
||||||
checkBoxPL->setChecked(pwGenOptions.at(11));
|
checkBoxPL->setChecked(pwGenOptions.at(11));
|
||||||
|
@ -129,7 +123,7 @@ CGenPwDialog::CGenPwDialog(QWidget* parent, bool StandAloneMode,Qt::WFlags fl)
|
||||||
CGenPwDialog::~CGenPwDialog(){
|
CGenPwDialog::~CGenPwDialog(){
|
||||||
config->setPwGenCategory(tabCategory->currentIndex());
|
config->setPwGenCategory(tabCategory->currentIndex());
|
||||||
QBitArray pwGenOptions(14);
|
QBitArray pwGenOptions(14);
|
||||||
pwGenOptions.setBit(0,Radio_1->isChecked());
|
//pwGenOptions.setBit(0,Radio_1->isChecked());
|
||||||
pwGenOptions.setBit(1,checkBox1->isChecked());
|
pwGenOptions.setBit(1,checkBox1->isChecked());
|
||||||
pwGenOptions.setBit(2,checkBox2->isChecked());
|
pwGenOptions.setBit(2,checkBox2->isChecked());
|
||||||
pwGenOptions.setBit(3,checkBox3->isChecked());
|
pwGenOptions.setBit(3,checkBox3->isChecked());
|
||||||
|
@ -157,34 +151,6 @@ void CGenPwDialog::paintEvent(QPaintEvent *event){
|
||||||
painter.drawPixmap(QPoint(0,0),BannerPixmap);
|
painter.drawPixmap(QPoint(0,0),BannerPixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGenPwDialog::OnRadio1StateChanged(bool state)
|
|
||||||
{
|
|
||||||
if(state){
|
|
||||||
checkBox1->setEnabled(true);
|
|
||||||
checkBox2->setEnabled(true);
|
|
||||||
checkBox3->setEnabled(true);
|
|
||||||
checkBox4->setEnabled(true);
|
|
||||||
checkBox5->setEnabled(true);
|
|
||||||
checkBox6->setEnabled(true);
|
|
||||||
checkBox7->setEnabled(true);
|
|
||||||
}else{
|
|
||||||
checkBox1->setDisabled(true);
|
|
||||||
checkBox2->setDisabled(true);
|
|
||||||
checkBox3->setDisabled(true);
|
|
||||||
checkBox4->setDisabled(true);
|
|
||||||
checkBox5->setDisabled(true);
|
|
||||||
checkBox6->setDisabled(true);
|
|
||||||
checkBox7->setDisabled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGenPwDialog::OnRadio2StateChanged(bool state){
|
|
||||||
if(state)
|
|
||||||
Edit_chars->setEnabled(true);
|
|
||||||
else
|
|
||||||
Edit_chars->setDisabled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGenPwDialog::OnGeneratePw()
|
void CGenPwDialog::OnGeneratePw()
|
||||||
{
|
{
|
||||||
if(Check_CollectEntropy->isChecked()){
|
if(Check_CollectEntropy->isChecked()){
|
||||||
|
@ -226,8 +192,8 @@ void CGenPwDialog::OnGeneratePw()
|
||||||
|
|
||||||
void CGenPwDialog::estimateQuality(){
|
void CGenPwDialog::estimateQuality(){
|
||||||
int num = 0;
|
int num = 0;
|
||||||
if (tabCategory->currentIndex()==0){
|
int index = tabCategory->currentIndex();
|
||||||
if(Radio_1->isChecked()){
|
if (index == 0) {
|
||||||
if (checkBox1->isChecked()) {
|
if (checkBox1->isChecked()) {
|
||||||
num+=26;
|
num+=26;
|
||||||
if (Check_ExcludeLookAlike->isChecked())
|
if (Check_ExcludeLookAlike->isChecked())
|
||||||
|
@ -255,10 +221,7 @@ void CGenPwDialog::estimateQuality(){
|
||||||
if (checkBox7->isChecked())
|
if (checkBox7->isChecked())
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
else
|
else if (index == 1) {
|
||||||
num=Edit_chars->text().length();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if (checkBoxPU->isChecked())
|
if (checkBoxPU->isChecked())
|
||||||
num+=26;
|
num+=26;
|
||||||
if (checkBoxPL->isChecked())
|
if (checkBoxPL->isChecked())
|
||||||
|
@ -268,6 +231,9 @@ void CGenPwDialog::estimateQuality(){
|
||||||
if (checkBoxPS->isChecked())
|
if (checkBoxPS->isChecked())
|
||||||
num+=32;
|
num+=32;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
num=Edit_chars->text().length();
|
||||||
|
}
|
||||||
|
|
||||||
float bits = 0;
|
float bits = 0;
|
||||||
if (num)
|
if (num)
|
||||||
|
@ -354,7 +320,7 @@ QString CGenPwDialog::generatePasswordInternal(int length){
|
||||||
bool ensureEveryGroup = false;
|
bool ensureEveryGroup = false;
|
||||||
QList<PwGroup> groupTable;
|
QList<PwGroup> groupTable;
|
||||||
|
|
||||||
if(Radio_1->isChecked()){
|
if (tabCategory->currentIndex() == 0) {
|
||||||
if (Check_EveryGroup->isChecked()){
|
if (Check_EveryGroup->isChecked()){
|
||||||
if (checkBox1->isChecked()) groups++;
|
if (checkBox1->isChecked()) groups++;
|
||||||
if (checkBox2->isChecked()) groups++;
|
if (checkBox2->isChecked()) groups++;
|
||||||
|
@ -446,21 +412,20 @@ QString CGenPwDialog::generatePasswordInternal(int length){
|
||||||
|
|
||||||
void CGenPwDialog::setGenerateEnabled(){
|
void CGenPwDialog::setGenerateEnabled(){
|
||||||
bool enable;
|
bool enable;
|
||||||
|
int index = tabCategory->currentIndex();
|
||||||
|
|
||||||
if (tabCategory->currentIndex()==0){
|
if (index == 0) {
|
||||||
if (Radio_1->isChecked()){
|
|
||||||
enable = checkBox1->isChecked() || checkBox2->isChecked() || checkBox3->isChecked() ||
|
enable = checkBox1->isChecked() || checkBox2->isChecked() || checkBox3->isChecked() ||
|
||||||
checkBox4->isChecked() || checkBox5->isChecked() || checkBox6->isChecked() ||
|
checkBox4->isChecked() || checkBox5->isChecked() || checkBox6->isChecked() ||
|
||||||
checkBox7->isChecked();
|
checkBox7->isChecked();
|
||||||
}
|
}
|
||||||
else{
|
else if (index == 1) {
|
||||||
enable = !Edit_chars->text().isEmpty();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
enable = checkBoxPU->isChecked() || checkBoxPL->isChecked() ||
|
enable = checkBoxPU->isChecked() || checkBoxPL->isChecked() ||
|
||||||
checkBoxPN->isChecked() || checkBoxPS->isChecked();
|
checkBoxPN->isChecked() || checkBoxPS->isChecked();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
enable = !Edit_chars->text().isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
ButtonGenerate->setEnabled(enable);
|
ButtonGenerate->setEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,8 +46,6 @@ class CGenPwDialog : public QDialog, public Ui_GenPwDlg
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void OnGeneratePw();
|
void OnGeneratePw();
|
||||||
void OnRadio2StateChanged(bool);
|
|
||||||
void OnRadio1StateChanged(bool);
|
|
||||||
void OnCancel();
|
void OnCancel();
|
||||||
void OnAccept();
|
void OnAccept();
|
||||||
void estimateQuality();
|
void estimateQuality();
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<author>Tarek Saidi</author>
|
<author>Tarek Saidi</author>
|
||||||
<class>EditEntryDialog</class>
|
<class>EditEntryDialog</class>
|
||||||
|
@ -7,7 +8,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>494</width>
|
<width>494</width>
|
||||||
<height>491</height>
|
<height>490</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -23,7 +24,7 @@
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item rowspan="2" row="5" column="1" >
|
<item row="5" column="1" rowspan="2">
|
||||||
<layout class="QGridLayout">
|
<layout class="QGridLayout">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
|
@ -31,7 +32,7 @@
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QToolButton" name="ButtonGenPw">
|
<widget class="QToolButton" name="ButtonGenPw">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -65,7 +66,7 @@
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QToolButton" name="ButtonEchoMode">
|
<widget class="QToolButton" name="ButtonEchoMode">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -104,7 +105,7 @@
|
||||||
<item row="7" column="0">
|
<item row="7" column="0">
|
||||||
<widget class="QLabel" name="textLabel9">
|
<widget class="QLabel" name="textLabel9">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -117,7 +118,7 @@
|
||||||
<item row="10" column="0">
|
<item row="10" column="0">
|
||||||
<widget class="QLabel" name="textLabel12">
|
<widget class="QLabel" name="textLabel12">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -130,7 +131,7 @@
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="textLabel4">
|
<widget class="QLabel" name="textLabel4">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -143,7 +144,7 @@
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="textLabel5">
|
<widget class="QLabel" name="textLabel5">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -156,7 +157,7 @@
|
||||||
<item row="8" column="0">
|
<item row="8" column="0">
|
||||||
<widget class="QLabel" name="textLabel10">
|
<widget class="QLabel" name="textLabel10">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -169,7 +170,7 @@
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="textLabel7">
|
<widget class="QLabel" name="textLabel7">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -182,7 +183,7 @@
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="textLabel3">
|
<widget class="QLabel" name="textLabel3">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -201,20 +202,20 @@
|
||||||
<item row="6" column="0">
|
<item row="6" column="0">
|
||||||
<widget class="QLabel" name="textLabel8">
|
<widget class="QLabel" name="textLabel8">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Password Repet.:</string>
|
<string>Repeat:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="textLabel6">
|
<widget class="QLabel" name="textLabel6">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -227,7 +228,7 @@
|
||||||
<item row="9" column="0">
|
<item row="9" column="0">
|
||||||
<widget class="QLabel" name="textLabel11">
|
<widget class="QLabel" name="textLabel11">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -277,7 +278,7 @@
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -341,7 +342,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="Label_AttachmentSize">
|
<widget class="QLabel" name="Label_AttachmentSize">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
|
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
@ -433,7 +434,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="Combo_Group">
|
<widget class="QComboBox" name="Combo_Group">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>GenPwDlg</class>
|
<class>GenPwDlg</class>
|
||||||
<widget class="QDialog" name="GenPwDlg">
|
<widget class="QDialog" name="GenPwDlg">
|
||||||
|
@ -6,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>460</width>
|
<width>460</width>
|
||||||
<height>505</height>
|
<height>432</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -38,22 +39,14 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tabRandom">
|
<widget class="QWidget" name="tabRandom">
|
||||||
<property name="geometry" >
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>438</width>
|
|
||||||
<height>243</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Random</string>
|
<string>Random</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="Radio_1" >
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Use follo&wing character groups:</string>
|
<string>Use following character groups:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -145,48 +138,6 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QRadioButton" name="Radio_2" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Use &only following characters:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" >
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType" >
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0" >
|
|
||||||
<size>
|
|
||||||
<width>30</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="Edit_chars" >
|
|
||||||
<property name="font" >
|
|
||||||
<font>
|
|
||||||
<family>Serif</family>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="maxLength" >
|
|
||||||
<number>255</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="Check_ExcludeLookAlike">
|
<widget class="QCheckBox" name="Check_ExcludeLookAlike">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -204,14 +155,6 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tabPronounceable">
|
<widget class="QWidget" name="tabPronounceable">
|
||||||
<property name="geometry" >
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>438</width>
|
|
||||||
<height>243</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
<string>Pronounceable</string>
|
<string>Pronounceable</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
@ -224,7 +167,7 @@
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>60</height>
|
<height>1</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
|
@ -272,7 +215,59 @@
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>60</height>
|
<height>1</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="tabCustom">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Custom</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>51</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use the following characters:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="Edit_chars">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Serif</family>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="maxLength">
|
||||||
|
<number>255</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_4">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>51</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
|
@ -490,7 +485,6 @@
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>tabCategory</tabstop>
|
<tabstop>tabCategory</tabstop>
|
||||||
<tabstop>Radio_1</tabstop>
|
|
||||||
<tabstop>checkBox1</tabstop>
|
<tabstop>checkBox1</tabstop>
|
||||||
<tabstop>checkBox2</tabstop>
|
<tabstop>checkBox2</tabstop>
|
||||||
<tabstop>checkBox3</tabstop>
|
<tabstop>checkBox3</tabstop>
|
||||||
|
@ -498,8 +492,6 @@
|
||||||
<tabstop>checkBox6</tabstop>
|
<tabstop>checkBox6</tabstop>
|
||||||
<tabstop>checkBox7</tabstop>
|
<tabstop>checkBox7</tabstop>
|
||||||
<tabstop>checkBox4</tabstop>
|
<tabstop>checkBox4</tabstop>
|
||||||
<tabstop>Radio_2</tabstop>
|
|
||||||
<tabstop>Edit_chars</tabstop>
|
|
||||||
<tabstop>Check_ExcludeLookAlike</tabstop>
|
<tabstop>Check_ExcludeLookAlike</tabstop>
|
||||||
<tabstop>Check_EveryGroup</tabstop>
|
<tabstop>Check_EveryGroup</tabstop>
|
||||||
<tabstop>Spin_Num</tabstop>
|
<tabstop>Spin_Num</tabstop>
|
||||||
|
|
|
@ -51,8 +51,6 @@ int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
setlocale(LC_CTYPE, "");
|
setlocale(LC_CTYPE, "");
|
||||||
|
|
||||||
QT_REQUIRE_VERSION(argc, argv, "4.3.0");
|
|
||||||
|
|
||||||
#if defined(Q_WS_X11) && defined(AUTOTYPE)
|
#if defined(Q_WS_X11) && defined(AUTOTYPE)
|
||||||
QApplication* app = new KeepassApplication(argc,argv);
|
QApplication* app = new KeepassApplication(argc,argv);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -714,23 +714,27 @@ void KeepassMainWindow::updateDetailView(){
|
||||||
QString templ=DetailViewTemplate;
|
QString templ=DetailViewTemplate;
|
||||||
IEntryHandle* entry=((EntryViewItem*)(EntryView->selectedItems()[0]))->EntryHandle;
|
IEntryHandle* entry=((EntryViewItem*)(EntryView->selectedItems()[0]))->EntryHandle;
|
||||||
|
|
||||||
templ.replace("%group%",entry->group()->title());
|
templ.replace("%group%", Qt::escape(entry->group()->title()));
|
||||||
templ.replace("%title%",entry->title());
|
templ.replace("%title%", Qt::escape(entry->title()));
|
||||||
if(config->hideUsernames())templ.replace("%username%","****");
|
if (config->hideUsernames())
|
||||||
else templ.replace("%username%",entry->username());
|
templ.replace("%username%","****");
|
||||||
|
else
|
||||||
|
templ.replace("%username%", Qt::escape(entry->username()));
|
||||||
if (!config->hidePasswords()) {
|
if (!config->hidePasswords()) {
|
||||||
SecString password=entry->password();
|
SecString password=entry->password();
|
||||||
password.unlock();
|
password.unlock();
|
||||||
templ.replace("%password%",password.string());
|
templ.replace("%password%", Qt::escape(password.string()));
|
||||||
}
|
}
|
||||||
else templ.replace("%password%","****");
|
else {
|
||||||
templ.replace("%url%",entry->url());
|
templ.replace("%password%","****");
|
||||||
templ.replace("%creation%",entry->creation().toString(Qt::SystemLocaleDate));
|
}
|
||||||
templ.replace("%lastmod%",entry->lastMod().toString(Qt::SystemLocaleDate));
|
templ.replace("%url%", Qt::escape(entry->url()));
|
||||||
templ.replace("%lastaccess%",entry->lastAccess().toString(Qt::SystemLocaleDate));
|
templ.replace("%creation%", Qt::escape(entry->creation().toString(Qt::SystemLocaleDate)));
|
||||||
templ.replace("%expire%",entry->expire().toString(Qt::SystemLocaleDate));
|
templ.replace("%lastmod%", Qt::escape(entry->lastMod().toString(Qt::SystemLocaleDate)));
|
||||||
templ.replace("%comment%",entry->comment().replace("\n","<br/>"));
|
templ.replace("%lastaccess%", Qt::escape(entry->lastAccess().toString(Qt::SystemLocaleDate)));
|
||||||
templ.replace("%attachment%",entry->binaryDesc());
|
templ.replace("%expire%", Qt::escape(entry->expire().toString(Qt::SystemLocaleDate)));
|
||||||
|
templ.replace("%comment%", Qt::escape(entry->comment()).replace("\n","<br/>"));
|
||||||
|
templ.replace("%attachment%", Qt::escape(entry->binaryDesc()));
|
||||||
|
|
||||||
if(entry->expire()!=Date_Never){
|
if(entry->expire()!=Date_Never){
|
||||||
int secs=QDateTime::currentDateTime().secsTo(entry->expire());
|
int secs=QDateTime::currentDateTime().secsTo(entry->expire());
|
||||||
|
|
Loading…
Reference in New Issue