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

View File

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

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>805</width>
<height>509</height>
<width>853</width>
<height>592</height>
</rect>
</property>
<property name="windowTitle">
@ -17,23 +17,27 @@
<iconset resource="images.qrc">
<normaloff>:/images/logo/logo_48.png</normaloff>:/images/logo/logo_48.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="margin">
<number>0</number>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="HeaderFrame" name="headerFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="spacing">
<number>0</number>
<property name="styleSheet">
<string notr="true"/>
</property>
<item row="1" column="0">
<widget class="QFrame" name="frame">
<property name="minimumSize">
<size>
<width>0</width>
<height>30</height>
</size>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="header_label">
<property name="font">
<font>
@ -49,7 +53,7 @@
</property>
</widget>
</item>
<item row="1" column="0">
<item>
<widget class="QLabel" name="genprofileinfo_label">
<property name="font">
<font>
@ -65,10 +69,7 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBox">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<item>
<widget class="QLabel" name="no_gpg_key_label">
<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>
@ -78,17 +79,8 @@
</property>
</widget>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,0,0,0">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QCheckBox" name="new_gpg_key_checkbox">
<property name="maximumSize">
@ -118,35 +110,6 @@
</property>
</widget>
</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>
<widget class="QPushButton" name="importIdentity_PB">
<property name="sizePolicy">
@ -173,6 +136,68 @@
</property>
</widget>
</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>
<spacer name="horizontalSpacer">
<property name="orientation">
@ -188,7 +213,7 @@
</item>
</layout>
</item>
<item row="2" column="0">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
@ -250,7 +275,7 @@
<item>
<widget class="QLabel" name="keylength_label">
<property name="text">
<string>RSA key length</string>
<string>SSL key length</string>
</property>
</widget>
</item>
@ -267,6 +292,24 @@
</item>
<item>
<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">
<string>Enter your nickname here</string>
</property>
@ -305,6 +348,12 @@ anonymous, you can use a fake email.</string>
</item>
<item>
<widget class="QLineEdit" name="password_input_2">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Put a strong password here. This password protects your PGP key.</string>
</property>
@ -321,6 +370,12 @@ anonymous, you can use a fake email.</string>
</item>
<item>
<widget class="QLineEdit" name="node_input">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maxLength">
<number>64</number>
</property>
@ -333,6 +388,18 @@ anonymous, you can use a fake email.</string>
</property>
<item>
<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">
<number>64</number>
</property>
@ -347,6 +414,9 @@ anonymous, you can use a fake email.</string>
</item>
<item>
<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">
<number>1</number>
</property>
@ -367,29 +437,7 @@ anonymous, you can use a fake email.</string>
</item>
</layout>
</item>
<item row="5" column="0">
<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">
<item>
<widget class="QLabel" name="label_hiddenaddr2">
<property name="minimumSize">
<size>
@ -411,7 +459,29 @@ anonymous, you can use a fake email.</string>
</property>
</widget>
</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">
<property name="maximumSize">
<size>
@ -435,38 +505,19 @@ anonymous, you can use a fake email.</string>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</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>
<zorder>headerFrame</zorder>
<zorder>header_label</zorder>
<zorder>genButton</zorder>
<zorder>header_label</zorder>
<zorder>layoutWidget</zorder>
<zorder>layoutWidget_2</zorder>
<zorder>genprofileinfo_label</zorder>
<zorder>entropy_bar</zorder>
<zorder>label_hiddenaddr2</zorder>
<zorder>entropy_label</zorder>
<zorder>layoutWidget_3</zorder>
<zorder>headerFrame</zorder>
<zorder>no_gpg_key_label</zorder>
</widget>
<customwidgets>
<customwidget>
@ -476,21 +527,6 @@ anonymous, you can use a fake email.</string>
<container>1</container>
</customwidget>
</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>
<include location="images.qrc"/>
</resources>