2018-11-13 16:02:26 -05:00
|
|
|
/*******************************************************************************
|
|
|
|
* gui/connect/ConnectFriendWizard.h *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2018 retroshare team <retroshare.project@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU Affero General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
|
|
|
|
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>
|
2015-06-06 08:25:17 -04:00
|
|
|
#include <QMap>
|
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
|
|
|
|
2015-06-06 08:25:17 -04:00
|
|
|
Q_PROPERTY(QString bannerPixmap READ bannerPixmap WRITE setBannerPixmap)
|
|
|
|
Q_PROPERTY(int titleFontSize READ titleFontSize WRITE setTitleFontSize)
|
|
|
|
Q_PROPERTY(int titleFontWeight READ titleFontWeight WRITE setTitleFontWeight)
|
|
|
|
Q_PROPERTY(QString titleColor READ titleColor WRITE setTitleColor)
|
|
|
|
|
2009-03-26 12:58:06 -04:00
|
|
|
public:
|
2019-06-09 18:37:13 -04:00
|
|
|
enum Page { Page_Text, Page_ErrorMessage, Page_Conclusion, Page_WebMail };
|
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-08-16 06:20:34 -04:00
|
|
|
void setCertificate(const QString &certificate, bool friendRequest);
|
2014-03-17 16:56:06 -04:00
|
|
|
void setGpgId(const RsPgpId &gpgId, const RsPeerId &sslId, bool friendRequest);
|
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
|
|
|
|
2015-06-06 08:25:17 -04:00
|
|
|
void setBannerPixmap(const QString &pixmap);
|
|
|
|
QString bannerPixmap();
|
|
|
|
void setTitleFontSize(int size);
|
|
|
|
int titleFontSize();
|
|
|
|
void setTitleFontWeight(int weight);
|
|
|
|
int titleFontWeight();
|
|
|
|
void setTitleColor(const QString &color);
|
|
|
|
QString titleColor();
|
|
|
|
|
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 */
|
2015-10-24 18:54:22 -04:00
|
|
|
void runEmailClient2();
|
2015-06-07 14:28:17 -04:00
|
|
|
void pasteCert();
|
2017-05-08 11:26:12 -04:00
|
|
|
void openCert();
|
2012-08-14 19:20:33 -04:00
|
|
|
void friendCertChanged();
|
2012-05-22 18:24:10 -04:00
|
|
|
void cleanFriendCert();
|
|
|
|
|
2012-12-01 14:22:22 -05:00
|
|
|
ServicePermissionFlags serviceFlags() const ;
|
|
|
|
|
2012-05-22 18:24:10 -04:00
|
|
|
/* CertificatePage */
|
2019-06-09 18:36:40 -04:00
|
|
|
//void loadFriendCert();
|
|
|
|
//void generateCertificateCalled();
|
2012-05-22 18:24:10 -04:00
|
|
|
|
|
|
|
/* ConclusionPage */
|
|
|
|
void groupCurrentIndexChanged(int index);
|
2019-06-10 09:15:15 -04:00
|
|
|
|
2015-10-24 11:05:12 -04:00
|
|
|
/* WebMailPage */
|
2019-06-10 09:15:15 -04:00
|
|
|
void inviteGmail();
|
|
|
|
void inviteYahoo();
|
|
|
|
void inviteOutlook();
|
|
|
|
void inviteAol();
|
|
|
|
void inviteYandex();
|
2015-10-24 11:05:12 -04:00
|
|
|
|
2017-01-23 11:58:31 -05:00
|
|
|
void toggleAdvanced();
|
2010-06-09 19:46:24 -04:00
|
|
|
|
2009-03-26 12:58:06 -04:00
|
|
|
private:
|
2012-12-22 16:22:03 -05:00
|
|
|
// returns the translated error string for the error code (to be found in rspeers.h)
|
|
|
|
QString getErrorString(uint32_t) ;
|
2015-06-06 08:25:17 -04:00
|
|
|
void updateStylesheet();
|
|
|
|
void setTitleText(QWizardPage *page, const QString &title);
|
2017-01-23 11:58:31 -05:00
|
|
|
bool AdvancedVisible;
|
2019-06-10 09:15:15 -04:00
|
|
|
|
2015-06-06 08:25:17 -04:00
|
|
|
private:
|
2012-05-22 18:24:10 -04:00
|
|
|
bool error;
|
|
|
|
RsPeerDetails peerDetails;
|
2012-08-16 06:20:34 -04:00
|
|
|
std::string mCertificate;
|
2009-03-26 12:58:06 -04:00
|
|
|
|
2019-06-10 09:15:15 -04:00
|
|
|
bool mIsShortInvite;
|
|
|
|
|
2015-06-06 08:25:17 -04:00
|
|
|
/* Stylesheet */
|
|
|
|
QString mBannerPixmap;
|
|
|
|
int mTitleFontSize;
|
|
|
|
int mTitleFontWeight;
|
|
|
|
QString mTitleColor;
|
|
|
|
QMap<QWizardPage*, QString> mTitleString;
|
|
|
|
|
2012-08-16 06:20:34 -04:00
|
|
|
/* TextPage */
|
|
|
|
QTimer *cleanfriendCertTimer;
|
2012-08-14 19:20:33 -04:00
|
|
|
|
2012-08-16 06:20:34 -04:00
|
|
|
/* FofPage */
|
2014-03-17 16:56:06 -04:00
|
|
|
std::map<QCheckBox*, RsPeerId> _id_boxes;
|
|
|
|
std::map<QCheckBox*, RsPgpId> _gpg_id_boxes;
|
2009-03-26 12:58:06 -04:00
|
|
|
|
2012-05-22 18:24:10 -04:00
|
|
|
/* ConclusionPage */
|
|
|
|
QString groupId;
|
2019-06-10 09:15:15 -04:00
|
|
|
|
2015-10-24 11:05:12 -04:00
|
|
|
/* WebMailPage */
|
2019-06-10 09:15:15 -04:00
|
|
|
QString subject;
|
2015-10-24 11:05:12 -04:00
|
|
|
QString body;
|
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
|