2018-12-25 15:34:59 -05:00
|
|
|
/*******************************************************************************
|
|
|
|
* gui/NetworkDialog.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/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
2009-04-29 13:07:28 -04:00
|
|
|
|
|
|
|
#ifndef _CONNECTIONSDIALOG_H
|
|
|
|
#define _CONNECTIONSDIALOG_H
|
|
|
|
|
2020-08-18 08:43:45 -04:00
|
|
|
#include <retroshare-gui/RsAutoUpdatePage.h>
|
|
|
|
|
2009-04-29 13:07:28 -04:00
|
|
|
#include "ui_NetworkDialog.h"
|
2020-08-18 08:43:45 -04:00
|
|
|
|
2017-10-08 15:00:15 -04:00
|
|
|
#include "gui/NetworkDialog/pgpid_item_model.h"
|
|
|
|
#include "gui/NetworkDialog/pgpid_item_proxy.h"
|
|
|
|
|
|
|
|
//tmp
|
|
|
|
class QTreeWidgetItem;
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2017-03-01 16:25:57 -05:00
|
|
|
class RSTreeWidgetItemCompareRole ;
|
|
|
|
|
2017-12-16 11:46:44 -05:00
|
|
|
|
2017-03-01 16:25:57 -05:00
|
|
|
class NetworkDialog : public RsAutoUpdatePage
|
2009-04-29 13:07:28 -04:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2012-11-19 11:01:21 -05:00
|
|
|
Q_PROPERTY(QColor backgroundColorSelf READ backgroundColorSelf WRITE setBackgroundColorSelf)
|
|
|
|
Q_PROPERTY(QColor backgroundColorOwnSign READ backgroundColorOwnSign WRITE setBackgroundColorOwnSign)
|
|
|
|
Q_PROPERTY(QColor backgroundColorAcceptConnection READ backgroundColorAcceptConnection WRITE setBackgroundColorAcceptConnection)
|
|
|
|
Q_PROPERTY(QColor backgroundColorHasSignedMe READ backgroundColorHasSignedMe WRITE setBackgroundColorHasSignedMe)
|
|
|
|
Q_PROPERTY(QColor backgroundColorDenied READ backgroundColorDenied WRITE setBackgroundColorDenied)
|
|
|
|
|
2009-04-29 13:07:28 -04:00
|
|
|
public:
|
|
|
|
/** Default Constructor */
|
|
|
|
NetworkDialog(QWidget *parent = 0);
|
2007-11-14 22:18:48 -05:00
|
|
|
|
2009-11-17 07:45:06 -05:00
|
|
|
virtual void updateDisplay() ; // overloaded from RsAutoUpdatePage
|
2017-10-08 15:00:15 -04:00
|
|
|
|
2012-11-19 11:01:21 -05:00
|
|
|
QColor backgroundColorSelf() const { return mBackgroundColorSelf; }
|
|
|
|
QColor backgroundColorOwnSign() const { return mBackgroundColorOwnSign; }
|
|
|
|
QColor backgroundColorAcceptConnection() const { return mBackgroundColorAcceptConnection; }
|
|
|
|
QColor backgroundColorHasSignedMe() const { return mBackgroundColorHasSignedMe; }
|
|
|
|
QColor backgroundColorDenied() const { return mBackgroundColorDenied; }
|
|
|
|
|
2017-12-16 11:46:44 -05:00
|
|
|
void setBackgroundColorSelf(QColor color) { PGPIdItemModel->setBackgroundColorSelf(color); mBackgroundColorSelf = color; }
|
|
|
|
void setBackgroundColorOwnSign(QColor color) { PGPIdItemModel->setBackgroundColorOwnSign(color); mBackgroundColorOwnSign = color; }
|
|
|
|
void setBackgroundColorAcceptConnection(QColor color) { PGPIdItemModel->setBackgroundColorAcceptConnection(color); mBackgroundColorAcceptConnection = color; }
|
|
|
|
void setBackgroundColorHasSignedMe(QColor color) { PGPIdItemModel->setBackgroundColorHasSignedMe(color); mBackgroundColorHasSignedMe = color; }
|
|
|
|
void setBackgroundColorDenied(QColor color) { PGPIdItemModel->setBackgroundColorDenied(color); mBackgroundColorDenied = color; }
|
2012-11-19 11:01:21 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void changeEvent(QEvent *e);
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
private slots:
|
2009-04-29 13:07:28 -04:00
|
|
|
|
2017-10-08 15:00:15 -04:00
|
|
|
void removeUnusedKeys() ;
|
2020-11-24 09:48:56 -05:00
|
|
|
void removeSelectedKeys() ;
|
2009-03-21 16:29:23 -04:00
|
|
|
void makeFriend() ;
|
2009-04-07 17:01:45 -04:00
|
|
|
void denyFriend() ;
|
2009-04-29 13:07:28 -04:00
|
|
|
void peerdetails();
|
2011-05-16 18:51:08 -04:00
|
|
|
void copyLink();
|
2019-01-06 14:58:32 -05:00
|
|
|
|
2009-04-29 13:07:28 -04:00
|
|
|
/** Create the context popup menu and it's submenus */
|
2013-07-04 16:09:46 -04:00
|
|
|
void connectTreeWidgetCostumPopupMenu( QPoint point );
|
2010-01-13 16:32:56 -05:00
|
|
|
|
2009-04-29 13:07:28 -04:00
|
|
|
/** Called when user clicks "Load Cert" to choose location of a Cert file */
|
2009-07-16 10:36:03 -04:00
|
|
|
|
2019-01-06 14:58:32 -05:00
|
|
|
//void on_actionAddFriend_activated();
|
|
|
|
//void on_actionExportKey_activated();
|
|
|
|
//void on_actionCreate_New_Profile_activated();
|
2010-12-23 03:58:57 -05:00
|
|
|
|
2012-10-29 06:59:26 -04:00
|
|
|
void filterColumnChanged(int);
|
2007-11-14 22:18:48 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2020-11-24 09:48:56 -05:00
|
|
|
void removeKeys(std::set<RsPgpId> selected) ;
|
|
|
|
|
2012-11-19 11:01:21 -05:00
|
|
|
/* Color definitions (for standard see qss.default) */
|
|
|
|
QColor mBackgroundColorSelf;
|
|
|
|
QColor mBackgroundColorOwnSign;
|
|
|
|
QColor mBackgroundColorAcceptConnection;
|
|
|
|
QColor mBackgroundColorHasSignedMe;
|
|
|
|
QColor mBackgroundColorDenied;
|
|
|
|
|
2017-03-01 16:25:57 -05:00
|
|
|
RSTreeWidgetItemCompareRole *compareNetworkRole ;
|
|
|
|
|
2017-10-08 15:00:15 -04:00
|
|
|
//iinternal long lived data
|
|
|
|
std::list<RsPgpId> neighs;
|
|
|
|
|
|
|
|
pgpid_item_model *PGPIdItemModel;
|
|
|
|
pgpid_item_proxy *PGPIdItemProxy;
|
|
|
|
|
2009-04-29 13:07:28 -04:00
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::NetworkDialog ui;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|