mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-12 11:02:30 -04: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
3 changed files with 98 additions and 24 deletions
|
@ -19,30 +19,36 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
|
||||
#include "AddFriendWizard.h"
|
||||
//#include "rshare.h"
|
||||
//#include "config/gconfig.h"
|
||||
|
||||
//#include "rsiface/rsiface.h"
|
||||
#include "AddFriendWizard.h"
|
||||
#include "rsiface/rsiface.h"
|
||||
#include "rsiface/rspeers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include <QContextMenuEvent>
|
||||
#include <QMenu>
|
||||
#include <QCursor>
|
||||
#include <QPoint>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QMouseEvent>
|
||||
#include <QPixmap>
|
||||
#include <QPoint>
|
||||
|
||||
#include "gui/NetworkDialog.h"
|
||||
|
||||
/** Constructor */
|
||||
AddFriendWizard::AddFriendWizard(QWidget *parent, Qt::WFlags flags)
|
||||
: QDialog(parent, flags)
|
||||
AddFriendWizard::AddFriendWizard(NetworkDialog *cd, QWidget *parent, Qt::WFlags flags)
|
||||
: QDialog(parent, flags), cDialog(cd)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
//GConfig config;
|
||||
//config.loadWidgetInformation(this);
|
||||
//GConfig config;
|
||||
//config.loadWidgetInformation(this);
|
||||
|
||||
connect(ui.loadfileButton, SIGNAL(clicked()), this, SLOT(loadfile()));
|
||||
|
||||
|
||||
setFixedSize(QSize(508, 312));
|
||||
|
@ -51,9 +57,29 @@ AddFriendWizard::AddFriendWizard(QWidget *parent, Qt::WFlags flags)
|
|||
#ifdef Q_WS_WIN
|
||||
|
||||
#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()
|
||||
|
@ -128,3 +154,31 @@ void AddFriendWizard::on_cancelButton_clicked()
|
|||
// leave but show that cancel was pressed
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue