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 <QFileDialog>
#include <QGraphicsOpacityEffect> #include <QGraphicsOpacityEffect>
#include <QMessageBox> #include <QMessageBox>
#include <QMenu>
#include <QMouseEvent> #include <QMouseEvent>
#include <QTextBrowser> #include <QTextBrowser>
#include <QTimer> #include <QTimer>
@ -45,7 +46,7 @@
#include <iostream> #include <iostream>
#define IMAGE_GOOD ":/images/accepted16.png" #define IMAGE_GOOD ":/images/accepted16.png"
#define IMAGE_BAD ":/images/deletemail24.png" #define IMAGE_BAD ":/images/cancel.png"
class EntropyCollectorWidget: public QTextBrowser class EntropyCollectorWidget: public QTextBrowser
{ {
@ -133,8 +134,8 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
//ui.headerFrame->setHeaderImage(QPixmap(":/icons/svg/profile.svg")); //ui.headerFrame->setHeaderImage(QPixmap(":/icons/svg/profile.svg"));
//ui.headerFrame->setHeaderText(tr("Create a new profile")); //ui.headerFrame->setHeaderText(tr("Create a new profile"));
connect(ui.reuse_existing_node_CB, SIGNAL(clicked()), this, SLOT(switchReuseExistingNode())); connect(ui.reuse_existing_node_CB, SIGNAL(triggered()), this, SLOT(switchReuseExistingNode()));
connect(ui.adv_checkbox, SIGNAL(clicked()), this, SLOT(setupState())); connect(ui.adv_checkbox, SIGNAL(triggered()), this, SLOT(setupState()));
connect(ui.nodeType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(setupState())); connect(ui.nodeType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(setupState()));
connect(ui.genButton, SIGNAL(clicked()), this, SLOT(genPerson())); connect(ui.genButton, SIGNAL(clicked()), this, SLOT(genPerson()));
@ -173,6 +174,11 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
* mark last one as default. * 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 ; mAllFieldsOk = false ;
mEntropyOk = false ; mEntropyOk = false ;
@ -246,22 +252,22 @@ void GenCertDialog::setupState()
genNewGPGKey = generate_new; 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")); 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.headerFrame->setHeaderText(generate_new?tr("Create a new profile and node"):tr("Create a new node"));
ui.label_nodeType->setVisible(adv_state) ; ui.label_nodeType->setVisible(adv_state) ;
ui.nodeType_CB->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.importIdentity_PB->setVisible(adv_state && !generate_new) ;
ui.exportIdentity_PB->setVisible(adv_state && !generate_new) ; ui.exportIdentity_PB->setVisible(adv_state && !generate_new) ;
ui.genPGPuser->setVisible(adv_state && haveGPGKeys && !generate_new) ; ui.genPGPuser->setVisible(adv_state && haveGPGKeys && !generate_new) ;
ui.genprofileinfo_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\"")); //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); //no_gpg_key_label->setVisible(false);
ui.nickname_label->setVisible(adv_state) ; ui.nickname_label->setVisible(adv_state) ;
ui.nickname_input->setVisible(adv_state) ; ui.nickname_input->setVisible(adv_state) ;
@ -269,7 +275,7 @@ void GenCertDialog::setupState()
ui.name_label->setVisible(true); ui.name_label->setVisible(true);
ui.name_input->setVisible(generate_new); 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_label->setVisible(adv_state && !mOnlyGenerateIdentity);
ui.nickname_input->setVisible(adv_state && !mOnlyGenerateIdentity); ui.nickname_input->setVisible(adv_state && !mOnlyGenerateIdentity);
@ -300,14 +306,16 @@ void GenCertDialog::setupState()
if(mEntropyOk && mAllFieldsOk) if(mEntropyOk && mAllFieldsOk)
{ {
ui.genButton->setEnabled(true) ; 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.genButton->setToolTip(tr("Click to create your node and/or profile")) ;
ui.generate_label->setPixmap(QPixmap(IMAGE_GOOD)) ;
} }
else else
{ {
ui.genButton->setEnabled(false) ; 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.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 //generate a new gpg key
std::string err_string; 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.")); //_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.no_gpg_key_label->show();
ui.reuse_existing_node_CB->hide(); //ui.reuse_existing_node_CB->hide();
ui.name_label->hide(); ui.name_label->hide();
ui.name_input->hide(); ui.name_input->hide();
ui.nickname_label->hide(); ui.nickname_label->hide();
@ -514,9 +522,9 @@ void GenCertDialog::genPerson()
ui.node_input->hide(); ui.node_input->hide();
ui.genButton->hide(); ui.genButton->hide();
ui.importIdentity_PB->hide(); ui.importIdentity_PB->hide();
ui.genprofileinfo_label->hide(); //ui.genprofileinfo_label->hide();
ui.nodeType_CB->hide(); ui.nodeType_CB->hide();
ui.adv_checkbox->hide(); //ui.adv_checkbox->hide();
ui.keylength_label->hide(); ui.keylength_label->hide();
ui.keylength_comboBox->hide(); ui.keylength_comboBox->hide();

View file

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>724</width> <width>533</width>
<height>667</height> <height>544</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -54,7 +54,10 @@
<string/> <string/>
</property> </property>
<property name="pixmap"> <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>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
@ -77,22 +80,13 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="adv_checkbox"> <widget class="QPushButton" name="optionsButton">
<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>
<property name="text"> <property name="text">
<string>Advanced options</string> <string>Options</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="icons.qrc"> <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>
<property name="iconSize"> <property name="iconSize">
<size> <size>
@ -100,196 +94,47 @@
<height>24</height> <height>24</height>
</size> </size>
</property> </property>
<property name="tristate"> <property name="default">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="flat">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<widget class="StyledLabel" name="header_label"> <widget class="QFrame" name="profile_frame">
<property name="palette"> <property name="styleSheet">
<palette> <string notr="true"/>
<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>
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::Box</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
<property name="text"> <property name="frameShadow">
<string>You can create a new profile with this form. <enum>QFrame::Raised</enum>
Alternatively you can use an existing profile. Just uncheck &quot;Create a new profile&quot;</string>
</property> </property>
<property name="wordWrap"> <layout class="QGridLayout" name="gridLayout">
<bool>true</bool> <item row="0" column="0">
</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="profilGLayout"> <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"> <item row="9" column="2">
<widget class="QLineEdit" name="password_input_2"> <widget class="QLineEdit" name="password_input_2">
<property name="sizePolicy"> <property name="sizePolicy">
@ -354,13 +199,6 @@ Alternatively you can use an existing profile. Just uncheck &quot;Create a new p
</property> </property>
</widget> </widget>
</item> </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"> <item row="18" column="2">
<widget class="QProgressBar" name="entropy_bar"> <widget class="QProgressBar" name="entropy_bar">
<property name="sizePolicy"> <property name="sizePolicy">
@ -411,16 +249,6 @@ Alternatively you can use an existing profile. Just uncheck &quot;Create a new p
</item> </item>
</widget> </widget>
</item> </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"> <item row="5" column="2">
<widget class="QLineEdit" name="node_input"> <widget class="QLineEdit" name="node_input">
<property name="sizePolicy"> <property name="sizePolicy">
@ -504,6 +332,9 @@ Alternatively you can use an existing profile. Just uncheck &quot;Create a new p
<property name="toolTip"> <property name="toolTip">
<string>Your profile is associated with a PGP key pair. RetroShare currently ignores DSA keys.</string> <string>Your profile is associated with a PGP key pair. RetroShare currently ignores DSA keys.</string>
</property> </property>
<property name="styleSheet">
<string notr="true"/>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -532,19 +363,6 @@ Alternatively you can use an existing profile. Just uncheck &quot;Create a new p
</property> </property>
</widget> </widget>
</item> </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> </layout>
</item> </item>
<item row="9" column="3"> <item row="9" column="3">
@ -706,24 +524,7 @@ Alternatively you can use an existing profile. Just uncheck &quot;Create a new p
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item row="19" column="2">
</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>
<widget class="QPushButton" name="genButton"> <widget class="QPushButton" name="genButton">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <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> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </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"> <property name="styleSheet">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="text"> <property name="text">
<string>Go!</string> <string>Go!</string>
</property> </property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
</widget> </widget>
</item> </item>
<item> <item row="19" column="3">
<widget class="QLabel" name="go_check_LB"> <widget class="QLabel" name="generate_label">
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
</widget> </widget>
</item> </item>
<item> </layout>
<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>
</item> </item>
</layout> </layout>
</widget>
</item> </item>
<item> <item>
<spacer name="verticalSpacer_2"> <spacer name="verticalSpacer_2">
@ -778,27 +586,33 @@ Alternatively you can use an existing profile. Just uncheck &quot;Create a new p
</widget> </widget>
</item> </item>
</layout> </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> </widget>
<customwidgets>
<customwidget>
<class>StyledLabel</class>
<extends>QLabel</extends>
<header>gui/common/StyledLabel.h</header>
</customwidget>
</customwidgets>
<tabstops> <tabstops>
<tabstop>name_input</tabstop> <tabstop>name_input</tabstop>
<tabstop>node_input</tabstop> <tabstop>node_input</tabstop>
<tabstop>password_input</tabstop> <tabstop>password_input</tabstop>
<tabstop>password_input_2</tabstop> <tabstop>password_input_2</tabstop>
<tabstop>adv_checkbox</tabstop>
<tabstop>keylength_comboBox</tabstop> <tabstop>keylength_comboBox</tabstop>
<tabstop>exportIdentity_PB</tabstop> <tabstop>exportIdentity_PB</tabstop>
<tabstop>reuse_existing_node_CB</tabstop>
<tabstop>genPGPuser</tabstop> <tabstop>genPGPuser</tabstop>
<tabstop>hiddenaddr_input</tabstop> <tabstop>hiddenaddr_input</tabstop>
<tabstop>hiddenport_spinBox</tabstop> <tabstop>hiddenport_spinBox</tabstop>
<tabstop>genButton</tabstop>
<tabstop>importIdentity_PB</tabstop> <tabstop>importIdentity_PB</tabstop>
</tabstops> </tabstops>
<resources> <resources>

View file

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