mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-04 09:05:34 -05:00
little changes for AddFriendWizard
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@492 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
cbaf3fffc9
commit
20c9e7d224
@ -19,24 +19,28 @@
|
|||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
|
#include "AddFriendWizard.h"
|
||||||
//#include "rshare.h"
|
//#include "rshare.h"
|
||||||
//#include "config/gconfig.h"
|
//#include "config/gconfig.h"
|
||||||
|
|
||||||
//#include "rsiface/rsiface.h"
|
#include "rsiface/rsiface.h"
|
||||||
#include "AddFriendWizard.h"
|
#include "rsiface/rspeers.h"
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#include <QContextMenuEvent>
|
#include <QContextMenuEvent>
|
||||||
#include <QMenu>
|
|
||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
#include <QPoint>
|
#include <QMenu>
|
||||||
|
#include <QMessageBox>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
#include <QPoint>
|
||||||
|
|
||||||
|
#include "gui/NetworkDialog.h"
|
||||||
|
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
AddFriendWizard::AddFriendWizard(QWidget *parent, Qt::WFlags flags)
|
AddFriendWizard::AddFriendWizard(NetworkDialog *cd, QWidget *parent, Qt::WFlags flags)
|
||||||
: QDialog(parent, flags)
|
: QDialog(parent, flags), cDialog(cd)
|
||||||
{
|
{
|
||||||
/* Invoke the Qt Designer generated object setup routine */
|
/* Invoke the Qt Designer generated object setup routine */
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
@ -44,6 +48,8 @@ AddFriendWizard::AddFriendWizard(QWidget *parent, Qt::WFlags flags)
|
|||||||
//GConfig config;
|
//GConfig config;
|
||||||
//config.loadWidgetInformation(this);
|
//config.loadWidgetInformation(this);
|
||||||
|
|
||||||
|
connect(ui.loadfileButton, SIGNAL(clicked()), this, SLOT(loadfile()));
|
||||||
|
|
||||||
|
|
||||||
setFixedSize(QSize(508, 312));
|
setFixedSize(QSize(508, 312));
|
||||||
|
|
||||||
@ -53,8 +59,28 @@ AddFriendWizard::AddFriendWizard(QWidget *parent, Qt::WFlags flags)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* The destructor for AddFriendWizard
|
||||||
|
*/
|
||||||
|
AddFriendWizard::~AddFriendWizard()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void AddFriendWizard::reset(QSettings *settingsPointer)
|
||||||
|
{
|
||||||
|
// set the labelstackedWidget and textstackedWidget to the first position
|
||||||
|
//labelstackedWidget->setCurrentIndex(0);
|
||||||
|
ui.textstackedWidget->setCurrentIndex(0);
|
||||||
|
// disable the backButton: We don't need it if we are on the first position
|
||||||
|
ui.backButton->setEnabled(false);
|
||||||
|
// and we aren't at the last step, were the next button becomes the finish button
|
||||||
|
lastStep = false;
|
||||||
|
|
||||||
|
settings = settingsPointer;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AddFriendWizard::on_nextButton_clicked()
|
void AddFriendWizard::on_nextButton_clicked()
|
||||||
{
|
{
|
||||||
@ -128,3 +154,31 @@ void AddFriendWizard::on_cancelButton_clicked()
|
|||||||
// leave but show that cancel was pressed
|
// leave but show that cancel was pressed
|
||||||
reject();
|
reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AddFriendWizard::loadfile()
|
||||||
|
{
|
||||||
|
|
||||||
|
/* show file dialog,
|
||||||
|
* load file into screen,
|
||||||
|
* push done button!
|
||||||
|
*/
|
||||||
|
std::string id;
|
||||||
|
if (cDialog)
|
||||||
|
{
|
||||||
|
id = cDialog->loadneighbour();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* call make Friend */
|
||||||
|
if (id != "")
|
||||||
|
{
|
||||||
|
close();
|
||||||
|
cDialog->showpeerdetails(id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* error message */
|
||||||
|
int ret = QMessageBox::warning(this, tr("RetroShare"),
|
||||||
|
tr("Certificate Load Failed"),
|
||||||
|
QMessageBox::Ok, QMessageBox::Ok);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -24,10 +24,12 @@
|
|||||||
#define _ADDFRIENDWIZARD_H
|
#define _ADDFRIENDWIZARD_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
#include <QSettings>
|
||||||
|
|
||||||
#include "ui_AddFriendWizard.h"
|
#include "ui_AddFriendWizard.h"
|
||||||
|
|
||||||
|
class NetworkDialog;
|
||||||
|
|
||||||
class AddFriendWizard : public QDialog
|
class AddFriendWizard : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -35,9 +37,11 @@ class AddFriendWizard : public QDialog
|
|||||||
public:
|
public:
|
||||||
/** Default Constructor */
|
/** Default Constructor */
|
||||||
|
|
||||||
AddFriendWizard(QWidget *parent = 0, Qt::WFlags flags = 0);
|
AddFriendWizard(NetworkDialog *cd, QWidget *parent = 0, Qt::WFlags flags = 0);
|
||||||
/** Default Destructor */
|
/** Default Destructor */
|
||||||
|
~AddFriendWizard();
|
||||||
|
|
||||||
|
void reset(QSettings *settingsPointer);
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -47,12 +51,18 @@ private slots:
|
|||||||
void on_backButton_clicked();
|
void on_backButton_clicked();
|
||||||
void on_cancelButton_clicked();
|
void on_cancelButton_clicked();
|
||||||
|
|
||||||
|
void loadfile();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
QSettings *settings;
|
||||||
|
|
||||||
bool lastStep;
|
bool lastStep;
|
||||||
|
|
||||||
|
NetworkDialog *cDialog;
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
Ui::AddFriendWizard ui;
|
Ui::AddFriendWizard ui;
|
||||||
};
|
};
|
||||||
|
@ -10,9 +10,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy>
|
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||||
<hsizetype>7</hsizetype>
|
|
||||||
<vsizetype>7</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@ -690,7 +688,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Enter the Key code you got from your friend:</span></p></body></html></string>
|
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Enter the Key code you got from your friend:</span></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QTextBrowser" name="textBrowser" >
|
<widget class="QTextBrowser" name="keyText" >
|
||||||
<property name="geometry" >
|
<property name="geometry" >
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
@ -748,17 +746,29 @@ p, li { white-space: pre-wrap; }
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" >
|
||||||
<property name="margin" >
|
<property name="leftMargin" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing" >
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalSpacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QLineEdit" name="lineEdit" />
|
<widget class="QLineEdit" name="lineEdit" />
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1" >
|
<item row="0" column="1" >
|
||||||
<widget class="QPushButton" name="pushButton_4" >
|
<widget class="QPushButton" name="loadfileButton" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Browse</string>
|
<string>Browse</string>
|
||||||
</property>
|
</property>
|
||||||
@ -809,9 +819,9 @@ p, li { white-space: pre-wrap; }
|
|||||||
<tabstop>keyradioButton</tabstop>
|
<tabstop>keyradioButton</tabstop>
|
||||||
<tabstop>pqipemradioButton</tabstop>
|
<tabstop>pqipemradioButton</tabstop>
|
||||||
<tabstop>inviteradioButton</tabstop>
|
<tabstop>inviteradioButton</tabstop>
|
||||||
<tabstop>textBrowser</tabstop>
|
<tabstop>keyText</tabstop>
|
||||||
<tabstop>lineEdit</tabstop>
|
<tabstop>lineEdit</tabstop>
|
||||||
<tabstop>pushButton_4</tabstop>
|
<tabstop>loadfileButton</tabstop>
|
||||||
<tabstop>emailText</tabstop>
|
<tabstop>emailText</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user