Improved look n feel of Profile Generation Window.

This commit is contained in:
defnax 2017-04-24 01:23:05 +02:00
parent 190a638cc1
commit 6313d89718
5 changed files with 1177 additions and 1354 deletions

View file

@ -25,6 +25,7 @@
#include <QFileDialog>
#include <QGraphicsOpacityEffect>
#include <QMessageBox>
#include <QMenu>
#include <QMouseEvent>
#include <QTextBrowser>
#include <QTimer>
@ -45,7 +46,7 @@
#include <iostream>
#define IMAGE_GOOD ":/images/accepted16.png"
#define IMAGE_BAD ":/images/deletemail24.png"
#define IMAGE_BAD ":/images/cancel.png"
class EntropyCollectorWidget: public QTextBrowser
{
@ -133,8 +134,8 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
//ui.headerFrame->setHeaderImage(QPixmap(":/icons/svg/profile.svg"));
//ui.headerFrame->setHeaderText(tr("Create a new profile"));
connect(ui.reuse_existing_node_CB, SIGNAL(clicked()), this, SLOT(switchReuseExistingNode()));
connect(ui.adv_checkbox, SIGNAL(clicked()), this, SLOT(setupState()));
connect(ui.reuse_existing_node_CB, SIGNAL(triggered()), this, SLOT(switchReuseExistingNode()));
connect(ui.adv_checkbox, SIGNAL(triggered()), this, SLOT(setupState()));
connect(ui.nodeType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(setupState()));
connect(ui.genButton, SIGNAL(clicked()), this, SLOT(genPerson()));
@ -173,6 +174,11 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
* mark last one as default.
*/
QMenu *menu = new QMenu(tr("Advanced options"));
menu->addAction(ui.adv_checkbox);
menu->addAction(ui.reuse_existing_node_CB);
ui.optionsButton->setMenu(menu);
mAllFieldsOk = false ;
mEntropyOk = false ;
@ -246,22 +252,22 @@ void GenCertDialog::setupState()
genNewGPGKey = generate_new;
ui.no_node_label->setVisible(false);
//ui.no_node_label->setVisible(false);
setWindowTitle(generate_new?tr("Create new profile and new Retroshare node"):tr("Create new Retroshare node"));
//ui.headerFrame->setHeaderText(generate_new?tr("Create a new profile and node"):tr("Create a new node"));
ui.label_nodeType->setVisible(adv_state) ;
ui.nodeType_CB->setVisible(adv_state) ;
ui.reuse_existing_node_CB->setVisible(adv_state) ;
ui.reuse_existing_node_CB->setEnabled(adv_state) ;
ui.importIdentity_PB->setVisible(adv_state && !generate_new) ;
ui.exportIdentity_PB->setVisible(adv_state && !generate_new) ;
ui.genPGPuser->setVisible(adv_state && haveGPGKeys && !generate_new) ;
ui.genprofileinfo_label->setVisible(false);
ui.no_gpg_key_label->setText(tr("Welcome to Retroshare. Before you can proceed you need to create a profile and associate a node with it. To do so please fill out this form.\nAlternatively you can import a (previously exported) profile. Just uncheck \"Create a new profile\""));
ui.no_gpg_key_label->setVisible(false);
//ui.genprofileinfo_label->setVisible(false);
//ui.no_gpg_key_label->setText(tr("Welcome to Retroshare. Before you can proceed you need to create a profile and associate a node with it. To do so please fill out this form.\nAlternatively you can import a (previously exported) profile. Just uncheck \"Create a new profile\""));
//no_gpg_key_label->setVisible(false);
ui.nickname_label->setVisible(adv_state) ;
ui.nickname_input->setVisible(adv_state) ;
@ -269,7 +275,7 @@ void GenCertDialog::setupState()
ui.name_label->setVisible(true);
ui.name_input->setVisible(generate_new);
ui.header_label->setVisible(false) ;
//ui.header_label->setVisible(false) ;
ui.nickname_label->setVisible(adv_state && !mOnlyGenerateIdentity);
ui.nickname_input->setVisible(adv_state && !mOnlyGenerateIdentity);
@ -300,14 +306,16 @@ void GenCertDialog::setupState()
if(mEntropyOk && mAllFieldsOk)
{
ui.genButton->setEnabled(true) ;
ui.genButton->setIcon(QIcon(IMAGE_GOOD)) ;
//ui.genButton->setIcon(QIcon(IMAGE_GOOD)) ;
ui.genButton->setToolTip(tr("Click to create your node and/or profile")) ;
ui.generate_label->setPixmap(QPixmap(IMAGE_GOOD)) ;
}
else
{
ui.genButton->setEnabled(false) ;
ui.genButton->setIcon(QIcon(IMAGE_BAD)) ;
//ui.genButton->setIcon(QIcon(IMAGE_BAD)) ;
ui.genButton->setToolTip(tr("Disabled until all fields correctly set and enough randomness collected.")) ;
ui.generate_label->setPixmap(QPixmap(IMAGE_BAD)) ;
}
}
@ -495,9 +503,9 @@ void GenCertDialog::genPerson()
}
//generate a new gpg key
std::string err_string;
ui.no_gpg_key_label->setText(tr("Generating new node key, please be patient: this process needs generating large prime numbers, and can take some minutes on slow computers. \n\nFill in your password when asked, to sign your new key."));
ui.no_gpg_key_label->show();
ui.reuse_existing_node_CB->hide();
//_key_label->setText(tr("Generating new node key, please be patient: this process needs generating large prime numbers, and can take some minutes on slow computers. \n\nFill in your password when asked, to sign your new key."));
//ui.no_gpg_key_label->show();
//ui.reuse_existing_node_CB->hide();
ui.name_label->hide();
ui.name_input->hide();
ui.nickname_label->hide();
@ -514,9 +522,9 @@ void GenCertDialog::genPerson()
ui.node_input->hide();
ui.genButton->hide();
ui.importIdentity_PB->hide();
ui.genprofileinfo_label->hide();
//ui.genprofileinfo_label->hide();
ui.nodeType_CB->hide();
ui.adv_checkbox->hide();
//ui.adv_checkbox->hide();
ui.keylength_label->hide();
ui.keylength_comboBox->hide();

