Turned RsInit into a static class, and changed retroshare invite so that it does not contain signatures anymore.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1022 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2009-02-08 14:30:28 +00:00
parent b9abc24e5c
commit 78c07ca367
18 changed files with 589 additions and 464 deletions

View file

@ -21,6 +21,7 @@
#include <rshare.h>
#include <rsiface/rsinit.h>
#include "GenCertDialog.h"
#include "gui/Preferences/rsharesettings.h"
#include <QFileDialog>
@ -33,8 +34,8 @@
/** Default constructor */
GenCertDialog::GenCertDialog(RsInit *conf, QWidget *parent, Qt::WFlags flags)
: QDialog(parent, flags), rsConfig(conf)
GenCertDialog::GenCertDialog(QWidget *parent, Qt::WFlags flags)
: QDialog(parent, flags)
{
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
@ -124,7 +125,7 @@ void GenCertDialog::genPerson()
return;
}
bool okGen = RsGenerateCertificate(rsConfig, genName, genOrg, genLoc, genCountry, passwd, err);
bool okGen = RsInit::RsGenerateCertificate(genName, genOrg, genLoc, genCountry, passwd, err);
if (okGen)
{
@ -155,7 +156,7 @@ void GenCertDialog::selectFriend()
std::string fname, userName;
fname = fileName.toStdString();
if (ValidateTrustedUser(rsConfig, fname, userName))
if (RsInit::ValidateTrustedUser(fname, userName))
{
ui.genFriend -> setText(QString::fromStdString(userName));
}
@ -177,7 +178,7 @@ void GenCertDialog::checkChanged(int i)
/* invalidate selection */
std::string fname = "";
std::string userName = "";
ValidateTrustedUser(rsConfig, fname, userName);
RsInit::ValidateTrustedUser(fname, userName);
ui.genFriend -> setText("<None Selected>");
}
}
@ -187,7 +188,7 @@ void GenCertDialog::loadCertificates()
{
bool autoSave = false;
/* Final stage of loading */
if (LoadCertificates(rsConfig, autoSave))
if (RsInit::LoadCertificates(autoSave))
{
close();
}

View file

@ -35,7 +35,7 @@ class GenCertDialog : public QDialog
public:
/** Default constructor */
GenCertDialog(RsInit *config, QWidget *parent = 0, Qt::WFlags flags = 0);
GenCertDialog(QWidget *parent = 0, Qt::WFlags flags = 0);
/** Default destructor */
//~GenCertDialog();
@ -63,8 +63,6 @@ private:
/** Qt Designer generated object */
Ui::GenCertDialog ui;
RsInit *rsConfig;
};
#endif

View file

@ -20,6 +20,7 @@
****************************************************************/
#include <rshare.h>
#include <rsiface/rsinit.h>
#include "StartDialog.h"
#include "GenCertDialog.h"
#include "LogoBar.h"
@ -33,8 +34,8 @@
/** Default constructor */
StartDialog::StartDialog(RsInit *conf, QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags), rsConfig(conf), reqNewCert(false)
StartDialog::StartDialog(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags), reqNewCert(false)
{
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
@ -69,7 +70,7 @@ StartDialog::StartDialog(RsInit *conf, QWidget *parent, Qt::WFlags flags)
/* load the Certificate File name */
std::string userName;
if (ValidateCertificate(rsConfig, userName))
if (RsInit::ValidateCertificate(userName))
{
/* just need to enter password */
ui.loadName->setText(QString::fromStdString(userName));
@ -120,7 +121,7 @@ void StartDialog::closeinfodlg()
void StartDialog::loadPerson()
{
std::string passwd = ui.loadPasswd->text().toStdString();
LoadPassword(rsConfig, passwd);
RsInit::LoadPassword(passwd);
loadCertificates();
}
@ -128,7 +129,7 @@ void StartDialog::loadCertificates()
{
bool autoSave = (Qt::Checked == ui.autoBox -> checkState());
/* Final stage of loading */
if (LoadCertificates(rsConfig, autoSave))
if (RsInit::LoadCertificates(autoSave))
{
close();
}

View file

@ -41,7 +41,7 @@ class StartDialog : public QMainWindow
public:
/** Default constructor */
StartDialog(RsInit *config, QWidget *parent = 0, Qt::WFlags flags = 0);
StartDialog(QWidget *parent = 0, Qt::WFlags flags = 0);
/** Default destructor */
//~StartDialog();
@ -83,8 +83,6 @@ private:
#endif
**************/
RsInit *rsConfig;
bool reqNewCert;
};

View file

@ -102,6 +102,9 @@ void InviteDialog::emailbutton()
void InviteDialog::setInfo(std::string invite)
{
// ui.emailText->setCurrentFont(QFont("TypeWriter",10)) ;
// ui.emailText->currentFont().setLetterSpacing(QFont::AbsoluteSpacing,1) ;
// ui.emailText->currentFont().setStyleHint(QFont::TypeWriter,QFont::Courier) ;
ui.emailText->setText(QString::fromStdString(invite));
}

View file

@ -13,22 +13,10 @@
<string>Invite a Friend</string>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<property name="margin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<property name="spacing" >
<number>6</number>
</property>
<item row="2" column="2" >
@ -46,17 +34,25 @@
</item>
<item row="1" column="0" colspan="7" >
<widget class="QTextEdit" name="emailText" >
<property name="font" >
<font>
<family>Courier New</family>
<pointsize>10</pointsize>
<kerning>false</kerning>
</font>
</property>
<property name="readOnly" >
<bool>true</bool>
</property>
<property name="html" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
<string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
&lt;/style>&lt;/head>&lt;body style=" font-family:'Courier New'; font-size:10pt; font-weight:400; font-style:normal;">
&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Arial'; font-size:8pt;">&lt;/p>&lt;/body>&lt;/html></string>
</property>
<property name="acceptRichText" >
<bool>true</bool>
<bool>false</bool>
</property>
</widget>
</item>
@ -484,7 +480,7 @@ p, li { white-space: pre-wrap; }
</palette>
</property>
<property name="styleSheet" >
<string>background-image: url(:/images/invitefriendlabel.png);</string>
<string notr="true" >background-image: url(:/images/invitefriendlabel.png);</string>
</property>
<property name="text" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
@ -520,7 +516,7 @@ p, li { white-space: pre-wrap; }
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@ -553,7 +549,7 @@ p, li { white-space: pre-wrap; }
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@ -566,7 +562,7 @@ p, li { white-space: pre-wrap; }
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>