fixed genCertDialog. Still needs to prevent text fields to stretch into super small lines (how can i do this??)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8132 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-04-13 22:07:55 +00:00
parent 9677cb4934
commit e52976b3e6
3 changed files with 537 additions and 481 deletions

View file

@ -119,7 +119,8 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
ui.headerFrame->setHeaderText(tr("Create a new Identity")); ui.headerFrame->setHeaderText(tr("Create a new Identity"));
connect(ui.new_gpg_key_checkbox, SIGNAL(clicked()), this, SLOT(newGPGKeyGenUiSetup())); connect(ui.new_gpg_key_checkbox, SIGNAL(clicked()), this, SLOT(newGPGKeyGenUiSetup()));
connect(ui.adv_checkbox, SIGNAL(clicked()), this, SLOT(hiddenUiSetup())); connect(ui.adv_checkbox, SIGNAL(clicked()), this, SLOT(updateUiSetup()));
connect(ui.hidden_checkbox, SIGNAL(clicked()), this, SLOT(updateUiSetup()));
connect(ui.genButton, SIGNAL(clicked()), this, SLOT(genPerson())); connect(ui.genButton, SIGNAL(clicked()), this, SLOT(genPerson()));
connect(ui.importIdentity_PB, SIGNAL(clicked()), this, SLOT(importIdentity())); connect(ui.importIdentity_PB, SIGNAL(clicked()), this, SLOT(importIdentity()));
@ -232,7 +233,7 @@ void GenCertDialog::init()
ui.header_label->setText(text); ui.header_label->setText(text);
newGPGKeyGenUiSetup(); newGPGKeyGenUiSetup();
hiddenUiSetup(); updateUiSetup();
} }
void GenCertDialog::mouseMoveEvent(QMouseEvent *e) void GenCertDialog::mouseMoveEvent(QMouseEvent *e)
@ -292,18 +293,21 @@ void GenCertDialog::newGPGKeyGenUiSetup() {
} }
} }
void GenCertDialog::hiddenUiSetup() void GenCertDialog::updateUiSetup()
{ {
if (ui.adv_checkbox->isChecked()) if (ui.adv_checkbox->isChecked())
{
ui.hidden_checkbox->show();
ui.keylength_label->show();
ui.keylength_comboBox->show();
if(ui.hidden_checkbox->isChecked())
{ {
ui.hiddenaddr_input->show(); ui.hiddenaddr_input->show();
ui.hiddenaddr_label->show(); ui.hiddenaddr_label->show();
ui.label_hiddenaddr2->show(); ui.label_hiddenaddr2->show();
ui.hiddenport_label->show(); ui.hiddenport_label->show();
ui.hiddenport_spinBox->show(); ui.hiddenport_spinBox->show();
ui.keylength_label->show();
ui.keylength_comboBox->show();
} }
else else
{ {
@ -312,9 +316,24 @@ void GenCertDialog::hiddenUiSetup()
ui.label_hiddenaddr2->hide(); ui.label_hiddenaddr2->hide();
ui.hiddenport_label->hide(); ui.hiddenport_label->hide();
ui.hiddenport_spinBox->hide(); ui.hiddenport_spinBox->hide();
}
}
else
{
ui.hiddenaddr_input->hide();
ui.hiddenaddr_label->hide();
ui.label_hiddenaddr2->hide();
ui.hiddenport_label->hide();
ui.hiddenport_spinBox->hide();
ui.hidden_checkbox->hide();
ui.keylength_label->hide(); ui.keylength_label->hide();
ui.keylength_comboBox->hide(); ui.keylength_comboBox->hide();
if(ui.hidden_checkbox->isChecked())
ui.hidden_checkbox->setChecked(false) ;
} }
} }
void GenCertDialog::exportIdentity() void GenCertDialog::exportIdentity()
@ -368,7 +387,7 @@ void GenCertDialog::genPerson()
RsPgpId PGPId; RsPgpId PGPId;
bool isHiddenLoc = false; bool isHiddenLoc = false;
if (ui.adv_checkbox->isChecked()) if (ui.hidden_checkbox->isChecked())
{ {
std::string hl = ui.hiddenaddr_input->text().toStdString(); std::string hl = ui.hiddenaddr_input->text().toStdString();
uint16_t port = ui.hiddenport_spinBox->value(); uint16_t port = ui.hiddenport_spinBox->value();
@ -443,6 +462,7 @@ void GenCertDialog::genPerson()
ui.genButton->hide(); ui.genButton->hide();
ui.importIdentity_PB->hide(); ui.importIdentity_PB->hide();
ui.genprofileinfo_label->hide(); ui.genprofileinfo_label->hide();
ui.hidden_checkbox->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

@ -42,7 +42,7 @@ private slots:
void exportIdentity(); void exportIdentity();
void newGPGKeyGenUiSetup(); void newGPGKeyGenUiSetup();
void grabMouse(); void grabMouse();
void hiddenUiSetup(); void updateUiSetup();
private: private:
void init(); void init();

View file

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>805</width> <width>853</width>
<height>509</height> <height>592</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -17,23 +17,27 @@
<iconset resource="images.qrc"> <iconset resource="images.qrc">
<normaloff>:/images/logo/logo_48.png</normaloff>:/images/logo/logo_48.png</iconset> <normaloff>:/images/logo/logo_48.png</normaloff>:/images/logo/logo_48.png</iconset>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<property name="margin"> <item>
<number>0</number> <widget class="HeaderFrame" name="headerFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="spacing"> <property name="styleSheet">
<number>0</number> <string notr="true"/>
</property> </property>
<item row="1" column="0"> <property name="frameShape">
<widget class="QFrame" name="frame"> <enum>QFrame::NoFrame</enum>
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <property name="frameShadow">
<item row="0" column="0"> <enum>QFrame::Plain</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="header_label"> <widget class="QLabel" name="header_label">
<property name="font"> <property name="font">
<font> <font>
@ -49,7 +53,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item>
<widget class="QLabel" name="genprofileinfo_label"> <widget class="QLabel" name="genprofileinfo_label">
<property name="font"> <property name="font">
<font> <font>
@ -65,10 +69,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item>
<widget class="QGroupBox" name="groupBox">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="no_gpg_key_label"> <widget class="QLabel" name="no_gpg_key_label">
<property name="text"> <property name="text">
<string>It looks like you don't own any profile (PGP keys). Please fill in the form below to create one, or import an existing profile.</string> <string>It looks like you don't own any profile (PGP keys). Please fill in the form below to create one, or import an existing profile.</string>
@ -78,17 +79,8 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,0,0,0"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QCheckBox" name="new_gpg_key_checkbox"> <widget class="QCheckBox" name="new_gpg_key_checkbox">
<property name="maximumSize"> <property name="maximumSize">
@ -118,35 +110,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="adv_checkbox">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>32</height>
</size>
</property>
<property name="toolTip">
<string>Your profile is associated with a PGP key</string>
</property>
<property name="text">
<string>Advanced</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/kcmsystem24.png</normaloff>:/images/kcmsystem24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="importIdentity_PB"> <widget class="QPushButton" name="importIdentity_PB">
<property name="sizePolicy"> <property name="sizePolicy">
@ -173,6 +136,68 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QCheckBox" name="adv_checkbox">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>32</height>
</size>
</property>
<property name="toolTip">
<string>Your profile is associated with a PGP key</string>
</property>
<property name="text">
<string>Advanced options</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<normaloff>:/images/kcmsystem24.png</normaloff>:/images/kcmsystem24.png</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<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>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="hidden_checkbox">
<property name="text">
<string>Create a hidden node</string>
</property>
</widget>
</item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
@ -188,7 +213,7 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="2" column="0"> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
@ -250,7 +275,7 @@
<item> <item>
<widget class="QLabel" name="keylength_label"> <widget class="QLabel" name="keylength_label">
<property name="text"> <property name="text">
<string>RSA key length</string> <string>SSL key length</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -267,6 +292,24 @@
</item> </item>
<item> <item>
<widget class="QLineEdit" name="name_input"> <widget class="QLineEdit" name="name_input">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>32</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Enter your nickname here</string> <string>Enter your nickname here</string>
</property> </property>
@ -305,6 +348,12 @@ anonymous, you can use a fake email.</string>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="password_input_2"> <widget class="QLineEdit" name="password_input_2">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Put a strong password here. This password protects your PGP key.</string> <string>Put a strong password here. This password protects your PGP key.</string>
</property> </property>
@ -321,6 +370,12 @@ anonymous, you can use a fake email.</string>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="node_input"> <widget class="QLineEdit" name="node_input">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maxLength"> <property name="maxLength">
<number>64</number> <number>64</number>
</property> </property>
@ -333,6 +388,18 @@ anonymous, you can use a fake email.</string>
</property> </property>
<item> <item>
<widget class="QLineEdit" name="hiddenaddr_input"> <widget class="QLineEdit" name="hiddenaddr_input">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>32</height>
</size>
</property>
<property name="maxLength"> <property name="maxLength">
<number>64</number> <number>64</number>
</property> </property>
@ -347,6 +414,9 @@ anonymous, you can use a fake email.</string>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="hiddenport_spinBox"> <widget class="QSpinBox" name="hiddenport_spinBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This is your connection port.&lt;/p&gt;&lt;p&gt;Any value between 1024 and 65535 &lt;/p&gt;&lt;p&gt;should be ok. You can change it later.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum"> <property name="minimum">
<number>1</number> <number>1</number>
</property> </property>
@ -367,29 +437,7 @@ anonymous, you can use a fake email.</string>
</item> </item>
</layout> </layout>
</item> </item>
<item row="5" column="0"> <item>
<widget class="QProgressBar" name="entropy_bar">
<property name="value">
<number>24</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="entropy_label">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;Before proceeding, move your mouse around to help Retroshare collect as much randomness as possible. Filling the progressbar to 20% is needed, 100% is advised.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_hiddenaddr2"> <widget class="QLabel" name="label_hiddenaddr2">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -411,7 +459,29 @@ anonymous, you can use a fake email.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0"> <item>
<widget class="QLabel" name="entropy_label">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;Before proceeding, move your mouse around to help Retroshare collect as much randomness as possible. Filling the progressbar to 20% is needed, 100% is advised.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="entropy_bar">
<property name="value">
<number>24</number>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="genButton"> <widget class="QPushButton" name="genButton">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
@ -435,38 +505,19 @@ anonymous, you can use a fake email.</string>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> <zorder>headerFrame</zorder>
</item> <zorder>header_label</zorder>
<item row="3" column="0"> <zorder>genButton</zorder>
<spacer name="verticalSpacer"> <zorder>header_label</zorder>
<property name="orientation"> <zorder>layoutWidget</zorder>
<enum>Qt::Vertical</enum> <zorder>layoutWidget_2</zorder>
</property> <zorder>genprofileinfo_label</zorder>
<property name="sizeHint" stdset="0"> <zorder>entropy_bar</zorder>
<size> <zorder>label_hiddenaddr2</zorder>
<width>20</width> <zorder>entropy_label</zorder>
<height>40</height> <zorder>layoutWidget_3</zorder>
</size> <zorder>headerFrame</zorder>
</property> <zorder>no_gpg_key_label</zorder>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="HeaderFrame" name="headerFrame">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
</widget>
</item>
</layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
@ -476,21 +527,6 @@ anonymous, you can use a fake email.</string>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<tabstops>
<tabstop>genPGPuser</tabstop>
<tabstop>name_input</tabstop>
<tabstop>email_input</tabstop>
<tabstop>password_input</tabstop>
<tabstop>password_input_2</tabstop>
<tabstop>node_input</tabstop>
<tabstop>hiddenaddr_input</tabstop>
<tabstop>hiddenport_spinBox</tabstop>
<tabstop>genButton</tabstop>
<tabstop>new_gpg_key_checkbox</tabstop>
<tabstop>adv_checkbox</tabstop>
<tabstop>importIdentity_PB</tabstop>
<tabstop>exportIdentity_PB</tabstop>
</tabstops>
<resources> <resources>
<include location="images.qrc"/> <include location="images.qrc"/>
</resources> </resources>