mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed the update of check icons in genCertDialog
This commit is contained in:
parent
5069ba86dd
commit
59f428f096
@ -108,20 +108,10 @@ void GenCertDialog::grabMouse()
|
|||||||
|
|
||||||
ui.entropy_bar->setValue(count*100/2048) ;
|
ui.entropy_bar->setValue(count*100/2048) ;
|
||||||
|
|
||||||
if(ui.entropy_bar->value() < 20)
|
if(!mEntropyOk && ui.entropy_bar->value() >= 20)
|
||||||
{
|
{
|
||||||
ui.genButton->setEnabled(false) ;
|
mEntropyOk = true ;
|
||||||
//ui.genButton->setIcon(QIcon(":/images/delete.png")) ;
|
updateCheckLabels();
|
||||||
ui.genButton->setToolTip(tr("Currently disabled. Please move your mouse around until you reach at least 20%")) ;
|
|
||||||
|
|
||||||
ui.randomness_check_LB->setPixmap(QPixmap(IMAGE_BAD)) ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ui.genButton->setEnabled(true) ;
|
|
||||||
//ui.genButton->setIcon(QIcon(":/images/resume.png")) ;
|
|
||||||
ui.genButton->setToolTip(tr("Click to create your node and/or profile")) ;
|
|
||||||
ui.randomness_check_LB->setPixmap(QPixmap(IMAGE_GOOD)) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RsInit::collectEntropy(E+(F << 16)) ;
|
RsInit::collectEntropy(E+(F << 16)) ;
|
||||||
@ -168,22 +158,23 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
|
|||||||
ui.keylength_comboBox->addItem("Very high (4096 bits)", QVariant(4096));
|
ui.keylength_comboBox->addItem("Very high (4096 bits)", QVariant(4096));
|
||||||
|
|
||||||
#if QT_VERSION >= 0x040700
|
#if QT_VERSION >= 0x040700
|
||||||
ui.node_input->setPlaceholderText(tr("[Required] Examples: Home, Laptop,...")) ;
|
ui.node_input->setPlaceholderText(tr("[Required] Examples: Home, Laptop,...(Visible to friends).")) ;
|
||||||
ui.hiddenaddr_input->setPlaceholderText(tr("[Optional] Tor/I2P address - Examples: xa76giaf6ifda7ri63i263.onion (obtained by you from Tor)")) ;
|
ui.hiddenaddr_input->setPlaceholderText(tr("[Optional] Tor/I2P address (Example: xa76giaf6ifda7ri63i263.onion)")) ;
|
||||||
ui.name_input->setPlaceholderText(tr("[Required] Identifies your Retrohare node(s). Visible to your friends, and friends of friends."));
|
ui.name_input->setPlaceholderText(tr("[Required] Visible to friends, and friends of friends."));
|
||||||
ui.nickname_input->setPlaceholderText(tr("[Optional] Used when you write in chat lobbies, forums and channel comments. Can be setup later if you need one."));
|
ui.nickname_input->setPlaceholderText(tr("[Optional] Used to write in chat rooms and forums. Can be set later."));
|
||||||
ui.password_input->setPlaceholderText(tr("[Required] This password protects your data and is required when re-start."));
|
ui.password_input->setPlaceholderText(tr("[Required] This password protects your data. Dont forget it!"));
|
||||||
ui.password_input_2->setPlaceholderText(tr("[Required] Type the same password again here."));
|
ui.password_input_2->setPlaceholderText(tr("[Required] Type the same password again here."));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ui.nickname_input->setMaxLength(RSID_MAXIMUM_NICKNAME_SIZE);
|
ui.nickname_input->setMaxLength(RSID_MAXIMUM_NICKNAME_SIZE);
|
||||||
|
|
||||||
ui.node_input->setToolTip(tr("Enter a meaningful node description. e.g. : home, laptop, etc. \nThis field will be used to differentiate different Retroshare nodes for\nthe same profile.")) ;
|
|
||||||
|
|
||||||
/* get all available pgp private certificates....
|
/* get all available pgp private certificates....
|
||||||
* mark last one as default.
|
* mark last one as default.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
mAllFieldsOk = false ;
|
||||||
|
mEntropyOk = false ;
|
||||||
|
|
||||||
initKeyList();
|
initKeyList();
|
||||||
setupState();
|
setupState();
|
||||||
}
|
}
|
||||||
@ -303,7 +294,18 @@ void GenCertDialog::setupState()
|
|||||||
ui.hiddenport_label->setVisible(hidden_state);
|
ui.hiddenport_label->setVisible(hidden_state);
|
||||||
ui.hiddenport_spinBox->setVisible(hidden_state);
|
ui.hiddenport_spinBox->setVisible(hidden_state);
|
||||||
|
|
||||||
updateCheckLabels();
|
if(mEntropyOk && mAllFieldsOk)
|
||||||
|
{
|
||||||
|
ui.genButton->setEnabled(true) ;
|
||||||
|
ui.genButton->setIcon(QIcon(":/images/resume.png")) ;
|
||||||
|
ui.genButton->setToolTip(tr("Click to create your node and/or profile")) ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui.genButton->setEnabled(false) ;
|
||||||
|
ui.genButton->setIcon(QIcon(":/images/delete.png")) ;
|
||||||
|
ui.genButton->setToolTip(tr("Disabled until all fields correctly set and enough randomness collected.")) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenCertDialog::exportIdentity()
|
void GenCertDialog::exportIdentity()
|
||||||
@ -327,10 +329,45 @@ void GenCertDialog::updateCheckLabels()
|
|||||||
QPixmap good( IMAGE_GOOD ) ;
|
QPixmap good( IMAGE_GOOD ) ;
|
||||||
QPixmap bad ( IMAGE_BAD ) ;
|
QPixmap bad ( IMAGE_BAD ) ;
|
||||||
|
|
||||||
ui.node_name_check_LB ->setPixmap( (ui.node_input->text().length() > 3)?good:bad ) ;
|
mAllFieldsOk = true ;
|
||||||
ui.profile_name_check_LB->setPixmap( (ui.name_input->text().length() > 3)?good:bad ) ;
|
|
||||||
ui.password_check_LB ->setPixmap( (ui.password_input->text().length() > 3)?good:bad ) ;
|
if(ui.node_input->text().length() > 3)
|
||||||
ui.password2_check_LB ->setPixmap( (ui.password_input->text().length() > 3 && ui.password_input->text() == ui.password_input_2->text())?good:bad) ;
|
ui.node_name_check_LB ->setPixmap(good) ;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mAllFieldsOk = false ;
|
||||||
|
ui.node_name_check_LB ->setPixmap(bad) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ui.name_input->text().length() > 3)
|
||||||
|
ui.profile_name_check_LB ->setPixmap(good) ;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mAllFieldsOk = false ;
|
||||||
|
ui.profile_name_check_LB ->setPixmap(bad) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ui.password_input->text().length() > 3)
|
||||||
|
ui.password_check_LB ->setPixmap(good) ;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mAllFieldsOk = false ;
|
||||||
|
ui.password_check_LB ->setPixmap(bad) ;
|
||||||
|
}
|
||||||
|
if(ui.password_input->text().length() > 3 && ui.password_input->text() == ui.password_input_2->text())
|
||||||
|
ui.password2_check_LB ->setPixmap(good) ;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mAllFieldsOk = false ;
|
||||||
|
ui.password2_check_LB ->setPixmap(bad) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mEntropyOk)
|
||||||
|
ui.randomness_check_LB->setPixmap(QPixmap(IMAGE_GOOD)) ;
|
||||||
|
else
|
||||||
|
ui.randomness_check_LB->setPixmap(QPixmap(IMAGE_BAD)) ;
|
||||||
|
|
||||||
|
setupState();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GenCertDialog::importIdentity()
|
bool GenCertDialog::importIdentity()
|
||||||
|
@ -55,6 +55,8 @@ private:
|
|||||||
bool genNewGPGKey;
|
bool genNewGPGKey;
|
||||||
bool haveGPGKeys;
|
bool haveGPGKeys;
|
||||||
bool mOnlyGenerateIdentity;
|
bool mOnlyGenerateIdentity;
|
||||||
|
bool mAllFieldsOk ;
|
||||||
|
bool mEntropyOk ;
|
||||||
QString mGXSNickname;
|
QString mGXSNickname;
|
||||||
|
|
||||||
QTimer *entropy_timer ;
|
QTimer *entropy_timer ;
|
||||||
|
@ -352,7 +352,7 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>You can have one or more identities. They are used when you write in chat lobbies, forums and channel comments. They act as the destination for distant chat and the Retroshare distant mail system.</string>
|
<string><html><head/><body><p>Identities are used when you write in chat rooms, forums and channel comments. </p><p>They also receive/send email over the Retroshare network. You can create</p><p>a signed identity now, or do it later on when you get to need it.</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -423,6 +423,9 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
|
|||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>Your node name designates the Retroshare instance that</p><p>will run on this computer.</p></body></html></string>
|
||||||
|
</property>
|
||||||
<property name="maxLength">
|
<property name="maxLength">
|
||||||
<number>64</number>
|
<number>64</number>
|
||||||
</property>
|
</property>
|
||||||
@ -488,7 +491,7 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Enter your nickname here</string>
|
<string><html><head/><body><p>The profile name identifies you over the network.</p><p>It is used by your friends to accept connections from you.</p><p>You can create multiple Retroshare nodes with the</p><p>same profile on different computers.</p><p><br/></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@ -501,7 +504,7 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="genPGPuser">
|
<widget class="QComboBox" name="genPGPuser">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@ -631,7 +634,7 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Put a strong password here. This password protects your private PGP key.</string>
|
<string><html><head/><body><p>Put a strong password here. This password protects your private node key!</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="inputMask">
|
<property name="inputMask">
|
||||||
<string/>
|
<string/>
|
||||||
@ -660,7 +663,7 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Put a strong password here. This password protects your private PGP key.</string>
|
<string><html><head/><body><p>Put a strong password here. This password protects your private node key!</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="inputMask">
|
<property name="inputMask">
|
||||||
<string/>
|
<string/>
|
||||||
|
Loading…
Reference in New Issue
Block a user