2018-11-13 16:02:26 -05:00
|
|
|
/*******************************************************************************
|
|
|
|
* gui/connect/ConfCertDialog.h *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2006 Crypton <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/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
#ifndef _CONFCERTDIALOG_H
|
|
|
|
#define _CONFCERTDIALOG_H
|
|
|
|
|
2008-04-07 20:31:46 -04:00
|
|
|
#include <QDialog>
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
#include "ui_ConfCertDialog.h"
|
2014-03-17 16:56:06 -04:00
|
|
|
#include <retroshare/rstypes.h>
|
2018-09-17 17:03:11 -04:00
|
|
|
#include <retroshare/rspeers.h>
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2008-04-07 20:31:46 -04:00
|
|
|
class ConfCertDialog : public QDialog
|
2007-11-14 22:18:48 -05:00
|
|
|
{
|
2010-10-25 16:19:57 -04:00
|
|
|
Q_OBJECT
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2010-10-25 16:19:57 -04:00
|
|
|
public:
|
|
|
|
enum enumPage { PageDetails, PageTrust, PageCertificate };
|
2009-05-07 18:43:11 -04:00
|
|
|
|
2014-03-17 16:56:06 -04:00
|
|
|
template<class ID_CLASS> static void showIt(const ID_CLASS& id, enumPage page)
|
|
|
|
{
|
2014-10-09 11:17:42 -04:00
|
|
|
ConfCertDialog *confdialog = instance(id);
|
2014-03-17 16:56:06 -04:00
|
|
|
|
|
|
|
switch (page) {
|
|
|
|
case PageDetails:
|
|
|
|
confdialog->ui.stabWidget->setCurrentIndex(0);
|
|
|
|
break;
|
|
|
|
case PageTrust:
|
|
|
|
confdialog->ui.stabWidget->setCurrentIndex(1);
|
|
|
|
break;
|
|
|
|
case PageCertificate:
|
|
|
|
confdialog->ui.stabWidget->setCurrentIndex(2);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
confdialog->load();
|
|
|
|
confdialog->show();
|
|
|
|
confdialog->raise();
|
|
|
|
confdialog->activateWindow();
|
|
|
|
|
|
|
|
/* window will destroy itself! */
|
|
|
|
}
|
2011-05-18 17:23:26 -04:00
|
|
|
static void loadAll();
|
2018-09-17 17:03:11 -04:00
|
|
|
static QString getCertificateDescription(const RsPeerDetails& det,bool signatures_included,bool extra_locators_included);
|
2009-05-07 18:43:11 -04:00
|
|
|
|
2010-10-25 16:19:57 -04:00
|
|
|
signals:
|
|
|
|
void configChanged();
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2010-10-25 16:19:57 -04:00
|
|
|
private:
|
|
|
|
/** Default constructor */
|
2014-03-17 16:56:06 -04:00
|
|
|
ConfCertDialog(const RsPeerId &id,const RsPgpId& pgp_id, QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
2010-10-25 16:19:57 -04:00
|
|
|
/** Default destructor */
|
|
|
|
~ConfCertDialog();
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2014-03-17 16:56:06 -04:00
|
|
|
static ConfCertDialog *instance(const RsPeerId &peer_id);
|
|
|
|
static ConfCertDialog *instance(const RsPgpId &pgp_id);
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2010-10-25 16:19:57 -04:00
|
|
|
void load();
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
private slots:
|
2010-10-25 16:19:57 -04:00
|
|
|
void applyDialog();
|
2012-01-23 15:55:08 -05:00
|
|
|
void loadInvitePage();
|
2010-06-13 19:42:21 -04:00
|
|
|
|
2010-10-25 16:19:57 -04:00
|
|
|
void showHelpDialog();
|
|
|
|
/** Called when a child window requests the given help <b>topic</b>. */
|
|
|
|
void showHelpDialog(const QString &topic);
|
2010-06-13 19:42:21 -04:00
|
|
|
|
2007-11-14 22:18:48 -05:00
|
|
|
private:
|
2014-03-17 16:56:06 -04:00
|
|
|
RsPeerId peerId;
|
|
|
|
RsPgpId pgpId;
|
|
|
|
|
2017-01-24 10:17:53 -05:00
|
|
|
QString nameAndLocation;
|
|
|
|
|
2010-06-13 19:42:21 -04:00
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::ConfCertDialog ui;
|
2007-11-14 22:18:48 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|