2007-11-15 03:18:48 +00:00
|
|
|
/****************************************************************
|
|
|
|
* RetroShare is distributed under the following license:
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006, crypton
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* 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 General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _CONFCERTDIALOG_H
|
|
|
|
#define _CONFCERTDIALOG_H
|
|
|
|
|
2008-04-08 00:31:46 +00:00
|
|
|
#include <QDialog>
|
2007-11-15 03:18:48 +00:00
|
|
|
|
|
|
|
#include "ui_ConfCertDialog.h"
|
2014-03-17 20:56:06 +00:00
|
|
|
#include <retroshare/rstypes.h>
|
2018-09-17 23:03:11 +02:00
|
|
|
#include <retroshare/rspeers.h>
|
2007-11-15 03:18:48 +00:00
|
|
|
|
2008-04-08 00:31:46 +00:00
|
|
|
class ConfCertDialog : public QDialog
|
2007-11-15 03:18:48 +00:00
|
|
|
{
|
2010-10-25 20:19:57 +00:00
|
|
|
Q_OBJECT
|
2007-11-15 03:18:48 +00:00
|
|
|
|
2010-10-25 20:19:57 +00:00
|
|
|
public:
|
|
|
|
enum enumPage { PageDetails, PageTrust, PageCertificate };
|
2009-05-07 22:43:11 +00:00
|
|
|
|
2014-03-17 20:56:06 +00:00
|
|
|
template<class ID_CLASS> static void showIt(const ID_CLASS& id, enumPage page)
|
|
|
|
{
|
2014-10-09 15:17:42 +00:00
|
|
|
ConfCertDialog *confdialog = instance(id);
|
2014-03-17 20:56:06 +00: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 21:23:26 +00:00
|
|
|
static void loadAll();
|
2018-09-17 23:03:11 +02:00
|
|
|
static QString getCertificateDescription(const RsPeerDetails& det,bool signatures_included,bool extra_locators_included);
|
2009-05-07 22:43:11 +00:00
|
|
|
|
2010-10-25 20:19:57 +00:00
|
|
|
signals:
|
|
|
|
void configChanged();
|
2007-11-15 03:18:48 +00:00
|
|
|
|
2010-10-25 20:19:57 +00:00
|
|
|
private:
|
|
|
|
/** Default constructor */
|
2014-03-17 20:56:06 +00:00
|
|
|
ConfCertDialog(const RsPeerId &id,const RsPgpId& pgp_id, QWidget *parent = 0, Qt::WindowFlags flags = 0);
|
2010-10-25 20:19:57 +00:00
|
|
|
/** Default destructor */
|
|
|
|
~ConfCertDialog();
|
2007-11-15 03:18:48 +00:00
|
|
|
|
2014-03-17 20:56:06 +00:00
|
|
|
static ConfCertDialog *instance(const RsPeerId &peer_id);
|
|
|
|
static ConfCertDialog *instance(const RsPgpId &pgp_id);
|
2007-11-15 03:18:48 +00:00
|
|
|
|
2010-10-25 20:19:57 +00:00
|
|
|
void load();
|
2007-11-15 03:18:48 +00:00
|
|
|
|
|
|
|
private slots:
|
2010-10-25 20:19:57 +00:00
|
|
|
void applyDialog();
|
2012-01-23 20:55:08 +00:00
|
|
|
void loadInvitePage();
|
2010-06-13 23:42:21 +00:00
|
|
|
|
2010-10-25 20:19:57 +00:00
|
|
|
void showHelpDialog();
|
|
|
|
/** Called when a child window requests the given help <b>topic</b>. */
|
|
|
|
void showHelpDialog(const QString &topic);
|
2010-06-13 23:42:21 +00:00
|
|
|
|
2007-11-15 03:18:48 +00:00
|
|
|
private:
|
2014-03-17 20:56:06 +00:00
|
|
|
RsPeerId peerId;
|
|
|
|
RsPgpId pgpId;
|
|
|
|
|
2017-01-24 16:17:53 +01:00
|
|
|
QString nameAndLocation;
|
|
|
|
|
2010-06-13 23:42:21 +00:00
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::ConfCertDialog ui;
|
2007-11-15 03:18:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|