From 3f6503dfc344444a137c9d668231704e7ab050f6 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 12 Oct 2021 22:29:36 +0200 Subject: [PATCH] added friend server control UI --- .../src/gui/FriendServerControl.cpp | 41 +++++++ retroshare-gui/src/gui/FriendServerControl.h | 34 ++++++ retroshare-gui/src/gui/FriendServerControl.ui | 103 ++++++++++++++++++ retroshare-gui/src/gui/FriendsDialog.cpp | 2 + retroshare-gui/src/gui/FriendsDialog.h | 4 +- retroshare-gui/src/retroshare-gui.pro | 3 + 6 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 retroshare-gui/src/gui/FriendServerControl.cpp create mode 100644 retroshare-gui/src/gui/FriendServerControl.h create mode 100644 retroshare-gui/src/gui/FriendServerControl.ui diff --git a/retroshare-gui/src/gui/FriendServerControl.cpp b/retroshare-gui/src/gui/FriendServerControl.cpp new file mode 100644 index 000000000..d4ab1dc5c --- /dev/null +++ b/retroshare-gui/src/gui/FriendServerControl.cpp @@ -0,0 +1,41 @@ +/******************************************************************************* + * gui/FriendServer.cpp * + * * + * Copyright (c) 2021 Retroshare Team * + * * + * 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 . * + * * + *******************************************************************************/ + +#include "FriendServerControl.h" +//#include + +#include + +/** Constructor */ +FriendServerControl::FriendServerControl(QWidget *parent) +{ + /* Invoke the Qt Designer generated object setup routine */ + setupUi(this); + +// /* Hide Settings frame */ +// connect( ui.maxFriendLevelSB, SIGNAL(valueChanged(int)), this, SLOT(setMaxFriendLevel(int))); +// connect( ui.edgeLengthSB, SIGNAL(valueChanged(int)), this, SLOT(setEdgeLength(int))); +// connect( ui.freezeCheckBox, SIGNAL(toggled(bool)), this, SLOT(setFreezeState(bool))); +// connect( ui.nameBox, SIGNAL(textChanged(QString)), this, SLOT(setNameSearch(QString))); +} + +FriendServerControl::~FriendServerControl() +{ +} diff --git a/retroshare-gui/src/gui/FriendServerControl.h b/retroshare-gui/src/gui/FriendServerControl.h new file mode 100644 index 000000000..ecdbce756 --- /dev/null +++ b/retroshare-gui/src/gui/FriendServerControl.h @@ -0,0 +1,34 @@ +/******************************************************************************* + * gui/NetworkView.h * + * * + * Copyright (c) 2008 Robert Fernie * + * * + * 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 . * + * * + *******************************************************************************/ + +#pragma once + +#include + +#include "ui_FriendServerControl.h" + +class FriendServerControl : public QWidget, public Ui::FriendServerControl +{ + Q_OBJECT + + public: + FriendServerControl(QWidget *parent = 0); + virtual ~FriendServerControl(); +}; diff --git a/retroshare-gui/src/gui/FriendServerControl.ui b/retroshare-gui/src/gui/FriendServerControl.ui new file mode 100644 index 000000000..aa699560c --- /dev/null +++ b/retroshare-gui/src/gui/FriendServerControl.ui @@ -0,0 +1,103 @@ + + + FriendServerControl + + + + 0 + 0 + 620 + 499 + + + + + + + On/Off + + + + + + + + + Friends to request: + + + + + + + 1 + + + 15 + + + 5 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Server onion address: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 380 + + + + + + + + + diff --git a/retroshare-gui/src/gui/FriendsDialog.cpp b/retroshare-gui/src/gui/FriendsDialog.cpp index 660f13fa7..79338c9f8 100644 --- a/retroshare-gui/src/gui/FriendsDialog.cpp +++ b/retroshare-gui/src/gui/FriendsDialog.cpp @@ -44,6 +44,7 @@ #include "NetworkView.h" #include "NetworkDialog.h" #include "gui/common/NewFriendList.h" +#include "gui/FriendServerControl.h" #include "gui/Identity/IdDialog.h" /* Images for Newsfeed icons */ //#define IMAGE_NEWSFEED "" @@ -90,6 +91,7 @@ FriendsDialog::FriendsDialog(QWidget *parent) : MainPage(parent) ui.tabWidget->setTabPosition(QTabWidget::North); ui.tabWidget->addTab(networkView = new NetworkView(),QIcon(IMAGE_NETWORK2), tr("Network graph")); ui.tabWidget->addTab(networkDialog = new NetworkDialog(),QIcon(IMAGE_PEERS), tr("Keyring")); + ui.tabWidget->addTab(friendServerControl = new FriendServerControl(),QIcon(IMAGE_PEERS), tr("Friend Server")); ui.tabWidget->hideCloseButton(0); ui.tabWidget->hideCloseButton(1); diff --git a/retroshare-gui/src/gui/FriendsDialog.h b/retroshare-gui/src/gui/FriendsDialog.h index bd8979224..7e86669b8 100644 --- a/retroshare-gui/src/gui/FriendsDialog.h +++ b/retroshare-gui/src/gui/FriendsDialog.h @@ -30,6 +30,7 @@ class NetworkDialog; class NetworkView; class IdDialog; class CirclesDialog; +class FriendServerControl; class FriendsDialog : public MainPage { @@ -64,7 +65,8 @@ public: NetworkDialog *networkDialog ; NetworkView *networkView ; - + FriendServerControl *friendServerControl ; + IdDialog *idDialog; private slots: diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index 654efd170..46d13d20d 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -424,6 +424,7 @@ HEADERS += rshare.h \ gui/AboutDialog.h \ gui/AboutWidget.h \ gui/NetworkView.h \ + gui/FriendServerControl.h \ gui/FriendsDialog.h \ gui/ServicePermissionDialog.h \ gui/RemoteDirModel.h \ @@ -689,6 +690,7 @@ FORMS += gui/StartDialog.ui \ gui/FileTransfer/BannedFilesDialog.ui \ gui/MainWindow.ui \ gui/NetworkView.ui \ + gui/FriendServerControl.ui \ gui/FriendsDialog.ui \ gui/ShareManager.ui \ # gui/ShareDialog.ui \ @@ -809,6 +811,7 @@ SOURCES += main.cpp \ gui/mainpagestack.cpp \ gui/MainWindow.cpp \ gui/NetworkView.cpp \ + gui/FriendServerControl.cpp \ gui/FriendsDialog.cpp \ gui/ServicePermissionDialog.cpp \ gui/RemoteDirModel.cpp \