2012-05-22 18:24:10 -04:00
|
|
|
#ifndef CONNECTFRIENDWIZARD_H
|
|
|
|
#define CONNECTFRIENDWIZARD_H
|
2009-03-26 12:58:06 -04:00
|
|
|
|
|
|
|
#include <QWizard>
|
2012-05-22 18:24:10 -04:00
|
|
|
#include <retroshare/rspeers.h>
|
|
|
|
#include <map>
|
2009-03-26 12:58:06 -04:00
|
|
|
|
|
|
|
class QCheckBox;
|
2012-05-22 18:24:10 -04:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ConnectFriendWizard;
|
|
|
|
}
|
2009-03-26 12:58:06 -04:00
|
|
|
|
|
|
|
//============================================================================
|
2009-03-28 06:41:49 -04:00
|
|
|
//! A wizard for adding friends. Based on standard QWizard component
|
|
|
|
|
|
|
|
//! The process of adding friends follows this scheme:
|
|
|
|
//! /-> Use text certificates \ /-> errorpage(if went wrong)
|
|
|
|
//! intro -| |-> ->
|
|
|
|
//! \-> Use *.pqi files / \-> fill peer details
|
2012-05-22 18:24:10 -04:00
|
|
|
//!
|
2009-03-28 06:41:49 -04:00
|
|
|
|
2009-03-26 12:58:06 -04:00
|
|
|
class ConnectFriendWizard : public QWizard
|
|
|
|
{
|
2012-05-22 18:24:10 -04:00
|
|
|
Q_OBJECT
|
2009-03-26 12:58:06 -04:00
|
|
|
|
|
|
|
public:
|
2012-05-22 18:24:10 -04:00
|
|
|
enum Page { Page_Intro, Page_Text, Page_Cert, Page_ErrorMessage, Page_Conclusion, Page_Foff, Page_Rsid, Page_Email };
|
2009-03-26 12:58:06 -04:00
|
|
|
|
2012-05-22 18:24:10 -04:00
|
|
|
ConnectFriendWizard(QWidget *parent = 0);
|
|
|
|
~ConnectFriendWizard();
|
2009-03-26 12:58:06 -04:00
|
|
|
|
2012-05-22 18:24:10 -04:00
|
|
|
void setCertificate(const QString &certificate);
|
2009-03-26 12:58:06 -04:00
|
|
|
|
2012-05-22 18:24:10 -04:00
|
|
|
virtual bool validateCurrentPage();
|
|
|
|
virtual int nextId() const;
|
|
|
|
virtual void accept();
|
2009-03-26 12:58:06 -04:00
|
|
|
|
2012-05-22 18:24:10 -04:00
|
|
|
void setGroup(const std::string &id);
|
2011-04-08 14:53:12 -04:00
|
|
|
|
2012-05-22 18:24:10 -04:00
|
|
|
protected:
|
|
|
|
void initializePage(int id);
|
2009-03-26 12:58:06 -04:00
|
|
|
|
|
|
|
private slots:
|
2012-05-22 18:24:10 -04:00
|
|
|
/* TextPage */
|
|
|
|
void updateOwnCert();
|
|
|
|
void toggleSignatureState();
|
2012-08-13 15:37:50 -04:00
|
|
|
void toggleFormatState();
|
2012-05-22 18:24:10 -04:00
|
|
|
void runEmailClient();
|
|
|
|
void showHelpUserCert();
|
|
|
|
void copyCert();
|
|
|
|
void saveCert();
|
|
|
|
void cleanFriendCert();
|
|
|
|
|
|
|
|
/* CertificatePage */
|
|
|
|
void loadFriendCert();
|
|
|
|
void generateCertificateCalled();
|
|
|
|
|
|
|
|
/* FofPage */
|
|
|
|
void updatePeersList(int index);
|
|
|
|
void signAllSelectedUsers();
|
|
|
|
|
|
|
|
/* ConclusionPage */
|
|
|
|
void groupCurrentIndexChanged(int index);
|
2010-06-09 19:46:24 -04:00
|
|
|
|
2009-03-26 12:58:06 -04:00
|
|
|
private:
|
2012-05-22 18:24:10 -04:00
|
|
|
bool error;
|
|
|
|
RsPeerDetails peerDetails;
|
2009-03-26 12:58:06 -04:00
|
|
|
|
2012-05-22 18:24:10 -04:00
|
|
|
/* FofPage */
|
|
|
|
std::map<QCheckBox*, std::string> _id_boxes;
|
|
|
|
std::map<QCheckBox*, std::string> _gpg_id_boxes;
|
2009-03-26 12:58:06 -04:00
|
|
|
|
2012-05-22 18:24:10 -04:00
|
|
|
/* ConclusionPage */
|
|
|
|
QString groupId;
|
2010-06-09 19:46:24 -04:00
|
|
|
|
2012-05-22 18:24:10 -04:00
|
|
|
Ui::ConnectFriendWizard *ui;
|
2009-03-26 12:58:06 -04:00
|
|
|
};
|
|
|
|
|
2012-05-22 18:24:10 -04:00
|
|
|
class ConnectFriendPage : public QWizardPage
|
2009-05-18 15:51:40 -04:00
|
|
|
{
|
2012-05-22 18:24:10 -04:00
|
|
|
friend class ConnectFriendWizard; // for access to registerField
|
2009-05-18 15:51:40 -04:00
|
|
|
|
2012-05-22 18:24:10 -04:00
|
|
|
Q_OBJECT
|
2009-03-26 12:58:06 -04:00
|
|
|
|
|
|
|
public:
|
2012-05-22 18:24:10 -04:00
|
|
|
ConnectFriendPage(QWidget *parent = 0);
|
2009-03-26 12:58:06 -04:00
|
|
|
|
2012-05-22 18:24:10 -04:00
|
|
|
void setComplete(bool isComplete);
|
|
|
|
virtual bool isComplete() const;
|
2009-03-26 12:58:06 -04:00
|
|
|
|
|
|
|
private:
|
2012-05-22 18:24:10 -04:00
|
|
|
bool useComplete;
|
|
|
|
bool complete;
|
2009-03-26 12:58:06 -04:00
|
|
|
};
|
|
|
|
|
2012-05-22 18:24:10 -04:00
|
|
|
#endif // CONNECTFRIENDWIZARD_H
|