View file

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>724</width>
<height>667</height>
<width>533</width>
<height>544</height>
</rect>
</property>
<property name="windowTitle">
@ -54,7 +54,10 @@
<string/>
</property>
<property name="pixmap">
<pixmap resource="images.qrc">:/images/logo/logo_splash.png</pixmap>
<pixmap resource="images.qrc">:/images/logo/logo_spash2.png</pixmap>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@ -77,22 +80,13 @@
</spacer>
</item>
<item>
<widget class="QCheckBox" name="adv_checkbox">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>32</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use this if you need to import an existing profile, if you want to generate a new node with an already existing key, or if you want to create a TOR/I2P hidden node.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<widget class="QPushButton" name="optionsButton">
<property name="text">
<string>Advanced options</string>
<string>Options</string>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/icons/settings/general.svg</normaloff>:/icons/settings/general.svg</iconset>
<normaloff>:/icons/svg/options.svg</normaloff>:/icons/svg/options.svg</iconset>
</property>
<property name="iconSize">
<size>
@ -100,196 +94,47 @@
<height>24</height>
</size>
</property>
<property name="tristate">
<property name="default">
<bool>false</bool>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="StyledLabel" name="header_label">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>178</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>178</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>178</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>178</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="autoFillBackground">
<bool>true</bool>
<widget class="QFrame" name="profile_frame">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
<enum>QFrame::StyledPanel</enum>
</property>
<property name="text">
<string>You can create a new profile with this form.
Alternatively you can use an existing profile. Just uncheck &quot;Create a new profile&quot;</string>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="StyledLabel" name="genprofileinfo_label">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>178</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>178</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>178</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>178</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="text">
<string>You can create and run Retroshare nodes on different computers using the same profile. To do so just export the selected profile, import it on the other computer and create a new node with it.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="no_gpg_key_label">
<property name="text">
<string>It looks like no profile (PGP keys) exists. Please fill in the form below to create one, or import an existing profile.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="no_node_label">
<property name="text">
<string>No node exists for this profile.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QGridLayout" name="profilGLayout">
<item row="7" column="3">
<widget class="QLabel" name="password_check_LB">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="15" column="0">
<widget class="QLabel" name="keylength_label">
<property name="text">
<string>PGP key length</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QLineEdit" name="password_input_2">
<property name="sizePolicy">
@ -354,13 +199,6 @@ Alternatively you can use an existing profile. Just uncheck &quot;Create a new p
</property>
</widget>
</item>
<item row="7" column="3">
<widget class="QLabel" name="password_check_LB">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="18" column="2">
<widget class="QProgressBar" name="entropy_bar">
<property name="sizePolicy">
@ -411,16 +249,6 @@ Alternatively you can use an existing profile. Just uncheck &quot;Create a new p
</item>
</widget>
</item>
<item row="15" column="0">
<widget class="QLabel" name="keylength_label">
<property name="text">
<string>PGP key length</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLineEdit" name="node_input">
<property name="sizePolicy">
@ -504,6 +332,9 @@ Alternatively you can use an existing profile. Just uncheck &quot;Create a new p
<property name="toolTip">
<string>Your profile is associated with a PGP key pair. RetroShare currently ignores DSA keys.</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
</widget>
</item>
<item>
@ -532,19 +363,6 @@ Alternatively you can use an existing profile. Just uncheck &quot;Create a new p
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="reuse_existing_node_CB">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Re-use an existing profile</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="9" column="3">
@ -706,24 +524,7 @@ Alternatively you can use an existing profile. Just uncheck &quot;Create a new p
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<item row="19" column="2">
<widget class="QPushButton" name="genButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@ -731,35 +532,42 @@ Alternatively you can use an existing profile. Just uncheck &quot;Create a new p
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Go!</string>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="go_check_LB">
<item row="19" column="3">
<widget class="QLabel" name="generate_label">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
@ -778,27 +586,33 @@ Alternatively you can use an existing profile. Just uncheck &quot;Create a new p
</widget>
</item>
</layout>
<action name="adv_checkbox">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Advanced options</string>
</property>
</action>
<action name="reuse_existing_node_CB">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Use existing node</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>StyledLabel</class>
<extends>QLabel</extends>
<header>gui/common/StyledLabel.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>name_input</tabstop>
<tabstop>node_input</tabstop>
<tabstop>password_input</tabstop>
<tabstop>password_input_2</tabstop>
<tabstop>adv_checkbox</tabstop>
<tabstop>keylength_comboBox</tabstop>
<tabstop>exportIdentity_PB</tabstop>
<tabstop>reuse_existing_node_CB</tabstop>
<tabstop>genPGPuser</tabstop>
<tabstop>hiddenaddr_input</tabstop>
<tabstop>hiddenport_spinBox</tabstop>
<tabstop>genButton</tabstop>
<tabstop>importIdentity_PB</tabstop>
</tabstops>
<resources>

View file

@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/">
<file>images/logo/logo_spash2.png</file>
<file>images/network_map.png</file>
<file>images/global_switch_on.png</file>
<file>images/global_switch_off.png</file>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 792 B

After

Width:  |  Height:  |  Size: 640 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB