mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
60f51c358c
- added automatic cleaning of certificates in both formats - grouped all certificate cleaning/parsing code in rscertificate.cc - removed unused files cleanupxpgp.h/cc - added upper/lower case to rsid template. The new format is to be tested. It is supposed to be much more robust than the previous format, in particular, allowing any string for location names. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5410 b45a01b8-16f6-495d-af2f-9b41ad6348cc
98 lines
2.1 KiB
C++
Executable File
98 lines
2.1 KiB
C++
Executable File
#ifndef CONNECTFRIENDWIZARD_H
|
|
#define CONNECTFRIENDWIZARD_H
|
|
|
|
#include <QWizard>
|
|
#include <retroshare/rspeers.h>
|
|
#include <map>
|
|
|
|
class QCheckBox;
|
|
|
|
namespace Ui {
|
|
class ConnectFriendWizard;
|
|
}
|
|
|
|
//============================================================================
|
|
//! 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
|
|
//!
|
|
|
|
class ConnectFriendWizard : public QWizard
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum Page { Page_Intro, Page_Text, Page_Cert, Page_ErrorMessage, Page_Conclusion, Page_Foff, Page_Rsid, Page_Email };
|
|
|
|
ConnectFriendWizard(QWidget *parent = 0);
|
|
~ConnectFriendWizard();
|
|
|
|
void setCertificate(const QString &certificate);
|
|
|
|
virtual bool validateCurrentPage();
|
|
virtual int nextId() const;
|
|
virtual void accept();
|
|
|
|
void setGroup(const std::string &id);
|
|
|
|
protected:
|
|
void initializePage(int id);
|
|
|
|
private slots:
|
|
/* TextPage */
|
|
void updateOwnCert();
|
|
void toggleSignatureState();
|
|
void toggleFormatState();
|
|
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);
|
|
|
|
private:
|
|
bool error;
|
|
RsPeerDetails peerDetails;
|
|
|
|
/* FofPage */
|
|
std::map<QCheckBox*, std::string> _id_boxes;
|
|
std::map<QCheckBox*, std::string> _gpg_id_boxes;
|
|
|
|
/* ConclusionPage */
|
|
QString groupId;
|
|
|
|
Ui::ConnectFriendWizard *ui;
|
|
};
|
|
|
|
class ConnectFriendPage : public QWizardPage
|
|
{
|
|
friend class ConnectFriendWizard; // for access to registerField
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
ConnectFriendPage(QWidget *parent = 0);
|
|
|
|
void setComplete(bool isComplete);
|
|
virtual bool isComplete() const;
|
|
|
|
private:
|
|
bool useComplete;
|
|
bool complete;
|
|
};
|
|
|
|
#endif // CONNECTFRIENDWIZARD_H
|