From 02aec3d9ef6f95266666beaabdf3555a248125ce Mon Sep 17 00:00:00 2001
From: felisucoibi
Date: Tue, 17 Jan 2017 16:32:56 +0100
Subject: [PATCH 01/90] button changes
---
retroshare-gui/src/gui/MainWindow.cpp | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp
index 807b43667..7a6c5f263 100644
--- a/retroshare-gui/src/gui/MainWindow.cpp
+++ b/retroshare-gui/src/gui/MainWindow.cpp
@@ -344,14 +344,6 @@ void MainWindow::initStackedPage()
addPage(homePage = new HomePage(ui->stackPages), grp, NULL);
- addPage(newsFeed = new NewsFeed(ui->stackPages), grp, ¬ify);
- addPage(friendsDialog = new FriendsDialog(ui->stackPages), grp, ¬ify);
-
-#ifdef RS_USE_NEW_PEOPLE_DIALOG
- PeopleDialog *peopleDialog = NULL;
- addPage(peopleDialog = new PeopleDialog(ui->stackPages), grp, ¬ify);
-#endif
-
addPage(idDialog = new IdDialog(ui->stackPages), grp, ¬ify);
//#ifdef RS_USE_CIRCLES
@@ -359,13 +351,18 @@ void MainWindow::initStackedPage()
// addPage(circlesDialog = new CirclesDialog(ui->stackPages), grp, ¬ify);
//#endif
- addPage(transfersDialog = new TransfersDialog(ui->stackPages), grp, ¬ify);
addPage(chatLobbyDialog = new ChatLobbyWidget(ui->stackPages), grp, ¬ify);
- addPage(messagesDialog = new MessagesDialog(ui->stackPages), grp, ¬ify);
+ addPage(transfersDialog = new TransfersDialog(ui->stackPages), grp, ¬ify);
addPage(gxschannelDialog = new GxsChannelDialog(ui->stackPages), grp, ¬ify);
addPage(gxsforumDialog = new GxsForumsDialog(ui->stackPages), grp, ¬ify);
+ addPage(messagesDialog = new MessagesDialog(ui->stackPages), grp, ¬ify);
addPage(postedDialog = new PostedDialog(ui->stackPages), grp, ¬ify);
-
+ addPage(friendsDialog = new FriendsDialog(ui->stackPages), grp, ¬ify);
+ #ifdef RS_USE_NEW_PEOPLE_DIALOG
+ PeopleDialog *peopleDialog = NULL;
+ addPage(peopleDialog = new PeopleDialog(ui->stackPages), grp, ¬ify);
+ #endif
+ addPage(newsFeed = new NewsFeed(ui->stackPages), grp, ¬ify);
#ifdef RS_USE_WIKI
WikiDialog *wikiDialog = NULL;
addPage(wikiDialog = new WikiDialog(ui->stackPages), grp, ¬ify);
@@ -430,7 +427,8 @@ void MainWindow::initStackedPage()
#endif
/** Add icon on Action bar */
- addAction(new QAction(QIcon(IMAGE_ADDFRIEND), tr("Add"), ui->toolBarAction), &MainWindow::addFriend, SLOT(addFriend()));
+ // I remove add a friend because it's in HOME ghibli
+ //addAction(new QAction(QIcon(IMAGE_ADDFRIEND), tr("Add"), ui->toolBarAction), &MainWindow::addFriend, SLOT(addFriend()));
//addAction(new QAction(QIcon(IMAGE_NEWRSCOLLECTION), tr("New"), ui->toolBarAction), &MainWindow::newRsCollection, SLOT(newRsCollection()));
addAction(new QAction(QIcon(IMAGE_PREFERENCES), tr("Options"), ui->toolBarAction), &MainWindow::showSettings, SLOT(showSettings()));
addAction(new QAction(QIcon(IMAGE_ABOUT), tr("About"), ui->toolBarAction), &MainWindow::showabout, SLOT(showabout()));
From 0633744aa83caf42af1c5a583302834542a2ae61 Mon Sep 17 00:00:00 2001
From: felisucoibi
Date: Tue, 17 Jan 2017 16:34:37 +0100
Subject: [PATCH 02/90] buttons
---
retroshare-gui/src/gui/FileTransfer/TransfersDialog.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.h b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.h
index 8477d0749..54aa869a6 100644
--- a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.h
+++ b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.h
@@ -60,7 +60,7 @@ public:
~TransfersDialog();
virtual QIcon iconPixmap() const { return QIcon(IMAGE_TRANSFERS) ; } //MainPage
- virtual QString pageName() const { return tr("File sharing") ; } //MainPage
+ virtual QString pageName() const { return tr("Files") ; } //MainPage
virtual QString helpText() const { return ""; } //MainPage
virtual UserNotify *getUserNotify(QObject *parent);
From 701868d88c43931273f0397fffe861157a834cd2 Mon Sep 17 00:00:00 2001
From: felisucoibi
Date: Tue, 17 Jan 2017 16:35:20 +0100
Subject: [PATCH 03/90] Update MessagesDialog.h
---
retroshare-gui/src/gui/MessagesDialog.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/retroshare-gui/src/gui/MessagesDialog.h b/retroshare-gui/src/gui/MessagesDialog.h
index 0fc6b4fc3..ba7fa3437 100644
--- a/retroshare-gui/src/gui/MessagesDialog.h
+++ b/retroshare-gui/src/gui/MessagesDialog.h
@@ -45,7 +45,7 @@ public:
~MessagesDialog();
virtual QIcon iconPixmap() const { return QIcon(IMAGE_MESSAGES) ; } //MainPage
- virtual QString pageName() const { return tr("Messages") ; } //MainPage
+ virtual QString pageName() const { return tr("Mail") ; } //MainPage
virtual QString helpText() const { return ""; } //MainPage
virtual UserNotify *getUserNotify(QObject *parent);
From d31cb0d67d7ff00bb32a3e724bef98caef3eb62f Mon Sep 17 00:00:00 2001
From: felisucoibi
Date: Tue, 17 Jan 2017 16:36:24 +0100
Subject: [PATCH 04/90] Update NewsFeed.h
---
retroshare-gui/src/gui/NewsFeed.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/retroshare-gui/src/gui/NewsFeed.h b/retroshare-gui/src/gui/NewsFeed.h
index 3ab453d8d..b49779b2b 100644
--- a/retroshare-gui/src/gui/NewsFeed.h
+++ b/retroshare-gui/src/gui/NewsFeed.h
@@ -49,7 +49,7 @@ public:
virtual ~NewsFeed();
virtual QIcon iconPixmap() const { return QIcon(IMAGE_NEWSFEED) ; } //MainPage
- virtual QString pageName() const { return tr("News feed") ; } //MainPage
+ virtual QString pageName() const { return tr("Log") ; } //MainPage
virtual QString helpText() const { return ""; } //MainPage
virtual UserNotify *getUserNotify(QObject *parent);
From 982c8377f8bfbf3a09bed953d381c2f3e9016786 Mon Sep 17 00:00:00 2001
From: felisucoibi
Date: Tue, 17 Jan 2017 16:37:23 +0100
Subject: [PATCH 05/90] Update PostedDialog.h
---
retroshare-gui/src/gui/Posted/PostedDialog.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/retroshare-gui/src/gui/Posted/PostedDialog.h b/retroshare-gui/src/gui/Posted/PostedDialog.h
index 358db5749..396144cdb 100644
--- a/retroshare-gui/src/gui/Posted/PostedDialog.h
+++ b/retroshare-gui/src/gui/Posted/PostedDialog.h
@@ -39,7 +39,7 @@ public:
~PostedDialog();
virtual QIcon iconPixmap() const { return QIcon(IMAGE_POSTED) ; } //MainPage
- virtual QString pageName() const { return tr("Posted") ; } //MainPage
+ virtual QString pageName() const { return tr("Links") ; } //MainPage
virtual QString helpText() const { return ""; } //MainPage
virtual UserNotify *getUserNotify(QObject *parent);
From 66ab7c9eabe8b053aeb25262450333cc6d7529d3 Mon Sep 17 00:00:00 2001
From: felisucoibi
Date: Tue, 17 Jan 2017 16:49:36 +0100
Subject: [PATCH 06/90] Update ChatLobbyUserNotify.cpp
---
retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp
index 3c90ce595..15cb3d942 100644
--- a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp
+++ b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp
@@ -33,7 +33,7 @@
ChatLobbyUserNotify::ChatLobbyUserNotify(QObject *parent) :
UserNotify(parent)
{
- _name = tr("Chat Lobbies");
+ _name = tr("Chats");
_group = "ChatLobby";
_bCheckForNickName = Settings->valueFromGroup(_group, "CheckForNickName", true).toBool();
From 296903a00d8ffbcd834591eff7416c424a5a59db Mon Sep 17 00:00:00 2001
From: felisucoibi
Date: Tue, 17 Jan 2017 16:51:16 +0100
Subject: [PATCH 07/90] Update MainWindow.cpp
---
retroshare-gui/src/gui/MainWindow.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp
index 7a6c5f263..a1819c0c8 100644
--- a/retroshare-gui/src/gui/MainWindow.cpp
+++ b/retroshare-gui/src/gui/MainWindow.cpp
@@ -344,8 +344,6 @@ void MainWindow::initStackedPage()
addPage(homePage = new HomePage(ui->stackPages), grp, NULL);
- addPage(idDialog = new IdDialog(ui->stackPages), grp, ¬ify);
-
//#ifdef RS_USE_CIRCLES
// CirclesDialog *circlesDialog = NULL;
// addPage(circlesDialog = new CirclesDialog(ui->stackPages), grp, ¬ify);
@@ -357,6 +355,7 @@ void MainWindow::initStackedPage()
addPage(gxsforumDialog = new GxsForumsDialog(ui->stackPages), grp, ¬ify);
addPage(messagesDialog = new MessagesDialog(ui->stackPages), grp, ¬ify);
addPage(postedDialog = new PostedDialog(ui->stackPages), grp, ¬ify);
+ addPage(idDialog = new IdDialog(ui->stackPages), grp, ¬ify);
addPage(friendsDialog = new FriendsDialog(ui->stackPages), grp, ¬ify);
#ifdef RS_USE_NEW_PEOPLE_DIALOG
PeopleDialog *peopleDialog = NULL;
From ce53a9d3925be6f359e0a9c28627a653f0a6bd28 Mon Sep 17 00:00:00 2001
From: felisucoibi
Date: Tue, 17 Jan 2017 16:55:14 +0100
Subject: [PATCH 08/90] Update FriendsDialog.h
---
retroshare-gui/src/gui/FriendsDialog.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/retroshare-gui/src/gui/FriendsDialog.h b/retroshare-gui/src/gui/FriendsDialog.h
index 960337b6f..d37e395a7 100644
--- a/retroshare-gui/src/gui/FriendsDialog.h
+++ b/retroshare-gui/src/gui/FriendsDialog.h
@@ -57,7 +57,7 @@ public:
~FriendsDialog ();
virtual QIcon iconPixmap() const { return QIcon(IMAGE_NETWORK) ; } //MainPage
- virtual QString pageName() const { return tr("Network") ; } //MainPage
+ virtual QString pageName() const { return tr("Friends") ; } //MainPage
virtual QString helpText() const { return ""; } //MainPage
virtual UserNotify *getUserNotify(QObject *parent);
From dc391c53fb99f15ffef9c41021961c8cb8e7d16c Mon Sep 17 00:00:00 2001
From: felisucoibi
Date: Tue, 17 Jan 2017 17:00:41 +0100
Subject: [PATCH 09/90] Update ChatLobbyWidget.h
---
retroshare-gui/src/gui/ChatLobbyWidget.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.h b/retroshare-gui/src/gui/ChatLobbyWidget.h
index 4ce19cf95..dff4a9206 100644
--- a/retroshare-gui/src/gui/ChatLobbyWidget.h
+++ b/retroshare-gui/src/gui/ChatLobbyWidget.h
@@ -35,7 +35,7 @@ public:
~ChatLobbyWidget();
virtual QIcon iconPixmap() const { return QIcon(IMAGE_CHATLOBBY) ; } //MainPage
- virtual QString pageName() const { return tr("Chat Lobbies") ; } //MainPage
+ virtual QString pageName() const { return tr("Chats") ; } //MainPage
virtual QString helpText() const { return ""; } //MainPage
virtual UserNotify *getUserNotify(QObject *parent); //MainPage
From 07dd196e6dcbc4d2aea03bd73e2cb2bed0d8b436 Mon Sep 17 00:00:00 2001
From: felisucoibi
Date: Wed, 18 Jan 2017 09:54:32 +0100
Subject: [PATCH 10/90] changed friends to second flaces csoler agreed
---
retroshare-gui/src/gui/MainWindow.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp
index a1819c0c8..f5c342ac4 100644
--- a/retroshare-gui/src/gui/MainWindow.cpp
+++ b/retroshare-gui/src/gui/MainWindow.cpp
@@ -348,7 +348,7 @@ void MainWindow::initStackedPage()
// CirclesDialog *circlesDialog = NULL;
// addPage(circlesDialog = new CirclesDialog(ui->stackPages), grp, ¬ify);
//#endif
-
+ addPage(friendsDialog = new FriendsDialog(ui->stackPages), grp, ¬ify);
addPage(chatLobbyDialog = new ChatLobbyWidget(ui->stackPages), grp, ¬ify);
addPage(transfersDialog = new TransfersDialog(ui->stackPages), grp, ¬ify);
addPage(gxschannelDialog = new GxsChannelDialog(ui->stackPages), grp, ¬ify);
@@ -356,7 +356,7 @@ void MainWindow::initStackedPage()
addPage(messagesDialog = new MessagesDialog(ui->stackPages), grp, ¬ify);
addPage(postedDialog = new PostedDialog(ui->stackPages), grp, ¬ify);
addPage(idDialog = new IdDialog(ui->stackPages), grp, ¬ify);
- addPage(friendsDialog = new FriendsDialog(ui->stackPages), grp, ¬ify);
+
#ifdef RS_USE_NEW_PEOPLE_DIALOG
PeopleDialog *peopleDialog = NULL;
addPage(peopleDialog = new PeopleDialog(ui->stackPages), grp, ¬ify);
From 1217a85d994d2189536f971005ef9556d599f76d Mon Sep 17 00:00:00 2001
From: felisucoibi
Date: Wed, 18 Jan 2017 10:15:07 +0100
Subject: [PATCH 11/90] change chat lobies t chat rooms strings
---
retroshare-gui/src/gui/ChatLobbyWidget.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp
index 06c8833ef..a7efa552d 100644
--- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp
+++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp
@@ -171,8 +171,8 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
int S = QFontMetricsF(font()).height();
QString help_str = tr("\
- Chat Lobbies
\
- Chat lobbies are distributed chat rooms, and work pretty much like IRC. \
+
Chat Rooms
\
+ Chat rooms work pretty much like IRC. \
They allow you to talk anonymously with tons of people without the need to make friends.
\
A chat lobby can be public (your friends see it) or private (your friends can't see it, unless you \
invite them with ). \
@@ -181,10 +181,10 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
The list at left shows \
chat lobbies your friends are participating in. You can either \
\
- - Right click to create a new chat lobby
\
+ - Right click to create a new chat room
\
- Double click a chat lobby to enter, chat, and show it to your friends
\
\
- Note: For the chat lobbies to work properly, your computer needs be on time. So check your system clock!\
+ Note: For the chat rooms to work properly, your computer needs be on time. So check your system clock!\
\
"
).arg(QString::number(2*S)).arg(QString::number(S)) ;
From 2d764f4755e84cf0d08aba2a889a33948f7ca5d8 Mon Sep 17 00:00:00 2001
From: felisucoibi
Date: Wed, 18 Jan 2017 10:26:25 +0100
Subject: [PATCH 12/90] updated sectionnames chat lobbi
---
retroshare-gui/src/gui/settings/NotifyPage.ui | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/retroshare-gui/src/gui/settings/NotifyPage.ui b/retroshare-gui/src/gui/settings/NotifyPage.ui
index b3f4063a1..eff7404f9 100755
--- a/retroshare-gui/src/gui/settings/NotifyPage.ui
+++ b/retroshare-gui/src/gui/settings/NotifyPage.ui
@@ -47,7 +47,7 @@
-
- Friend Connect
+ Friend Connected
@@ -68,7 +68,7 @@
-
- Posted
+ Links
@@ -82,14 +82,14 @@
-
- Messages
+ Mails
-
- Chat
+ Chats
@@ -242,7 +242,7 @@
-
- Chat Lobby
+ Chat Room
@@ -414,7 +414,7 @@
-
- Chat lobbies
+ Chat rooms
@@ -438,7 +438,7 @@
- Chat Lobbies
+ Chat Rooms
-
From 837bb76d339733246a75f102c57a3e97225212df Mon Sep 17 00:00:00 2001
From: felisucoibi
Date: Wed, 18 Jan 2017 10:31:50 +0100
Subject: [PATCH 13/90] Update CreateLobbyDialog.cpp
---
retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp b/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp
index 9a59b2913..a9871ab77 100644
--- a/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp
+++ b/retroshare-gui/src/gui/chat/CreateLobbyDialog.cpp
@@ -40,7 +40,7 @@ CreateLobbyDialog::CreateLobbyDialog(const std::set& peer_list, int pr
ui->setupUi(this);
ui->headerFrame->setHeaderImage(QPixmap(":/icons/png/chat-lobbies.png"));
- ui->headerFrame->setHeaderText(tr("Create Chat Lobby"));
+ ui->headerFrame->setHeaderText(tr("Create Chat Room"));
RsGxsId default_identity ;
rsMsgs->getDefaultIdentityForChatLobby(default_identity) ;
@@ -48,7 +48,7 @@ CreateLobbyDialog::CreateLobbyDialog(const std::set& peer_list, int pr
ui->idChooser_CB->loadIds(IDCHOOSER_ID_REQUIRED, default_identity);
#if QT_VERSION >= 0x040700
- ui->lobbyName_LE->setPlaceholderText(tr("Put a sensible lobby name here"));
+ ui->lobbyName_LE->setPlaceholderText(tr("Put a sensible chat room name here"));
ui->lobbyTopic_LE->setPlaceholderText(tr("Set a descriptive topic here"));
#endif
@@ -149,7 +149,7 @@ void CreateLobbyDialog::createLobby()
ChatLobbyId id = rsMsgs->createChatLobby(lobby_name,gxs_id, lobby_topic, shareList, lobby_flags);
- std::cerr << "gui: Created chat lobby " << std::hex << id << std::dec << std::endl ;
+ std::cerr << "gui: Created chat room " << std::hex << id << std::dec << std::endl ;
// open chat window !!
ChatDialog::chatFriend(ChatId(id)) ;
From 47a4ed55fd1d275be2b103491b17ec770694f35d Mon Sep 17 00:00:00 2001
From: felisucoibi
Date: Wed, 18 Jan 2017 10:34:34 +0100
Subject: [PATCH 14/90] Update ChatLobbyWidget.ui
---
retroshare-gui/src/gui/ChatLobbyWidget.ui | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.ui b/retroshare-gui/src/gui/ChatLobbyWidget.ui
index eb3817345..66395ca34 100644
--- a/retroshare-gui/src/gui/ChatLobbyWidget.ui
+++ b/retroshare-gui/src/gui/ChatLobbyWidget.ui
@@ -72,7 +72,7 @@
-
- Chat lobbies
+ Chat rooms
From 1b8de7b30e8db318527eb0a9fce3b99e4249f712 Mon Sep 17 00:00:00 2001
From: jolavillette
Date: Wed, 18 Jan 2017 13:25:45 +0100
Subject: [PATCH 15/90] Attempt to reduce BW bursts
---
libretroshare/src/pqi/pqistreamer.cc | 150 ++++++++++++++-------------
libretroshare/src/pqi/pqistreamer.h | 5 +-
2 files changed, 84 insertions(+), 71 deletions(-)
diff --git a/libretroshare/src/pqi/pqistreamer.cc b/libretroshare/src/pqi/pqistreamer.cc
index 76f5b1581..9694f9ce3 100644
--- a/libretroshare/src/pqi/pqistreamer.cc
+++ b/libretroshare/src/pqi/pqistreamer.cc
@@ -48,8 +48,10 @@ static struct RsLog::logInfo pqistreamerzoneInfo = {RsLog::Default, "pqistreamer
#define pqistreamerzone &pqistreamerzoneInfo
static const int PQISTREAM_ABS_MAX = 100000000; /* 100 MB/sec (actually per loop) */
-static const int PQISTREAM_AVG_PERIOD = 5; // update speed estimate every 5 seconds
+static const int PQISTREAM_AVG_PERIOD = 1; // update speed estimate every second
static const float PQISTREAM_AVG_FRAC = 0.8; // for bandpass filter over speed estimate.
+static const float PQISTREAM_AVG_DT_FRAC = 0.99; // for low pass filter over elapsed time
+
static const int PQISTREAM_OPTIMAL_PACKET_SIZE = 512; // It is believed that this value should be lower than TCP slices and large enough as compare to encryption padding.
// most importantly, it should be constant, so as to allow correct QoS.
static const int PQISTREAM_SLICE_FLAG_STARTS = 0x01; //
@@ -100,7 +102,8 @@ pqistreamer::pqistreamer(RsSerialiser *rss, const RsPeerId& id, BinInterface *bi
mPkt_wpending(NULL), mPkt_wpending_size(0),
mTotalRead(0), mTotalSent(0),
mCurrRead(0), mCurrSent(0),
- mAvgReadCount(0), mAvgSentCount(0)
+ mAvgReadCount(0), mAvgSentCount(0),
+ mAvgDtOut(0), mAvgDtIn(0)
{
// 100 B/s (minimal)
@@ -114,8 +117,7 @@ pqistreamer::pqistreamer(RsSerialiser *rss, const RsPeerId& id, BinInterface *bi
mAcceptsPacketSlicing = false ; // by default. Will be turned into true when everyone's ready.
mLastSentPacketSlicingProbe = 0 ;
- mAvgLastUpdate = time(NULL);
- mCurrSentTS = mCurrReadTS = getCurrentTS();
+ mAvgLastUpdate = mCurrSentTS = mCurrReadTS = getCurrentTS();
mIncomingSize = 0 ;
@@ -231,47 +233,46 @@ void pqistreamer::setRate(bool b,float f)
void pqistreamer::updateRates()
{
- // now update rates both ways.
+ // update rates both ways.
- time_t t = time(NULL); // get current timestep.
- int64_t diff ;
+ double t = getCurrentTS(); // get current timestamp.
+ double diff ;
- {
- RsStackMutex stack(mStreamerMtx); /**** LOCKED MUTEX ****/
+ {
+ RsStackMutex stack(mStreamerMtx); /**** LOCKED MUTEX ****/
+ diff = t - mAvgLastUpdate ;
+ }
- diff = int64_t(t) - int64_t(mAvgLastUpdate) ;
- }
-
- if (diff > PQISTREAM_AVG_PERIOD)
- {
- float avgReadpSec = getRate(true ) * PQISTREAM_AVG_FRAC + (1.0 - PQISTREAM_AVG_FRAC) * mAvgReadCount/(1024.0 * float(diff));
- float avgSentpSec = getRate(false) * PQISTREAM_AVG_FRAC + (1.0 - PQISTREAM_AVG_FRAC) * mAvgSentCount/(1024.0 * float(diff));
+ if (diff > PQISTREAM_AVG_PERIOD)
+ {
+ float avgReadpSec = PQISTREAM_AVG_FRAC * getRate(true ) + (1.0 - PQISTREAM_AVG_FRAC) * mAvgReadCount/(1024.0 * diff);
+ float avgSentpSec = PQISTREAM_AVG_FRAC * getRate(false) + (1.0 - PQISTREAM_AVG_FRAC) * mAvgSentCount/(1024.0 * diff);
#ifdef DEBUG_PQISTREAMER
- std::cerr << "Peer " << PeerId() << ": Current speed estimates: " << avgReadpSec << " / " << avgSentpSec << std::endl;
+ uint64_t t_now = 1000 * getCurrentTS();
+ std::cerr << std::dec << t_now << " DEBUG_PQISTREAMER pqistreamer::updateRates PeerId " << this->PeerId().toStdString() << " Current speed estimates: down " << std::dec << (int)(1024 * avgReadpSec) << " B/s / up " << (int)(1024 * avgSentpSec) << " B/s" << std::endl;
#endif
- /* pretend our rate is zero if we are
- * not bandwidthLimited().
- */
- if (mBio->bandwidthLimited())
- {
- setRate(true, avgReadpSec);
- setRate(false, avgSentpSec);
- }
- else
- {
- std::cerr << "Warning: setting to 0" << std::endl;
- setRate(true, 0);
- setRate(false, 0);
- }
- {
- RsStackMutex stack(mStreamerMtx); /**** LOCKED MUTEX ****/
- mAvgLastUpdate = t;
- mAvgReadCount = 0;
- mAvgSentCount = 0;
- }
- }
+ // now store the new rates, zero meaning that we are not bandwidthLimited()
+
+ if (mBio->bandwidthLimited())
+ {
+ setRate(true, avgReadpSec);
+ setRate(false, avgSentpSec);
+ }
+ else
+ {
+ setRate(true, 0);
+ setRate(false, 0);
+ }
+
+ {
+ RsStackMutex stack(mStreamerMtx); /**** LOCKED MUTEX ****/
+ mAvgLastUpdate = t;
+ mAvgReadCount = 0;
+ mAvgSentCount = 0;
+ }
+ }
}
int pqistreamer::tick_bio()
@@ -1114,12 +1115,11 @@ float pqistreamer::outTimeSlice_locked()
return 1;
}
-// very simple.....
int pqistreamer::outAllowedBytes_locked()
{
- double t = getCurrentTS() ; // Grabs today's time in sec, with ms accuracy. Allows a much more accurate allocation of bw
+ double t = getCurrentTS() ; // in sec, with high accuracy
- /* allow a lot if not bandwidthLimited */
+ // allow a lot if not bandwidthLimited()
if (!mBio->bandwidthLimited())
{
mCurrSent = 0;
@@ -1127,70 +1127,80 @@ int pqistreamer::outAllowedBytes_locked()
return PQISTREAM_ABS_MAX;
}
- double dt = t - mCurrSentTS;
+ // dt is the time elapsed since the last round of sending data
+ double dt = t - mCurrSentTS;
- // limiter -> for when currSentTs -> 0.
- if (dt > 5)
- dt = 5;
+ // ignore cases where dt > 1s
+ if (dt > 1)
+ dt = 1;
- double maxout = getMaxRate(false) * 1024.0;
+ // low pass filter on mAvgDtOut
+ mAvgDtOut = PQISTREAM_AVG_DT_FRAC * mAvgDtOut + (1 - PQISTREAM_AVG_DT_FRAC) * dt;
+
+ double maxout = getMaxRate(false) * 1024.0;
- mCurrSent -= int(dt * maxout);
+ // this is used to take into account a possible excess of data sent during the previous round
+ mCurrSent -= int(dt * maxout);
if (mCurrSent < 0)
mCurrSent = 0;
mCurrSentTS = t;
+ // now calculate the max amount of data allowed to be sent during the next round
+ // we limit this quota to what should be sent at most during mAvgDtOut, taking into account the excess of data possibly sent during the previous round
+ double quota = mAvgDtOut * maxout - mCurrSent;
+
#ifdef DEBUG_PQISTREAMER
- {
- std::string out;
- rs_sprintf(out, "pqistreamer::outAllowedBytes() is %d/%d", maxout - mCurrSent, maxout);
- pqioutput(PQL_DEBUG_ALL, pqistreamerzone, out);
- }
+ uint64_t t_now = 1000 * getCurrentTS();
+ std::cerr << std::dec << t_now << " DEBUG_PQISTREAMER pqistreamer::outAllowedBytes_locked PeerId " << this->PeerId().toStdString() << " dt " << (int)(1000 * dt) << "ms, mAvgDtOut " << (int)(1000 * mAvgDtOut) << "ms, maxout " << (int)(maxout) << " bytes/s, mCurrSent " << mCurrSent << " bytes, quota " << (int)(quota) << " bytes" << std::endl;
#endif
-
- return maxout - mCurrSent;
+ return quota;
}
int pqistreamer::inAllowedBytes_locked()
{
- double t = getCurrentTS(); // in secs, with a ms accuracy
+ double t = getCurrentTS(); // in sec, with high accuracy
- /* allow a lot if not bandwidthLimited */
+ // allow a lot if not bandwidthLimited()
if (!mBio->bandwidthLimited())
{
+ mCurrRead = 0;
mCurrReadTS = t;
- mCurrRead = 0;
return PQISTREAM_ABS_MAX;
}
- double dt = t - mCurrReadTS;
+ // dt is the time elapsed since the last round of receiving data
+ double dt = t - mCurrReadTS;
- // limiter -> for when currReadTs -> 0.
- if (dt > 5)
- dt = 5;
+ // limit dt to 1s
+ if (dt > 1)
+ dt = 1;
- double maxin = getMaxRate(true) * 1024.0;
+ // low pass filter on mAvgDtIn
+ mAvgDtIn = PQISTREAM_AVG_DT_FRAC * mAvgDtIn + (1 - PQISTREAM_AVG_DT_FRAC) * dt;
- mCurrRead -= int(dt * maxin);
+ double maxin = getMaxRate(true) * 1024.0;
+
+ // this is used to take into account a possible excess of data received during the previous round
+ mCurrRead -= int(dt * maxin);
if (mCurrRead < 0)
mCurrRead = 0;
mCurrReadTS = t;
+ // now calculate the max amount of data allowed to be received during the next round
+ // we limit this quota to what should be received at most during mAvgDtOut, taking into account the excess of data possibly received during the previous round
+ double quota = mAvgDtIn * maxin - mCurrRead;
+
#ifdef DEBUG_PQISTREAMER
- {
- std::string out;
- rs_sprintf(out, "pqistreamer::inAllowedBytes() is %d/%d", maxin - mCurrRead, maxin);
- pqioutput(PQL_DEBUG_ALL, pqistreamerzone, out);
- }
+ uint64_t t_now = 1000 * getCurrentTS();
+ std::cerr << std::dec << t_now << " DEBUG_PQISTREAMER pqistreamer::inAllowedBytes_locked PeerId " << this->PeerId().toStdString() << " dt " << (int)(1000 * dt) << "ms, mAvgDtIn " << (int)(1000 * mAvgDtIn) << "ms, maxin " << (int)(maxin) << " bytes/s, mCurrRead " << mCurrRead << " bytes, quota " << (int)(quota) << " bytes" << std::endl;
#endif
-
- return maxin - mCurrRead;
+ return quota;
}
diff --git a/libretroshare/src/pqi/pqistreamer.h b/libretroshare/src/pqi/pqistreamer.h
index b4351670c..fe2754854 100644
--- a/libretroshare/src/pqi/pqistreamer.h
+++ b/libretroshare/src/pqi/pqistreamer.h
@@ -162,10 +162,13 @@ class pqistreamer: public PQInterface
double mCurrReadTS; // TS from which these are measured.
double mCurrSentTS;
- time_t mAvgLastUpdate; // TS from which these are measured.
+ double mAvgLastUpdate; // TS from which these are measured.
uint32_t mAvgReadCount;
uint32_t mAvgSentCount;
+ double mAvgDtOut; // average time diff between 2 rounds of sending data
+ double mAvgDtIn; // average time diff between 2 rounds of receiving data
+
time_t mLastIncomingTs;
// traffic statistics
From 0ca477d01b53e762ea54a3266c81151d7ffb6a84 Mon Sep 17 00:00:00 2001
From: RetroPooh
Date: Fri, 20 Jan 2017 22:26:50 +0300
Subject: [PATCH 16/90] add chatlobby option to disable sending typing
notifications
---
retroshare-gui/src/gui/chat/ChatWidget.cpp | 4 ++--
retroshare-gui/src/gui/settings/ChatPage.cpp | 2 ++
retroshare-gui/src/gui/settings/ChatPage.ui | 7 +++++++
retroshare-gui/src/gui/settings/rsharesettings.cpp | 10 ++++++++++
retroshare-gui/src/gui/settings/rsharesettings.h | 3 +++
5 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp
index f31ee3b31..15736c786 100644
--- a/retroshare-gui/src/gui/chat/ChatWidget.cpp
+++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp
@@ -1088,8 +1088,8 @@ void ChatWidget::updateStatusTyping()
#ifdef ONLY_FOR_LINGUIST
tr("is typing...");
#endif
-
- rsMsgs->sendStatusString(chatId, "is typing...");
+ if(!Settings->getChatDoNotSendIsTyping())
+ rsMsgs->sendStatusString(chatId, "is typing...");
lastStatusSendTime = time(NULL) ;
}
}
diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp
index e4e32abdf..2293d41a0 100644
--- a/retroshare-gui/src/gui/settings/ChatPage.cpp
+++ b/retroshare-gui/src/gui/settings/ChatPage.cpp
@@ -131,6 +131,7 @@ ChatPage::save(QString &/*errmsg*/)
Settings->setChatSendMessageWithCtrlReturn(ui.sendMessageWithCtrlReturn->isChecked());
Settings->setChatSendAsPlainTextByDef(ui.sendAsPlainTextByDef->isChecked());
Settings->setChatLoadEmbeddedImages(ui.loadEmbeddedImages->isChecked());
+ Settings->setChatDoNotSendIsTyping(ui.DontSendTyping->isChecked());
Settings->setChatSearchCharToStartSearch(ui.sbSearch_CharToStart->value());
Settings->setChatSearchCaseSensitively(ui.cbSearch_CaseSensitively->isChecked());
@@ -240,6 +241,7 @@ ChatPage::load()
ui.sendMessageWithCtrlReturn->setChecked(Settings->getChatSendMessageWithCtrlReturn());
ui.sendAsPlainTextByDef->setChecked(Settings->getChatSendAsPlainTextByDef());
ui.loadEmbeddedImages->setChecked(Settings->getChatLoadEmbeddedImages());
+ ui.DontSendTyping->setChecked(Settings->getChatDoNotSendIsTyping());
ui.sbSearch_CharToStart->setValue(Settings->getChatSearchCharToStartSearch());
ui.cbSearch_CaseSensitively->setChecked(Settings->getChatSearchCaseSensitively());
diff --git a/retroshare-gui/src/gui/settings/ChatPage.ui b/retroshare-gui/src/gui/settings/ChatPage.ui
index d9569af3f..de8ffbdb4 100644
--- a/retroshare-gui/src/gui/settings/ChatPage.ui
+++ b/retroshare-gui/src/gui/settings/ChatPage.ui
@@ -271,6 +271,13 @@
+ -
+
+
+ Do not send typing notifications
+
+
+
diff --git a/retroshare-gui/src/gui/settings/rsharesettings.cpp b/retroshare-gui/src/gui/settings/rsharesettings.cpp
index 46ecdd147..553417ee5 100644
--- a/retroshare-gui/src/gui/settings/rsharesettings.cpp
+++ b/retroshare-gui/src/gui/settings/rsharesettings.cpp
@@ -514,6 +514,16 @@ void RshareSettings::setChatSendMessageWithCtrlReturn(bool bValue)
setValueToGroup("Chat", "SendMessageWithCtrlReturn", bValue);
}
+bool RshareSettings::getChatDoNotSendIsTyping()
+{
+ return valueFromGroup("Chat", "DoNotSendIsTyping", false).toBool();
+}
+
+void RshareSettings::setChatDoNotSendIsTyping(bool bValue)
+{
+ setValueToGroup("Chat", "DoNotSendIsTyping", bValue);
+}
+
bool RshareSettings::getChatSendAsPlainTextByDef()
{
return valueFromGroup("Chat", "SendAsPlainTextByDef", false).toBool();
diff --git a/retroshare-gui/src/gui/settings/rsharesettings.h b/retroshare-gui/src/gui/settings/rsharesettings.h
index 9ad2d31ff..8f544f903 100644
--- a/retroshare-gui/src/gui/settings/rsharesettings.h
+++ b/retroshare-gui/src/gui/settings/rsharesettings.h
@@ -210,6 +210,9 @@ public:
bool getChatSendMessageWithCtrlReturn();
void setChatSendMessageWithCtrlReturn(bool bValue);
+ bool getChatDoNotSendIsTyping();
+ void setChatDoNotSendIsTyping(bool bValue);
+
bool getChatSendAsPlainTextByDef();
void setChatSendAsPlainTextByDef(bool bValue);
From baa9713384c9b55b1236062c73e10fdb49ca5f77 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sat, 21 Jan 2017 21:38:10 +0100
Subject: [PATCH 17/90] partially changed lobby->chat room in displayed strings
in the GUI
---
retroshare-gui/src/gui/ChatLobbyWidget.cpp | 40 +++++++++----------
.../src/gui/chat/ChatLobbyDialog.cpp | 18 ++++-----
2 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp
index a7efa552d..7b97e15a5 100644
--- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp
+++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp
@@ -174,15 +174,15 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
Chat Rooms
\
Chat rooms work pretty much like IRC. \
They allow you to talk anonymously with tons of people without the need to make friends.
\
- A chat lobby can be public (your friends see it) or private (your friends can't see it, unless you \
+
A chat room can be public (your friends see it) or private (your friends can't see it, unless you \
invite them with ). \
- Once you have been invited to a private lobby, you will be able to see it when your friends \
+ Once you have been invited to a private room, you will be able to see it when your friends \
are using it.
\
The list at left shows \
chat lobbies your friends are participating in. You can either \
\
- Right click to create a new chat room
\
- - Double click a chat lobby to enter, chat, and show it to your friends
\
+ - Double click a chat room to enter, chat, and show it to your friends
\
\
Note: For the chat rooms to work properly, your computer needs be on time. So check your system clock!\
\
@@ -255,7 +255,7 @@ void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint)
QMenu contextMnu(this);
if (item && item->type() == TYPE_FOLDER) {
- QAction *action = contextMnu.addAction(QIcon(IMAGE_CREATE), tr("Create chat lobby"), this, SLOT(createChatLobby()));
+ QAction *action = contextMnu.addAction(QIcon(IMAGE_CREATE), tr("Create chat room"), this, SLOT(createChatLobby()));
action->setData(item->data(COLUMN_DATA, ROLE_PRIVACYLEVEL).toInt());
}
@@ -265,7 +265,7 @@ void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint)
rsIdentity->getOwnIds(own_identities) ;
if (item->data(COLUMN_DATA, ROLE_SUBSCRIBED).toBool())
- contextMnu.addAction(QIcon(IMAGE_UNSUBSCRIBE), tr("Leave this lobby"), this, SLOT(unsubscribeItem()));
+ contextMnu.addAction(QIcon(IMAGE_UNSUBSCRIBE), tr("Leave this room"), this, SLOT(unsubscribeItem()));
else
{
QTreeWidgetItem *item = ui.lobbyTreeWidget->currentItem();
@@ -280,18 +280,18 @@ void ChatLobbyWidget::lobbyTreeWidgetCustomPopupMenu(QPoint)
if(own_identities.empty())
{
if(removed)
- contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Create a non anonymous identity and enter this lobby"), this, SLOT(createIdentityAndSubscribe()));
+ contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Create a non anonymous identity and enter this room"), this, SLOT(createIdentityAndSubscribe()));
else
- contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Create an identity and enter this lobby"), this, SLOT(createIdentityAndSubscribe()));
+ contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Create an identity and enter this chat room"), this, SLOT(createIdentityAndSubscribe()));
}
else if(own_identities.size() == 1)
{
- QAction *action = contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Enter this lobby"), this, SLOT(subscribeChatLobbyAs()));
+ QAction *action = contextMnu.addAction(QIcon(IMAGE_SUBSCRIBE), tr("Enter this chat room"), this, SLOT(subscribeChatLobbyAs()));
action->setData(QString::fromStdString((own_identities.front()).toStdString())) ;
}
else
{
- QMenu *mnu = contextMnu.addMenu(QIcon(IMAGE_SUBSCRIBE),tr("Enter this lobby as...")) ;
+ QMenu *mnu = contextMnu.addMenu(QIcon(IMAGE_SUBSCRIBE),tr("Enter this chat room as...")) ;
for(std::list::const_iterator it=own_identities.begin();it!=own_identities.end();++it)
{
@@ -405,7 +405,7 @@ void ChatLobbyWidget::addChatPage(ChatLobbyDialog *d)
if(rsMsgs->getChatLobbyInfo(id,linfo))
_lobby_infos[id].default_icon = (linfo.lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC) ? QIcon(IMAGE_PUBLIC):QIcon(IMAGE_PRIVATE) ;
else
- std::cerr << "(EE) cannot find info for lobby " << std::hex << id << std::dec << std::endl;
+ std::cerr << "(EE) cannot find info for room " << std::hex << id << std::dec << std::endl;
}
}
@@ -424,7 +424,7 @@ void ChatLobbyWidget::setCurrentChatPage(ChatLobbyDialog *d)
void ChatLobbyWidget::updateDisplay()
{
#ifdef CHAT_LOBBY_GUI_DEBUG
- std::cerr << "updating chat lobby display!" << std::endl;
+ std::cerr << "updating chat room display!" << std::endl;
#endif
std::vector visibleLobbies;
rsMsgs->getListOfNearbyChatLobbies(visibleLobbies);
@@ -795,7 +795,7 @@ void ChatLobbyWidget::subscribeChatLobbyAtItem(QTreeWidgetItem *item)
if( (flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED) && !(idd.mFlags & RS_IDENTITY_FLAGS_PGP_LINKED))
{
- QMessageBox::warning(NULL,tr("Default identity is anonymous"),tr("You cannot join this lobby with your default identity, since it is anonymous and the lobby forbids it.")) ;
+ QMessageBox::warning(NULL,tr("Default identity is anonymous"),tr("You cannot join this chat room with your default identity, since it is anonymous and the chat room forbids it.")) ;
return ;
}
}
@@ -840,12 +840,12 @@ void ChatLobbyWidget::showBlankPage(ChatLobbyId id)
ui.lobbysec_lineEdit->setText( (( (*it).lobby_flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED)?tr("No anonymous IDs"):tr("Anonymous IDs accepted")) );
ui.lobbypeers_lineEdit->setText( QString::number((*it).total_number_of_peers) );
- QString text = tr("You're not subscribed to this lobby; Double click-it to enter and chat.") ;
+ QString text = tr("You're not subscribed to this chat room; Double click-it to enter and chat.") ;
if(my_ids.empty())
{
if( (*it).lobby_flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED)
- text += "\n\n"+tr("You will need to create a non anonymous identity in order to join this chat lobby.") ;
+ text += "\n\n"+tr("You will need to create a non anonymous identity in order to join this chat room.") ;
else
text += "\n\n"+tr("You will need to create an identity in order to join chat lobbies.") ;
}
@@ -861,7 +861,7 @@ void ChatLobbyWidget::showBlankPage(ChatLobbyId id)
ui.lobbypeers_lineEdit->clear();
ui.lobbysec_lineEdit->clear();
- QString text = tr("No lobby selected. \nSelect lobbies at left to show details.\nDouble click lobbies to enter and chat.") ;
+ QString text = tr("No chat room selected. \nSelect chat rooms at left to show details.\nDouble click lobbies to enter and chat.") ;
ui.lobbyInfoLabel->setText(text) ;
}
@@ -965,7 +965,7 @@ void ChatLobbyWidget::unsubscribeItem()
void ChatLobbyWidget::unsubscribeChatLobby(ChatLobbyId id)
{
- std::cerr << "Unsubscribing from chat lobby" << std::endl;
+ std::cerr << "Unsubscribing from chat room" << std::endl;
// close the tab.
@@ -1072,12 +1072,12 @@ void ChatLobbyWidget::readChatLobbyInvites()
for(std::list::const_iterator it(invites.begin());it!=invites.end();++it)
{
- QMessageBox mb(QObject::tr("Join chat lobby"),
- tr("%1 invites you to chat lobby named %2").arg(QString::fromUtf8(rsPeers->getPeerName((*it).peer_id).c_str())).arg(RsHtml::plainText(it->lobby_name)),
+ QMessageBox mb(QObject::tr("Join chat room"),
+ tr("%1 invites you to chat room named %2").arg(QString::fromUtf8(rsPeers->getPeerName((*it).peer_id).c_str())).arg(RsHtml::plainText(it->lobby_name)),
QMessageBox::Question, QMessageBox::Yes,QMessageBox::No, 0);
- QLabel *label = new QLabel(tr("Choose an identity for this lobby:"));
+ QLabel *label = new QLabel(tr("Choose an identity for this chat room:"));
GxsIdChooser *idchooser = new GxsIdChooser ;
idchooser->loadIds(IDCHOOSER_ID_REQUIRED,default_id) ;
@@ -1112,7 +1112,7 @@ void ChatLobbyWidget::readChatLobbyInvites()
if(rsMsgs->acceptLobbyInvite((*it).lobby_id,chosen_id))
ChatDialog::chatFriend(ChatId((*it).lobby_id),true);
else
- std::cerr << "Can't join lobby with id 0x" << std::hex << (*it).lobby_id << std::dec << std::endl;
+ std::cerr << "Can't join chat room with id 0x" << std::hex << (*it).lobby_id << std::dec << std::endl;
}
}
diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp
index 987f12244..4056156bb 100644
--- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp
+++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp
@@ -178,7 +178,7 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi
unsubscribeButton->setMaximumSize(QSize(2.4*S,2.4*S)) ;
unsubscribeButton->setText(QString()) ;
unsubscribeButton->setAutoRaise(true) ;
- unsubscribeButton->setToolTip(tr("Leave this lobby (Unsubscribe)"));
+ unsubscribeButton->setToolTip(tr("Leave this chat room (Unsubscribe)"));
{
QIcon icon ;
@@ -314,7 +314,7 @@ void ChatLobbyDialog::init()
{
title = QString::fromUtf8(linfo.lobby_name.c_str());
- QString msg = tr("Welcome to lobby %1").arg(RsHtml::plainText(linfo.lobby_name));
+ QString msg = tr("Welcome to chat room %1").arg(RsHtml::plainText(linfo.lobby_name));
_lobby_name = QString::fromUtf8(linfo.lobby_name.c_str()) ;
if (!linfo.lobby_topic.empty()) {
msg += "\n" + tr("Topic: %1").arg(RsHtml::plainText(linfo.lobby_topic));
@@ -480,9 +480,9 @@ void ChatLobbyDialog::addChatMsg(const ChatMessage& msg)
QString notifyMsg = name + ": " + editor.toPlainText();
if(notifyMsg.length() > 30)
- MainWindow::displayLobbySystrayMsg(tr("Lobby chat") + ": " + _lobby_name, notifyMsg.left(30) + QString("..."));
+ MainWindow::displayLobbySystrayMsg(tr("Room chat") + ": " + _lobby_name, notifyMsg.left(30) + QString("..."));
else
- MainWindow::displayLobbySystrayMsg(tr("Lobby chat") + ": " + _lobby_name, notifyMsg);
+ MainWindow::displayLobbySystrayMsg(tr("Room chat") + ": " + _lobby_name, notifyMsg);
}
// also update peer list.
@@ -790,12 +790,12 @@ void ChatLobbyDialog::displayLobbyEvent(int event_type, const RsGxsId& gxs_id, c
{
case RS_CHAT_LOBBY_EVENT_PEER_LEFT:
qsParticipant=gxs_id;
- ui.chatWidget->addChatMsg(true, tr("Lobby management"), QDateTime::currentDateTime(), QDateTime::currentDateTime(), tr("%1 has left the lobby.").arg(RsHtml::plainText(name)), ChatWidget::MSGTYPE_SYSTEM);
+ ui.chatWidget->addChatMsg(true, tr("Lobby management"), QDateTime::currentDateTime(), QDateTime::currentDateTime(), tr("%1 has left the room.").arg(RsHtml::plainText(name)), ChatWidget::MSGTYPE_SYSTEM);
emit peerLeft(id()) ;
break;
case RS_CHAT_LOBBY_EVENT_PEER_JOINED:
qsParticipant=gxs_id;
- ui.chatWidget->addChatMsg(true, tr("Lobby management"), QDateTime::currentDateTime(), QDateTime::currentDateTime(), tr("%1 joined the lobby.").arg(RsHtml::plainText(name)), ChatWidget::MSGTYPE_SYSTEM);
+ ui.chatWidget->addChatMsg(true, tr("Lobby management"), QDateTime::currentDateTime(), QDateTime::currentDateTime(), tr("%1 joined the room.").arg(RsHtml::plainText(name)), ChatWidget::MSGTYPE_SYSTEM);
emit peerJoined(id()) ;
break;
case RS_CHAT_LOBBY_EVENT_PEER_STATUS:
@@ -827,10 +827,10 @@ void ChatLobbyDialog::displayLobbyEvent(int event_type, const RsGxsId& gxs_id, c
}
break;
case RS_CHAT_LOBBY_EVENT_KEEP_ALIVE:
- //std::cerr << "Received keep alive packet from " << nickname.toStdString() << " in lobby " << getPeerId() << std::endl;
+ //std::cerr << "Received keep alive packet from " << nickname.toStdString() << " in chat room " << getPeerId() << std::endl;
break;
default:
- std::cerr << "ChatLobbyDialog::displayLobbyEvent() Unhandled lobby event type " << event_type << std::endl;
+ std::cerr << "ChatLobbyDialog::displayLobbyEvent() Unhandled chat room event type " << event_type << std::endl;
}
if (!qsParticipant.isNull())
@@ -854,7 +854,7 @@ bool ChatLobbyDialog::canClose()
}
*/
- if (QMessageBox::Yes == QMessageBox::question(this, tr("Unsubscribe to lobby"), tr("Do you want to unsubscribe to this chat lobby?"), QMessageBox::Yes | QMessageBox::No)) {
+ if (QMessageBox::Yes == QMessageBox::question(this, tr("Unsubscribe from chat room"), tr("Do you want to unsubscribe to this chat room?"), QMessageBox::Yes | QMessageBox::No)) {
return true;
}
From dc43611dd406fa2bc86909db512d8829da38ad2d Mon Sep 17 00:00:00 2001
From: csoler
Date: Sun, 22 Jan 2017 18:52:30 +0100
Subject: [PATCH 18/90] changed Lobbies into Chat rooms in a few places
---
retroshare-gui/src/gui/ChatLobbyWidget.cpp | 8 ++++----
retroshare-gui/src/gui/ChatLobbyWidget.ui | 7 +++----
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp
index 7b97e15a5..904bb8c4f 100644
--- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp
+++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp
@@ -99,28 +99,28 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
QHeaderView_setSectionResizeModeColumn(header, COLUMN_SUBSCRIBED, QHeaderView::Interactive);
privateSubLobbyItem = new RSTreeWidgetItem(compareRole, TYPE_FOLDER);
- privateSubLobbyItem->setText(COLUMN_NAME, tr("Private Subscribed Lobbies"));
+ privateSubLobbyItem->setText(COLUMN_NAME, tr("Private Subscribed chat rooms"));
privateSubLobbyItem->setData(COLUMN_NAME, ROLE_SORT, "1");
// privateLobbyItem->setIcon(COLUMN_NAME, QIcon(IMAGE_PRIVATE));
privateSubLobbyItem->setData(COLUMN_DATA, ROLE_PRIVACYLEVEL, CHAT_LOBBY_PRIVACY_LEVEL_PRIVATE);
ui.lobbyTreeWidget->insertTopLevelItem(0, privateSubLobbyItem);
publicSubLobbyItem = new RSTreeWidgetItem(compareRole, TYPE_FOLDER);
- publicSubLobbyItem->setText(COLUMN_NAME, tr("Public Subscribed Lobbies"));
+ publicSubLobbyItem->setText(COLUMN_NAME, tr("Public Subscribed chat rooms"));
publicSubLobbyItem->setData(COLUMN_NAME, ROLE_SORT, "2");
// publicLobbyItem->setIcon(COLUMN_NAME, QIcon(IMAGE_PUBLIC));
publicSubLobbyItem->setData(COLUMN_DATA, ROLE_PRIVACYLEVEL, CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC);
ui.lobbyTreeWidget->insertTopLevelItem(1, publicSubLobbyItem);
privateLobbyItem = new RSTreeWidgetItem(compareRole, TYPE_FOLDER);
- privateLobbyItem->setText(COLUMN_NAME, tr("Private Lobbies"));
+ privateLobbyItem->setText(COLUMN_NAME, tr("Private chat rooms"));
privateLobbyItem->setData(COLUMN_NAME, ROLE_SORT, "3");
// privateLobbyItem->setIcon(COLUMN_NAME, QIcon(IMAGE_PRIVATE));
privateLobbyItem->setData(COLUMN_DATA, ROLE_PRIVACYLEVEL, CHAT_LOBBY_PRIVACY_LEVEL_PRIVATE);
ui.lobbyTreeWidget->insertTopLevelItem(2, privateLobbyItem);
publicLobbyItem = new RSTreeWidgetItem(compareRole, TYPE_FOLDER);
- publicLobbyItem->setText(COLUMN_NAME, tr("Public Lobbies"));
+ publicLobbyItem->setText(COLUMN_NAME, tr("Public chat rooms"));
publicLobbyItem->setData(COLUMN_NAME, ROLE_SORT, "4");
// publicLobbyItem->setIcon(COLUMN_NAME, QIcon(IMAGE_PUBLIC));
publicLobbyItem->setData(COLUMN_DATA, ROLE_PRIVACYLEVEL, CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC);
diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.ui b/retroshare-gui/src/gui/ChatLobbyWidget.ui
index 66395ca34..3b53302ab 100644
--- a/retroshare-gui/src/gui/ChatLobbyWidget.ui
+++ b/retroshare-gui/src/gui/ChatLobbyWidget.ui
@@ -95,7 +95,7 @@
Qt::NoFocus
-
+
:/icons/help_64.png:/icons/help_64.png
@@ -242,7 +242,7 @@
- Lobby Name:
+ Chat room Name:
@@ -255,7 +255,7 @@
- Lobby Id:
+ Chat room Id:
@@ -440,7 +440,6 @@
-
From 214fbc79572d616a6ce68c44240081bf2f7522c0 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sun, 22 Jan 2017 21:06:11 +0100
Subject: [PATCH 19/90] added a friend recommendation menu entry in Home drop
menu, and created the dialog to create/send the recommendations
---
retroshare-gui/src/gui/HomePage.cpp | 10 ++
retroshare-gui/src/gui/HomePage.h | 3 +-
.../src/gui/connect/FriendRecommendDialog.cpp | 77 ++++++++++++
.../src/gui/connect/FriendRecommendDialog.h | 22 ++++
.../src/gui/connect/FriendRecommendDialog.ui | 118 ++++++++++++++++++
retroshare-gui/src/retroshare-gui.pro | 3 +
6 files changed, 232 insertions(+), 1 deletion(-)
create mode 100644 retroshare-gui/src/gui/connect/FriendRecommendDialog.cpp
create mode 100644 retroshare-gui/src/gui/connect/FriendRecommendDialog.h
create mode 100644 retroshare-gui/src/gui/connect/FriendRecommendDialog.ui
diff --git a/retroshare-gui/src/gui/HomePage.cpp b/retroshare-gui/src/gui/HomePage.cpp
index 104f7af1d..f8f6f0383 100644
--- a/retroshare-gui/src/gui/HomePage.cpp
+++ b/retroshare-gui/src/gui/HomePage.cpp
@@ -25,6 +25,7 @@
#include "gui/notifyqt.h"
#include "gui/msgs/MessageComposer.h"
#include "gui/connect/ConnectFriendWizard.h"
+#include "gui/connect/FriendRecommendDialog.h"
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include
@@ -60,10 +61,14 @@ HomePage::HomePage(QWidget *parent) :
QAction *SendAction = new QAction(QIcon(),tr("Send via Email"), this);
connect(SendAction, SIGNAL(triggered()), this, SLOT(runEmailClient()));
+ QAction *RecAction = new QAction(QIcon(),tr("Recommend friends to each others"), this);
+ connect(RecAction, SIGNAL(triggered()), this, SLOT(recommendFriends()));
+
QMenu *menu = new QMenu();
menu->addAction(CopyAction);
menu->addAction(SaveAction);
menu->addAction(SendAction);
+ menu->addAction(RecAction);
ui->shareButton->setMenu(menu);
@@ -109,6 +114,11 @@ static void sendMail(QString sAddress, QString sSubject, QString sBody)
QDesktopServices::openUrl (url);
}
+void HomePage::recommendFriends()
+{
+ FriendRecommendDialog::showIt() ;
+}
+
void HomePage::runEmailClient()
{
sendMail("", tr("RetroShare Invite"), ui->userCertEdit->toPlainText());
diff --git a/retroshare-gui/src/gui/HomePage.h b/retroshare-gui/src/gui/HomePage.h
index 74be89afd..a11980ac7 100644
--- a/retroshare-gui/src/gui/HomePage.h
+++ b/retroshare-gui/src/gui/HomePage.h
@@ -53,7 +53,8 @@ private slots:
void runEmailClient();
void copyCert();
void saveCert();
- void addFriend();
+ void recommendFriends();
+ void addFriend();
private:
Ui::HomePage *ui;
diff --git a/retroshare-gui/src/gui/connect/FriendRecommendDialog.cpp b/retroshare-gui/src/gui/connect/FriendRecommendDialog.cpp
new file mode 100644
index 000000000..d4140a939
--- /dev/null
+++ b/retroshare-gui/src/gui/connect/FriendRecommendDialog.cpp
@@ -0,0 +1,77 @@
+#include
+
+#include "FriendRecommendDialog.h"
+#include "gui/msgs/MessageComposer.h"
+
+FriendRecommendDialog::FriendRecommendDialog(QWidget *parent)
+ : QDialog(parent), ui(new Ui::FriendRecommendDialog)
+{
+ ui->setupUi(this) ;
+}
+FriendRecommendDialog::~FriendRecommendDialog()
+{
+}
+
+void FriendRecommendDialog::load()
+{
+ ui->frec_recommendList->setHeaderText(tr("Recommend friends"));
+ ui->frec_recommendList->setModus(FriendSelectionWidget::MODUS_CHECK);
+ ui->frec_recommendList->setShowType(FriendSelectionWidget::SHOW_GROUP | FriendSelectionWidget::SHOW_SSL);
+ ui->frec_recommendList->start();
+
+ ui->frec_toList->setHeaderText(tr("To"));
+ ui->frec_toList->setModus(FriendSelectionWidget::MODUS_CHECK);
+ ui->frec_toList->start();
+
+ ui->frec_messageEdit->setText(MessageComposer::recommendMessage());
+}
+
+void FriendRecommendDialog::showIt()
+{
+ FriendRecommendDialog *dialog = instance();
+
+ dialog->load();
+
+ dialog->show();
+ dialog->raise();
+ dialog->activateWindow();
+}
+
+FriendRecommendDialog *FriendRecommendDialog::instance()
+{
+ static FriendRecommendDialog *d = NULL ;
+
+ if(d == NULL)
+ d = new FriendRecommendDialog(NULL);
+
+ return d;
+}
+
+void FriendRecommendDialog::accept()
+{
+ std::set recommendIds;
+ ui->frec_recommendList->selectedIds(recommendIds, false);
+
+ if (recommendIds.empty()) {
+ QMessageBox::warning(this, "RetroShare", tr("Please select at least one friend for recommendation."), QMessageBox::Ok, QMessageBox::Ok);
+ return ;
+ }
+
+ std::set toIds;
+ ui->frec_toList->selectedIds(toIds, false);
+
+ if (toIds.empty()) {
+ QMessageBox::warning(this, "RetroShare", tr("Please select at least one friend as recipient."), QMessageBox::Ok, QMessageBox::Ok);
+ return ;
+ }
+
+ std::set::iterator toId;
+ for (toId = toIds.begin(); toId != toIds.end(); ++toId) {
+ MessageComposer::recommendFriend(recommendIds, *toId, ui->frec_messageEdit->toHtml(), true);
+ }
+
+ QDialog::accept() ;
+
+ QMessageBox::information(NULL,tr("Recommendation messages sent!"),tr("A recommendation message was sent to each of the chosen friends!")) ;
+}
+
diff --git a/retroshare-gui/src/gui/connect/FriendRecommendDialog.h b/retroshare-gui/src/gui/connect/FriendRecommendDialog.h
new file mode 100644
index 000000000..c364e12eb
--- /dev/null
+++ b/retroshare-gui/src/gui/connect/FriendRecommendDialog.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include
+#include "ui_FriendRecommendDialog.h"
+
+class FriendRecommendDialog: public QDialog
+{
+public:
+ FriendRecommendDialog(QWidget *parent) ;
+ virtual ~FriendRecommendDialog() ;
+
+ static void showIt();
+
+private:
+ static FriendRecommendDialog *instance();
+
+ virtual void accept() ;
+
+ void load();
+
+ Ui::FriendRecommendDialog *ui;
+};
diff --git a/retroshare-gui/src/gui/connect/FriendRecommendDialog.ui b/retroshare-gui/src/gui/connect/FriendRecommendDialog.ui
new file mode 100644
index 000000000..d91172f6f
--- /dev/null
+++ b/retroshare-gui/src/gui/connect/FriendRecommendDialog.ui
@@ -0,0 +1,118 @@
+
+
+ FriendRecommendDialog
+
+
+
+ 0
+ 0
+ 1398
+ 774
+
+
+
+ Dialog
+
+
+ -
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+ -
+
+
+ Message:
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QDialogButtonBox::Cancel|QDialogButtonBox::Ok
+
+
+
+
+ buttonBox
+ frec_label
+ frec_messageEdit
+ layoutWidget
+ frec_recommendList
+
+
+
+ FriendSelectionWidget
+ QWidget
+ gui/common/FriendSelectionWidget.h
+ 1
+
+
+
+
+
+ buttonBox
+ accepted()
+ FriendRecommendDialog
+ accept()
+
+
+ 248
+ 254
+
+
+ 157
+ 274
+
+
+
+
+ buttonBox
+ rejected()
+ FriendRecommendDialog
+ reject()
+
+
+ 316
+ 260
+
+
+ 286
+ 274
+
+
+
+
+
diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro
index 0a5601dfe..94949c38c 100644
--- a/retroshare-gui/src/retroshare-gui.pro
+++ b/retroshare-gui/src/retroshare-gui.pro
@@ -425,6 +425,7 @@ HEADERS += rshare.h \
gui/chat/ChatLobbyUserNotify.h \
gui/connect/ConfCertDialog.h \
gui/connect/PGPKeyDialog.h \
+ gui/connect/FriendRecommendDialog.h \
gui/msgs/MessageInterface.h \
gui/msgs/MessageComposer.h \
gui/msgs/MessageWindow.h \
@@ -616,6 +617,7 @@ FORMS += gui/StartDialog.ui \
gui/connect/PGPKeyDialog.ui \
gui/connect/ConnectFriendWizard.ui \
gui/connect/ConnectProgressDialog.ui \
+ gui/connect/FriendRecommendDialog.ui \
gui/msgs/MessageComposer.ui \
gui/msgs/MessageWindow.ui\
gui/msgs/MessageWidget.ui\
@@ -903,6 +905,7 @@ SOURCES += main.cpp \
gui/feeds/NewsFeedUserNotify.cpp \
gui/connect/ConnectFriendWizard.cpp \
gui/connect/ConnectProgressDialog.cpp \
+ gui/connect/FriendRecommendDialog.cpp \
gui/groups/CreateGroup.cpp \
gui/GetStartedDialog.cpp \
gui/statistics/BandwidthGraphWindow.cpp \
From 7da68ff72d5b0cb0cdd969bd7b44d62da38f6b0e Mon Sep 17 00:00:00 2001
From: csoler
Date: Sun, 22 Jan 2017 21:44:26 +0100
Subject: [PATCH 20/90] improved certificate parsing in Home so that corrupted
certs never get accepted
---
libretroshare/src/pgp/rscertificate.cc | 17 ++++++++++--
libretroshare/src/pgp/rscertificate.h | 2 +-
libretroshare/src/rsserver/p3peers.cc | 2 +-
.../src/gui/connect/ConnectFriendWizard.cpp | 27 +++++++++++--------
4 files changed, 33 insertions(+), 15 deletions(-)
diff --git a/libretroshare/src/pgp/rscertificate.cc b/libretroshare/src/pgp/rscertificate.cc
index 9f78a78de..b29952c91 100644
--- a/libretroshare/src/pgp/rscertificate.cc
+++ b/libretroshare/src/pgp/rscertificate.cc
@@ -431,12 +431,25 @@ unsigned short RsCertificate::loc_port_us() const
return (int)ipv4_internal_ip_and_port[4]*256 + (int)ipv4_internal_ip_and_port[5] ;
}
-bool RsCertificate::cleanCertificate(const std::string& input,std::string& output,Format& format,int& error_code)
+bool RsCertificate::cleanCertificate(const std::string& input,std::string& output,Format& format,int& error_code,bool check_content)
{
if(cleanCertificate(input,output,error_code))
{
format = RS_CERTIFICATE_RADIX ;
- return true ;
+
+ if(!check_content)
+ return true ;
+
+ try
+ {
+ RsCertificate c(input) ;
+ return true ;
+ }
+ catch(uint32_t err_code)
+ {
+ error_code = err_code ;
+ return false;
+ }
}
return false ;
diff --git a/libretroshare/src/pgp/rscertificate.h b/libretroshare/src/pgp/rscertificate.h
index 1c25cf6b4..7f206d904 100644
--- a/libretroshare/src/pgp/rscertificate.h
+++ b/libretroshare/src/pgp/rscertificate.h
@@ -41,7 +41,7 @@ class RsCertificate
const unsigned char *pgp_key() const { return binary_pgp_key ; }
size_t pgp_key_size() const { return binary_pgp_key_size ; }
- static bool cleanCertificate(const std::string& input,std::string& output,RsCertificate::Format& format,int& error_code) ;
+ static bool cleanCertificate(const std::string& input, std::string& output, RsCertificate::Format& format, int& error_code, bool check_content) ;
private:
static bool cleanCertificate(const std::string& input,std::string& output,int&) ; // new radix format
diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc
index d4b5fe332..c46f4398b 100644
--- a/libretroshare/src/rsserver/p3peers.cc
+++ b/libretroshare/src/rsserver/p3peers.cc
@@ -1214,7 +1214,7 @@ bool p3Peers::cleanCertificate(const std::string &certstr, std::string &cleanCer
{
RsCertificate::Format format ;
- return RsCertificate::cleanCertificate(certstr,cleanCert,format,error_code) ;
+ return RsCertificate::cleanCertificate(certstr,cleanCert,format,error_code,true) ;
}
bool p3Peers::saveCertificateToFile(const RsPeerId &id, const std::string &/*fname*/)
diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp
index e69b46278..03f54329c 100755
--- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp
+++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp
@@ -962,13 +962,14 @@ void ConnectFriendWizard::friendCertChanged()
void ConnectFriendWizard::cleanFriendCert()
{
bool certValid = false;
- QString errorMsg;
+ QString errorMsg ;
std::string cert = ui->friendCertEdit->toPlainText().toUtf8().constData();
if (cert.empty()) {
ui->friendCertCleanLabel->setPixmap(QPixmap(":/images/delete.png"));
ui->friendCertCleanLabel->setToolTip("");
ui->friendCertCleanLabel->setStyleSheet("");
+ errorMsg = tr("");
} else {
std::string cleanCert;
@@ -984,23 +985,27 @@ void ConnectFriendWizard::cleanFriendCert()
ui->friendCertCleanLabel->setStyleSheet("");
connect(ui->friendCertEdit, SIGNAL(textChanged()), this, SLOT(friendCertChanged()));
}
+ errorMsg = tr("Certificate appears to be valid");
+ ui->friendCertCleanLabel->setPixmap(QPixmap(":/images/accepted16.png"));
} else {
if (error_code > 0) {
switch (error_code) {
- case RS_PEER_CERT_CLEANING_CODE_NO_BEGIN_TAG:
- errorMsg = tr("No or misspelled BEGIN tag found") ;
- break ;
- case RS_PEER_CERT_CLEANING_CODE_NO_END_TAG:
- errorMsg = tr("No or misspelled END tag found") ;
- break ;
- case RS_PEER_CERT_CLEANING_CODE_NO_CHECKSUM:
- errorMsg = tr("No checksum found (the last 5 chars should be separated by a '=' char), or no newline after tag line (e.g. line beginning with Version:)") ;
- break ;
+ case CERTIFICATE_PARSING_ERROR_CHECKSUM_ERROR :
+ case CERTIFICATE_PARSING_ERROR_WRONG_VERSION :
+ case CERTIFICATE_PARSING_ERROR_SIZE_ERROR :
+ case CERTIFICATE_PARSING_ERROR_INVALID_LOCATION_ID :
+ case CERTIFICATE_PARSING_ERROR_INVALID_EXTERNAL_IP :
+ case CERTIFICATE_PARSING_ERROR_INVALID_LOCAL_IP :
+ case CERTIFICATE_PARSING_ERROR_INVALID_CHECKSUM_SECTION :
+ case CERTIFICATE_PARSING_ERROR_UNKNOWN_SECTION_PTAG :
+ case CERTIFICATE_PARSING_ERROR_MISSING_CHECKSUM :
+
default:
- errorMsg = tr("Fake certificate: take any real certificate, and replace some of the letters randomly") ;
+ errorMsg = tr("Not a valid Retroshare certificate!") ;
ui->friendCertCleanLabel->setStyleSheet("QLabel#friendCertCleanLabel {border: 2px solid red; border-radius: 6px;}");
}
}
+ ui->friendCertCleanLabel->setPixmap(QPixmap(":/images/delete.png"));
}
}
From 58c296c69d1907b2690d38dc8710ed88ac0e2c67 Mon Sep 17 00:00:00 2001
From: RetroPooh
Date: Mon, 23 Jan 2017 00:25:17 +0300
Subject: [PATCH 21/90] hide typing notification setting in chat options by
default
---
retroshare-gui/src/gui/settings/ChatPage.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp
index 2293d41a0..8f74c69d9 100644
--- a/retroshare-gui/src/gui/settings/ChatPage.cpp
+++ b/retroshare-gui/src/gui/settings/ChatPage.cpp
@@ -34,6 +34,7 @@
#include "gui/chat/ChatDialog.h"
#include "gui/notifyqt.h"
#include "rsharesettings.h"
+#include
#include
#include
@@ -132,7 +133,7 @@ ChatPage::save(QString &/*errmsg*/)
Settings->setChatSendAsPlainTextByDef(ui.sendAsPlainTextByDef->isChecked());
Settings->setChatLoadEmbeddedImages(ui.loadEmbeddedImages->isChecked());
Settings->setChatDoNotSendIsTyping(ui.DontSendTyping->isChecked());
-
+
Settings->setChatSearchCharToStartSearch(ui.sbSearch_CharToStart->value());
Settings->setChatSearchCaseSensitively(ui.cbSearch_CaseSensitively->isChecked());
Settings->setChatSearchWholeWords(ui.cbSearch_WholeWords->isChecked());
@@ -243,6 +244,12 @@ ChatPage::load()
ui.loadEmbeddedImages->setChecked(Settings->getChatLoadEmbeddedImages());
ui.DontSendTyping->setChecked(Settings->getChatDoNotSendIsTyping());
+ std::string advsetting;
+ if(rsConfig->getConfigurationOption(RS_CONFIG_ADVANCED, advsetting) && (advsetting == "YES"))
+ { }
+ else
+ ui.DontSendTyping->hide();
+
ui.sbSearch_CharToStart->setValue(Settings->getChatSearchCharToStartSearch());
ui.cbSearch_CaseSensitively->setChecked(Settings->getChatSearchCaseSensitively());
ui.cbSearch_WholeWords->setChecked(Settings->getChatSearchWholeWords());
From e82b4fe3c3e761bf27286a4d4334f0b68bf7040e Mon Sep 17 00:00:00 2001
From: RetroPooh
Date: Mon, 23 Jan 2017 00:34:02 +0300
Subject: [PATCH 22/90] friend connect wizard - add tooltips for checkboxes;
hide 40peers warning if you have <30 friends; restored back own cert actions
for advanced mode
---
.../src/gui/connect/ConnectFriendWizard.cpp | 14 ++++++++++++--
.../src/gui/connect/ConnectFriendWizard.ui | 15 +++++++++++++++
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp
index e69b46278..bf5624ba7 100755
--- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp
+++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp
@@ -42,6 +42,7 @@
#include
#include
+#include
#include "ConnectProgressDialog.h"
#include "gui/GetStartedDialog.h"
@@ -120,8 +121,17 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) :
body += "\n" + GetStartedDialog::GetCutBelowText();
body += "\n\n" + QString::fromUtf8(rsPeers->GetRetroshareInvite(false).c_str());
-
- ui->userFrame->hide();
+
+ std::string advsetting;
+ if(rsConfig->getConfigurationOption(RS_CONFIG_ADVANCED, advsetting) && (advsetting == "YES"))
+ { }
+ else
+ ui->userFrame->hide();
+
+ unsigned int onlineCount = 0, friendCount = 0;
+ rsPeers->getPeerCount (&friendCount, &onlineCount, false);
+ if(friendCount<30)
+ ui->makefriend_infolabel->hide();
updateStylesheet();
}
diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui b/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui
index 81f70f0cc..5a1a90a62 100644
--- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui
+++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui
@@ -1267,6 +1267,9 @@ resources.
true
+
+ <html><head/><body><p><span style=" font-size:10pt;">Signing a friend's key is a way to express your trust into this friend, to your other friends. The signatures below cryptographically attest that owners of the listed keys recognise the current PGP key as authentic.</span></p></body></html>
+
-
@@ -1309,6 +1312,9 @@ resources.
-
+
+ <html><head/><body><p><span style=" font-size:10pt;">Signing a friend's key is a way to express your trust into this friend, to your other friends. It helps them to decide whether to allow connections from that key based on your own trust. Signing a key is absolutely optional and cannot be undone, so do it wisely.</span></p></body></html>
+
Authenticate friend (Sign PGP Key)
@@ -1364,6 +1370,9 @@ resources.
Can be used as direct source
+
+ <html><head/><body><p align="justify">Retroshare periodically checks your friend lists for browsable files matching your transfers, to establish a direct transfer. In this case, your friend knows you're downloading the file.</p><p align="justify">To prevent this behavior for this friend only, uncheck this box. You can still perform a direct transfer if you explicitly ask for it, by e.g. downloading from your friend's file list. This setting is applied to all locations of the same node.</p></body></html>
+
-
@@ -1371,6 +1380,9 @@ resources.
Auto-download recommended files
+
+ <html><head/><body><p>This option allows you to automatically download a file that is recommended in an message coming from this node. This can be used for instance to send files between your own nodes. Applied to all locations of the same node.</p></body></html>
+
-
@@ -1378,6 +1390,9 @@ resources.
Require whitelist clearance to connect
+
+ <html><head/><body><p>Peers that have this option cannot connect if their connection address is not in the whitelist. This protects you from traffic forwarding attacks. When used, rejected peers will be reported by "security feed items" in the News Feed section. From there, you can whitelist/blacklist their IP. Applies to all locations of the same node.</p></body></html>
+
From bcb1f19990cedea5256bdb899427454e0cea98f7 Mon Sep 17 00:00:00 2001
From: RetroPooh
Date: Mon, 23 Jan 2017 15:09:40 +0300
Subject: [PATCH 23/90] friend add wizard - hide options checkboxes in
collapsible panel, default on in advanced mode
---
.../src/gui/connect/ConnectFriendWizard.cpp | 29 ++-
.../src/gui/connect/ConnectFriendWizard.ui | 243 ++++++++++--------
2 files changed, 160 insertions(+), 112 deletions(-)
diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp
index bf5624ba7..775fb00fc 100755
--- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp
+++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp
@@ -114,7 +114,7 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) :
connect(ui->aolButton, SIGNAL(clicked()), this, SLOT(inviteAol()));
connect(ui->yandexButton, SIGNAL(clicked()), this, SLOT(inviteYandex()));
connect(ui->emailButton, SIGNAL(clicked()), this, SLOT(runEmailClient2()));
-
+ connect(ui->toggleadvancedButton, SIGNAL(clicked()), this, SLOT(toggleAdvanced()));
subject = tr("RetroShare Invitation");
body = GetStartedDialog::GetInviteText();
@@ -124,9 +124,16 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) :
std::string advsetting;
if(rsConfig->getConfigurationOption(RS_CONFIG_ADVANCED, advsetting) && (advsetting == "YES"))
- { }
+ {
+ ui->toggleadvancedButton->setVisible(false);
+ }
else
- ui->userFrame->hide();
+ {
+ ui->userFrame->hide(); // certificates page - top half with own cert and it's functions
+
+ ui->horizontalLayout_13->hide(); // Advanced options - key sign, whitelist, direct source ...
+ AdvancedVisible=false;
+ }
unsigned int onlineCount = 0, friendCount = 0;
rsPeers->getPeerCount (&friendCount, &onlineCount, false);
@@ -1285,3 +1292,19 @@ void ConnectFriendWizard::runEmailClient2()
{
sendMail("", subject, body );
}
+
+void ConnectFriendWizard::toggleAdvanced()
+{
+ if(AdvancedVisible)
+ {
+ ui->horizontalLayout_13->hide();
+ ui->toggleadvancedButton->setText("Show advanced options");
+ AdvancedVisible=false;
+ }
+ else
+ {
+ ui->horizontalLayout_13->show();
+ ui->toggleadvancedButton->setText("Hide advanced options");
+ AdvancedVisible=true;
+ }
+}
diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui b/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui
index 5a1a90a62..dbe8220b1 100644
--- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui
+++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui
@@ -6,8 +6,8 @@
0
0
- 691
- 533
+ 620
+ 530
@@ -1264,12 +1264,12 @@ resources.
-
+
+ <html><head/><body><p><span style=" font-size:10pt;">Signing a friend's key is a way to express your trust into this friend, to your other friends. The signatures below cryptographically attest that owners of the listed keys recognise the current PGP key as authentic.</span></p></body></html>
+
true
-
- <html><head/><body><p><span style=" font-size:10pt;">Signing a friend's key is a way to express your trust into this friend, to your other friends. The signatures below cryptographically attest that owners of the listed keys recognise the current PGP key as authentic.</span></p></body></html>
-
-
@@ -1300,120 +1300,132 @@ resources.
-
-
-
-
-
-
-
-
-
- Add key to keyring
-
-
-
- -
-
-
+
+
+ Show Advanced options
+
+
+
+ -
+
+
+
+ 6
+
+
-
+
+
-
+
+
+ Add key to keyring
+
+
+
+ -
+
+
<html><head/><body><p><span style=" font-size:10pt;">Signing a friend's key is a way to express your trust into this friend, to your other friends. It helps them to decide whether to allow connections from that key based on your own trust. Signing a key is absolutely optional and cannot be undone, so do it wisely.</span></p></body></html>
-
- Authenticate friend (Sign PGP Key)
-
-
-
- -
-
-
- Add as friend to connect with
-
-
-
- -
-
-
-
-
-
- Add IP to whitelist
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
- Add friend to group:
-
-
-
- -
-
-
-
-
-
-
- -
-
-
-
-
-
- Options
-
-
+
+ Authenticate friend (Sign PGP Key)
+
+
+
+ -
+
+
+ Add as friend to connect with
+
+
+
+ -
+
-
-
+
- Can be used as direct source
+ Add IP to whitelist
-
- <html><head/><body><p align="justify">Retroshare periodically checks your friend lists for browsable files matching your transfers, to establish a direct transfer. In this case, your friend knows you're downloading the file.</p><p align="justify">To prevent this behavior for this friend only, uncheck this box. You can still perform a direct transfer if you explicitly ask for it, by e.g. downloading from your friend's file list. This setting is applied to all locations of the same node.</p></body></html>
-
-
-
-
- Auto-download recommended files
-
-
- <html><head/><body><p>This option allows you to automatically download a file that is recommended in an message coming from this node. This can be used for instance to send files between your own nodes. Applied to all locations of the same node.</p></body></html>
-
-
-
- -
-
-
- Require whitelist clearance to connect
-
-
- <html><head/><body><p>Peers that have this option cannot connect if their connection address is not in the whitelist. This protects you from traffic forwarding attacks. When used, rejected peers will be reported by "security feed items" in the News Feed section. From there, you can whitelist/blacklist their IP. Applies to all locations of the same node.</p></body></html>
-
-
+
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 38
- 38
-
-
-
-
-
-
-
+
+ -
+
+
-
+
+
+ Add friend to group:
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
-
+
+
+ Options
+
+
+
-
+
+
+ <html><head/><body><p align="justify">Retroshare periodically checks your friend lists for browsable files matching your transfers, to establish a direct transfer. In this case, your friend knows you're downloading the file.</p><p align="justify">To prevent this behavior for this friend only, uncheck this box. You can still perform a direct transfer if you explicitly ask for it, by e.g. downloading from your friend's file list. This setting is applied to all locations of the same node.</p></body></html>
+
+
+ Can be used as direct source
+
+
+
+ -
+
+
+ <html><head/><body><p>This option allows you to automatically download a file that is recommended in an message coming from this node. This can be used for instance to send files between your own nodes. Applied to all locations of the same node.</p></body></html>
+
+
+ Auto-download recommended files
+
+
+
+ -
+
+
+ <html><head/><body><p>Peers that have this option cannot connect if their connection address is not in the whitelist. This protects you from traffic forwarding attacks. When used, rejected peers will be reported by "security feed items" in the News Feed section. From there, you can whitelist/blacklist their IP. Applies to all locations of the same node.</p></body></html>
+
+
+ Require whitelist clearance to connect
+
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 38
+ 38
+
+
+
+
+
+
+
+
-
@@ -1495,6 +1507,19 @@ resources.
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
From 5dc5496767c7986eb74e0f968c8a685df45aa078 Mon Sep 17 00:00:00 2001
From: RetroPooh
Date: Mon, 23 Jan 2017 18:31:00 +0300
Subject: [PATCH 24/90] add friend dialog - hide email and trust strings if not
in advanced mode
---
retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp
index 775fb00fc..e42447d38 100755
--- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp
+++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp
@@ -104,7 +104,7 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) :
ui->fr_label->hide();
ui->requestinfolabel->hide();
-
+
connect(ui->acceptNoSignGPGCheckBox,SIGNAL(toggled(bool)), ui->_options_GB,SLOT(setEnabled(bool))) ;
connect(ui->addKeyToKeyring_CB,SIGNAL(toggled(bool)), ui->acceptNoSignGPGCheckBox,SLOT(setChecked(bool))) ;
@@ -133,6 +133,11 @@ ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) :
ui->horizontalLayout_13->hide(); // Advanced options - key sign, whitelist, direct source ...
AdvancedVisible=false;
+
+ ui->emailLabel->hide(); // is it ever used?
+ ui->emailEdit->hide();
+ ui->trustLabel->hide();
+ ui->trustEdit->hide();
}
unsigned int onlineCount = 0, friendCount = 0;
From 091ea055fe4826b18003f6076b17785c85a54cd2 Mon Sep 17 00:00:00 2001
From: RetroPooh
Date: Mon, 23 Jan 2017 19:58:31 +0300
Subject: [PATCH 25/90] fix previous - forgot .h file
---
retroshare-gui/src/gui/connect/ConnectFriendWizard.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.h b/retroshare-gui/src/gui/connect/ConnectFriendWizard.h
index 54eb71062..2bd69f882 100755
--- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.h
+++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.h
@@ -90,13 +90,15 @@ private slots:
void inviteAol();
void inviteYandex();
+ void toggleAdvanced();
private:
// returns the translated error string for the error code (to be found in rspeers.h)
QString getErrorString(uint32_t) ;
void updateStylesheet();
void setTitleText(QWizardPage *page, const QString &title);
-
+ bool AdvancedVisible;
+
private:
bool error;
RsPeerDetails peerDetails;
From 9937513dfd72cfdd405d820b4881bfaac16a5dd2 Mon Sep 17 00:00:00 2001
From: Phenom
Date: Wed, 18 Jan 2017 20:18:12 +0100
Subject: [PATCH 26/90] Add StatusBar and its widgets show options.
The StatusBar is shown by default.
---
retroshare-gui/src/gui/MainWindow.cpp | 65 +++++++-
retroshare-gui/src/gui/MainWindow.h | 8 +
.../src/gui/settings/AppearancePage.cpp | 62 ++++++--
.../src/gui/settings/AppearancePage.ui | 140 +++++++++++++-----
4 files changed, 217 insertions(+), 58 deletions(-)
diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp
index 807b43667..7d821ce3f 100644
--- a/retroshare-gui/src/gui/MainWindow.cpp
+++ b/retroshare-gui/src/gui/MainWindow.cpp
@@ -19,14 +19,15 @@
* Boston, MA 02110-1301, USA.
****************************************************************/
-#include
-#include
-#include
-#include
-#include
#include
#include
+#include
+#include
+#include
+#include
+#include
#include
+#include
#ifdef BLOGS
#include "gui/unfinished/blogs/BlogsDialog.h"
@@ -223,8 +224,11 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
if (!state.isEmpty()) restoreState(state);
/** StatusBar section ********/
+ statusBar()->setVisible(Settings->valueFromGroup("StatusBar", "ShowStatusBar", QVariant(true)).toBool());
+
/* initialize combobox in status bar */
statusComboBox = new QComboBox(statusBar());
+ statusComboBox->setVisible(Settings->valueFromGroup("StatusBar", "ShowStatus", QVariant(true)).toBool());
statusComboBox->setFocusPolicy(Qt::ClickFocus);
initializeStatusObject(statusComboBox, true);
@@ -237,32 +241,39 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
statusBar()->addWidget(widget);
peerstatus = new PeerStatus();
+ peerstatus->setVisible(Settings->valueFromGroup("StatusBar", "ShowPeer", QVariant(true)).toBool());
statusBar()->addWidget(peerstatus);
natstatus = new NATStatus();
+ natstatus->setVisible(Settings->valueFromGroup("StatusBar", "ShowNAT", QVariant(true)).toBool());
statusBar()->addWidget(natstatus);
dhtstatus = new DHTStatus();
+ dhtstatus->setVisible(Settings->valueFromGroup("StatusBar", "ShowDHT", QVariant(true)).toBool());
statusBar()->addWidget(dhtstatus);
hashingstatus = new HashingStatus();
+ hashingstatus->setVisible(Settings->valueFromGroup("StatusBar", "ShowHashing", QVariant(true)).toBool());
statusBar()->addPermanentWidget(hashingstatus, 1);
discstatus = new DiscStatus();
+ discstatus->setVisible(Settings->valueFromGroup("StatusBar", "ShowDisc", QVariant(true)).toBool());
statusBar()->addPermanentWidget(discstatus);
ratesstatus = new RatesStatus();
+ ratesstatus->setVisible(Settings->valueFromGroup("StatusBar", "ShowRate", QVariant(true)).toBool());
statusBar()->addPermanentWidget(ratesstatus);
opModeStatus = new OpModeStatus();
+ opModeStatus->setVisible(Settings->valueFromGroup("StatusBar", "ShowOpMode", QVariant(true)).toBool());
statusBar()->addPermanentWidget(opModeStatus);
soundStatus = new SoundStatus();
- soundStatus->setHidden(Settings->valueFromGroup("StatusBar", "HideSound", QVariant(false)).toBool());
+ soundStatus->setVisible(Settings->valueFromGroup("StatusBar", "ShowSound", QVariant(true)).toBool());
statusBar()->addPermanentWidget(soundStatus);
toasterDisable = new ToasterDisable();
- toasterDisable->setHidden(Settings->valueFromGroup("StatusBar", "HideToaster", QVariant(false)).toBool());
+ toasterDisable->setVisible(Settings->valueFromGroup("StatusBar", "ShowToaster", QVariant(true)).toBool());
statusBar()->addPermanentWidget(toasterDisable);
sysTrayStatus = new SysTrayStatus();
@@ -309,6 +320,7 @@ MainWindow::~MainWindow()
Settings->setValueToGroup("MainWindow", "SplitterState", ui->splitter->saveState());
Settings->setValueToGroup("MainWindow", "State", saveState());
+ delete statusComboBox;
delete peerstatus;
delete natstatus;
delete dhtstatus;
@@ -1477,6 +1489,45 @@ void MainWindow::processLastArgs()
//{
// ServicePermissionDialog::showYourself();
//}
+QComboBox *MainWindow::statusComboBoxInstance()
+{
+ return statusComboBox;
+}
+
+PeerStatus *MainWindow::peerstatusInstance()
+{
+ return peerstatus;
+}
+
+NATStatus *MainWindow::natstatusInstance()
+{
+ return natstatus;
+}
+
+DHTStatus *MainWindow::dhtstatusInstance()
+{
+ return dhtstatus;
+}
+
+HashingStatus *MainWindow::hashingstatusInstance()
+{
+ return hashingstatus;
+}
+
+DiscStatus *MainWindow::discstatusInstance()
+{
+ return discstatus;
+}
+
+RatesStatus *MainWindow::ratesstatusInstance()
+{
+ return ratesstatus;
+}
+
+OpModeStatus *MainWindow::opModeStatusInstance()
+{
+ return opModeStatus;
+}
SoundStatus *MainWindow::soundStatusInstance()
{
diff --git a/retroshare-gui/src/gui/MainWindow.h b/retroshare-gui/src/gui/MainWindow.h
index 51fc4835b..ef65c65ce 100644
--- a/retroshare-gui/src/gui/MainWindow.h
+++ b/retroshare-gui/src/gui/MainWindow.h
@@ -173,6 +173,14 @@ public:
void removeStatusObject(QObject *pObject);
void setStatus(QObject *pObject, int nStatus);
+ QComboBox *statusComboBoxInstance();
+ PeerStatus *peerstatusInstance();
+ NATStatus *natstatusInstance();
+ DHTStatus *dhtstatusInstance();
+ HashingStatus *hashingstatusInstance();
+ DiscStatus *discstatusInstance();
+ RatesStatus *ratesstatusInstance();
+ OpModeStatus *opModeStatusInstance();
SoundStatus *soundStatusInstance();
ToasterDisable *toasterDisableInstance();
SysTrayStatus *sysTrayStatusInstance();
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.cpp b/retroshare-gui/src/gui/settings/AppearancePage.cpp
index 0d431e996..b860ca2aa 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.cpp
+++ b/retroshare-gui/src/gui/settings/AppearancePage.cpp
@@ -19,15 +19,25 @@
* Boston, MA 02110-1301, USA.
****************************************************************/
-#include
-#include
+#include
#include
+#include
+#include
+#include
+#include
#include "lang/languagesupport.h"
#include
#include "AppearancePage.h"
#include "rsharesettings.h"
#include "gui/MainWindow.h"
+#include "gui/statusbar/peerstatus.h"
+#include "gui/statusbar/natstatus.h"
+#include "gui/statusbar/dhtstatus.h"
+#include "gui/statusbar/hashingstatus.h"
+#include "gui/statusbar/discstatus.h"
+#include "gui/statusbar/ratesstatus.h"
+#include "gui/statusbar/OpModeStatus.h"
#include "gui/statusbar/SoundStatus.h"
#include "gui/statusbar/ToasterDisable.h"
#include "gui/statusbar/SysTrayStatus.h"
@@ -41,11 +51,21 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
MainWindow *pMainWindow = MainWindow::getInstance();
connect(ui.cmboStyleSheet, SIGNAL(activated(int)), this, SLOT(loadStyleSheet(int)));
- connect(ui.checkBoxStatusCompactMode, SIGNAL(toggled(bool)), pMainWindow, SLOT(setCompactStatusMode(bool)));
- connect(ui.checkBoxHideSoundStatus, SIGNAL(toggled(bool)), pMainWindow->soundStatusInstance(), SLOT(setHidden(bool)));
- connect(ui.checkBoxHideToasterDisable, SIGNAL(toggled(bool)), pMainWindow->toasterDisableInstance(), SLOT(setHidden(bool)));
- connect(ui.checkBoxShowSystrayOnStatus, SIGNAL(toggled(bool)), pMainWindow->sysTrayStatusInstance(), SLOT(setVisible(bool)));
+
+ connect(ui.grpStatus, SIGNAL(toggled(bool)), pMainWindow->statusBar(), SLOT(setVisible(bool)));
+ connect(ui.checkBoxStatusCompactMode, SIGNAL(toggled(bool)), pMainWindow, SLOT(setCompactStatusMode(bool)));
connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), pMainWindow, SLOT(toggleStatusToolTip(bool)));
+ connect(ui.checkBoxShowStatusStatus, SIGNAL(toggled(bool)), pMainWindow->statusComboBoxInstance(), SLOT(setVisible(bool)));
+ connect(ui.checkBoxShowPeerStatus, SIGNAL(toggled(bool)), pMainWindow->peerstatusInstance(), SLOT(setVisible(bool)));
+ connect(ui.checkBoxShowNATStatus, SIGNAL(toggled(bool)), pMainWindow->natstatusInstance(), SLOT(setVisible(bool)));
+ connect(ui.checkBoxShowDHTStatus, SIGNAL(toggled(bool)), pMainWindow->dhtstatusInstance(), SLOT(setVisible(bool)));
+ connect(ui.checkBoxShowHashingStatus, SIGNAL(toggled(bool)), pMainWindow->hashingstatusInstance(), SLOT(setVisible(bool)));
+ connect(ui.checkBoxShowDiscStatus, SIGNAL(toggled(bool)), pMainWindow->discstatusInstance(), SLOT(setVisible(bool)));
+ connect(ui.checkBoxShowRateStatus, SIGNAL(toggled(bool)), pMainWindow->ratesstatusInstance(), SLOT(setVisible(bool)));
+ connect(ui.checkBoxShowOpModeStatus, SIGNAL(toggled(bool)), pMainWindow->opModeStatusInstance(), SLOT(setVisible(bool)));
+ connect(ui.checkBoxShowSoundStatus, SIGNAL(toggled(bool)), pMainWindow->soundStatusInstance(), SLOT(setVisible(bool)));
+ connect(ui.checkBoxShowToasterDisable, SIGNAL(toggled(bool)), pMainWindow->toasterDisableInstance(), SLOT(setVisible(bool)));
+ connect(ui.checkBoxShowSystrayOnStatus, SIGNAL(toggled(bool)), pMainWindow->sysTrayStatusInstance(), SLOT(setVisible(bool)));
/* Populate combo boxes */
foreach (QString code, LanguageSupport::languageCodes()) {
@@ -139,12 +159,21 @@ bool AppearancePage::save(QString &errmsg)
/* Set to new style */
Rshare::setStyle(ui.cmboStyle->currentText());
+ Settings->setValueToGroup("StatusBar", "ShowStatusBar", QVariant(ui.grpStatus->isChecked()));
Settings->setValueToGroup("StatusBar", "CompactMode", QVariant(ui.checkBoxStatusCompactMode->isChecked()));
- Settings->setValueToGroup("StatusBar", "HideSound", QVariant(ui.checkBoxHideSoundStatus->isChecked()));
- Settings->setValueToGroup("StatusBar", "HideToaster", QVariant(ui.checkBoxHideToasterDisable->isChecked()));
- Settings->setValueToGroup("StatusBar", "ShowSysTrayOnStatusBar", QVariant(ui.checkBoxShowSystrayOnStatus->isChecked()));
Settings->setValueToGroup("StatusBar", "DisableSysTrayToolTip", QVariant(ui.checkBoxDisableSysTrayToolTip->isChecked()));
MainWindow::getInstance()->toggleStatusToolTip(ui.checkBoxDisableSysTrayToolTip->isChecked());
+ Settings->setValueToGroup("StatusBar", "ShowStatus", QVariant(ui.checkBoxShowStatusStatus->isChecked()));
+ Settings->setValueToGroup("StatusBar", "ShowPeer", QVariant(ui.checkBoxShowPeerStatus->isChecked()));
+ Settings->setValueToGroup("StatusBar", "ShowNAT", QVariant(ui.checkBoxShowNATStatus->isChecked()));
+ Settings->setValueToGroup("StatusBar", "ShowDHT", QVariant(ui.checkBoxShowDHTStatus->isChecked()));
+ Settings->setValueToGroup("StatusBar", "ShowHashing", QVariant(ui.checkBoxShowHashingStatus->isChecked()));
+ Settings->setValueToGroup("StatusBar", "ShowDisc", QVariant(ui.checkBoxShowDiscStatus->isChecked()));
+ Settings->setValueToGroup("StatusBar", "ShowRate", QVariant(ui.checkBoxShowRateStatus->isChecked()));
+ Settings->setValueToGroup("StatusBar", "ShowOpMode", QVariant(ui.checkBoxShowOpModeStatus->isChecked()));
+ Settings->setValueToGroup("StatusBar", "ShowSound", QVariant(ui.checkBoxShowSoundStatus->isChecked()));
+ Settings->setValueToGroup("StatusBar", "ShowToaster", QVariant(ui.checkBoxShowToasterDisable->isChecked()));
+ Settings->setValueToGroup("StatusBar", "ShowSysTrayOnStatusBar", QVariant(ui.checkBoxShowSystrayOnStatus->isChecked()));
return true;
}
@@ -227,11 +256,20 @@ void AppearancePage::load()
ui.cmboListItemSize->setCurrentIndex(5);
}
+ ui.grpStatus->setChecked(Settings->valueFromGroup("StatusBar", "ShowStatusBar", QVariant(true)).toBool());
ui.checkBoxStatusCompactMode->setChecked(Settings->valueFromGroup("StatusBar", "CompactMode", QVariant(false)).toBool());
- ui.checkBoxHideSoundStatus->setChecked(Settings->valueFromGroup("StatusBar", "HideSound", QVariant(false)).toBool());
- ui.checkBoxHideToasterDisable->setChecked(Settings->valueFromGroup("StatusBar", "HideToaster", QVariant(false)).toBool());
- ui.checkBoxShowSystrayOnStatus->setChecked(Settings->valueFromGroup("StatusBar", "ShowSysTrayOnStatusBar", QVariant(false)).toBool());
ui.checkBoxDisableSysTrayToolTip->setChecked(Settings->valueFromGroup("StatusBar", "DisableSysTrayToolTip", QVariant(false)).toBool());
+ ui.checkBoxShowStatusStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowStatus", QVariant(true)).toBool());
+ ui.checkBoxShowPeerStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowPeer", QVariant(true)).toBool());
+ ui.checkBoxShowNATStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowNAT", QVariant(true)).toBool());
+ ui.checkBoxShowDHTStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowDHT", QVariant(true)).toBool());
+ ui.checkBoxShowHashingStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowHashing", QVariant(true)).toBool());
+ ui.checkBoxShowDiscStatus-> setChecked(Settings->valueFromGroup("StatusBar", "Show eDisc", QVariant(true)).toBool());
+ ui.checkBoxShowRateStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowRate", QVariant(true)).toBool());
+ ui.checkBoxShowOpModeStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowOpMode", QVariant(true)).toBool());
+ ui.checkBoxShowSoundStatus-> setChecked(Settings->valueFromGroup("StatusBar", "ShowSound", QVariant(true)).toBool());
+ ui.checkBoxShowToasterDisable->setChecked(Settings->valueFromGroup("StatusBar", "ShowToaster", QVariant(true)).toBool());
+ ui.checkBoxShowSystrayOnStatus->setChecked(Settings->valueFromGroup("StatusBar", "ShowSysTrayOnStatusBar", QVariant(false)).toBool());
}
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.ui b/retroshare-gui/src/gui/settings/AppearancePage.ui
index 95f3bf297..dface3903 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.ui
+++ b/retroshare-gui/src/gui/settings/AppearancePage.ui
@@ -7,13 +7,13 @@
0
0
1160
- 567
+ 608
Qt::NoContextMenu
-
+
6
@@ -43,7 +43,7 @@
Language
-
+
-
@@ -71,7 +71,7 @@
-
-
+
Qt::Horizontal
@@ -103,7 +103,7 @@
Style
-
+
-
@@ -118,7 +118,7 @@
-
-
+
Qt::Horizontal
@@ -144,7 +144,7 @@
Style Sheet
-
+
-
@@ -156,7 +156,7 @@
-
-
+
Qt::Horizontal
@@ -172,7 +172,7 @@
-
-
+
Qt::Vertical
@@ -198,7 +198,7 @@
Tool Bar
-
+
-
@@ -207,7 +207,7 @@
QFrame::Plain
-
+
2
@@ -235,7 +235,7 @@
-
-
+
Qt::Horizontal
@@ -265,7 +265,7 @@
QFrame::Plain
-
+
2
@@ -293,7 +293,7 @@
-
-
+
Qt::Horizontal
@@ -326,7 +326,7 @@
QFrame::NoFrame
-
+
-
-
@@ -456,8 +456,91 @@
Status Bar
-
-
-
+
+ true
+
+
+ true
+
+
+
-
+
+
+ Show SysTray on Status Bar
+
+
+
+ -
+
+
+ Show Toaster Disable
+
+
+
+ -
+
+
+ Show Sound Status
+
+
+
+ -
+
+
+ Show Operating Mode Status
+
+
+
+ -
+
+
+ Show Network Rate Status
+
+
+
+ -
+
+
+ Show Discovery Status
+
+
+
+ -
+
+
+ Show DHT Status
+
+
+
+ -
+
+
+ Show Hashing Status
+
+
+
+ -
+
+
+ Show NAT Status
+
+
+
+ -
+
+
+ Show Peer Status
+
+
+
+ -
+
+
+ Show Status ComboBox
+
+
+
+ -
Remove surplus text in status bar.
@@ -467,28 +550,7 @@
- -
-
-
- Hide Sound Status
-
-
-
- -
-
-
- Hide Toaster Disable
-
-
-
- -
-
-
- Show SysTray on Status Bar
-
-
-
- -
+
-
Disable SysTray ToolTip
From 8cf5abcb9dcc3bb54d1912381cd09cd77a4447b3 Mon Sep 17 00:00:00 2001
From: RetroPooh
Date: Mon, 23 Jan 2017 21:10:06 +0300
Subject: [PATCH 27/90] options-network default tab opened changed to first
---
retroshare-gui/src/gui/settings/ServerPage.ui | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/retroshare-gui/src/gui/settings/ServerPage.ui b/retroshare-gui/src/gui/settings/ServerPage.ui
index 27c6c9a6b..894545470 100755
--- a/retroshare-gui/src/gui/settings/ServerPage.ui
+++ b/retroshare-gui/src/gui/settings/ServerPage.ui
@@ -26,7 +26,7 @@
-
- 2
+ 0
From 1cdb970e231d1b77891c4ea25a6aa4877090e01d Mon Sep 17 00:00:00 2001
From: csoler
Date: Tue, 24 Jan 2017 22:39:28 +0100
Subject: [PATCH 28/90] moved the AboutDialog into Options
---
retroshare-gui/src/gui/AboutDialog.cpp | 778 +----------------
retroshare-gui/src/gui/AboutDialog.h | 179 +---
retroshare-gui/src/gui/AboutDialog.ui | 87 +-
retroshare-gui/src/gui/AboutWidget.cpp | 808 ++++++++++++++++++
retroshare-gui/src/gui/AboutWidget.h | 204 +++++
retroshare-gui/src/gui/AboutWidget.ui | 82 ++
retroshare-gui/src/gui/MainWindow.cpp | 4 +-
.../src/gui/settings/rsettingswin.cpp | 2 +
retroshare-gui/src/retroshare-gui.pro | 6 +
9 files changed, 1124 insertions(+), 1026 deletions(-)
create mode 100644 retroshare-gui/src/gui/AboutWidget.cpp
create mode 100644 retroshare-gui/src/gui/AboutWidget.h
create mode 100644 retroshare-gui/src/gui/AboutWidget.ui
diff --git a/retroshare-gui/src/gui/AboutDialog.cpp b/retroshare-gui/src/gui/AboutDialog.cpp
index 441b78b9e..3648d2f27 100644
--- a/retroshare-gui/src/gui/AboutDialog.cpp
+++ b/retroshare-gui/src/gui/AboutDialog.cpp
@@ -21,789 +21,17 @@
****************************************************************/
#include "AboutDialog.h"
-#include "HelpDialog.h"
-#include "rshare.h"
-
-#include
-#include
-#include
-#include
-#include "settings/rsharesettings.h"
-
-#ifdef ENABLE_WEBUI
-#include
-#endif
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
AboutDialog::AboutDialog(QWidget* parent)
-: QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
+ : QDialog(parent,Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
{
- setupUi(this);
-
- QHBoxLayout* l = new QHBoxLayout();
- l->setMargin(0);
- l->addStretch(1);
- l->addStretch(1);
- frame->setContentsMargins(0, 0, 0, 0);
- frame->setLayout(l);
- tWidget = NULL;
- installAWidget();
-
- updateTitle();
-
#ifdef Q_OS_WIN
setWindowFlags(windowFlags() | Qt::MSWindowsFixedSizeDialogHint);
#endif
-}
-void AboutDialog::installAWidget() {
- assert(tWidget == NULL);
- AWidget* aWidget = new AWidget();
- QVBoxLayout* l = (QVBoxLayout*)frame->layout();
- l->insertWidget(0, aWidget);
- l->setStretchFactor(aWidget, 100);
-}
+ setupUi(this) ;
-void AboutDialog::installTWidget() {
- assert(tWidget == NULL);
- tWidget = new TBoard();
- QLabel* npLabel = new NextPieceLabel(tWidget);
- tWidget->setNextPieceLabel(npLabel);
-
- QWidget* pan = new QWidget();
- QVBoxLayout* vl = new QVBoxLayout(pan);
- QLabel* topRecLabel = new QLabel(tr("Max score: %1").arg(tWidget->getMaxScore()));
- QLabel* scoreLabel = new QLabel(pan);
- QLabel* levelLabel = new QLabel(pan);
- vl->addStretch();
- vl->addWidget(topRecLabel);
- vl->addStretch();
- vl->addWidget(npLabel);
- vl->addStretch();
- vl->addWidget(scoreLabel);
- vl->addWidget(levelLabel);
- vl->addStretch();
-
- QHBoxLayout* l = (QHBoxLayout*)frame->layout();
- l->insertWidget(0, pan);
- l->insertWidget(0, tWidget);
- QRect cRect = frame->contentsRect();
- int height = tWidget->heightForWidth(cRect.width());
- tWidget->setFixedSize(cRect.width() * cRect.height() / height, cRect.height());
- npLabel->setFixedSize(tWidget->squareWidth()*4, tWidget->squareHeight()*5);
- l->setStretchFactor(tWidget, 100);
- connect(tWidget, SIGNAL(scoreChanged(int)), SLOT(sl_scoreChanged(int)));
- connect(tWidget, SIGNAL(levelChanged(int)), SLOT(sl_levelChanged(int)));
- connect(this, SIGNAL(si_scoreChanged(QString)), scoreLabel, SLOT(setText(QString)));
- connect(this, SIGNAL(si_levelChanged(QString)), levelLabel, SLOT(setText(QString)));
- tWidget->setFocus();
- tWidget->start();
-}
-
-void AboutDialog::switchPages() {
- QLayoutItem* li = NULL;
- QLayout* l = frame->layout();
- while ((li = l->takeAt(0)) && li->widget()) {
- li->widget()->deleteLater();
- }
- if (tWidget==NULL) {
- installTWidget();
- } else {
- tWidget = NULL;
- installAWidget();
- }
- updateTitle();
-}
-
-void AboutDialog::sl_scoreChanged(int sc) {
- emit si_scoreChanged(tr("Score: %1").arg(sc));
-}
-
-void AboutDialog::sl_levelChanged(int level) {
- emit si_levelChanged(tr("Level: %1").arg(level));
-}
-
-void AboutDialog::updateTitle()
-{
- if (tWidget == NULL)
- {
- setWindowTitle(QString("%1 %2").arg(tr("About RetroShare"), Rshare::retroshareVersion(true)));
- }
- else
- {
- setWindowTitle(tr("Have fun ;-)"));
- }
-}
-
-void AboutDialog::keyPressEvent(QKeyEvent *e) {
- if (e->key() == Qt::Key_T) {
- switchPages();
- } else if (tWidget!=NULL && (e->key() == Qt::Key_P || e->key() == Qt::Key_Pause)) {
- tWidget->pause();
- }
- QDialog::keyPressEvent(e);
-}
-
-void AboutDialog::mousePressEvent(QMouseEvent *e) {
- QPoint globalPos = mapToGlobal(e->pos());
- QPoint framePos = frame->mapFromGlobal(globalPos);
- if (frame->contentsRect().contains(framePos)) {
- switchPages();
- }
- QDialog::mousePressEvent(e);
-}
-
-void AboutDialog::on_help_button_clicked()
-{
- HelpDialog helpdlg (this);
- helpdlg.exec();
-}
-
-AWidget::AWidget() {
- setMouseTracking(true);
-
- QImage image(":/images/logo/logo_info.png");
- QPainter p(&image);
- p.setPen(Qt::black);
- QFont font = p.font();
- font.setBold(true);
- font.setPointSizeF(font.pointSizeF() + 2);
- p.setFont(font);
-
- /* Draw RetroShare version */
- p.drawText(QRect(10, 10, width()-10, 60), QString("%1 : \n%2").arg(tr("RetroShare version"), Rshare::retroshareVersion(true)));
-
- /* Draw Qt's version number */
- p.drawText(QRect(10, 50, width()-10, 60), QString("Qt %1 : \n%2").arg(tr("version"), QT_VERSION_STR));
-
- p.end();
-
- image1 = image2 = image;
- setFixedSize(image1.size());
-
- int w = image1.width();
- int h = image1.height();
- heightField1.resize(w*h);
- heightField2.resize(w*h);
-
- density = 5;
- page = 0;
-
- startTimer(15);
+ QObject::connect(widget->close_button,SIGNAL(clicked()),this,SLOT(close()));
}
-void AWidget::timerEvent(QTimerEvent* e) {
- drawWater((QRgb*)image1.bits(), (QRgb*)image2.bits());
- calcWater(page, density);
- page ^= 1;
-
- if (qrand() % 128 == 0) {
- int r = 3 + qRound((double) qrand() * 4 / RAND_MAX);
- int h = 300 + qrand() * 200 / RAND_MAX;
- int x = 1 + r + qrand()%(image1.width() -2*r-1);
- int y = 1 + r + qrand()%(image1.height()-2*r-1);
- addBlob(x, y, r, h);
- }
-
- update();
- QObject::timerEvent(e);
-}
-
-
-void AWidget::paintEvent(QPaintEvent* e) {
- QWidget::paintEvent(e);
-
- QPainter p(this);
- p.drawImage(0, 0, image2);
-}
-
-void AWidget::mouseMoveEvent(QMouseEvent* e) {
- QPoint point = e->pos();
- addBlob(point.x() - 15,point.y(), 5, 400);
-}
-
-
-void AWidget::calcWater(int npage, int density) {
- int w = image1.width();
- int h = image1.height();
- int count = w + 1;
-
-
- // Set up the pointers
- int *newptr;
- int *oldptr;
- if(npage == 0) {
- newptr = &heightField1.front();
- oldptr = &heightField2.front();
- } else {
- newptr = &heightField2.front();
- oldptr = &heightField1.front();
- }
-
- for (int y = (h-1)*w; count < y; count += 2) {
- for (int x = count+w-2; count < x; ++count) {
- // This does the eight-pixel method. It looks much better.
- int newh = ((oldptr[count + w]
- + oldptr[count - w]
- + oldptr[count + 1]
- + oldptr[count - 1]
- + oldptr[count - w - 1]
- + oldptr[count - w + 1]
- + oldptr[count + w - 1]
- + oldptr[count + w + 1]
- ) >> 2 ) - newptr[count];
-
- newptr[count] = newh - (newh >> density);
- }
- }
-}
-
-void AWidget::addBlob(int x, int y, int radius, int height) {
- int w = image1.width();
- int h = image1.height();
-
- // Set up the pointers
- int *newptr;
-// int *oldptr;
- if (page == 0) {
- newptr = &heightField1.front();
-// oldptr = &heightField2.front();
- } else {
- newptr = &heightField2.front();
-// oldptr = &heightField1.front();
- }
-
- int rquad = radius * radius;
-
- int left=-radius, right = radius;
- int top=-radius, bottom = radius;
-
- // Perform edge clipping...
- if (x - radius < 1) left -= (x-radius-1);
- if (y - radius < 1) top -= (y-radius-1);
- if (x + radius > w-1) right -= (x+radius-w+1);
- if (y + radius > h-1) bottom-= (y+radius-h+1);
-
- for(int cy = top; cy < bottom; ++cy) {
- int cyq = cy*cy;
- for(int cx = left; cx < right; ++cx) {
- if (cx*cx + cyq < rquad) {
- newptr[w*(cy+y) + (cx+x)] += height;
- }
- }
- }
-}
-
-
-void AWidget::drawWater(QRgb* srcImage,QRgb* dstImage) {
- int w = image1.width();
- int h = image1.height();
-
- int offset = w + 1;
- int lIndex;
- int lBreak = w * h;
-
- int *ptr = &heightField1.front();
-
- for (int y = (h-1)*w; offset < y; offset += 2) {
- for (int x = offset+w-2; offset < x; ++offset) {
- int dx = ptr[offset] - ptr[offset+1];
- int dy = ptr[offset] - ptr[offset+w];
-
- lIndex = offset + w*(dy>>3) + (dx>>3);
- if(lIndex < lBreak && lIndex > 0) {
- QRgb c = srcImage[lIndex];
- c = shiftColor(c, dx);
- dstImage[offset] = c;
- }
- ++offset;
- dx = ptr[offset] - ptr[offset+1];
- dy = ptr[offset] - ptr[offset+w];
-
- lIndex = offset + w*(dy>>3) + (dx>>3);
- if(lIndex < lBreak && lIndex > 0) {
- QRgb c = srcImage[lIndex];
- c = shiftColor(c, dx);
- dstImage[offset] = c;
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-// T
-TBoard::TBoard(QWidget *parent) {
- Q_UNUSED(parent);
-
- setFocusPolicy(Qt::StrongFocus);
- isStarted = false;
- isWaitingAfterLine = false;
- numLinesRemoved = 0;
- numPiecesDropped = 0;
- isPaused = false;
- clearBoard();
- nextPiece.setRandomShape();
- score = 0;
- level = 0;
- curX = 0;
- curY = 0;
-
- maxScore = Settings->value("/about/maxsc").toInt();
-}
-TBoard::~TBoard() {
- int oldMax = Settings->value("/about/maxsc").toInt();
- int newMax = qMax(maxScore, score);
- if (oldMax < newMax) {
- Settings->setValue("/about/maxsc", newMax);
- }
-}
-
-int TBoard::heightForWidth ( int w ) const {
- return qRound(BoardHeight * float(w)/BoardWidth);
-}
-
-
-void TBoard::start() {
- if (isPaused) {
- return;
- }
-
- isStarted = true;
- isWaitingAfterLine = false;
- numLinesRemoved = 0;
- numPiecesDropped = 0;
- maxScore = qMax(score, maxScore);
- score = 0;
- level = 1;
- clearBoard();
-
- emit linesRemovedChanged(numLinesRemoved);
- emit scoreChanged(score);
- emit levelChanged(level);
-
- newPiece();
- timer.start(timeoutTime(), this);
-}
-
-void TBoard::pause() {
- if (!isStarted) {
- return;
- }
-
- isPaused = !isPaused;
- if (isPaused) {
- timer.stop();
- } else {
- timer.start(timeoutTime(), this);
- }
- update();
-}
-
-void TBoard::paintEvent(QPaintEvent *event) {
- QWidget::paintEvent(event);
-
- QPainter painter(this);
-
- painter.setPen(Qt::black);
- painter.drawRect(frameRect());
- QRect rect = boardRect();
- painter.fillRect(rect, Qt::white);
-
- if (isPaused) {
- painter.drawText(rect, Qt::AlignCenter, tr("Pause"));
- return;
- }
-
- int boardTop = rect.bottom() - BoardHeight*squareHeight();
-
- for (int i = 0; i < BoardHeight; ++i) {
- for (int j = 0; j < BoardWidth; ++j) {
- TPiece::Shape shape = shapeAt(j, BoardHeight - i - 1);
- if (shape != TPiece::NoShape) {
- drawSquare(painter, rect.left() + j * squareWidth(), boardTop + i * squareHeight(), shape);
- }
- }
- }
- if (curPiece.shape() != TPiece::NoShape) {
- for (int i = 0; i < 4; ++i) {
- int x = curX + curPiece.x(i);
- int y = curY - curPiece.y(i);
- drawSquare(painter, rect.left() + x * squareWidth(), boardTop + (BoardHeight - y - 1) * squareHeight(), curPiece.shape());
- }
- }
-}
-
-void TBoard::keyPressEvent(QKeyEvent *event) {
- if (!isStarted || isPaused || curPiece.shape() == TPiece::NoShape) {
- QWidget::keyPressEvent(event);
- return;
- }
-
- switch (event->key()) {
- case Qt::Key_Left:
- tryMove(curPiece, curX - 1, curY);
- break;
- case Qt::Key_Right:
- tryMove(curPiece, curX + 1, curY);
- break;
- case Qt::Key_Down:
- tryMove(curPiece.rotatedRight(), curX, curY);
- break;
- case Qt::Key_Up:
- tryMove(curPiece.rotatedLeft(), curX, curY);
- break;
- case Qt::Key_Space:
- dropDown();
- break;
- case Qt::Key_Control:
- oneLineDown();
- break;
- default:
- QWidget::keyPressEvent(event);
- }
-}
-
-void TBoard::timerEvent(QTimerEvent *event) {
- if (event->timerId() == timer.timerId()) {
- if (isWaitingAfterLine) {
- isWaitingAfterLine = false;
- newPiece();
- timer.start(timeoutTime(), this);
- } else {
- oneLineDown();
- }
- } else {
- QWidget::timerEvent(event);
- }
-}
-void TBoard::clearBoard() {
- for (int i = 0; i < BoardHeight * BoardWidth; ++i) {
- board[i] = TPiece::NoShape;
- }
-}
-
-void TBoard::dropDown() {
- int dropHeight = 0;
- int newY = curY;
- while (newY > 0) {
- if (!tryMove(curPiece, curX, newY - 1)) {
- break;
- }
- newY--;
- ++dropHeight;
- }
- pieceDropped(dropHeight);
-}
-void TBoard::oneLineDown() {
- if (!tryMove(curPiece, curX, curY - 1))
- pieceDropped(0);
-}
-void TBoard::pieceDropped(int dropHeight) {
- for (int i = 0; i < 4; ++i) {
- int x = curX + curPiece.x(i);
- int y = curY - curPiece.y(i);
- shapeAt(x, y) = curPiece.shape();
- }
-
- ++numPiecesDropped;
- if (numPiecesDropped % 50 == 0) {
- ++level;
- timer.start(timeoutTime(), this);
- emit levelChanged(level);
- }
-
- score += dropHeight + 7;
- emit scoreChanged(score);
- removeFullLines();
-
- if (!isWaitingAfterLine) {
- newPiece();
- }
-}
-
-void TBoard::removeFullLines() {
- int numFullLines = 0;
-
- for (int i = BoardHeight - 1; i >= 0; --i) {
- bool lineIsFull = true;
-
- for (int j = 0; j < BoardWidth; ++j) {
- if (shapeAt(j, i) == TPiece::NoShape) {
- lineIsFull = false;
- break;
- }
- }
-
- if (lineIsFull) {
- ++numFullLines;
- for (int k = i; k < BoardHeight - 1; ++k) {
- for (int j = 0; j < BoardWidth; ++j) {
- shapeAt(j, k) = shapeAt(j, k + 1);
- }
- }
- for (int j = 0; j < BoardWidth; ++j) {
- shapeAt(j, BoardHeight - 1) = TPiece::NoShape;
- }
- }
- }
-
- if (numFullLines > 0) {
- numLinesRemoved += numFullLines;
- score += 10 * numFullLines;
- emit linesRemovedChanged(numLinesRemoved);
- emit scoreChanged(score);
-
- timer.start(500, this);
- isWaitingAfterLine = true;
- curPiece.setShape(TPiece::NoShape);
- update();
- }
-}
-void TBoard::newPiece() {
- curPiece = nextPiece;
- nextPiece.setRandomShape();
- showNextPiece();
- curX = BoardWidth / 2 + 1;
- curY = BoardHeight - 1 + curPiece.minY();
-
- if (!tryMove(curPiece, curX, curY)) {
- curPiece.setShape(TPiece::NoShape);
- timer.stop();
- isStarted = false;
- }
-}
-
-void TBoard::showNextPiece() {
- if (!nextPieceLabel) {
- return;
- }
-
- int dx = nextPiece.maxX() - nextPiece.minX() + 1;
- int dy = nextPiece.maxY() - nextPiece.minY() + 1;
-
- QPixmap pixmap(dx * squareWidth(), dy * squareHeight());
- QPainter painter(&pixmap);
- painter.fillRect(pixmap.rect(), nextPieceLabel->palette().background());
-
- for (int i = 0; i < 4; ++i) {
- int x = nextPiece.x(i) - nextPiece.minX();
- int y = nextPiece.y(i) - nextPiece.minY();
- drawSquare(painter, x * squareWidth(), y * squareHeight(), nextPiece.shape());
- }
- nextPieceLabel->setPixmap(pixmap);
-}
-
-bool TBoard::tryMove(const TPiece &newPiece, int newX, int newY) {
- for (int i = 0; i < 4; ++i) {
- int x = newX + newPiece.x(i);
- int y = newY - newPiece.y(i);
- if (x < 0 || x >= BoardWidth || y < 0 || y >= BoardHeight) {
- return false;
- }
- if (shapeAt(x, y) != TPiece::NoShape) {
- return false;
- }
- }
-
- curPiece = newPiece;
- curX = newX;
- curY = newY;
- update();
- return true;
-}
-
-void TBoard::drawSquare(QPainter &painter, int x, int y, TPiece::Shape shape) {
- static const QRgb colorTable[8] = { 0x000000, 0xCC6666, 0x66CC66, 0x6666CC, 0xCCCC66, 0xCC66CC, 0x66CCCC, 0xDAAA00};
-
- QColor color = colorTable[int(shape)];
- painter.fillRect(x + 1, y + 1, squareWidth() - 2, squareHeight() - 2, color);
-
- painter.setPen(color.light());
- painter.drawLine(x, y + squareHeight() - 1, x, y);
- painter.drawLine(x, y, x + squareWidth() - 1, y);
-
- painter.setPen(color.dark());
- painter.drawLine(x + 1, y + squareHeight() - 1, x + squareWidth() - 1, y + squareHeight() - 1);
- painter.drawLine(x + squareWidth() - 1, y + squareHeight() - 1, x + squareWidth() - 1, y + 1);
-}
-
-
-void TPiece::setRandomShape() {
- setShape(TPiece::Shape(qrand() % 7 + 1));
-}
-
-
-void TPiece::setShape(TPiece::Shape shape) {
- static const int coordsTable[8][4][2] = {
- { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
- { { 0, -1 }, { 0, 0 }, { -1, 0 }, { -1, 1 } },
- { { 0, -1 }, { 0, 0 }, { 1, 0 }, { 1, 1 } },
- { { 0, -1 }, { 0, 0 }, { 0, 1 }, { 0, 2 } },
- { { -1, 0 }, { 0, 0 }, { 1, 0 }, { 0, 1 } },
- { { 0, 0 }, { 1, 0 }, { 0, 1 }, { 1, 1 } },
- { { -1, -1 }, { 0, -1 }, { 0, 0 }, { 0, 1 } },
- { { 1, -1 }, { 0, -1 }, { 0, 0 }, { 0, 1 } }
- };
-
- for (int i = 0; i < 4 ; i++) {
- for (int j = 0; j < 2; ++j) {
- coords[i][j] = coordsTable[shape][i][j];
- }
- }
- pieceShape = shape;
-}
-int TPiece::minX() const {
- int min = coords[0][0];
- for (int i = 1; i < 4; ++i) {
- min = qMin(min, coords[i][0]);
- }
- return min;
-}
-
-int TPiece::maxX() const {
- int max = coords[0][0];
- for (int i = 1; i < 4; ++i) {
- max = qMax(max, coords[i][0]);
- }
- return max;
-}
-
-int TPiece::minY() const {
- int min = coords[0][1];
- for (int i = 1; i < 4; ++i) {
- min = qMin(min, coords[i][1]);
- }
- return min;
-}
-
-int TPiece::maxY() const {
- int max = coords[0][1];
- for (int i = 1; i < 4; ++i) {
- max = qMax(max, coords[i][1]);
- }
- return max;
-}
-
-TPiece TPiece::rotatedLeft() const {
- if (pieceShape == SquareShape) {
- return *this;
- }
-
- TPiece result;
- result.pieceShape = pieceShape;
- for (int i = 0; i < 4; ++i) {
- result.setX(i, y(i));
- result.setY(i, -x(i));
- }
- return result;
-}
-
-TPiece TPiece::rotatedRight() const {
- if (pieceShape == SquareShape) {
- return *this;
- }
- TPiece result;
- result.pieceShape = pieceShape;
- for (int i = 0; i < 4; ++i) {
- result.setX(i, -y(i));
- result.setY(i, x(i));
- }
- return result;
-}
-
-NextPieceLabel::NextPieceLabel( QWidget* parent /* = 0*/ ) : QLabel(parent)
-{
- QPalette p = palette();
- p.setColor(QPalette::Background, Qt::white);
- setPalette(p);
- setFrameShape(QFrame::Box);
- setAlignment(Qt::AlignCenter);
- setAutoFillBackground(true);
-}
-
-static QString addLibraries(const std::string &name, const std::list &libraries)
-{
- QString mTextEdit;
- mTextEdit+=QString::fromUtf8(name.c_str());
- mTextEdit+="\n";
-
- std::list::const_iterator libraryIt;
- for (libraryIt = libraries.begin(); libraryIt != libraries.end(); ++libraryIt) {
-
- mTextEdit+=" - ";
- mTextEdit+=QString::fromUtf8(libraryIt->mName.c_str());
- mTextEdit+=": ";
- mTextEdit+=QString::fromUtf8(libraryIt->mVersion.c_str());
- mTextEdit+="\n";
- }
- mTextEdit+="\n";
- return mTextEdit;
-}
-
-
-void AboutDialog::on_copy_button_clicked()
-{
- QString verInfo;
- QString rsVerString = "RetroShare Version: ";
- rsVerString+=Rshare::retroshareVersion(true);
- verInfo+=rsVerString;
- verInfo+="\n";
-
-
-#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0)
- #if QT_VERSION >= QT_VERSION_CHECK (5, 4, 0)
- verInfo+=QSysInfo::prettyProductName();
- #endif
-#else
- #ifdef Q_OS_LINUX
- verInfo+="Linux";
- #endif
- #ifdef Q_OS_WIN
- verInfo+="Windows";
- #endif
- #ifdef Q_OS_MAC
- verInfo+="Mac";
- #endif
-#endif
- verInfo+=" ";
- QString qtver = QString("QT ")+QT_VERSION_STR;
- verInfo+=qtver;
- verInfo+="\n\n";
-
- /* Add version numbers of libretroshare */
- std::list libraries;
- RsControl::instance()->getLibraries(libraries);
- verInfo+=addLibraries("libretroshare", libraries);
-
-#ifdef ENABLE_WEBUI
- /* Add version numbers of RetroShare */
- // Add versions here. Find a better place.
- libraries.clear();
- libraries.push_back(RsLibraryInfo("Libmicrohttpd", MHD_get_version()));
- verInfo+=addLibraries("RetroShare", libraries);
-#endif // ENABLE_WEBUI
-
- /* Add version numbers of plugins */
- if (rsPlugins) {
- for (int i = 0; i < rsPlugins->nbPlugins(); ++i) {
- RsPlugin *plugin = rsPlugins->plugin(i);
- if (plugin) {
- libraries.clear();
- plugin->getLibraries(libraries);
- verInfo+=addLibraries(plugin->getPluginName(), libraries);
- }
- }
- }
-
-
- QApplication::clipboard()->setText(verInfo);
-}
diff --git a/retroshare-gui/src/gui/AboutDialog.h b/retroshare-gui/src/gui/AboutDialog.h
index c0095699b..6b1d19ed1 100644
--- a/retroshare-gui/src/gui/AboutDialog.h
+++ b/retroshare-gui/src/gui/AboutDialog.h
@@ -20,186 +20,17 @@
* Boston, MA 02110-1301, USA.
****************************************************************/
-#ifndef _GB2_ABOUT_DIALOG_
-#define _GB2_ABOUT_DIALOG_
+#pragma once
#include "ui_AboutDialog.h"
-
-#include
-#include
+#include "AboutWidget.h"
#include
-#include
-#include
-#include
-#include
-
-class AWidget;
-class TBoard;
-class NextPieceLabel;
-
-class AboutDialog : public QDialog, public Ui::AboutDialog
+class AboutDialog : public QDialog, public Ui::AboutDialog
{
- Q_OBJECT
public:
- AboutDialog(QWidget *parent = 0);
-
-private slots:
- void sl_scoreChanged(int);
- void sl_levelChanged(int);
- void on_help_button_clicked();
-
- void on_copy_button_clicked();
-
-signals:
- void si_scoreChanged(QString);
- void si_maxScoreChanged(QString);
- void si_levelChanged(QString);
-
-protected:
- void keyPressEvent(QKeyEvent *event);
- void mousePressEvent(QMouseEvent *event);
-private:
- void switchPages();
- void installAWidget();
- void installTWidget();
- void updateTitle();
-
- TBoard* tWidget;
+ AboutDialog(QWidget *parent = NULL);
+ virtual ~AboutDialog() {}
};
-//////////////////////////////////////////////////////////////////////////
-// A
-class AWidget : public QWidget {
- Q_OBJECT
-
-public:
- AWidget();
-
-protected:
- void timerEvent(QTimerEvent* e);
- void paintEvent(QPaintEvent* e);
- void mouseMoveEvent(QMouseEvent* e);
-
-private:
- void calcWater(int npage, int density);
-
- void addBlob(int x, int y, int radius, int height);
-
- void drawWater(QRgb* srcImage, QRgb* dstImage);
-
- static QRgb shiftColor(QRgb color,int shift) {
- return qRgb(qBound(0, qRed(color) - shift, 255),
- qBound(0, qGreen(color) - shift,255),
- qBound(0, qBlue(color) - shift, 255));
- }
-
- int page;
- int density;
- QVector heightField1;
- QVector heightField2;
- QImage image1;
- QImage image2;
-};
-
-//////////////////////////////////////////////////////////////////////////
-// T
-
-class TPiece {
-public:
- enum Shape { NoShape, ZShape, SShape, LineShape, TShape, SquareShape, LShape, MirroredLShape };
-
- TPiece() { setShape(NoShape); }
-
- void setRandomShape();
- void setShape(Shape shape);
-
- Shape shape() const { return pieceShape; }
- int x(int index) const { return coords[index][0]; }
- int y(int index) const { return coords[index][1]; }
- int minX() const;
- int maxX() const;
- int minY() const;
- int maxY() const;
- TPiece rotatedLeft() const;
- TPiece rotatedRight() const;
-
-private:
- void setX(int index, int x) { coords[index][0] = x; }
- void setY(int index, int y) { coords[index][1] = y; }
-
- Shape pieceShape;
- int coords[4][2];
-};
-
-class TBoard : public QWidget {
- Q_OBJECT
-
-public:
- TBoard(QWidget *parent = 0);
- ~TBoard();
- int heightForWidth ( int w ) const;
- int getScore() const {return score;}
- int getMaxScore() const {return qMax(maxScore, score);}
- int getLevel() const {return level;}
- void setNextPieceLabel(QLabel *label) {nextPieceLabel = label;}
- int squareWidth() const { return boardRect().width() / BoardWidth; }
- int squareHeight() const { return boardRect().height() / BoardHeight; }
-
-public slots:
- void start();
- void pause();
-
-signals:
- void scoreChanged(int score);
- void levelChanged(int level);
- void linesRemovedChanged(int numLines);
-
-protected:
- void paintEvent(QPaintEvent *event);
- void keyPressEvent(QKeyEvent *event);
- void timerEvent(QTimerEvent *event);
-
-private:
-
- enum { BoardWidth = 10, BoardHeight = 22 };
-
- TPiece::Shape &shapeAt(int x, int y) { return board[(y * BoardWidth) + x]; }
- int timeoutTime() const { return 1000 / (1 + level); }
- QRect boardRect() const {return QRect(1, 1, width()-2, height()-2);}
- QRect frameRect() const {return QRect(0, 0, width()-1, height()-1);}
- void clearBoard();
- void dropDown();
- void oneLineDown();
- void pieceDropped(int dropHeight);
- void removeFullLines();
- void newPiece();
- void showNextPiece();
- bool tryMove(const TPiece &newPiece, int newX, int newY);
- void drawSquare(QPainter &painter, int x, int y, TPiece::Shape shape);
-
- QBasicTimer timer;
- QPointer nextPieceLabel;
- bool isStarted;
- bool isPaused;
- bool isWaitingAfterLine;
- TPiece curPiece;
- TPiece nextPiece;
- int curX;
- int curY;
- int numLinesRemoved;
- int numPiecesDropped;
- int score;
- int maxScore;
- int level;
- TPiece::Shape board[BoardWidth * BoardHeight];
-};
-
-class NextPieceLabel : public QLabel {
-public:
- NextPieceLabel(QWidget* parent = 0);
-};
-
-
-#endif
diff --git a/retroshare-gui/src/gui/AboutDialog.ui b/retroshare-gui/src/gui/AboutDialog.ui
index d279f801c..9e5bb9bc1 100644
--- a/retroshare-gui/src/gui/AboutDialog.ui
+++ b/retroshare-gui/src/gui/AboutDialog.ui
@@ -6,7 +6,7 @@
0
0
- 271
+ 422
376
@@ -36,85 +36,20 @@
9
-
-
-
- QFrame::StyledPanel
-
-
- QFrame::Raised
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- -
-
-
-
-
-
- About
-
-
-
- -
-
-
- Copy Info
-
-
-
- :/images/copy.png:/images/copy.png
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- close
-
-
-
-
+
+
+
+ AboutWidget
+ QWidget
+
+ 1
+
+
-
-
- close_button
- clicked()
- AboutDialog
- reject()
-
-
- 243
- 281
-
-
- 145
- 187
-
-
-
-
+
diff --git a/retroshare-gui/src/gui/AboutWidget.cpp b/retroshare-gui/src/gui/AboutWidget.cpp
new file mode 100644
index 000000000..a10e70686
--- /dev/null
+++ b/retroshare-gui/src/gui/AboutWidget.cpp
@@ -0,0 +1,808 @@
+/****************************************************************
+ * This file is distributed under the following license:
+ *
+ * Copyright (c) 2009, RetroShare Team
+ * Copyright (C) 2008 Unipro, Russia (http://ugene.unipro.ru)
+ *
+ * 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.
+ ****************************************************************/
+
+#include "AboutDialog.h"
+#include "HelpDialog.h"
+#include "rshare.h"
+
+#include
+#include
+#include
+#include
+#include "settings/rsharesettings.h"
+
+#ifdef ENABLE_WEBUI
+#include
+#endif
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+AboutWidget::AboutWidget(QWidget* parent)
+: QWidget(parent)
+{
+ setupUi(this);
+
+ QHBoxLayout* l = new QHBoxLayout();
+ l->setMargin(0);
+ l->addStretch(1);
+ l->addStretch(1);
+ frame->setContentsMargins(0, 0, 0, 0);
+ frame->setLayout(l);
+ tWidget = NULL;
+ installAWidget();
+
+ updateTitle();
+
+ QObject::connect(help_button,SIGNAL(clicked()),this,SLOT(on_help_button_clicked()));
+ QObject::connect(copy_button,SIGNAL(clicked()),this,SLOT(on_copy_button_clicked()));
+}
+
+void AboutWidget::installAWidget() {
+ assert(tWidget == NULL);
+ AWidget* aWidget = new AWidget();
+ QVBoxLayout* l = (QVBoxLayout*)frame->layout();
+ l->insertWidget(0, aWidget);
+// l->setStretchFactor(aWidget, 100);
+}
+
+void AboutWidget::installTWidget() {
+ assert(tWidget == NULL);
+ tWidget = new TBoard();
+ QLabel* npLabel = new NextPieceLabel(tWidget);
+ tWidget->setNextPieceLabel(npLabel);
+
+ QWidget* pan = new QWidget();
+ QVBoxLayout* vl = new QVBoxLayout(pan);
+ QLabel* topRecLabel = new QLabel(tr("Max score: %1").arg(tWidget->getMaxScore()));
+ QLabel* scoreLabel = new QLabel(pan);
+ QLabel* levelLabel = new QLabel(pan);
+ vl->addStretch();
+ vl->addWidget(topRecLabel);
+ vl->addStretch();
+ vl->addWidget(npLabel);
+ vl->addStretch();
+ vl->addWidget(scoreLabel);
+ vl->addWidget(levelLabel);
+ vl->addStretch();
+
+ QHBoxLayout* l = (QHBoxLayout*)frame->layout();
+ l->insertWidget(0, pan);
+ l->insertWidget(0, tWidget);
+ QRect cRect = frame->contentsRect();
+ int height = tWidget->heightForWidth(cRect.width());
+ tWidget->setFixedSize(cRect.width() * cRect.height() / height, cRect.height());
+ npLabel->setFixedSize(tWidget->squareWidth()*4, tWidget->squareHeight()*5);
+ l->setStretchFactor(tWidget, 100);
+ connect(tWidget, SIGNAL(scoreChanged(int)), SLOT(sl_scoreChanged(int)));
+ connect(tWidget, SIGNAL(levelChanged(int)), SLOT(sl_levelChanged(int)));
+ connect(this, SIGNAL(si_scoreChanged(QString)), scoreLabel, SLOT(setText(QString)));
+ connect(this, SIGNAL(si_levelChanged(QString)), levelLabel, SLOT(setText(QString)));
+ tWidget->setFocus();
+ tWidget->start();
+}
+
+void AboutWidget::switchPages() {
+ QLayoutItem* li = NULL;
+ QLayout* l = frame->layout();
+ while ((li = l->takeAt(0)) && li->widget()) {
+ li->widget()->deleteLater();
+ }
+ if (tWidget==NULL) {
+ installTWidget();
+ } else {
+ tWidget = NULL;
+ installAWidget();
+ }
+ updateTitle();
+}
+
+void AboutWidget::sl_scoreChanged(int sc) {
+ emit si_scoreChanged(tr("Score: %1").arg(sc));
+}
+
+void AboutWidget::sl_levelChanged(int level) {
+ emit si_levelChanged(tr("Level: %1").arg(level));
+}
+
+void AboutWidget::updateTitle()
+{
+ if (tWidget == NULL)
+ {
+ setWindowTitle(QString("%1 %2").arg(tr("About RetroShare"), Rshare::retroshareVersion(true)));
+ }
+ else
+ {
+ setWindowTitle(tr("Have fun ;-)"));
+ }
+}
+
+void AboutWidget::keyPressEvent(QKeyEvent *e) {
+ if (e->key() == Qt::Key_T) {
+ switchPages();
+ } else if (tWidget!=NULL && (e->key() == Qt::Key_P || e->key() == Qt::Key_Pause)) {
+ tWidget->pause();
+ }
+ QWidget::keyPressEvent(e);
+}
+
+void AboutWidget::mousePressEvent(QMouseEvent *e) {
+ QPoint globalPos = mapToGlobal(e->pos());
+ QPoint framePos = frame->mapFromGlobal(globalPos);
+ if (frame->contentsRect().contains(framePos)) {
+ switchPages();
+ }
+ QWidget::mousePressEvent(e);
+}
+
+void AboutWidget::on_help_button_clicked()
+{
+ HelpDialog helpdlg (this);
+ helpdlg.exec();
+}
+
+AWidget::AWidget() {
+ setMouseTracking(true);
+
+ QImage image(":/images/logo/logo_info.png");
+ QPainter p(&image);
+ p.setPen(Qt::black);
+ QFont font = p.font();
+ font.setBold(true);
+ font.setPointSizeF(font.pointSizeF() + 2);
+ p.setFont(font);
+
+ /* Draw RetroShare version */
+ p.drawText(QRect(10, 10, width()-10, 60), QString("%1 : \n%2").arg(tr("RetroShare version"), Rshare::retroshareVersion(true)));
+
+ /* Draw Qt's version number */
+ p.drawText(QRect(10, 50, width()-10, 60), QString("Qt %1 : \n%2").arg(tr("version"), QT_VERSION_STR));
+
+ p.end();
+
+ image1 = image2 = image;
+ setFixedSize(image1.size());
+
+ int w = image1.width();
+ int h = image1.height();
+ heightField1.resize(w*h);
+ heightField2.resize(w*h);
+
+ density = 5;
+ page = 0;
+
+ startTimer(15);
+}
+
+
+void AWidget::timerEvent(QTimerEvent* e) {
+ drawWater((QRgb*)image1.bits(), (QRgb*)image2.bits());
+ calcWater(page, density);
+ page ^= 1;
+
+ if (qrand() % 128 == 0) {
+ int r = 3 + qRound((double) qrand() * 4 / RAND_MAX);
+ int h = 300 + qrand() * 200 / RAND_MAX;
+ int x = 1 + r + qrand()%(image1.width() -2*r-1);
+ int y = 1 + r + qrand()%(image1.height()-2*r-1);
+ addBlob(x, y, r, h);
+ }
+
+ update();
+ QObject::timerEvent(e);
+}
+
+
+void AWidget::paintEvent(QPaintEvent* e) {
+ QWidget::paintEvent(e);
+
+ QPainter p(this);
+ p.drawImage(0, 0, image2);
+}
+
+void AWidget::mouseMoveEvent(QMouseEvent* e) {
+ QPoint point = e->pos();
+ addBlob(point.x() - 15,point.y(), 5, 400);
+}
+
+
+void AWidget::calcWater(int npage, int density) {
+ int w = image1.width();
+ int h = image1.height();
+ int count = w + 1;
+
+
+ // Set up the pointers
+ int *newptr;
+ int *oldptr;
+ if(npage == 0) {
+ newptr = &heightField1.front();
+ oldptr = &heightField2.front();
+ } else {
+ newptr = &heightField2.front();
+ oldptr = &heightField1.front();
+ }
+
+ for (int y = (h-1)*w; count < y; count += 2) {
+ for (int x = count+w-2; count < x; ++count) {
+ // This does the eight-pixel method. It looks much better.
+ int newh = ((oldptr[count + w]
+ + oldptr[count - w]
+ + oldptr[count + 1]
+ + oldptr[count - 1]
+ + oldptr[count - w - 1]
+ + oldptr[count - w + 1]
+ + oldptr[count + w - 1]
+ + oldptr[count + w + 1]
+ ) >> 2 ) - newptr[count];
+
+ newptr[count] = newh - (newh >> density);
+ }
+ }
+}
+
+void AWidget::addBlob(int x, int y, int radius, int height) {
+ int w = image1.width();
+ int h = image1.height();
+
+ // Set up the pointers
+ int *newptr;
+// int *oldptr;
+ if (page == 0) {
+ newptr = &heightField1.front();
+// oldptr = &heightField2.front();
+ } else {
+ newptr = &heightField2.front();
+// oldptr = &heightField1.front();
+ }
+
+ int rquad = radius * radius;
+
+ int left=-radius, right = radius;
+ int top=-radius, bottom = radius;
+
+ // Perform edge clipping...
+ if (x - radius < 1) left -= (x-radius-1);
+ if (y - radius < 1) top -= (y-radius-1);
+ if (x + radius > w-1) right -= (x+radius-w+1);
+ if (y + radius > h-1) bottom-= (y+radius-h+1);
+
+ for(int cy = top; cy < bottom; ++cy) {
+ int cyq = cy*cy;
+ for(int cx = left; cx < right; ++cx) {
+ if (cx*cx + cyq < rquad) {
+ newptr[w*(cy+y) + (cx+x)] += height;
+ }
+ }
+ }
+}
+
+
+void AWidget::drawWater(QRgb* srcImage,QRgb* dstImage) {
+ int w = image1.width();
+ int h = image1.height();
+
+ int offset = w + 1;
+ int lIndex;
+ int lBreak = w * h;
+
+ int *ptr = &heightField1.front();
+
+ for (int y = (h-1)*w; offset < y; offset += 2) {
+ for (int x = offset+w-2; offset < x; ++offset) {
+ int dx = ptr[offset] - ptr[offset+1];
+ int dy = ptr[offset] - ptr[offset+w];
+
+ lIndex = offset + w*(dy>>3) + (dx>>3);
+ if(lIndex < lBreak && lIndex > 0) {
+ QRgb c = srcImage[lIndex];
+ c = shiftColor(c, dx);
+ dstImage[offset] = c;
+ }
+ ++offset;
+ dx = ptr[offset] - ptr[offset+1];
+ dy = ptr[offset] - ptr[offset+w];
+
+ lIndex = offset + w*(dy>>3) + (dx>>3);
+ if(lIndex < lBreak && lIndex > 0) {
+ QRgb c = srcImage[lIndex];
+ c = shiftColor(c, dx);
+ dstImage[offset] = c;
+ }
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////
+// T
+TBoard::TBoard(QWidget *parent) {
+ Q_UNUSED(parent);
+
+ setFocusPolicy(Qt::StrongFocus);
+ isStarted = false;
+ isWaitingAfterLine = false;
+ numLinesRemoved = 0;
+ numPiecesDropped = 0;
+ isPaused = false;
+ clearBoard();
+ nextPiece.setRandomShape();
+ score = 0;
+ level = 0;
+ curX = 0;
+ curY = 0;
+
+ maxScore = Settings->value("/about/maxsc").toInt();
+}
+TBoard::~TBoard() {
+ int oldMax = Settings->value("/about/maxsc").toInt();
+ int newMax = qMax(maxScore, score);
+ if (oldMax < newMax) {
+ Settings->setValue("/about/maxsc", newMax);
+ }
+}
+
+int TBoard::heightForWidth ( int w ) const {
+ return qRound(BoardHeight * float(w)/BoardWidth);
+}
+
+
+void TBoard::start() {
+ if (isPaused) {
+ return;
+ }
+
+ isStarted = true;
+ isWaitingAfterLine = false;
+ numLinesRemoved = 0;
+ numPiecesDropped = 0;
+ maxScore = qMax(score, maxScore);
+ score = 0;
+ level = 1;
+ clearBoard();
+
+ emit linesRemovedChanged(numLinesRemoved);
+ emit scoreChanged(score);
+ emit levelChanged(level);
+
+ newPiece();
+ timer.start(timeoutTime(), this);
+}
+
+void TBoard::pause() {
+ if (!isStarted) {
+ return;
+ }
+
+ isPaused = !isPaused;
+ if (isPaused) {
+ timer.stop();
+ } else {
+ timer.start(timeoutTime(), this);
+ }
+ update();
+}
+
+void TBoard::paintEvent(QPaintEvent *event) {
+ QWidget::paintEvent(event);
+
+ QPainter painter(this);
+
+ painter.setPen(Qt::black);
+ painter.drawRect(frameRect());
+ QRect rect = boardRect();
+ painter.fillRect(rect, Qt::white);
+
+ if (isPaused) {
+ painter.drawText(rect, Qt::AlignCenter, tr("Pause"));
+ return;
+ }
+
+ int boardTop = rect.bottom() - BoardHeight*squareHeight();
+
+ for (int i = 0; i < BoardHeight; ++i) {
+ for (int j = 0; j < BoardWidth; ++j) {
+ TPiece::Shape shape = shapeAt(j, BoardHeight - i - 1);
+ if (shape != TPiece::NoShape) {
+ drawSquare(painter, rect.left() + j * squareWidth(), boardTop + i * squareHeight(), shape);
+ }
+ }
+ }
+ if (curPiece.shape() != TPiece::NoShape) {
+ for (int i = 0; i < 4; ++i) {
+ int x = curX + curPiece.x(i);
+ int y = curY - curPiece.y(i);
+ drawSquare(painter, rect.left() + x * squareWidth(), boardTop + (BoardHeight - y - 1) * squareHeight(), curPiece.shape());
+ }
+ }
+}
+
+void TBoard::keyPressEvent(QKeyEvent *event) {
+ if (!isStarted || isPaused || curPiece.shape() == TPiece::NoShape) {
+ QWidget::keyPressEvent(event);
+ return;
+ }
+
+ switch (event->key()) {
+ case Qt::Key_Left:
+ tryMove(curPiece, curX - 1, curY);
+ break;
+ case Qt::Key_Right:
+ tryMove(curPiece, curX + 1, curY);
+ break;
+ case Qt::Key_Down:
+ tryMove(curPiece.rotatedRight(), curX, curY);
+ break;
+ case Qt::Key_Up:
+ tryMove(curPiece.rotatedLeft(), curX, curY);
+ break;
+ case Qt::Key_Space:
+ dropDown();
+ break;
+ case Qt::Key_Control:
+ oneLineDown();
+ break;
+ default:
+ QWidget::keyPressEvent(event);
+ }
+}
+
+void TBoard::timerEvent(QTimerEvent *event) {
+ if (event->timerId() == timer.timerId()) {
+ if (isWaitingAfterLine) {
+ isWaitingAfterLine = false;
+ newPiece();
+ timer.start(timeoutTime(), this);
+ } else {
+ oneLineDown();
+ }
+ } else {
+ QWidget::timerEvent(event);
+ }
+}
+void TBoard::clearBoard() {
+ for (int i = 0; i < BoardHeight * BoardWidth; ++i) {
+ board[i] = TPiece::NoShape;
+ }
+}
+
+void TBoard::dropDown() {
+ int dropHeight = 0;
+ int newY = curY;
+ while (newY > 0) {
+ if (!tryMove(curPiece, curX, newY - 1)) {
+ break;
+ }
+ newY--;
+ ++dropHeight;
+ }
+ pieceDropped(dropHeight);
+}
+void TBoard::oneLineDown() {
+ if (!tryMove(curPiece, curX, curY - 1))
+ pieceDropped(0);
+}
+void TBoard::pieceDropped(int dropHeight) {
+ for (int i = 0; i < 4; ++i) {
+ int x = curX + curPiece.x(i);
+ int y = curY - curPiece.y(i);
+ shapeAt(x, y) = curPiece.shape();
+ }
+
+ ++numPiecesDropped;
+ if (numPiecesDropped % 50 == 0) {
+ ++level;
+ timer.start(timeoutTime(), this);
+ emit levelChanged(level);
+ }
+
+ score += dropHeight + 7;
+ emit scoreChanged(score);
+ removeFullLines();
+
+ if (!isWaitingAfterLine) {
+ newPiece();
+ }
+}
+
+void TBoard::removeFullLines() {
+ int numFullLines = 0;
+
+ for (int i = BoardHeight - 1; i >= 0; --i) {
+ bool lineIsFull = true;
+
+ for (int j = 0; j < BoardWidth; ++j) {
+ if (shapeAt(j, i) == TPiece::NoShape) {
+ lineIsFull = false;
+ break;
+ }
+ }
+
+ if (lineIsFull) {
+ ++numFullLines;
+ for (int k = i; k < BoardHeight - 1; ++k) {
+ for (int j = 0; j < BoardWidth; ++j) {
+ shapeAt(j, k) = shapeAt(j, k + 1);
+ }
+ }
+ for (int j = 0; j < BoardWidth; ++j) {
+ shapeAt(j, BoardHeight - 1) = TPiece::NoShape;
+ }
+ }
+ }
+
+ if (numFullLines > 0) {
+ numLinesRemoved += numFullLines;
+ score += 10 * numFullLines;
+ emit linesRemovedChanged(numLinesRemoved);
+ emit scoreChanged(score);
+
+ timer.start(500, this);
+ isWaitingAfterLine = true;
+ curPiece.setShape(TPiece::NoShape);
+ update();
+ }
+}
+void TBoard::newPiece() {
+ curPiece = nextPiece;
+ nextPiece.setRandomShape();
+ showNextPiece();
+ curX = BoardWidth / 2 + 1;
+ curY = BoardHeight - 1 + curPiece.minY();
+
+ if (!tryMove(curPiece, curX, curY)) {
+ curPiece.setShape(TPiece::NoShape);
+ timer.stop();
+ isStarted = false;
+ }
+}
+
+void TBoard::showNextPiece() {
+ if (!nextPieceLabel) {
+ return;
+ }
+
+ int dx = nextPiece.maxX() - nextPiece.minX() + 1;
+ int dy = nextPiece.maxY() - nextPiece.minY() + 1;
+
+ QPixmap pixmap(dx * squareWidth(), dy * squareHeight());
+ QPainter painter(&pixmap);
+ painter.fillRect(pixmap.rect(), nextPieceLabel->palette().background());
+
+ for (int i = 0; i < 4; ++i) {
+ int x = nextPiece.x(i) - nextPiece.minX();
+ int y = nextPiece.y(i) - nextPiece.minY();
+ drawSquare(painter, x * squareWidth(), y * squareHeight(), nextPiece.shape());
+ }
+ nextPieceLabel->setPixmap(pixmap);
+}
+
+bool TBoard::tryMove(const TPiece &newPiece, int newX, int newY) {
+ for (int i = 0; i < 4; ++i) {
+ int x = newX + newPiece.x(i);
+ int y = newY - newPiece.y(i);
+ if (x < 0 || x >= BoardWidth || y < 0 || y >= BoardHeight) {
+ return false;
+ }
+ if (shapeAt(x, y) != TPiece::NoShape) {
+ return false;
+ }
+ }
+
+ curPiece = newPiece;
+ curX = newX;
+ curY = newY;
+ update();
+ return true;
+}
+
+void TBoard::drawSquare(QPainter &painter, int x, int y, TPiece::Shape shape) {
+ static const QRgb colorTable[8] = { 0x000000, 0xCC6666, 0x66CC66, 0x6666CC, 0xCCCC66, 0xCC66CC, 0x66CCCC, 0xDAAA00};
+
+ QColor color = colorTable[int(shape)];
+ painter.fillRect(x + 1, y + 1, squareWidth() - 2, squareHeight() - 2, color);
+
+ painter.setPen(color.light());
+ painter.drawLine(x, y + squareHeight() - 1, x, y);
+ painter.drawLine(x, y, x + squareWidth() - 1, y);
+
+ painter.setPen(color.dark());
+ painter.drawLine(x + 1, y + squareHeight() - 1, x + squareWidth() - 1, y + squareHeight() - 1);
+ painter.drawLine(x + squareWidth() - 1, y + squareHeight() - 1, x + squareWidth() - 1, y + 1);
+}
+
+
+void TPiece::setRandomShape() {
+ setShape(TPiece::Shape(qrand() % 7 + 1));
+}
+
+
+void TPiece::setShape(TPiece::Shape shape) {
+ static const int coordsTable[8][4][2] = {
+ { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
+ { { 0, -1 }, { 0, 0 }, { -1, 0 }, { -1, 1 } },
+ { { 0, -1 }, { 0, 0 }, { 1, 0 }, { 1, 1 } },
+ { { 0, -1 }, { 0, 0 }, { 0, 1 }, { 0, 2 } },
+ { { -1, 0 }, { 0, 0 }, { 1, 0 }, { 0, 1 } },
+ { { 0, 0 }, { 1, 0 }, { 0, 1 }, { 1, 1 } },
+ { { -1, -1 }, { 0, -1 }, { 0, 0 }, { 0, 1 } },
+ { { 1, -1 }, { 0, -1 }, { 0, 0 }, { 0, 1 } }
+ };
+
+ for (int i = 0; i < 4 ; i++) {
+ for (int j = 0; j < 2; ++j) {
+ coords[i][j] = coordsTable[shape][i][j];
+ }
+ }
+ pieceShape = shape;
+}
+int TPiece::minX() const {
+ int min = coords[0][0];
+ for (int i = 1; i < 4; ++i) {
+ min = qMin(min, coords[i][0]);
+ }
+ return min;
+}
+
+int TPiece::maxX() const {
+ int max = coords[0][0];
+ for (int i = 1; i < 4; ++i) {
+ max = qMax(max, coords[i][0]);
+ }
+ return max;
+}
+
+int TPiece::minY() const {
+ int min = coords[0][1];
+ for (int i = 1; i < 4; ++i) {
+ min = qMin(min, coords[i][1]);
+ }
+ return min;
+}
+
+int TPiece::maxY() const {
+ int max = coords[0][1];
+ for (int i = 1; i < 4; ++i) {
+ max = qMax(max, coords[i][1]);
+ }
+ return max;
+}
+
+TPiece TPiece::rotatedLeft() const {
+ if (pieceShape == SquareShape) {
+ return *this;
+ }
+
+ TPiece result;
+ result.pieceShape = pieceShape;
+ for (int i = 0; i < 4; ++i) {
+ result.setX(i, y(i));
+ result.setY(i, -x(i));
+ }
+ return result;
+}
+
+TPiece TPiece::rotatedRight() const {
+ if (pieceShape == SquareShape) {
+ return *this;
+ }
+ TPiece result;
+ result.pieceShape = pieceShape;
+ for (int i = 0; i < 4; ++i) {
+ result.setX(i, -y(i));
+ result.setY(i, x(i));
+ }
+ return result;
+}
+
+NextPieceLabel::NextPieceLabel( QWidget* parent /* = 0*/ ) : QLabel(parent)
+{
+ QPalette p = palette();
+ p.setColor(QPalette::Background, Qt::white);
+ setPalette(p);
+ setFrameShape(QFrame::Box);
+ setAlignment(Qt::AlignCenter);
+ setAutoFillBackground(true);
+}
+
+static QString addLibraries(const std::string &name, const std::list &libraries)
+{
+ QString mTextEdit;
+ mTextEdit+=QString::fromUtf8(name.c_str());
+ mTextEdit+="\n";
+
+ std::list::const_iterator libraryIt;
+ for (libraryIt = libraries.begin(); libraryIt != libraries.end(); ++libraryIt) {
+
+ mTextEdit+=" - ";
+ mTextEdit+=QString::fromUtf8(libraryIt->mName.c_str());
+ mTextEdit+=": ";
+ mTextEdit+=QString::fromUtf8(libraryIt->mVersion.c_str());
+ mTextEdit+="\n";
+ }
+ mTextEdit+="\n";
+ return mTextEdit;
+}
+
+
+void AboutWidget::on_copy_button_clicked()
+{
+ QString verInfo;
+ QString rsVerString = "RetroShare Version: ";
+ rsVerString+=Rshare::retroshareVersion(true);
+ verInfo+=rsVerString;
+ verInfo+="\n";
+
+
+#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0)
+ #if QT_VERSION >= QT_VERSION_CHECK (5, 4, 0)
+ verInfo+=QSysInfo::prettyProductName();
+ #endif
+#else
+ #ifdef Q_OS_LINUX
+ verInfo+="Linux";
+ #endif
+ #ifdef Q_OS_WIN
+ verInfo+="Windows";
+ #endif
+ #ifdef Q_OS_MAC
+ verInfo+="Mac";
+ #endif
+#endif
+ verInfo+=" ";
+ QString qtver = QString("QT ")+QT_VERSION_STR;
+ verInfo+=qtver;
+ verInfo+="\n\n";
+
+ /* Add version numbers of libretroshare */
+ std::list libraries;
+ RsControl::instance()->getLibraries(libraries);
+ verInfo+=addLibraries("libretroshare", libraries);
+
+#ifdef ENABLE_WEBUI
+ /* Add version numbers of RetroShare */
+ // Add versions here. Find a better place.
+ libraries.clear();
+ libraries.push_back(RsLibraryInfo("Libmicrohttpd", MHD_get_version()));
+ verInfo+=addLibraries("RetroShare", libraries);
+#endif // ENABLE_WEBUI
+
+ /* Add version numbers of plugins */
+ if (rsPlugins) {
+ for (int i = 0; i < rsPlugins->nbPlugins(); ++i) {
+ RsPlugin *plugin = rsPlugins->plugin(i);
+ if (plugin) {
+ libraries.clear();
+ plugin->getLibraries(libraries);
+ verInfo+=addLibraries(plugin->getPluginName(), libraries);
+ }
+ }
+ }
+
+
+ QApplication::clipboard()->setText(verInfo);
+}
diff --git a/retroshare-gui/src/gui/AboutWidget.h b/retroshare-gui/src/gui/AboutWidget.h
new file mode 100644
index 000000000..3258e5585
--- /dev/null
+++ b/retroshare-gui/src/gui/AboutWidget.h
@@ -0,0 +1,204 @@
+/****************************************************************
+ * This file is distributed under the following license:
+ *
+ * Copyright (c) 2009, RetroShare Team
+ * Copyright (C) 2008 Unipro, Russia (http://ugene.unipro.ru)
+ *
+ * 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 _GB2_ABOUT_DIALOG_
+#define _GB2_ABOUT_DIALOG_
+
+#include "ui_AboutWidget.h"
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+
+class AWidget;
+class TBoard;
+class NextPieceLabel;
+
+class AboutWidget : public QWidget, public Ui::AboutWidget
+{
+ Q_OBJECT
+public:
+ AboutWidget(QWidget *parent = 0);
+
+private slots:
+ void sl_scoreChanged(int);
+ void sl_levelChanged(int);
+ void on_help_button_clicked();
+ void on_copy_button_clicked();
+
+signals:
+ void si_scoreChanged(QString);
+ void si_maxScoreChanged(QString);
+ void si_levelChanged(QString);
+
+protected:
+ void keyPressEvent(QKeyEvent *event);
+ void mousePressEvent(QMouseEvent *event);
+private:
+ void switchPages();
+ void installAWidget();
+ void installTWidget();
+ void updateTitle();
+
+ TBoard* tWidget;
+};
+
+//////////////////////////////////////////////////////////////////////////
+// A
+class AWidget : public QWidget {
+ Q_OBJECT
+
+public:
+ AWidget();
+
+protected:
+ void timerEvent(QTimerEvent* e);
+ void paintEvent(QPaintEvent* e);
+ void mouseMoveEvent(QMouseEvent* e);
+
+private:
+ void calcWater(int npage, int density);
+
+ void addBlob(int x, int y, int radius, int height);
+
+ void drawWater(QRgb* srcImage, QRgb* dstImage);
+
+ static QRgb shiftColor(QRgb color,int shift) {
+ return qRgb(qBound(0, qRed(color) - shift, 255),
+ qBound(0, qGreen(color) - shift,255),
+ qBound(0, qBlue(color) - shift, 255));
+ }
+
+ int page;
+ int density;
+ QVector heightField1;
+ QVector heightField2;
+ QImage image1;
+ QImage image2;
+};
+
+//////////////////////////////////////////////////////////////////////////
+// T
+
+class TPiece {
+public:
+ enum Shape { NoShape, ZShape, SShape, LineShape, TShape, SquareShape, LShape, MirroredLShape };
+
+ TPiece() { setShape(NoShape); }
+
+ void setRandomShape();
+ void setShape(Shape shape);
+
+ Shape shape() const { return pieceShape; }
+ int x(int index) const { return coords[index][0]; }
+ int y(int index) const { return coords[index][1]; }
+ int minX() const;
+ int maxX() const;
+ int minY() const;
+ int maxY() const;
+ TPiece rotatedLeft() const;
+ TPiece rotatedRight() const;
+
+private:
+ void setX(int index, int x) { coords[index][0] = x; }
+ void setY(int index, int y) { coords[index][1] = y; }
+
+ Shape pieceShape;
+ int coords[4][2];
+};
+
+class TBoard : public QWidget {
+ Q_OBJECT
+
+public:
+ TBoard(QWidget *parent = 0);
+ ~TBoard();
+ int heightForWidth ( int w ) const;
+ int getScore() const {return score;}
+ int getMaxScore() const {return qMax(maxScore, score);}
+ int getLevel() const {return level;}
+ void setNextPieceLabel(QLabel *label) {nextPieceLabel = label;}
+ int squareWidth() const { return boardRect().width() / BoardWidth; }
+ int squareHeight() const { return boardRect().height() / BoardHeight; }
+
+public slots:
+ void start();
+ void pause();
+
+signals:
+ void scoreChanged(int score);
+ void levelChanged(int level);
+ void linesRemovedChanged(int numLines);
+
+protected:
+ void paintEvent(QPaintEvent *event);
+ void keyPressEvent(QKeyEvent *event);
+ void timerEvent(QTimerEvent *event);
+
+private:
+
+ enum { BoardWidth = 10, BoardHeight = 22 };
+
+ TPiece::Shape &shapeAt(int x, int y) { return board[(y * BoardWidth) + x]; }
+ int timeoutTime() const { return 1000 / (1 + level); }
+ QRect boardRect() const {return QRect(1, 1, width()-2, height()-2);}
+ QRect frameRect() const {return QRect(0, 0, width()-1, height()-1);}
+ void clearBoard();
+ void dropDown();
+ void oneLineDown();
+ void pieceDropped(int dropHeight);
+ void removeFullLines();
+ void newPiece();
+ void showNextPiece();
+ bool tryMove(const TPiece &newPiece, int newX, int newY);
+ void drawSquare(QPainter &painter, int x, int y, TPiece::Shape shape);
+
+ QBasicTimer timer;
+ QPointer nextPieceLabel;
+ bool isStarted;
+ bool isPaused;
+ bool isWaitingAfterLine;
+ TPiece curPiece;
+ TPiece nextPiece;
+ int curX;
+ int curY;
+ int numLinesRemoved;
+ int numPiecesDropped;
+ int score;
+ int maxScore;
+ int level;
+ TPiece::Shape board[BoardWidth * BoardHeight];
+};
+
+class NextPieceLabel : public QLabel {
+public:
+ NextPieceLabel(QWidget* parent = 0);
+};
+
+
+#endif
diff --git a/retroshare-gui/src/gui/AboutWidget.ui b/retroshare-gui/src/gui/AboutWidget.ui
new file mode 100644
index 000000000..95fc79e05
--- /dev/null
+++ b/retroshare-gui/src/gui/AboutWidget.ui
@@ -0,0 +1,82 @@
+
+
+ AboutWidget
+
+
+
+ 0
+ 0
+ 594
+ 594
+
+
+
+ Form
+
+
+ -
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Raised
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
-
+
+
+ About
+
+
+
+ -
+
+
+ Copy Info
+
+
+
+ :/images/copy.png:/images/copy.png
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ close
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp
index 3f810857e..26204dea9 100644
--- a/retroshare-gui/src/gui/MainWindow.cpp
+++ b/retroshare-gui/src/gui/MainWindow.cpp
@@ -442,7 +442,9 @@ void MainWindow::initStackedPage()
//addAction(new QAction(QIcon(IMAGE_ADDFRIEND), tr("Add"), ui->toolBarAction), &MainWindow::addFriend, SLOT(addFriend()));
//addAction(new QAction(QIcon(IMAGE_NEWRSCOLLECTION), tr("New"), ui->toolBarAction), &MainWindow::newRsCollection, SLOT(newRsCollection()));
addAction(new QAction(QIcon(IMAGE_PREFERENCES), tr("Options"), ui->toolBarAction), &MainWindow::showSettings, SLOT(showSettings()));
- addAction(new QAction(QIcon(IMAGE_ABOUT), tr("About"), ui->toolBarAction), &MainWindow::showabout, SLOT(showabout()));
+
+ // Removed About because it's now in options.
+ //addAction(new QAction(QIcon(IMAGE_ABOUT), tr("About"), ui->toolBarAction), &MainWindow::showabout, SLOT(showabout()));
addAction(new QAction(QIcon(IMAGE_QUIT), tr("Quit"), ui->toolBarAction), &MainWindow::doQuit, SLOT(doQuit()));
QList > >::iterator notifyIt;
diff --git a/retroshare-gui/src/gui/settings/rsettingswin.cpp b/retroshare-gui/src/gui/settings/rsettingswin.cpp
index 0a3e8dbc4..7267299c8 100644
--- a/retroshare-gui/src/gui/settings/rsettingswin.cpp
+++ b/retroshare-gui/src/gui/settings/rsettingswin.cpp
@@ -39,6 +39,7 @@
#include "PeoplePage.h"
#include "MessagePage.h"
#include "ForumPage.h"
+#include "AboutPage.h"
#include "PostedPage.h"
#include "PluginsPage.h"
#include "ServicePermissionsPage.h"
@@ -167,6 +168,7 @@ RSettingsWin::initStackedWidget()
addPage(cp) ;
}
}
+ addPage(new AboutPage() );
// make the first page the default.
diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro
index 94949c38c..34924c60f 100644
--- a/retroshare-gui/src/retroshare-gui.pro
+++ b/retroshare-gui/src/retroshare-gui.pro
@@ -343,6 +343,7 @@ HEADERS += rshare.h \
gui/MainWindow.h \
gui/RSHumanReadableDelegate.h \
gui/AboutDialog.h \
+ gui/AboutWidget.h \
gui/NetworkView.h \
gui/MessengerWindow.h \
gui/FriendsDialog.h \
@@ -442,6 +443,7 @@ HEADERS += rshare.h \
gui/settings/GeneralPage.h \
gui/settings/PeoplePage.h \
gui/settings/DirectoriesPage.h \
+ gui/settings/AboutPage.h \
gui/settings/ServerPage.h \
gui/settings/NetworkPage.h \
gui/settings/NotifyPage.h \
@@ -586,6 +588,7 @@ FORMS += gui/StartDialog.ui \
gui/HomePage.ui\
gui/GenCertDialog.ui \
gui/AboutDialog.ui \
+ gui/AboutWidget.ui \
gui/QuickStartWizard.ui \
gui/NetworkDialog.ui \
gui/common/AvatarDialog.ui \
@@ -632,6 +635,7 @@ FORMS += gui/StartDialog.ui \
gui/settings/MessagePage.ui \
gui/settings/NewTag.ui \
gui/settings/ForumPage.ui \
+ gui/settings/AboutPage.ui \
gui/settings/PluginsPage.ui \
gui/settings/AppearancePage.ui \
gui/settings/TransferPage.ui \
@@ -703,6 +707,7 @@ SOURCES += main.cpp \
rshare.cpp \
gui/notifyqt.cpp \
gui/AboutDialog.cpp \
+ gui/AboutWidget.cpp \
gui/QuickStartWizard.cpp \
gui/StartDialog.cpp \
gui/HomePage.cpp\
@@ -846,6 +851,7 @@ SOURCES += main.cpp \
gui/settings/rsettingswin.cpp \
gui/settings/GeneralPage.cpp \
gui/settings/DirectoriesPage.cpp \
+ gui/settings/AboutPage.cpp \
gui/settings/ServerPage.cpp \
gui/settings/NetworkPage.cpp \
gui/settings/NotifyPage.cpp \
From 0774f0893319614a0521c8e51b9fd2bfe7adb6f8 Mon Sep 17 00:00:00 2001
From: csoler
Date: Wed, 25 Jan 2017 20:27:53 +0100
Subject: [PATCH 29/90] fixed display of about widget
---
retroshare-gui/src/gui/AboutWidget.cpp | 63 ++++++++++++++++++++------
retroshare-gui/src/gui/AboutWidget.h | 5 ++
2 files changed, 53 insertions(+), 15 deletions(-)
diff --git a/retroshare-gui/src/gui/AboutWidget.cpp b/retroshare-gui/src/gui/AboutWidget.cpp
index a10e70686..ff8faf431 100644
--- a/retroshare-gui/src/gui/AboutWidget.cpp
+++ b/retroshare-gui/src/gui/AboutWidget.cpp
@@ -68,7 +68,7 @@ void AboutWidget::installAWidget() {
AWidget* aWidget = new AWidget();
QVBoxLayout* l = (QVBoxLayout*)frame->layout();
l->insertWidget(0, aWidget);
-// l->setStretchFactor(aWidget, 100);
+ l->setStretchFactor(aWidget, 100);
}
void AboutWidget::installTWidget() {
@@ -151,7 +151,8 @@ void AboutWidget::keyPressEvent(QKeyEvent *e) {
QWidget::keyPressEvent(e);
}
-void AboutWidget::mousePressEvent(QMouseEvent *e) {
+void AboutWidget::mousePressEvent(QMouseEvent *e)
+{
QPoint globalPos = mapToGlobal(e->pos());
QPoint framePos = frame->mapFromGlobal(globalPos);
if (frame->contentsRect().contains(framePos)) {
@@ -166,37 +167,65 @@ void AboutWidget::on_help_button_clicked()
helpdlg.exec();
}
-AWidget::AWidget() {
- setMouseTracking(true);
+void AWidget::resizeEvent(QResizeEvent *e)
+{
+ mImagesReady = false ;
+}
- QImage image(":/images/logo/logo_info.png");
- QPainter p(&image);
+void AWidget::initImages()
+{
+ if(width() == 0) return ;
+ if(height() == 0) return ;
+
+ image1 = QImage(width(),height(),QImage::Format_ARGB32);
+ image1.fill(palette().color(QPalette::Background));
+
+ std::cerr << "width=" << width() << ", height=" << height() << std::endl;
+
+ //QImage image(":/images/logo/logo_info.png");
+ QPixmap image(":/images/logo/logo_splash.png");
+ QPainter p(&image1);
p.setPen(Qt::black);
QFont font = p.font();
font.setBold(true);
font.setPointSizeF(font.pointSizeF() + 2);
p.setFont(font);
+ //p.drawPixmap(QRect(10, 10, width()-10, 60), image);
+
/* Draw RetroShare version */
- p.drawText(QRect(10, 10, width()-10, 60), QString("%1 : \n%2").arg(tr("RetroShare version"), Rshare::retroshareVersion(true)));
+ p.drawText(QPointF(10, 50), QString("%1 : %2").arg(tr("RetroShare version"), Rshare::retroshareVersion(true)));
/* Draw Qt's version number */
- p.drawText(QRect(10, 50, width()-10, 60), QString("Qt %1 : \n%2").arg(tr("version"), QT_VERSION_STR));
+ p.drawText(QPointF(10, 90), QString("Qt %1 : %2").arg(tr("version"), QT_VERSION_STR));
p.end();
- image1 = image2 = image;
- setFixedSize(image1.size());
+// setFixedSize(image1.size());
+
+ image2 = image1 ;
int w = image1.width();
int h = image1.height();
+
+ heightField1.clear();
+ heightField2.clear();
+
heightField1.resize(w*h);
heightField2.resize(w*h);
- density = 5;
- page = 0;
+ mImagesReady = true ;
+ update() ;
+}
- startTimer(15);
+AWidget::AWidget() {
+// setMouseTracking(true);
+
+ density = 5;
+ page = 0;
+ mImagesReady = false ;
+
+// startTimer(15);
}
@@ -218,11 +247,15 @@ void AWidget::timerEvent(QTimerEvent* e) {
}
-void AWidget::paintEvent(QPaintEvent* e) {
+void AWidget::paintEvent(QPaintEvent* e)
+{
QWidget::paintEvent(e);
+ if(!mImagesReady)
+ initImages();
+
QPainter p(this);
- p.drawImage(0, 0, image2);
+ p.drawImage(0, 0, image1);
}
void AWidget::mouseMoveEvent(QMouseEvent* e) {
diff --git a/retroshare-gui/src/gui/AboutWidget.h b/retroshare-gui/src/gui/AboutWidget.h
index 3258e5585..fa891b740 100644
--- a/retroshare-gui/src/gui/AboutWidget.h
+++ b/retroshare-gui/src/gui/AboutWidget.h
@@ -26,6 +26,7 @@
#include "ui_AboutWidget.h"
#include
+#include
#include
#include
@@ -80,8 +81,10 @@ protected:
void timerEvent(QTimerEvent* e);
void paintEvent(QPaintEvent* e);
void mouseMoveEvent(QMouseEvent* e);
+ void resizeEvent(QResizeEvent *);
private:
+ void initImages();
void calcWater(int npage, int density);
void addBlob(int x, int y, int radius, int height);
@@ -100,6 +103,8 @@ private:
QVector heightField2;
QImage image1;
QImage image2;
+
+ bool mImagesReady ;
};
//////////////////////////////////////////////////////////////////////////
From 1cd64ce0fd669612dd8f2298c348509640a13068 Mon Sep 17 00:00:00 2001
From: csoler
Date: Wed, 25 Jan 2017 22:41:23 +0100
Subject: [PATCH 30/90] improved EE
---
retroshare-gui/src/gui/AboutWidget.cpp | 211 +++++++++++++++++++++----
retroshare-gui/src/gui/AboutWidget.h | 21 ++-
2 files changed, 194 insertions(+), 38 deletions(-)
diff --git a/retroshare-gui/src/gui/AboutWidget.cpp b/retroshare-gui/src/gui/AboutWidget.cpp
index ff8faf431..46932b33a 100644
--- a/retroshare-gui/src/gui/AboutWidget.cpp
+++ b/retroshare-gui/src/gui/AboutWidget.cpp
@@ -55,6 +55,7 @@ AboutWidget::AboutWidget(QWidget* parent)
frame->setContentsMargins(0, 0, 0, 0);
frame->setLayout(l);
tWidget = NULL;
+ aWidget = NULL;
installAWidget();
updateTitle();
@@ -65,10 +66,14 @@ AboutWidget::AboutWidget(QWidget* parent)
void AboutWidget::installAWidget() {
assert(tWidget == NULL);
- AWidget* aWidget = new AWidget();
+ aWidget = new AWidget();
QVBoxLayout* l = (QVBoxLayout*)frame->layout();
l->insertWidget(0, aWidget);
l->setStretchFactor(aWidget, 100);
+ aWidget->setFocus();
+
+ delete tWidget ;
+ tWidget = NULL;
}
void AboutWidget::installTWidget() {
@@ -105,6 +110,9 @@ void AboutWidget::installTWidget() {
connect(this, SIGNAL(si_levelChanged(QString)), levelLabel, SLOT(setText(QString)));
tWidget->setFocus();
tWidget->start();
+
+ delete aWidget ;
+ aWidget = NULL;
}
void AboutWidget::switchPages() {
@@ -142,21 +150,26 @@ void AboutWidget::updateTitle()
}
}
-void AboutWidget::keyPressEvent(QKeyEvent *e) {
- if (e->key() == Qt::Key_T) {
- switchPages();
- } else if (tWidget!=NULL && (e->key() == Qt::Key_P || e->key() == Qt::Key_Pause)) {
- tWidget->pause();
- }
- QWidget::keyPressEvent(e);
-}
+//void AboutWidget::keyPressEvent(QKeyEvent *e) {
+// if(aWidget != NULL)
+// aWidget->keyPressEvent(e) ;
+//}
void AboutWidget::mousePressEvent(QMouseEvent *e)
{
QPoint globalPos = mapToGlobal(e->pos());
QPoint framePos = frame->mapFromGlobal(globalPos);
+
if (frame->contentsRect().contains(framePos)) {
- switchPages();
+ {
+ if(e->modifiers() & Qt::ControlModifier)
+ switchPages();
+ else
+ {
+ if(aWidget)
+ aWidget->switchState();
+ }
+ }
}
QWidget::mousePressEvent(e);
}
@@ -167,6 +180,26 @@ void AboutWidget::on_help_button_clicked()
helpdlg.exec();
}
+void AWidget::switchState()
+{
+ mState = 1 - mState ;
+
+ if(mState == 1)
+ {
+ mStep = 1 ;
+ initGoL();
+ drawBitField();
+
+ mTimerId = startTimer(50);
+ }
+ else
+ killTimer(mTimerId);
+
+
+ update();
+
+}
+
void AWidget::resizeEvent(QResizeEvent *e)
{
mImagesReady = false ;
@@ -180,8 +213,6 @@ void AWidget::initImages()
image1 = QImage(width(),height(),QImage::Format_ARGB32);
image1.fill(palette().color(QPalette::Background));
- std::cerr << "width=" << width() << ", height=" << height() << std::endl;
-
//QImage image(":/images/logo/logo_info.png");
QPixmap image(":/images/logo/logo_splash.png");
QPainter p(&image1);
@@ -204,32 +235,130 @@ void AWidget::initImages()
// setFixedSize(image1.size());
image2 = image1 ;
+ mImagesReady = true ;
+
+ initGoL();
+ drawBitField();
+
+ update() ;
+}
+
+void AWidget::initGoL()
+{
+ int w = image1.width();
+ int h = image1.height();
+
+ int s = mStep ; // pixels per cell
+ int bw = w/s ;
+ int bh = h/s ;
+
+ bitfield1.clear();
+
+ bitfield1.resize(bw*bh,0);
+
+ for(int i=0;i= mMaxStep)
+ {
+ for(int i=0;i<=bh;++i) p.drawLine(0,i*s,bw*s,i*s) ;
+ for(int i=0;i<=bw;++i) p.drawLine(i*s,0,i*s,bh*s) ;
+ }
+
+ p.setPen(Qt::black);
+
+ for(int i=0;i= mMaxStep)
+ computeNextState();
+ else
+ {
+ initGoL();
+ mStep++ ;
+ }
+
+ drawBitField();
+
+#ifdef REMOVED
drawWater((QRgb*)image1.bits(), (QRgb*)image2.bits());
calcWater(page, density);
page ^= 1;
@@ -241,6 +370,7 @@ void AWidget::timerEvent(QTimerEvent* e) {
int y = 1 + r + qrand()%(image1.height()-2*r-1);
addBlob(x, y, r, h);
}
+#endif
update();
QObject::timerEvent(e);
@@ -249,15 +379,29 @@ void AWidget::timerEvent(QTimerEvent* e) {
void AWidget::paintEvent(QPaintEvent* e)
{
- QWidget::paintEvent(e);
-
- if(!mImagesReady)
- initImages();
+ QWidget::paintEvent(e);
- QPainter p(this);
- p.drawImage(0, 0, image1);
+ switch(mState)
+ {
+ default:
+ case 0:
+ {
+ if(!mImagesReady) initImages();
+ QPainter p(this);
+ p.drawImage(0, 0, image1);
+ }
+ break;
+
+ case 1:
+ {
+ QPainter p(this);
+ p.drawImage(0, 0, image2);
+ }
+ break;
+ }
}
+#ifdef REMOVED
void AWidget::mouseMoveEvent(QMouseEvent* e) {
QPoint point = e->pos();
addBlob(point.x() - 15,point.y(), 5, 400);
@@ -274,11 +418,11 @@ void AWidget::calcWater(int npage, int density) {
int *newptr;
int *oldptr;
if(npage == 0) {
- newptr = &heightField1.front();
- oldptr = &heightField2.front();
+ newptr = &bitfield1.front();
+ oldptr = &bitfield2.front();
} else {
- newptr = &heightField2.front();
- oldptr = &heightField1.front();
+ newptr = &bitfield2.front();
+ oldptr = &bitfield1.front();
}
for (int y = (h-1)*w; count < y; count += 2) {
@@ -307,10 +451,10 @@ void AWidget::addBlob(int x, int y, int radius, int height) {
int *newptr;
// int *oldptr;
if (page == 0) {
- newptr = &heightField1.front();
+ newptr = &bitfield1.front();
// oldptr = &heightField2.front();
} else {
- newptr = &heightField2.front();
+ newptr = &bitfield2.front();
// oldptr = &heightField1.front();
}
@@ -344,7 +488,7 @@ void AWidget::drawWater(QRgb* srcImage,QRgb* dstImage) {
int lIndex;
int lBreak = w * h;
- int *ptr = &heightField1.front();
+ int *ptr = &bitfield1.front();
for (int y = (h-1)*w; offset < y; offset += 2) {
for (int x = offset+w-2; offset < x; ++offset) {
@@ -370,6 +514,7 @@ void AWidget::drawWater(QRgb* srcImage,QRgb* dstImage) {
}
}
}
+#endif
//////////////////////////////////////////////////////////////////////////
// T
diff --git a/retroshare-gui/src/gui/AboutWidget.h b/retroshare-gui/src/gui/AboutWidget.h
index fa891b740..51a056bcd 100644
--- a/retroshare-gui/src/gui/AboutWidget.h
+++ b/retroshare-gui/src/gui/AboutWidget.h
@@ -58,7 +58,7 @@ signals:
void si_levelChanged(QString);
protected:
- void keyPressEvent(QKeyEvent *event);
+ //void keyPressEvent(QKeyEvent *event);
void mousePressEvent(QMouseEvent *event);
private:
void switchPages();
@@ -66,6 +66,7 @@ private:
void installTWidget();
void updateTitle();
+ AWidget* aWidget;
TBoard* tWidget;
};
@@ -77,14 +78,18 @@ class AWidget : public QWidget {
public:
AWidget();
+ void switchState() ;
+
protected:
void timerEvent(QTimerEvent* e);
void paintEvent(QPaintEvent* e);
- void mouseMoveEvent(QMouseEvent* e);
+ //void mouseMoveEvent(QMouseEvent* e);
void resizeEvent(QResizeEvent *);
-
+ //void keyPressEvent(QKeyEvent *e);
+
private:
void initImages();
+ void computeNextState();
void calcWater(int npage, int density);
void addBlob(int x, int y, int radius, int height);
@@ -96,15 +101,21 @@ private:
qBound(0, qGreen(color) - shift,255),
qBound(0, qBlue(color) - shift, 255));
}
+ void initGoL();
+ void drawBitField();
int page;
int density;
- QVector heightField1;
- QVector heightField2;
+ std::vector bitfield1;
+ std::vector bitfield2;
QImage image1;
QImage image2;
bool mImagesReady ;
+ int mState;
+ int mTimerId;
+ int mStep;
+ int mMaxStep;
};
//////////////////////////////////////////////////////////////////////////
From 883c4cc8a07ea2305f1b8c5f7b8139c9bcb85eae Mon Sep 17 00:00:00 2001
From: csoler
Date: Thu, 26 Jan 2017 09:19:18 +0100
Subject: [PATCH 31/90] improved AboutWidget a little bit
---
retroshare-gui/src/gui/AboutWidget.cpp | 17 ++++++++++-------
retroshare-gui/src/gui/AboutWidget.h | 2 +-
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/retroshare-gui/src/gui/AboutWidget.cpp b/retroshare-gui/src/gui/AboutWidget.cpp
index 46932b33a..f2ef6aac8 100644
--- a/retroshare-gui/src/gui/AboutWidget.cpp
+++ b/retroshare-gui/src/gui/AboutWidget.cpp
@@ -186,7 +186,7 @@ void AWidget::switchState()
if(mState == 1)
{
- mStep = 1 ;
+ mStep = 1.0f ;
initGoL();
drawBitField();
@@ -237,7 +237,6 @@ void AWidget::initImages()
image2 = image1 ;
mImagesReady = true ;
- initGoL();
drawBitField();
update() ;
@@ -258,7 +257,7 @@ void AWidget::initGoL()
for(int i=0;i= mMaxStep)
+ p.fillRect(QRect(i*s+1,j*s+1,s-2,s-2),QBrush(QColor(50,50,50)));
+ else
+ p.fillRect(QRect(i*s,j*s,s,s),QBrush(QColor(50,50,50)));
p.end();
}
@@ -301,7 +303,7 @@ AWidget::AWidget() {
density = 5;
page = 0;
mMaxStep = QFontMetricsF(font()).width(' ') ;
- mStep = 1 ;
+ mStep = 1.0f ;
mState = 0 ;
mImagesReady = false ;
@@ -353,7 +355,7 @@ void AWidget::timerEvent(QTimerEvent* e)
else
{
initGoL();
- mStep++ ;
+ mStep+=0.2f ;
}
drawBitField();
@@ -381,12 +383,13 @@ void AWidget::paintEvent(QPaintEvent* e)
{
QWidget::paintEvent(e);
+ if(!mImagesReady) initImages();
+
switch(mState)
{
default:
case 0:
{
- if(!mImagesReady) initImages();
QPainter p(this);
p.drawImage(0, 0, image1);
}
diff --git a/retroshare-gui/src/gui/AboutWidget.h b/retroshare-gui/src/gui/AboutWidget.h
index 51a056bcd..532170a97 100644
--- a/retroshare-gui/src/gui/AboutWidget.h
+++ b/retroshare-gui/src/gui/AboutWidget.h
@@ -114,7 +114,7 @@ private:
bool mImagesReady ;
int mState;
int mTimerId;
- int mStep;
+ float mStep;
int mMaxStep;
};
From 67af166c0cf305bf8c3210d307c88dbf20bd0a6a Mon Sep 17 00:00:00 2001
From: csoler
Date: Thu, 26 Jan 2017 22:35:33 +0100
Subject: [PATCH 32/90] moved Options window into a new Preferences tab
---
retroshare-gui/src/gui/MainWindow.cpp | 44 +++++++++++---
retroshare-gui/src/gui/MainWindow.h | 24 +++++++-
retroshare-gui/src/gui/NewsFeed.cpp | 2 +-
retroshare-gui/src/gui/chat/ChatWidget.cpp | 8 +--
retroshare-gui/src/gui/chat/ChatWidget.h | 2 +-
.../src/gui/settings/AppearancePage.cpp | 53 ++++++++++++-----
.../src/gui/settings/AppearancePage.h | 17 ++++++
.../src/gui/settings/rsettingswin.cpp | 59 ++++++++++---------
.../src/gui/settings/rsettingswin.h | 22 ++++---
retroshare-gui/src/retroshare-gui.pro | 2 +-
10 files changed, 168 insertions(+), 65 deletions(-)
diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp
index 26204dea9..58e972fb7 100644
--- a/retroshare-gui/src/gui/MainWindow.cpp
+++ b/retroshare-gui/src/gui/MainWindow.cpp
@@ -425,6 +425,7 @@ void MainWindow::initStackedPage()
addPage(getStartedPage = new GetStartedDialog(ui->stackPages), grp, NULL);
}
#endif
+ addPage(settingsDialog = new SettingsPage(ui->stackPages),grp,¬ify);
/* Create the toolbar */
ui->toolBarPage->addActions(grp->actions());
@@ -441,11 +442,11 @@ void MainWindow::initStackedPage()
// I remove add a friend because it's in HOME ghibli
//addAction(new QAction(QIcon(IMAGE_ADDFRIEND), tr("Add"), ui->toolBarAction), &MainWindow::addFriend, SLOT(addFriend()));
//addAction(new QAction(QIcon(IMAGE_NEWRSCOLLECTION), tr("New"), ui->toolBarAction), &MainWindow::newRsCollection, SLOT(newRsCollection()));
- addAction(new QAction(QIcon(IMAGE_PREFERENCES), tr("Options"), ui->toolBarAction), &MainWindow::showSettings, SLOT(showSettings()));
+ //addAction(new QAction(QIcon(IMAGE_PREFERENCES), tr("Options"), ui->toolBarAction), &MainWindow::showSettings, SLOT(showSettings()));
// Removed About because it's now in options.
//addAction(new QAction(QIcon(IMAGE_ABOUT), tr("About"), ui->toolBarAction), &MainWindow::showabout, SLOT(showabout()));
- addAction(new QAction(QIcon(IMAGE_QUIT), tr("Quit"), ui->toolBarAction), &MainWindow::doQuit, SLOT(doQuit()));
+ //addAction(new QAction(QIcon(IMAGE_QUIT), tr("Quit"), ui->toolBarAction), &MainWindow::doQuit, SLOT(doQuit()));
QList > >::iterator notifyIt;
for (notifyIt = notify.begin(); notifyIt != notify.end(); ++notifyIt) {
@@ -768,11 +769,7 @@ void MainWindow::updateFriends()
void MainWindow::postModDirectories(bool update_local)
{
- RSettingsWin::postModDirectories(update_local);
-
- // Why would we need that?? The effect is to reset the flags while we're changing them, so it's really not
- // a good idea.
- //ShareManager::postModDirectories(update_local);
+ //RSettingsPage::postModDirectories(update_local);
QCoreApplication::flush();
}
@@ -901,6 +898,9 @@ void SetForegroundWindowInternal(HWND hWnd)
_instance->ui->stackPages->setCurrentPage( _instance->transfersDialog );
_instance->transfersDialog->activatePage(TransfersDialog::LocalSharedFilesTab) ;
break;
+ case Options:
+ _instance->ui->stackPages->setCurrentPage( _instance->settingsDialog );
+ break;
case Messages:
_instance->ui->stackPages->setCurrentPage( _instance->messagesDialog );
break;
@@ -940,6 +940,9 @@ void SetForegroundWindowInternal(HWND hWnd)
if (page == _instance->friendsDialog) {
return Friends;
}
+ if (page == _instance->settingsDialog) {
+ return Options;
+ }
if (page == _instance->chatLobbyDialog) {
return ChatLobby;
}
@@ -991,6 +994,8 @@ void SetForegroundWindowInternal(HWND hWnd)
return _instance->idDialog;
case ChatLobby:
return _instance->chatLobbyDialog;
+ case Options:
+ return _instance->settingsDialog;
case Transfers:
return _instance->transfersDialog;
case SharedDirectories:
@@ -1054,7 +1059,7 @@ MainWindow::showMess()
/** Shows Options */
void MainWindow::showSettings()
{
- RSettingsWin::showYourself(this);
+ showWindow(MainWindow::Options);
}
/** Shows Messenger window */
@@ -1484,6 +1489,29 @@ void MainWindow::processLastArgs()
}
}
+void MainWindow::switchVisibilityStatus(StatusElement e,bool b)
+{
+ switch(e)
+ {
+ case StatusGrpStatus : getInstance()->statusBar() ->setVisible(b); break ;
+ case StatusCompactMode : getInstance()->setCompactStatusMode(b) ; break ;
+ case StatusShowToolTip : getInstance()->toggleStatusToolTip(b) ; break ;
+ case StatusShowStatus : getInstance()->peerstatusInstance() ->setVisible(b); break ;
+ case StatusShowPeer : getInstance()->natstatusInstance() ->setVisible(b); break ;
+ case StatusShowDHT : getInstance()->dhtstatusInstance() ->setVisible(b); break ;
+ case StatusShowHashing : getInstance()->hashingstatusInstance() ->setVisible(b); break ;
+ case StatusShowDisc : getInstance()->discstatusInstance() ->setVisible(b); break ;
+ case StatusShowRate : getInstance()->ratesstatusInstance() ->setVisible(b); break ;
+ case StatusShowOpMode : getInstance()->opModeStatusInstance() ->setVisible(b); break ;
+ case StatusShowSound : getInstance()->soundStatusInstance() ->setVisible(b); break ;
+ case StatusShowToaster : getInstance()->toasterDisableInstance() ->setVisible(b); break ;
+ case StatusShowSystray : getInstance()->sysTrayStatusInstance() ->setVisible(b); break ;
+
+ default:
+ std::cerr << "(EE) Unknown object to change visibility of: " << (int)e << std::endl;
+ }
+}
+
//void MainWindow::servicePermission()
//{
// ServicePermissionDialog::showYourself();
diff --git a/retroshare-gui/src/gui/MainWindow.h b/retroshare-gui/src/gui/MainWindow.h
index ef65c65ce..366c42173 100644
--- a/retroshare-gui/src/gui/MainWindow.h
+++ b/retroshare-gui/src/gui/MainWindow.h
@@ -53,6 +53,7 @@ class PostedDialog;
class FriendsDialog;
class IdDialog;
class ChatLobbyWidget;
+class SettingsPage ;
class ChatDialog;
class NetworkDialog;
class SearchDialog;
@@ -104,7 +105,25 @@ public:
Links = 10, /** Links page. */
#endif
Posted = 11, /** Posted links */
- People = 12 /** People page. */
+ People = 12, /** People page. */
+ Options = 13 /** People page. */
+ };
+
+
+ enum StatusElement {
+ StatusGrpStatus = 0x01,
+ StatusCompactMode = 0x02,
+ StatusShowToolTip = 0x03,
+ StatusShowStatus = 0x04,
+ StatusShowPeer = 0x05,
+ StatusShowDHT = 0x06,
+ StatusShowHashing = 0x07,
+ StatusShowDisc = 0x08,
+ StatusShowRate = 0x09,
+ StatusShowOpMode = 0x0a,
+ StatusShowSound = 0x0b,
+ StatusShowToaster = 0x0c,
+ StatusShowSystray = 0x0d
};
/** Create main window */
@@ -142,6 +161,7 @@ public:
IdDialog *idDialog ;
ChatLobbyWidget *chatLobbyDialog;
MessagesDialog *messagesDialog;
+ SettingsPage *settingsDialog;
SharedFilesDialog *sharedfilesDialog;
GxsChannelDialog *gxschannelDialog ;
GxsForumsDialog *gxsforumDialog ;
@@ -168,6 +188,8 @@ public:
static void installNotifyIcons();
static void displayLobbySystrayMsg(const QString&,const QString&);
+ static void switchVisibilityStatus(MainWindow::StatusElement e,bool b);
+
/* initialize widget with status informations, status constant stored in data or in Qt::UserRole */
void initializeStatusObject(QObject *pObject, bool bConnect);
void removeStatusObject(QObject *pObject);
diff --git a/retroshare-gui/src/gui/NewsFeed.cpp b/retroshare-gui/src/gui/NewsFeed.cpp
index 76756d061..9003c9bca 100644
--- a/retroshare-gui/src/gui/NewsFeed.cpp
+++ b/retroshare-gui/src/gui/NewsFeed.cpp
@@ -1396,5 +1396,5 @@ void NewsFeed::sendNewsFeedChanged()
void NewsFeed::feedoptions()
{
- RSettingsWin::showYourself(this, RSettingsWin::Notify);
+ SettingsPage::showYourself(this, SettingsPage::Notify);
}
diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp
index 15736c786..242e2dc43 100644
--- a/retroshare-gui/src/gui/chat/ChatWidget.cpp
+++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp
@@ -1006,10 +1006,10 @@ void ChatWidget::pasteText(const QString& S)
setColorAndFont(false);
}
-void ChatWidget::pasteCreateMsgLink()
-{
- RSettingsWin::showYourself(this, RSettingsWin::Chat);
-}
+//void ChatWidget::pasteCreateMsgLink()
+//{
+// RSettingsWin::showYourself(this, RSettingsWin::Chat);
+//}
void ChatWidget::contextMenuTextBrowser(QPoint point)
{
diff --git a/retroshare-gui/src/gui/chat/ChatWidget.h b/retroshare-gui/src/gui/chat/ChatWidget.h
index af4dab505..174b4d777 100644
--- a/retroshare-gui/src/gui/chat/ChatWidget.h
+++ b/retroshare-gui/src/gui/chat/ChatWidget.h
@@ -127,7 +127,7 @@ public slots:
void updateStatus(const QString &peer_id, int status);
private slots:
- void pasteCreateMsgLink() ;
+ //void pasteCreateMsgLink() ;
void clearChatHistory();
void deleteChatHistory();
void messageHistory();
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.cpp b/retroshare-gui/src/gui/settings/AppearancePage.cpp
index b860ca2aa..7bc85a103 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.cpp
+++ b/retroshare-gui/src/gui/settings/AppearancePage.cpp
@@ -49,23 +49,22 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
- MainWindow *pMainWindow = MainWindow::getInstance();
connect(ui.cmboStyleSheet, SIGNAL(activated(int)), this, SLOT(loadStyleSheet(int)));
- connect(ui.grpStatus, SIGNAL(toggled(bool)), pMainWindow->statusBar(), SLOT(setVisible(bool)));
- connect(ui.checkBoxStatusCompactMode, SIGNAL(toggled(bool)), pMainWindow, SLOT(setCompactStatusMode(bool)));
- connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), pMainWindow, SLOT(toggleStatusToolTip(bool)));
- connect(ui.checkBoxShowStatusStatus, SIGNAL(toggled(bool)), pMainWindow->statusComboBoxInstance(), SLOT(setVisible(bool)));
- connect(ui.checkBoxShowPeerStatus, SIGNAL(toggled(bool)), pMainWindow->peerstatusInstance(), SLOT(setVisible(bool)));
- connect(ui.checkBoxShowNATStatus, SIGNAL(toggled(bool)), pMainWindow->natstatusInstance(), SLOT(setVisible(bool)));
- connect(ui.checkBoxShowDHTStatus, SIGNAL(toggled(bool)), pMainWindow->dhtstatusInstance(), SLOT(setVisible(bool)));
- connect(ui.checkBoxShowHashingStatus, SIGNAL(toggled(bool)), pMainWindow->hashingstatusInstance(), SLOT(setVisible(bool)));
- connect(ui.checkBoxShowDiscStatus, SIGNAL(toggled(bool)), pMainWindow->discstatusInstance(), SLOT(setVisible(bool)));
- connect(ui.checkBoxShowRateStatus, SIGNAL(toggled(bool)), pMainWindow->ratesstatusInstance(), SLOT(setVisible(bool)));
- connect(ui.checkBoxShowOpModeStatus, SIGNAL(toggled(bool)), pMainWindow->opModeStatusInstance(), SLOT(setVisible(bool)));
- connect(ui.checkBoxShowSoundStatus, SIGNAL(toggled(bool)), pMainWindow->soundStatusInstance(), SLOT(setVisible(bool)));
- connect(ui.checkBoxShowToasterDisable, SIGNAL(toggled(bool)), pMainWindow->toasterDisableInstance(), SLOT(setVisible(bool)));
- connect(ui.checkBoxShowSystrayOnStatus, SIGNAL(toggled(bool)), pMainWindow->sysTrayStatusInstance(), SLOT(setVisible(bool)));
+ connect(ui.grpStatus, SIGNAL(toggled(bool)), this /* pMainWindow->statusBar(), */, SLOT(switch_status_grpStatus(bool)));
+ connect(ui.checkBoxStatusCompactMode, SIGNAL(toggled(bool)), this /* pMainWindow, */, SLOT(switch_status_compactMode(bool)));
+ connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), this /* pMainWindow, */, SLOT(switch_status_showToolTip(bool)));
+ connect(ui.checkBoxShowStatusStatus, SIGNAL(toggled(bool)), this /* pMainWindow->statusComboBoxInstance(), */, SLOT(switch_status_ShowStatus(bool)));
+ connect(ui.checkBoxShowPeerStatus, SIGNAL(toggled(bool)), this /* pMainWindow->peerstatusInstance(), */, SLOT(switch_status_ShowStatus(bool)));
+ connect(ui.checkBoxShowNATStatus, SIGNAL(toggled(bool)), this /* pMainWindow->natstatusInstance(), */, SLOT(switch_status_ShowPeer(bool)));
+ connect(ui.checkBoxShowDHTStatus, SIGNAL(toggled(bool)), this /* pMainWindow->dhtstatusInstance(), */, SLOT(switch_status_ShowDHT(bool)));
+ connect(ui.checkBoxShowHashingStatus, SIGNAL(toggled(bool)), this /* pMainWindow->hashingstatusInstance(), */, SLOT(switch_status_ShowHashing(bool)));
+ connect(ui.checkBoxShowDiscStatus, SIGNAL(toggled(bool)), this /* pMainWindow->discstatusInstance(), */, SLOT(switch_status_ShowDisc(bool)));
+ connect(ui.checkBoxShowRateStatus, SIGNAL(toggled(bool)), this /* pMainWindow->ratesstatusInstance(), */, SLOT(switch_status_ShowRate(bool)));
+ connect(ui.checkBoxShowOpModeStatus, SIGNAL(toggled(bool)), this /* pMainWindow->opModeStatusInstance(), */, SLOT(switch_status_ShowOpMode(bool)));
+ connect(ui.checkBoxShowSoundStatus, SIGNAL(toggled(bool)), this /* pMainWindow->soundStatusInstance(), */, SLOT(switch_status_ShowSound(bool)));
+ connect(ui.checkBoxShowToasterDisable, SIGNAL(toggled(bool)), this /* pMainWindow->toasterDisableInstance(), */, SLOT(switch_status_ShowToaster(bool)));
+ connect(ui.checkBoxShowSystrayOnStatus, SIGNAL(toggled(bool)), this /* pMainWindow->sysTrayStatusInstance(), */, SLOT(switch_status_ShowSystray(bool)));
/* Populate combo boxes */
foreach (QString code, LanguageSupport::languageCodes()) {
@@ -86,6 +85,30 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
}
}
+void AppearancePage::switch_status_grpStatus(bool b) { switch_status(MainWindow::StatusGrpStatus ,b) ; }
+void AppearancePage::switch_status_compactMode(bool b) { switch_status(MainWindow::StatusCompactMode,b) ; }
+void AppearancePage::switch_status_showToolTip(bool b) { switch_status(MainWindow::StatusShowToolTip,b) ; }
+void AppearancePage::switch_status_ShowStatus(bool b) { switch_status(MainWindow::StatusShowStatus ,b) ; }
+void AppearancePage::switch_status_ShowPeer(bool b) { switch_status(MainWindow::StatusShowPeer ,b) ; }
+void AppearancePage::switch_status_ShowDHT(bool b) { switch_status(MainWindow::StatusShowDHT ,b) ; }
+void AppearancePage::switch_status_ShowHashing(bool b) { switch_status(MainWindow::StatusShowHashing,b) ; }
+void AppearancePage::switch_status_ShowDisc(bool b) { switch_status(MainWindow::StatusShowDisc ,b) ; }
+void AppearancePage::switch_status_ShowRate(bool b) { switch_status(MainWindow::StatusShowRate ,b) ; }
+void AppearancePage::switch_status_ShowOpMode(bool b) { switch_status(MainWindow::StatusShowOpMode ,b) ; }
+void AppearancePage::switch_status_ShowSound(bool b) { switch_status(MainWindow::StatusShowSound ,b) ; }
+void AppearancePage::switch_status_ShowToaster(bool b) { switch_status(MainWindow::StatusShowToaster,b) ; }
+void AppearancePage::switch_status_ShowSystray(bool b) { switch_status(MainWindow::StatusShowSystray,b) ; }
+
+void AppearancePage::switch_status(MainWindow::StatusElement s,bool b)
+{
+ MainWindow *pMainWindow = MainWindow::getInstance();
+
+ if(!pMainWindow)
+ return ;
+
+ pMainWindow->switchVisibilityStatus(s,b) ;
+}
+
/** Saves the changes on this page */
bool AppearancePage::save(QString &errmsg)
{
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.h b/retroshare-gui/src/gui/settings/AppearancePage.h
index ae711eed0..2ae6ce212 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.h
+++ b/retroshare-gui/src/gui/settings/AppearancePage.h
@@ -23,6 +23,7 @@
#define _APPERARANCEPAGE_H
#include
+#include "gui/MainWindow.h"
#include "ui_AppearancePage.h"
class AppearancePage : public ConfigPage
@@ -45,7 +46,23 @@ public:
private slots:
void loadStyleSheet(int index);
+ void switch_status_grpStatus(bool b) ;
+ void switch_status_compactMode(bool b) ;
+ void switch_status_showToolTip(bool b) ;
+ void switch_status_ShowStatus(bool) ;
+ void switch_status_ShowPeer(bool) ;
+ void switch_status_ShowDHT(bool) ;
+ void switch_status_ShowHashing(bool) ;
+ void switch_status_ShowDisc(bool) ;
+ void switch_status_ShowRate(bool) ;
+ void switch_status_ShowOpMode(bool) ;
+ void switch_status_ShowSound(bool) ;
+ void switch_status_ShowToaster(bool) ;
+ void switch_status_ShowSystray(bool) ;
+
private:
+ void switch_status(MainWindow::StatusElement s,bool b);
+
/** Qt Designer generated object */
Ui::AppearancePage ui;
};
diff --git a/retroshare-gui/src/gui/settings/rsettingswin.cpp b/retroshare-gui/src/gui/settings/rsettingswin.cpp
index 7267299c8..50052eaa1 100644
--- a/retroshare-gui/src/gui/settings/rsettingswin.cpp
+++ b/retroshare-gui/src/gui/settings/rsettingswin.cpp
@@ -52,15 +52,15 @@
#include "rsettingswin.h"
-RSettingsWin *RSettingsWin::_instance = NULL;
-int RSettingsWin::lastPage = 0;
+//RSettingsWin *RSettingsWin::_instance = NULL;
+int SettingsPage::lastPage = 0;
-RSettingsWin::RSettingsWin(QWidget *parent)
- : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint)
+SettingsPage::SettingsPage(QWidget *parent)
+ : MainPage(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint)
{
ui.setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, true);
- setModal(false);
+// setModal(false);
/* Initialize help browser */
mHelpBrowser = new FloatingHelpBrowser(this, ui.helpButton);
@@ -74,31 +74,32 @@ RSettingsWin::RSettingsWin(QWidget *parent)
}
connect(ui.listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(setNewPage(int)));
- connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(saveChanges()));
- connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
+// connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(saveChanges()));
+// connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(close()));
connect(this, SIGNAL(finished(int)), this, SLOT(dialogFinished(int)));
}
-RSettingsWin::~RSettingsWin()
+SettingsPage::~SettingsPage()
{
/* Save window position */
Settings->setValueToGroup("SettingDialog", "Geometry", saveGeometry());
lastPage = ui.stackedWidget->currentIndex ();
- _instance = NULL;
+ //_instance = NULL;
}
-void RSettingsWin::dialogFinished(int result)
-{
- if (result == Rejected) {
- /* reaload style sheet */
- Rshare::loadStyleSheet(::Settings->getSheetName());
- }
-}
+//void RSettingsPage::dialogFinished(int result)
+//{
+// if (result == Rejected) {
+// /* reaload style sheet */
+// Rshare::loadStyleSheet(::Settings->getSheetName());
+// }
+//}
-/*static*/ void RSettingsWin::showYourself(QWidget *parent, PageType page /* = LastPage*/)
+/*static*/ void SettingsPage::showYourself(QWidget *parent, PageType page /* = LastPage*/)
{
+#ifdef TODO
if(_instance == NULL) {
- _instance = new RSettingsWin(parent);
+ _instance = new RSettingsPage(parent);
}
if (page != LastPage) {
@@ -112,17 +113,21 @@ void RSettingsWin::dialogFinished(int result)
_instance->show();
_instance->activateWindow();
+#else
+ std::cerr << "(EE) unimplemented call to RSettingsPage::showYourself" << std::endl;
+#endif
}
-/*static*/ void RSettingsWin::postModDirectories(bool update_local)
+/*static*/ void SettingsPage::postModDirectories(bool update_local)
{
- if (_instance == NULL || _instance->isHidden() || _instance->ui.stackedWidget == NULL) {
+ //if (_instance == NULL || _instance->isHidden() || _instance->ui.stackedWidget == NULL) {
+ if (ui.stackedWidget == NULL) {
return;
}
if (update_local) {
- if (_instance->ui.stackedWidget->currentIndex() == Directories) {
- ConfigPage *Page = dynamic_cast (_instance->ui.stackedWidget->currentWidget());
+ if (ui.stackedWidget->currentIndex() == Directories) {
+ ConfigPage *Page = dynamic_cast (ui.stackedWidget->currentWidget());
if (Page) {
Page->load();
}
@@ -131,7 +136,7 @@ void RSettingsWin::dialogFinished(int result)
}
void
-RSettingsWin::initStackedWidget()
+SettingsPage::initStackedWidget()
{
ui.stackedWidget->setCurrentIndex(-1);
ui.stackedWidget->removeWidget(ui.stackedWidget->widget(0));
@@ -175,7 +180,7 @@ RSettingsWin::initStackedWidget()
setNewPage(General);
}
-void RSettingsWin::addPage(ConfigPage *page)
+void SettingsPage::addPage(ConfigPage *page)
{
ui.stackedWidget->addWidget(page) ;
@@ -184,7 +189,7 @@ void RSettingsWin::addPage(ConfigPage *page)
}
void
-RSettingsWin::setNewPage(int page)
+SettingsPage::setNewPage(int page)
{
ConfigPage *pagew = dynamic_cast(ui.stackedWidget->widget(page)) ;
@@ -192,7 +197,7 @@ RSettingsWin::setNewPage(int page)
if(pagew == NULL)
{
- std::cerr << "Error in RSettingsWin::setNewPage(): widget is not a ConfigPage!" << std::endl;
+ std::cerr << "Error in RSettingsPage::setNewPage(): widget is not a ConfigPage!" << std::endl;
mHelpBrowser->clear();
return ;
}
@@ -207,7 +212,7 @@ RSettingsWin::setNewPage(int page)
/** Saves changes made to settings. */
void
-RSettingsWin::saveChanges()
+SettingsPage::saveChanges()
{
QString errmsg;
diff --git a/retroshare-gui/src/gui/settings/rsettingswin.h b/retroshare-gui/src/gui/settings/rsettingswin.h
index 98b6101f2..51371f8f7 100755
--- a/retroshare-gui/src/gui/settings/rsettingswin.h
+++ b/retroshare-gui/src/gui/settings/rsettingswin.h
@@ -24,24 +24,32 @@
#include
#include
-#include "ui_settings.h"
+#include "ui_settingsw.h"
+#include "mainpage.h"
class FloatingHelpBrowser;
-class RSettingsWin: public QDialog
+#define IMAGE_PREFERENCES ":/icons/png/options.png"
+
+class SettingsPage: public MainPage
{
Q_OBJECT
public:
+ SettingsPage(QWidget *parent = 0);
+
enum PageType { LastPage = -1, General = 0, Server, Transfer,Relay,
Directories, Plugins, Notify, Security, Message, Forum, Chat, Appearance, Sound, Fileassociations };
static void showYourself(QWidget *parent, PageType page = LastPage);
- static void postModDirectories(bool update_local);
+
+ void postModDirectories(bool update_local);
+
+ virtual QIcon iconPixmap() const { return QIcon(IMAGE_PREFERENCES) ; } //MainPage
+ virtual QString pageName() const { return tr("Preferences") ; } //MainPage
protected:
- RSettingsWin(QWidget *parent = 0);
- ~RSettingsWin();
+ ~SettingsPage();
void addPage(ConfigPage*) ;
@@ -52,14 +60,14 @@ public slots:
private slots:
/** Called when user clicks "Save Settings" */
void saveChanges();
- void dialogFinished(int result);
+ //void dialogFinished(int result);
private:
void initStackedWidget();
private:
FloatingHelpBrowser *mHelpBrowser;
- static RSettingsWin *_instance;
+ //static RSettingsWin *_instance;
static int lastPage;
/* UI - from Designer */
diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro
index 34924c60f..13a1e277e 100644
--- a/retroshare-gui/src/retroshare-gui.pro
+++ b/retroshare-gui/src/retroshare-gui.pro
@@ -624,7 +624,7 @@ FORMS += gui/StartDialog.ui \
gui/msgs/MessageComposer.ui \
gui/msgs/MessageWindow.ui\
gui/msgs/MessageWidget.ui\
- gui/settings/settings.ui \
+ gui/settings/settingsw.ui \
gui/settings/GeneralPage.ui \
gui/settings/DirectoriesPage.ui \
gui/settings/ServerPage.ui \
From 339572740ba7f6937c315151a1e8d9d51de800b0 Mon Sep 17 00:00:00 2001
From: csoler
Date: Thu, 26 Jan 2017 22:42:24 +0100
Subject: [PATCH 33/90] keep quit button into toolbar
---
retroshare-gui/src/gui/MainWindow.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp
index 58e972fb7..56da4a121 100644
--- a/retroshare-gui/src/gui/MainWindow.cpp
+++ b/retroshare-gui/src/gui/MainWindow.cpp
@@ -446,7 +446,8 @@ void MainWindow::initStackedPage()
// Removed About because it's now in options.
//addAction(new QAction(QIcon(IMAGE_ABOUT), tr("About"), ui->toolBarAction), &MainWindow::showabout, SLOT(showabout()));
- //addAction(new QAction(QIcon(IMAGE_QUIT), tr("Quit"), ui->toolBarAction), &MainWindow::doQuit, SLOT(doQuit()));
+
+ addAction(new QAction(QIcon(IMAGE_QUIT), tr("Quit"), ui->toolBarAction), &MainWindow::doQuit, SLOT(doQuit()));
QList > >::iterator notifyIt;
for (notifyIt = notify.begin(); notifyIt != notify.end(); ++notifyIt) {
From 53a19938428dc5be0fafc6bdb066cd94ae1f6d51 Mon Sep 17 00:00:00 2001
From: csoler
Date: Thu, 26 Jan 2017 22:46:58 +0100
Subject: [PATCH 34/90] added missing files
---
retroshare-gui/src/gui/settings/AboutPage.cpp | 19 ++
retroshare-gui/src/gui/settings/AboutPage.h | 52 +++++
retroshare-gui/src/gui/settings/AboutPage.ui | 29 +++
retroshare-gui/src/gui/settings/settingsw.ui | 196 ++++++++++++++++++
4 files changed, 296 insertions(+)
create mode 100644 retroshare-gui/src/gui/settings/AboutPage.cpp
create mode 100644 retroshare-gui/src/gui/settings/AboutPage.h
create mode 100644 retroshare-gui/src/gui/settings/AboutPage.ui
create mode 100644 retroshare-gui/src/gui/settings/settingsw.ui
diff --git a/retroshare-gui/src/gui/settings/AboutPage.cpp b/retroshare-gui/src/gui/settings/AboutPage.cpp
new file mode 100644
index 000000000..5b515ef32
--- /dev/null
+++ b/retroshare-gui/src/gui/settings/AboutPage.cpp
@@ -0,0 +1,19 @@
+#include
+#include "AboutPage.h"
+
+AboutPage::AboutPage(QWidget * parent , Qt::WindowFlags flags )
+ : ConfigPage(parent,flags)
+{
+ ui.setupUi(this);
+
+ ui.widget->close_button->hide();
+}
+
+AboutPage::~AboutPage()
+{
+}
+
+void AboutPage::load()
+{
+ std::cerr << "Loading AboutPage!" << std::endl;
+}
diff --git a/retroshare-gui/src/gui/settings/AboutPage.h b/retroshare-gui/src/gui/settings/AboutPage.h
new file mode 100644
index 000000000..e374a0c23
--- /dev/null
+++ b/retroshare-gui/src/gui/settings/AboutPage.h
@@ -0,0 +1,52 @@
+/****************************************************************
+ * RetroShare is distributed under the following license:
+ *
+ * Copyright (C) 2006 - 2009 RetroShare Team
+ *
+ * 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.
+ ****************************************************************/
+
+#pragma once
+
+#include
+
+#include
+#include "ui_AboutPage.h"
+
+class AboutPage : public ConfigPage
+{
+ Q_OBJECT
+
+public:
+ /** Default Constructor */
+ AboutPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
+ /** Default Destructor */
+ ~AboutPage();
+
+ /** Saves the changes on this page */
+ virtual bool save(QString &errmsg) { return true;}
+ /** Loads the settings for this page */
+ virtual void load();
+
+ virtual QPixmap iconPixmap() const { return QPixmap(":/icons/settings/sound.svg") ; }
+ virtual QString pageName() const { return tr("About") ; }
+ virtual QString helpText() const { return ""; }
+
+private:
+
+ /** Qt Designer generated object */
+ Ui::AboutPage ui;
+};
diff --git a/retroshare-gui/src/gui/settings/AboutPage.ui b/retroshare-gui/src/gui/settings/AboutPage.ui
new file mode 100644
index 000000000..07bea0e6e
--- /dev/null
+++ b/retroshare-gui/src/gui/settings/AboutPage.ui
@@ -0,0 +1,29 @@
+
+
+ AboutPage
+
+
+
+ 0
+ 0
+ 507
+ 346
+
+
+
+ -
+
+
+
+
+
+
+ AboutWidget
+ QWidget
+
+ 1
+
+
+
+
+
diff --git a/retroshare-gui/src/gui/settings/settingsw.ui b/retroshare-gui/src/gui/settings/settingsw.ui
new file mode 100644
index 000000000..b40ceda91
--- /dev/null
+++ b/retroshare-gui/src/gui/settings/settingsw.ui
@@ -0,0 +1,196 @@
+
+
+ Settings
+
+
+
+ 0
+ 0
+ 1619
+ 944
+
+
+
+ Form
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 11
+
+
+
+ Qt::IgnoreAction
+
+
+
+ 24
+ 24
+
+
+
+ Qt::ElideRight
+
+
+ QListView::Static
+
+
+ QListView::TopToBottom
+
+
+ false
+
+
+ QListView::Fixed
+
+
+ QListView::SinglePass
+
+
+ 0
+
+
+ QListView::ListMode
+
+
+ 0
+
+
+ true
+
+
+ -1
+
+
+
+ -
+
+
-
+
+
-
+
+
+ Qt::NoFocus
+
+
+
+ :/icons/help_64.png:/icons/help_64.png
+
+
+ true
+
+
+ true
+
+
+
+ -
+
+
+
+ 24
+ 24
+
+
+
+ true
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 75
+ true
+
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+
+
+ -
+
+
+ QFrame::NoFrame
+
+
+ QFrame::Plain
+
+
+ true
+
+
+
+
+ 0
+ 0
+ 1313
+ 849
+
+
+
+
+ 3
+
+
+ 3
+
+
+ 3
+
+
+ 3
+
+
-
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ StyledLabel
+ QLabel
+
+
+
+
+
+
+
+
From bd379e6b8963332725919d5fb624445a33b5c744 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sat, 28 Jan 2017 18:13:38 +0100
Subject: [PATCH 35/90] changed a few pages to not requiring to call save()
---
.../src/gui/settings/ChannelPage.cpp | 15 ++--
retroshare-gui/src/gui/settings/ChannelPage.h | 5 +-
.../src/gui/settings/CryptoPage.cpp | 7 --
retroshare-gui/src/gui/settings/CryptoPage.h | 8 +-
.../src/gui/settings/DirectoriesPage.cpp | 39 ++++------
.../src/gui/settings/DirectoriesPage.h | 7 +-
.../src/gui/settings/FileAssociationsPage.cpp | 32 --------
.../src/gui/settings/FileAssociationsPage.h | 1 -
retroshare-gui/src/gui/settings/ForumPage.cpp | 23 +++---
retroshare-gui/src/gui/settings/ForumPage.h | 8 +-
.../src/gui/settings/GeneralPage.cpp | 76 ++++++++++---------
retroshare-gui/src/gui/settings/GeneralPage.h | 41 ++++++----
.../gui/settings/GroupFrameSettingsWidget.cpp | 21 ++++-
.../gui/settings/GroupFrameSettingsWidget.h | 6 +-
.../src/gui/settings/PluginsPage.cpp | 7 --
retroshare-gui/src/gui/settings/PluginsPage.h | 2 -
.../src/gui/settings/PostedPage.cpp | 9 +--
retroshare-gui/src/gui/settings/PostedPage.h | 2 -
retroshare-gui/src/gui/settings/RelayPage.cpp | 24 ++++--
retroshare-gui/src/gui/settings/RelayPage.h | 4 +-
.../src/gui/settings/rsettingswin.cpp | 34 +--------
.../src/gui/settings/rsettingswin.h | 7 +-
.../src/retroshare-gui/configpage.h | 5 +-
23 files changed, 166 insertions(+), 217 deletions(-)
diff --git a/retroshare-gui/src/gui/settings/ChannelPage.cpp b/retroshare-gui/src/gui/settings/ChannelPage.cpp
index ca6c55031..c0de1ac60 100644
--- a/retroshare-gui/src/gui/settings/ChannelPage.cpp
+++ b/retroshare-gui/src/gui/settings/ChannelPage.cpp
@@ -30,21 +30,18 @@ ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags)
/* Initialize GroupFrameSettingsWidget */
ui.groupFrameSettingsWidget->setOpenAllInNewTabText(tr("Open each channel in a new tab"));
+
+ connect(ui.loadThreadCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateLoadThread)) ;
+
+ ui.groupFrameSettingsWidget->setType(GroupFrameSettings::Channel) ;
}
+void ChannelPage::updateLoadThread() { Settings->setChannelLoadThread(ui.loadThreadCheckBox->isChecked()); }
+
ChannelPage::~ChannelPage()
{
}
-/** Saves the changes on this page */
-bool ChannelPage::save(QString &/*errmsg*/)
-{
- Settings->setChannelLoadThread(ui.loadThreadCheckBox->isChecked());
- ui.groupFrameSettingsWidget->saveSettings(GroupFrameSettings::Channel);
-
- return true;
-}
-
/** Loads the settings for this page */
void ChannelPage::load()
{
diff --git a/retroshare-gui/src/gui/settings/ChannelPage.h b/retroshare-gui/src/gui/settings/ChannelPage.h
index 40e343fc0..69e28455b 100644
--- a/retroshare-gui/src/gui/settings/ChannelPage.h
+++ b/retroshare-gui/src/gui/settings/ChannelPage.h
@@ -33,8 +33,6 @@ public:
ChannelPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
~ChannelPage();
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
/** Loads the settings for this page */
virtual void load();
@@ -42,6 +40,9 @@ public:
virtual QString pageName() const { return tr("Channels") ; }
virtual QString helpText() const { return ""; }
+protected slots:
+ void updateLoadThread() ;
+
private:
Ui::ChannelPage ui;
};
diff --git a/retroshare-gui/src/gui/settings/CryptoPage.cpp b/retroshare-gui/src/gui/settings/CryptoPage.cpp
index 8cca2756c..1aa30b520 100755
--- a/retroshare-gui/src/gui/settings/CryptoPage.cpp
+++ b/retroshare-gui/src/gui/settings/CryptoPage.cpp
@@ -92,13 +92,6 @@ CryptoPage::~CryptoPage()
{
}
-/** Saves the changes on this page */
-bool
-CryptoPage::save(QString &/*errmsg*/)
-{
- return true;
-}
-
/** Loads the settings for this page */
void
CryptoPage::load()
diff --git a/retroshare-gui/src/gui/settings/CryptoPage.h b/retroshare-gui/src/gui/settings/CryptoPage.h
index a1bcb42f0..fb07b0da7 100755
--- a/retroshare-gui/src/gui/settings/CryptoPage.h
+++ b/retroshare-gui/src/gui/settings/CryptoPage.h
@@ -35,8 +35,6 @@ class CryptoPage : public ConfigPage
/** Default Destructor */
~CryptoPage();
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
/** Loads the settings for this page */
virtual QPixmap iconPixmap() const { return QPixmap(":/icons/settings/profile.svg") ; }
@@ -46,9 +44,9 @@ class CryptoPage : public ConfigPage
private slots:
virtual void load();
void copyPublicKey();
- void copyRSLink() ;
- virtual void showEvent ( QShowEvent * event );
- void profilemanager();
+ void copyRSLink() ;
+ virtual void showEvent ( QShowEvent * event );
+ void profilemanager();
bool fileSave();
bool fileSaveAs();
void showStats();
diff --git a/retroshare-gui/src/gui/settings/DirectoriesPage.cpp b/retroshare-gui/src/gui/settings/DirectoriesPage.cpp
index c3c466980..7fdd90cbb 100755
--- a/retroshare-gui/src/gui/settings/DirectoriesPage.cpp
+++ b/retroshare-gui/src/gui/settings/DirectoriesPage.cpp
@@ -37,6 +37,11 @@ DirectoriesPage::DirectoriesPage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.partialButton, SIGNAL(clicked( bool ) ), this , SLOT( setPartialsDirectory() ) );
connect(ui.editShareButton, SIGNAL(clicked()), this, SLOT(editDirectories()));
connect(ui.autoCheckDirectories_CB, SIGNAL(clicked(bool)), this, SLOT(toggleAutoCheckDirectories(bool)));
+
+ connect(ui.autoCheckDirectories_CB, SIGNAL(toggled(bool)), this,SLOT(updateAutoCheckDirectories())) ;
+ connect(ui.autoCheckDirectoriesDelay_SB,SIGNAL(valueChanged(int)),this,SLOT(updateAutoScanDirectoriesPeriod())) ;
+ connect(ui.shareDownloadDirectoryCB, SIGNAL(toggled(bool)), this,SLOT(updateShareDownloadDirectory())) ;
+ connect(ui.followSymLinks_CB, SIGNAL(toggled(bool)), this,SLOT(updateFollowSymLinks())) ;
}
void DirectoriesPage::toggleAutoCheckDirectories(bool b)
@@ -49,29 +54,10 @@ void DirectoriesPage::editDirectories()
ShareManager::showYourself() ;
}
-/** Saves the changes on this page */
-bool DirectoriesPage::save(QString &/*errmsg*/)
-{
- std::string dir = ui.incomingDir->text().toUtf8().constData();
- if (!dir.empty())
- {
- rsFiles->setDownloadDirectory(dir);
- }
-
- dir = ui.partialsDir->text().toUtf8().constData();
- if (!dir.empty())
- {
- rsFiles->setPartialsDirectory(dir);
- }
-
- rsFiles->setWatchEnabled(ui.autoCheckDirectories_CB->isChecked()) ;
- rsFiles->setWatchPeriod(ui.autoCheckDirectoriesDelay_SB->value());
-
- rsFiles->shareDownloadDirectory(ui.shareDownloadDirectoryCB->isChecked());
- rsFiles->setFollowSymLinks(ui.followSymLinks_CB->isChecked());
-
- return true;
-}
+void DirectoriesPage::updateAutoCheckDirectories() { rsFiles->setWatchEnabled(ui.autoCheckDirectories_CB->isChecked()) ; }
+void DirectoriesPage::updateAutoScanDirectoriesPeriod() { rsFiles->setWatchPeriod(ui.autoCheckDirectoriesDelay_SB->value()); }
+void DirectoriesPage::updateShareDownloadDirectory() { rsFiles->shareDownloadDirectory(ui.shareDownloadDirectoryCB->isChecked());}
+void DirectoriesPage::updateFollowSymLinks() { rsFiles->setFollowSymLinks(ui.followSymLinks_CB->isChecked()); }
/** Loads the settings for this page */
void DirectoriesPage::load()
@@ -95,6 +81,10 @@ void DirectoriesPage::setIncomingDirectory()
}
ui.incomingDir->setText(qdir);
+ std::string dir = ui.incomingDir->text().toUtf8().constData();
+
+ if(!dir.empty())
+ rsFiles->setDownloadDirectory(dir);
}
void DirectoriesPage::setPartialsDirectory()
@@ -105,4 +95,7 @@ void DirectoriesPage::setPartialsDirectory()
}
ui.partialsDir->setText(qdir);
+ std::string dir = ui.partialsDir->text().toUtf8().constData();
+ if (!dir.empty())
+ rsFiles->setPartialsDirectory(dir);
}
diff --git a/retroshare-gui/src/gui/settings/DirectoriesPage.h b/retroshare-gui/src/gui/settings/DirectoriesPage.h
index ffeb1bf34..dfb0f15cd 100755
--- a/retroshare-gui/src/gui/settings/DirectoriesPage.h
+++ b/retroshare-gui/src/gui/settings/DirectoriesPage.h
@@ -32,8 +32,6 @@ class DirectoriesPage: public ConfigPage
public:
DirectoriesPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
/** Loads the settings for this page */
virtual void load();
@@ -47,6 +45,11 @@ private slots:
void setPartialsDirectory();
void toggleAutoCheckDirectories(bool);
+ void updateAutoCheckDirectories() ;
+ void updateAutoScanDirectoriesPeriod() ;
+ void updateShareDownloadDirectory() ;
+ void updateFollowSymLinks() ;
+
private:
Ui::DirectoriesPage ui;
};
diff --git a/retroshare-gui/src/gui/settings/FileAssociationsPage.cpp b/retroshare-gui/src/gui/settings/FileAssociationsPage.cpp
index 95bd33cf1..d8f5f003c 100755
--- a/retroshare-gui/src/gui/settings/FileAssociationsPage.cpp
+++ b/retroshare-gui/src/gui/settings/FileAssociationsPage.cpp
@@ -131,38 +131,6 @@ FileAssociationsPage::~FileAssociationsPage()
{
}
-//============================================================================
-
-bool
-FileAssociationsPage::save (QString &/*errmsg*/)
-{
-// RshareSettings settings;
-
-
-// settings.beginGroup("FileAssotiations");
-// settings.setValue(".s01", "s01 test");
-// settings.setValue(".s02", "s02 test");
-// settings.setValue(".s03", "s03 test");
-// settings.setValue(".s04", "s04 test");
-// QMap::const_iterator ati = ations.constBegin();
-// while (ati != ations.constEnd())
-// {
-// settings.setValue( ati.key(), ati.value() );
-// qDebug() << " - " << ati.key() << ati.value() << "\n" ;
-// ++ati;
-// }
-//
-// settings.endGroup();
-
-// settings.sync();
-
-// delete settings;
-/* */
- return true;
-}
-
-//============================================================================
-
void
FileAssociationsPage::load()
{
diff --git a/retroshare-gui/src/gui/settings/FileAssociationsPage.h b/retroshare-gui/src/gui/settings/FileAssociationsPage.h
index 769dbabb0..078a437e0 100755
--- a/retroshare-gui/src/gui/settings/FileAssociationsPage.h
+++ b/retroshare-gui/src/gui/settings/FileAssociationsPage.h
@@ -52,7 +52,6 @@ public:
virtual ~FileAssociationsPage();
virtual void load();
- virtual bool save (QString &errmsg);
virtual QPixmap iconPixmap() const { return QPixmap(":/images/filetype-association.png") ; }
virtual QString pageName() const { return tr("Associations") ; }
diff --git a/retroshare-gui/src/gui/settings/ForumPage.cpp b/retroshare-gui/src/gui/settings/ForumPage.cpp
index 90ff1f176..d7681762e 100644
--- a/retroshare-gui/src/gui/settings/ForumPage.cpp
+++ b/retroshare-gui/src/gui/settings/ForumPage.cpp
@@ -30,24 +30,23 @@ ForumPage::ForumPage(QWidget * parent, Qt::WindowFlags flags)
/* Initialize GroupFrameSettingsWidget */
ui.groupFrameSettingsWidget->setOpenAllInNewTabText(tr("Open each forum in a new tab"));
+
+ connect(ui.setMsgToReadOnActivate,SIGNAL(toggled(bool)),this,SLOT(updateMsgReadOnActivate())) ;
+ connect(ui.expandNewMessages , SIGNAL(toggled(bool)), this, SLOT( updateExpandNewMessages()));
+ connect(ui.loadEmbeddedImages , SIGNAL(toggled(bool)), this, SLOT(updateLoadEmbeddedImage() ));
+ connect(ui.loadEmoticons , SIGNAL(toggled(bool)), this, SLOT( updateLoadEmoticons() ));
+
+ ui.groupFrameSettingsWidget->setType(GroupFrameSettings::Forum) ;
}
ForumPage::~ForumPage()
{
}
-/** Saves the changes on this page */
-bool ForumPage::save(QString &/*errmsg*/)
-{
- Settings->setForumMsgSetToReadOnActivate(ui.setMsgToReadOnActivate->isChecked());
- Settings->setForumExpandNewMessages(ui.expandNewMessages->isChecked());
- Settings->setForumLoadEmbeddedImages(ui.loadEmbeddedImages->isChecked());
- Settings->setForumLoadEmoticons(ui.loadEmoticons->isChecked());
-
- ui.groupFrameSettingsWidget->saveSettings(GroupFrameSettings::Forum);
-
- return true;
-}
+void ForumPage::updateMsgReadOnActivate() { Settings->setForumMsgSetToReadOnActivate(ui.setMsgToReadOnActivate->isChecked()); }
+void ForumPage::updateExpandNewMessages() { Settings->setForumExpandNewMessages( ui.expandNewMessages ->isChecked());}
+void ForumPage::updateLoadEmbeddedImages() { Settings->setForumLoadEmbeddedImages( ui.loadEmbeddedImages ->isChecked());}
+void ForumPage::updateLoadEmoticons() { Settings->setForumLoadEmoticons( ui.loadEmoticons ->isChecked()); }
/** Loads the settings for this page */
void ForumPage::load()
diff --git a/retroshare-gui/src/gui/settings/ForumPage.h b/retroshare-gui/src/gui/settings/ForumPage.h
index 6e1082a19..d4ca206e1 100644
--- a/retroshare-gui/src/gui/settings/ForumPage.h
+++ b/retroshare-gui/src/gui/settings/ForumPage.h
@@ -33,8 +33,6 @@ public:
ForumPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
~ForumPage();
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
/** Loads the settings for this page */
virtual void load();
@@ -42,6 +40,12 @@ public:
virtual QString pageName() const { return tr("Forum") ; }
virtual QString helpText() const { return ""; }
+protected slots:
+ void updateMsgReadOnActivate();
+ void updateExpandNewMessages();
+ void updateLoadEmbeddedImages();
+ void updateLoadEmoticons();
+
private:
Ui::ForumPage ui;
};
diff --git a/retroshare-gui/src/gui/settings/GeneralPage.cpp b/retroshare-gui/src/gui/settings/GeneralPage.cpp
index 7aa5f016f..a4a8b461d 100755
--- a/retroshare-gui/src/gui/settings/GeneralPage.cpp
+++ b/retroshare-gui/src/gui/settings/GeneralPage.cpp
@@ -38,8 +38,6 @@ GeneralPage::GeneralPage(QWidget * parent, Qt::WindowFlags flags) :
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
- /* Connect signals */
- connect(ui.runStartWizard_PB,SIGNAL(clicked()), this,SLOT(runStartWizard())) ;
/* Hide platform specific features */
#ifdef Q_OS_WIN
@@ -82,6 +80,10 @@ GeneralPage::GeneralPage(QWidget * parent, Qt::WindowFlags flags) :
ui.autoLogin->setEnabled(false);
ui.autoLogin->setToolTip(tr("Your RetroShare build has auto-login disabled."));
#endif // RS_AUTOLOGIN
+
+ /* Connect signals */
+ connect(ui.runStartWizard_PB,SIGNAL(clicked()), this,SLOT(runStartWizard())) ;
+ connect(ui.checkAdvanced,SIGNAL(toggled(bool)), this,SLOT(updateAdvancedMode())) ;
}
/** Destructor */
@@ -93,48 +95,48 @@ void GeneralPage::runStartWizard()
QuickStartWizard(this).exec();
}
-/** Saves the changes on this page */
-bool GeneralPage::save(QString &/*errmsg*/)
+void GeneralPage::updateAdvancedMode()
+{
+ if (ui.checkAdvanced->isChecked())
+ {
+ std::string opt("YES");
+ rsConfig->setConfigurationOption(RS_CONFIG_ADVANCED, opt);
+ }
+ else
+ {
+ std::string opt("NO");
+ rsConfig->setConfigurationOption(RS_CONFIG_ADVANCED, opt);
+ }
+}
+
+void GeneralPage::updateUseLocalServer() { Settings->setUseLocalServer(ui.useLocalServer->isChecked()); }
+void GeneralPage::updateMaxTimeBeforeIdle(){ Settings->setMaxTimeBeforeIdle(ui.idleSpinBox->value()); }
+void GeneralPage::updateStartMinimized() { Settings->setStartMinimized(ui.checkStartMinimized->isChecked()); }
+void GeneralPage::updateDoQuit() { Settings->setValue("doQuit", ui.checkQuit->isChecked()); }
+void GeneralPage::updateCloseToTray() { Settings->setCloseToTray(ui.checkCloseToTray->isChecked()); }
+void GeneralPage::updateAutoLogin() { RsInit::setAutoLogin(ui.autoLogin->isChecked());}
+void GeneralPage::updateRunRSOnBoot()
{
#ifdef Q_OS_WIN
#ifndef QT_DEBUG
Settings->setRunRetroshareOnBoot(ui.chkRunRetroshareAtSystemStartup->isChecked(), ui.chkRunRetroshareAtSystemStartupMinimized->isChecked());
#endif
#endif
+}
- Settings->setStartMinimized(ui.checkStartMinimized->isChecked());
-
- if (ui.checkAdvanced->isChecked())
- {
- std::string opt("YES");
- rsConfig->setConfigurationOption(RS_CONFIG_ADVANCED, opt);
- }
- else
- {
- std::string opt("NO");
- rsConfig->setConfigurationOption(RS_CONFIG_ADVANCED, opt);
- }
-
- Settings->setValue("doQuit", ui.checkQuit->isChecked());
- Settings->setCloseToTray(ui.checkCloseToTray->isChecked());
- RsInit::setAutoLogin(ui.autoLogin->isChecked());
-
- if (ui.registerRetroShareProtocol->isChecked() != Settings->getRetroShareProtocol()) {
- QString error ="";
- if (Settings->setRetroShareProtocol(ui.registerRetroShareProtocol->isChecked(), error) == false) {
- if (ui.registerRetroShareProtocol->isChecked()) {
- QMessageBox::critical(this, tr("Error"), tr("Could not add retroshare:// as protocol.").append("\n").append(error));
- } else {
- QMessageBox::critical(this, tr("Error"), tr("Could not remove retroshare:// protocol.").append("\n").append(error));
- }
- }
- }
-
- Settings->setUseLocalServer(ui.useLocalServer->isChecked());
-
- Settings->setMaxTimeBeforeIdle(ui.idleSpinBox->value());
-
- return true;
+void GeneralPage::updateRegisterRSProtocol()
+{
+ if (ui.registerRetroShareProtocol->isChecked() != Settings->getRetroShareProtocol())
+ {
+ QString error ="";
+ if (Settings->setRetroShareProtocol(ui.registerRetroShareProtocol->isChecked(), error) == false) {
+ if (ui.registerRetroShareProtocol->isChecked()) {
+ QMessageBox::critical(this, tr("Error"), tr("Could not add retroshare:// as protocol.").append("\n").append(error));
+ } else {
+ QMessageBox::critical(this, tr("Error"), tr("Could not remove retroshare:// protocol.").append("\n").append(error));
+ }
+ }
+ }
}
/** Loads the settings for this page */
diff --git a/retroshare-gui/src/gui/settings/GeneralPage.h b/retroshare-gui/src/gui/settings/GeneralPage.h
index fd7b90a33..d28146915 100755
--- a/retroshare-gui/src/gui/settings/GeneralPage.h
+++ b/retroshare-gui/src/gui/settings/GeneralPage.h
@@ -28,28 +28,37 @@
class GeneralPage : public ConfigPage
{
- Q_OBJECT
+ Q_OBJECT
public:
- /** Default Constructor */
- GeneralPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
- /** Default Destructor */
- ~GeneralPage();
+ /** Default Constructor */
+ GeneralPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
+ /** Default Destructor */
+ ~GeneralPage();
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
- /** Loads the settings for this page */
- virtual void load();
+ /** Saves the changes on this page */
+ /** Loads the settings for this page */
+ virtual void load();
- virtual QPixmap iconPixmap() const { return QPixmap(":/icons/settings/general.svg") ; }
- virtual QString pageName() const { return tr("General") ; }
- virtual QString helpText() const { return ""; }
+ virtual QPixmap iconPixmap() const { return QPixmap(":/icons/settings/general.svg") ; }
+ virtual QString pageName() const { return tr("General") ; }
+ virtual QString helpText() const { return ""; }
+
+public slots:
+ void runStartWizard() ;
+ void updateAdvancedMode();
+ void updateUseLocalServer() ;
+ void updateMaxTimeBeforeIdle();
+ void updateStartMinimized() ;
+ void updateDoQuit() ;
+ void updateCloseToTray() ;
+ void updateAutoLogin() ;
+ void updateRunRSOnBoot() ;
+ void updateRegisterRSProtocol();
- public slots:
- void runStartWizard() ;
private:
- /** Qt Designer generated object */
- Ui::GeneralPage ui;
+ /** Qt Designer generated object */
+ Ui::GeneralPage ui;
};
#endif
diff --git a/retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.cpp b/retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.cpp
index 5b55ff689..ad5e06c5c 100644
--- a/retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.cpp
+++ b/retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.cpp
@@ -1,3 +1,5 @@
+#include
+
#include "GroupFrameSettingsWidget.h"
#include "ui_GroupFrameSettingsWidget.h"
@@ -7,7 +9,11 @@ GroupFrameSettingsWidget::GroupFrameSettingsWidget(QWidget *parent) :
{
ui->setupUi(this);
+ mType = GroupFrameSettings::Nothing ;
mEnable = true;
+
+ connect(ui->openAllInNewTabCheckBox, SIGNAL(toggled(bool)),this,SLOT(saveSettings())) ;
+ connect(ui->hideTabBarWithOneTabCheckBox,SIGNAL(toggled(bool)),this,SLOT(saveSettings())) ;
}
GroupFrameSettingsWidget::~GroupFrameSettingsWidget()
@@ -22,6 +28,8 @@ void GroupFrameSettingsWidget::setOpenAllInNewTabText(const QString &text)
void GroupFrameSettingsWidget::loadSettings(GroupFrameSettings::Type type)
{
+ mType = type ;
+
GroupFrameSettings groupFrameSettings;
if (Settings->getGroupFrameSettings(type, groupFrameSettings)) {
ui->openAllInNewTabCheckBox->setChecked(groupFrameSettings.mOpenAllInNewTab);
@@ -32,13 +40,20 @@ void GroupFrameSettingsWidget::loadSettings(GroupFrameSettings::Type type)
}
}
-void GroupFrameSettingsWidget::saveSettings(GroupFrameSettings::Type type)
+void GroupFrameSettingsWidget::saveSettings()
{
- if (mEnable) {
+ if(mType == GroupFrameSettings::Nothing)
+ {
+ std::cerr << "(EE) No type initialized for groupFrameSettings. This is a bug." << std::endl;
+ return;
+ }
+
+ if (mEnable)
+ {
GroupFrameSettings groupFrameSettings;
groupFrameSettings.mOpenAllInNewTab = ui->openAllInNewTabCheckBox->isChecked();
groupFrameSettings.mHideTabBarWithOneTab = ui->hideTabBarWithOneTabCheckBox->isChecked();
- Settings->setGroupFrameSettings(type, groupFrameSettings);
+ Settings->setGroupFrameSettings(mType, groupFrameSettings);
}
}
diff --git a/retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.h b/retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.h
index 418a9f9e6..aa7eb1b82 100644
--- a/retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.h
+++ b/retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.h
@@ -20,11 +20,15 @@ public:
void setOpenAllInNewTabText(const QString &text);
void loadSettings(GroupFrameSettings::Type type);
- void saveSettings(GroupFrameSettings::Type type);
+
+ void setType(GroupFrameSettings::Type type) { mType = type ; }
+protected slots:
+ void saveSettings();
private:
bool mEnable;
Ui::GroupFrameSettingsWidget *ui;
+ GroupFrameSettings::Type mType ;
};
#endif // GROUPFRAMESETTINGSWIDGET_H
diff --git a/retroshare-gui/src/gui/settings/PluginsPage.cpp b/retroshare-gui/src/gui/settings/PluginsPage.cpp
index 39bd39a4a..cdc326ec0 100644
--- a/retroshare-gui/src/gui/settings/PluginsPage.cpp
+++ b/retroshare-gui/src/gui/settings/PluginsPage.cpp
@@ -210,13 +210,6 @@ PluginsPage::~PluginsPage()
{
}
-/** Saves the changes on this page */
-bool PluginsPage::save(QString &/*errmsg*/)
-{
- // nothing to save for now.
- return true;
-}
-
/** Loads the settings for this page */
void PluginsPage::load()
{
diff --git a/retroshare-gui/src/gui/settings/PluginsPage.h b/retroshare-gui/src/gui/settings/PluginsPage.h
index 08354ca68..0d8f72dac 100644
--- a/retroshare-gui/src/gui/settings/PluginsPage.h
+++ b/retroshare-gui/src/gui/settings/PluginsPage.h
@@ -32,8 +32,6 @@ class PluginsPage : public ConfigPage
PluginsPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
~PluginsPage();
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
/** Loads the settings for this page */
virtual void load();
diff --git a/retroshare-gui/src/gui/settings/PostedPage.cpp b/retroshare-gui/src/gui/settings/PostedPage.cpp
index 30b18f24d..76b3411b0 100644
--- a/retroshare-gui/src/gui/settings/PostedPage.cpp
+++ b/retroshare-gui/src/gui/settings/PostedPage.cpp
@@ -32,20 +32,13 @@ PostedPage::PostedPage(QWidget * parent, Qt::WindowFlags flags)
/* Initialize GroupFrameSettingsWidget */
ui->groupFrameSettingsWidget->setOpenAllInNewTabText(tr("Open each topic in a new tab"));
+ ui->groupFrameSettingsWidget->setType(GroupFrameSettings::Posted);
}
PostedPage::~PostedPage()
{
}
-/** Saves the changes on this page */
-bool PostedPage::save(QString &/*errmsg*/)
-{
- ui->groupFrameSettingsWidget->saveSettings(GroupFrameSettings::Posted);
-
- return true;
-}
-
/** Loads the settings for this page */
void PostedPage::load()
{
diff --git a/retroshare-gui/src/gui/settings/PostedPage.h b/retroshare-gui/src/gui/settings/PostedPage.h
index 73a454c5f..bc2cb8aa0 100644
--- a/retroshare-gui/src/gui/settings/PostedPage.h
+++ b/retroshare-gui/src/gui/settings/PostedPage.h
@@ -36,8 +36,6 @@ public:
PostedPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
~PostedPage();
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
/** Loads the settings for this page */
virtual void load();
diff --git a/retroshare-gui/src/gui/settings/RelayPage.cpp b/retroshare-gui/src/gui/settings/RelayPage.cpp
index a7cc7e041..258bc05aa 100644
--- a/retroshare-gui/src/gui/settings/RelayPage.cpp
+++ b/retroshare-gui/src/gui/settings/RelayPage.cpp
@@ -51,6 +51,16 @@ RelayPage::RelayPage(QWidget * parent, Qt::WindowFlags flags)
QObject::connect(ui.enableCheckBox,SIGNAL(stateChanged(int)),this,SLOT(updateEnabled()));
QObject::connect(ui.serverCheckBox,SIGNAL(stateChanged(int)),this,SLOT(updateEnabled()));
+
+ QObject::connect(ui.noFriendSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
+ QObject::connect(ui.bandFriendSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
+ QObject::connect(ui.noFOFSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
+ QObject::connect(ui.bandFOFSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
+ QObject::connect(ui.noGeneralSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
+ QObject::connect(ui.bandGeneralSpinBox,SIGNAL(valueChanged(int)),this,SLOT(updateTotals()));
+
+ QObject::connect(ui.enableCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateRelayMode()));
+ QObject::connect(ui.serverCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateRelayMode()));
}
QString RelayPage::helpText() const
@@ -66,10 +76,8 @@ QString RelayPage::helpText() const
is encrypted and authenticated by the two relayed nodes.") ;
}
- /** Saves the changes on this page */
-bool RelayPage::save(QString &/*errmsg*/)
+void RelayPage::updateTotals()
{
-
int nFriends = ui.noFriendSpinBox->value();
int friendBandwidth = ui.bandFriendSpinBox->value();
@@ -85,7 +93,12 @@ bool RelayPage::save(QString &/*errmsg*/)
rsDht->setRelayAllowance(RSDHT_RELAY_CLASS_FRIENDS, nFriends, 1024 * friendBandwidth);
rsDht->setRelayAllowance(RSDHT_RELAY_CLASS_FOF, nFOF, 1024 * fofBandwidth);
rsDht->setRelayAllowance(RSDHT_RELAY_CLASS_GENERAL, nGeneral, 1024 * genBandwidth);
+}
+/** Saves the changes on this page */
+
+void RelayPage::updateRelayMode()
+{
uint32_t relayMode = 0;
if (ui.enableCheckBox->isChecked())
{
@@ -106,7 +119,6 @@ bool RelayPage::save(QString &/*errmsg*/)
}
rsDht->setRelayMode(relayMode);
- return true;
}
/** Loads the settings for this page */
@@ -182,13 +194,9 @@ void RelayPage::updateRelayOptions()
int genBandwidth = ui.bandGeneralSpinBox->value();
ui.totalFriendLineEdit->setText(QString::number(nFriends * friendBandwidth * 2));
-
ui.totalFOFLineEdit->setText(QString::number(nFOF * fofBandwidth * 2));
-
ui.totalGeneralLineEdit->setText(QString::number(nGeneral * genBandwidth * 2));
-
ui.totalBandwidthLineEdit->setText(QString::number((nFriends * friendBandwidth + nFOF * fofBandwidth + nGeneral * genBandwidth) * 2));
-
ui.noTotalLineEdit->setText(QString::number(nFriends + nFOF + nGeneral));
}
diff --git a/retroshare-gui/src/gui/settings/RelayPage.h b/retroshare-gui/src/gui/settings/RelayPage.h
index d88dbd07b..5c8036926 100644
--- a/retroshare-gui/src/gui/settings/RelayPage.h
+++ b/retroshare-gui/src/gui/settings/RelayPage.h
@@ -35,8 +35,6 @@ class RelayPage: public ConfigPage
RelayPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
~RelayPage() {}
- /** Saves the changes on this page */
- virtual bool save(QString &/*errmsg*/);
/** Loads the settings for this page */
virtual void load();
@@ -51,6 +49,8 @@ class RelayPage: public ConfigPage
void addServer();
void removeServer();
void loadServers();
+ void updateTotals();
+ void updateRelayMode();
private:
diff --git a/retroshare-gui/src/gui/settings/rsettingswin.cpp b/retroshare-gui/src/gui/settings/rsettingswin.cpp
index 50052eaa1..1b88cbb53 100644
--- a/retroshare-gui/src/gui/settings/rsettingswin.cpp
+++ b/retroshare-gui/src/gui/settings/rsettingswin.cpp
@@ -141,7 +141,7 @@ SettingsPage::initStackedWidget()
ui.stackedWidget->setCurrentIndex(-1);
ui.stackedWidget->removeWidget(ui.stackedWidget->widget(0));
- addPage(new GeneralPage(0));
+ addPage(new GeneralPage());
addPage(new ServerPage());
addPage(new TransferPage());
addPage(new RelayPage() );
@@ -211,39 +211,11 @@ SettingsPage::setNewPage(int page)
}
/** Saves changes made to settings. */
-void
-SettingsPage::saveChanges()
+void SettingsPage::notifySettingsChanged()
{
- QString errmsg;
-
- /* Call each config page's save() method to save its data */
- int i, count = ui.stackedWidget->count();
- for (i = 0; i < count; i++)
- {
- ConfigPage *page = dynamic_cast(ui.stackedWidget->widget(i));
- if (page && page->wasLoaded()) {
- if (!page->save(errmsg))
- {
- /* Display the offending page */
- ui.stackedWidget->setCurrentWidget(page);
-
- /* Show the user what went wrong */
- QMessageBox::warning(this,
- tr("Error Saving Configuration on page")+" "+QString::number(i), errmsg,
- QMessageBox::Ok, QMessageBox::NoButton);
-
- /* Don't process the rest of the pages */
- return;
- }
- }
- }
-
/* call to RsIface save function.... */
//rsicontrol -> ConfigSave();
- if (NotifyQt::getInstance()) {
+ if (NotifyQt::getInstance())
NotifyQt::getInstance()->notifySettingsChanged();
- }
-
- close();
}
diff --git a/retroshare-gui/src/gui/settings/rsettingswin.h b/retroshare-gui/src/gui/settings/rsettingswin.h
index 51371f8f7..eff14f31b 100755
--- a/retroshare-gui/src/gui/settings/rsettingswin.h
+++ b/retroshare-gui/src/gui/settings/rsettingswin.h
@@ -58,8 +58,10 @@ public slots:
void setNewPage(int page);
private slots:
- /** Called when user clicks "Save Settings" */
- void saveChanges();
+ void notifySettingsChanged();
+
+ // Called when user clicks "Save Settings"
+ //void saveChanges();
//void dialogFinished(int result);
private:
@@ -67,7 +69,6 @@ private:
private:
FloatingHelpBrowser *mHelpBrowser;
- //static RSettingsWin *_instance;
static int lastPage;
/* UI - from Designer */
diff --git a/retroshare-gui/src/retroshare-gui/configpage.h b/retroshare-gui/src/retroshare-gui/configpage.h
index 1299f2b3f..ecb292740 100644
--- a/retroshare-gui/src/retroshare-gui/configpage.h
+++ b/retroshare-gui/src/retroshare-gui/configpage.h
@@ -23,6 +23,7 @@
#ifndef _CONFIGPAGE_H
#define _CONFIGPAGE_H
+#include
#include
class ConfigPage : public QWidget
@@ -37,8 +38,6 @@ class ConfigPage : public QWidget
/** Pure virtual method. Subclassed pages save their config settings here
* and return true if everything was saved successfully. */
- virtual bool save(QString &errmsg) = 0;
-
bool wasLoaded() { return loaded ; }
// Icon to be used to display the config page.
@@ -53,6 +52,8 @@ class ConfigPage : public QWidget
//
virtual QString helpText() const = 0;
+private:
+ virtual bool save(QString &errmsg) { std::cerr << "(EE) save() shoud not be called!" << std::endl; return true;}
protected:
virtual void showEvent(QShowEvent * /*event*/)
{
From 60d9ea006f25cf0363c31a75a0a556a3f97b1350 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sun, 29 Jan 2017 21:47:13 +0100
Subject: [PATCH 36/90] changed more ConfigPages to not requiring calls to
save()
---
retroshare-gui/src/gui/settings/AboutPage.h | 2 -
.../src/gui/settings/AppearancePage.cpp | 89 +++---
.../src/gui/settings/AppearancePage.h | 16 +-
retroshare-gui/src/gui/settings/ChatPage.h | 2 -
.../src/gui/settings/MessagePage.cpp | 29 +-
retroshare-gui/src/gui/settings/MessagePage.h | 7 +-
.../src/gui/settings/NetworkPage.cpp | 7 -
retroshare-gui/src/gui/settings/NetworkPage.h | 2 -
.../src/gui/settings/NotifyPage.cpp | 293 ++++++++++--------
retroshare-gui/src/gui/settings/NotifyPage.h | 16 +-
.../src/gui/settings/PeoplePage.cpp | 30 +-
retroshare-gui/src/gui/settings/PeoplePage.h | 11 +-
.../src/gui/settings/ServerPage.cpp | 48 +--
retroshare-gui/src/gui/settings/ServerPage.h | 4 +-
.../src/gui/settings/ServicePermissionsPage.h | 2 -
retroshare-gui/src/gui/settings/SoundPage.h | 2 -
.../src/gui/settings/TransferPage.h | 2 -
retroshare-gui/src/gui/settings/WebuiPage.h | 2 -
18 files changed, 310 insertions(+), 254 deletions(-)
diff --git a/retroshare-gui/src/gui/settings/AboutPage.h b/retroshare-gui/src/gui/settings/AboutPage.h
index e374a0c23..3f41750e0 100644
--- a/retroshare-gui/src/gui/settings/AboutPage.h
+++ b/retroshare-gui/src/gui/settings/AboutPage.h
@@ -36,8 +36,6 @@ public:
/** Default Destructor */
~AboutPage();
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg) { return true;}
/** Loads the settings for this page */
virtual void load();
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.cpp b/retroshare-gui/src/gui/settings/AppearancePage.cpp
index 7bc85a103..819997f25 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.cpp
+++ b/retroshare-gui/src/gui/settings/AppearancePage.cpp
@@ -83,44 +83,53 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
foreach (QString name, styleSheets.keys()) {
ui.cmboStyleSheet->addItem(name, styleSheets[name]);
}
+
+ connect(ui.cmboTollButtonsSize, SIGNAL(currentItemChanged(int)), this, SLOT(updateCmboToolButtonSize() ));
+ connect(ui.cmboListItemSize, SIGNAL(currentItemChanged(int)), this, SLOT(updateCmboListItemSize() ));
+ connect(ui.cmboTollButtonsStyle, SIGNAL(currentItemChanged(int)), this, SLOT(updateCmboToolButtonStyle()));
+ connect(ui.cmboLanguage, SIGNAL(currentItemChanged(int)), this, SLOT(updateLanguageCode() ));
+ connect(ui.cmboStyle, SIGNAL(currentItemChanged(int)), this, SLOT(updateInterfaceStyle() ));
+ connect(ui.cmboStyleSheet, SIGNAL(currentItemChanged(int)), this, SLOT(updateSheetName() ));
+ connect(ui.rbtPageOnToolBar, SIGNAL(toggled(bool)), this, SLOT(updateRbtPageOnToolBar() ));
+ connect(ui.rbtActionOnToolBar, SIGNAL(toggled(bool)), this, SLOT(updateActionButtonLoc() ));
+ connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), this, SLOT(updateStatusToolTip() ));
}
-void AppearancePage::switch_status_grpStatus(bool b) { switch_status(MainWindow::StatusGrpStatus ,b) ; }
-void AppearancePage::switch_status_compactMode(bool b) { switch_status(MainWindow::StatusCompactMode,b) ; }
-void AppearancePage::switch_status_showToolTip(bool b) { switch_status(MainWindow::StatusShowToolTip,b) ; }
-void AppearancePage::switch_status_ShowStatus(bool b) { switch_status(MainWindow::StatusShowStatus ,b) ; }
-void AppearancePage::switch_status_ShowPeer(bool b) { switch_status(MainWindow::StatusShowPeer ,b) ; }
-void AppearancePage::switch_status_ShowDHT(bool b) { switch_status(MainWindow::StatusShowDHT ,b) ; }
-void AppearancePage::switch_status_ShowHashing(bool b) { switch_status(MainWindow::StatusShowHashing,b) ; }
-void AppearancePage::switch_status_ShowDisc(bool b) { switch_status(MainWindow::StatusShowDisc ,b) ; }
-void AppearancePage::switch_status_ShowRate(bool b) { switch_status(MainWindow::StatusShowRate ,b) ; }
-void AppearancePage::switch_status_ShowOpMode(bool b) { switch_status(MainWindow::StatusShowOpMode ,b) ; }
-void AppearancePage::switch_status_ShowSound(bool b) { switch_status(MainWindow::StatusShowSound ,b) ; }
-void AppearancePage::switch_status_ShowToaster(bool b) { switch_status(MainWindow::StatusShowToaster,b) ; }
-void AppearancePage::switch_status_ShowSystray(bool b) { switch_status(MainWindow::StatusShowSystray,b) ; }
+void AppearancePage::switch_status_grpStatus(bool b) { switch_status(MainWindow::StatusGrpStatus ,"ShowStatusBar", b) ; }
+void AppearancePage::switch_status_compactMode(bool b) { switch_status(MainWindow::StatusCompactMode,"CompactMode", b) ; }
+void AppearancePage::switch_status_showToolTip(bool b) { switch_status(MainWindow::StatusShowToolTip,"DisableSysTrayToolTip", b) ; }
+void AppearancePage::switch_status_ShowStatus(bool b) { switch_status(MainWindow::StatusShowStatus ,"ShowStatus", b) ; }
+void AppearancePage::switch_status_ShowPeer(bool b) { switch_status(MainWindow::StatusShowPeer ,"ShowPeer", b) ; }
+void AppearancePage::switch_status_ShowDHT(bool b) { switch_status(MainWindow::StatusShowDHT ,"ShowDHT", b) ; }
+void AppearancePage::switch_status_ShowHashing(bool b) { switch_status(MainWindow::StatusShowHashing,"ShowHashing", b) ; }
+void AppearancePage::switch_status_ShowDisc(bool b) { switch_status(MainWindow::StatusShowDisc ,"ShowDisc", b) ; }
+void AppearancePage::switch_status_ShowRate(bool b) { switch_status(MainWindow::StatusShowRate ,"ShowRate", b) ; }
+void AppearancePage::switch_status_ShowOpMode(bool b) { switch_status(MainWindow::StatusShowOpMode ,"ShowOpMode", b) ; }
+void AppearancePage::switch_status_ShowSound(bool b) { switch_status(MainWindow::StatusShowSound ,"ShowSound", b) ; }
+void AppearancePage::switch_status_ShowToaster(bool b) { switch_status(MainWindow::StatusShowToaster,"ShowToaster", b) ; }
+void AppearancePage::switch_status_ShowSystray(bool b) { switch_status(MainWindow::StatusShowSystray,"ShowSysTrayOnStatusBar",b) ; }
-void AppearancePage::switch_status(MainWindow::StatusElement s,bool b)
+void AppearancePage::switch_status(MainWindow::StatusElement s,const QString& key, bool b)
{
MainWindow *pMainWindow = MainWindow::getInstance();
if(!pMainWindow)
return ;
+ Settings->setValueToGroup("StatusBar", key, QVariant(b));
+
pMainWindow->switchVisibilityStatus(s,b) ;
}
-/** Saves the changes on this page */
-bool AppearancePage::save(QString &errmsg)
+void AppearancePage::updateLanguageCode() { Settings->setLanguageCode(LanguageSupport::languageCode(ui.cmboLanguage->currentText())); }
+void AppearancePage::updateInterfaceStyle() { Settings->setInterfaceStyle(ui.cmboStyle->currentText()); }
+void AppearancePage::updateSheetName() { Settings->setSheetName(ui.cmboStyleSheet->itemData(ui.cmboStyleSheet->currentIndex()).toString()); }
+void AppearancePage::updateRbtPageOnToolBar() { Settings->setPageButtonLoc(ui.rbtPageOnToolBar->isChecked());}
+void AppearancePage::updateActionButtonLoc() { Settings->setActionButtonLoc(ui.rbtActionOnToolBar->isChecked()); }
+void AppearancePage::updateStatusToolTip() { MainWindow::getInstance()->toggleStatusToolTip(ui.checkBoxDisableSysTrayToolTip->isChecked()); }
+
+void AppearancePage::updateCmboToolButtonStyle()
{
- Q_UNUSED(errmsg);
-
- QString languageCode = LanguageSupport::languageCode(ui.cmboLanguage->currentText());
-
- Settings->setLanguageCode(languageCode);
- Settings->setInterfaceStyle(ui.cmboStyle->currentText());
- Settings->setSheetName(ui.cmboStyleSheet->itemData(ui.cmboStyleSheet->currentIndex()).toString());
- Settings->setPageButtonLoc(ui.rbtPageOnToolBar->isChecked());
- Settings->setActionButtonLoc(ui.rbtActionOnToolBar->isChecked());
switch (ui.cmboTollButtonsStyle->currentIndex())
{
case 0:
@@ -136,6 +145,10 @@ bool AppearancePage::save(QString &errmsg)
default:
Settings->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
}
+}
+
+void AppearancePage::updateCmboToolButtonSize()
+{
switch (ui.cmboTollButtonsSize->currentIndex())
{
case 0:
@@ -157,6 +170,9 @@ bool AppearancePage::save(QString &errmsg)
case 5:
Settings->setToolButtonSize(128);
}
+}
+void AppearancePage::updateCmboListItemSize()
+{
switch (ui.cmboListItemSize->currentIndex())
{
case 0:
@@ -178,29 +194,10 @@ bool AppearancePage::save(QString &errmsg)
case 5:
Settings->setListItemIconSize(128);
}
-
- /* Set to new style */
- Rshare::setStyle(ui.cmboStyle->currentText());
-
- Settings->setValueToGroup("StatusBar", "ShowStatusBar", QVariant(ui.grpStatus->isChecked()));
- Settings->setValueToGroup("StatusBar", "CompactMode", QVariant(ui.checkBoxStatusCompactMode->isChecked()));
- Settings->setValueToGroup("StatusBar", "DisableSysTrayToolTip", QVariant(ui.checkBoxDisableSysTrayToolTip->isChecked()));
- MainWindow::getInstance()->toggleStatusToolTip(ui.checkBoxDisableSysTrayToolTip->isChecked());
- Settings->setValueToGroup("StatusBar", "ShowStatus", QVariant(ui.checkBoxShowStatusStatus->isChecked()));
- Settings->setValueToGroup("StatusBar", "ShowPeer", QVariant(ui.checkBoxShowPeerStatus->isChecked()));
- Settings->setValueToGroup("StatusBar", "ShowNAT", QVariant(ui.checkBoxShowNATStatus->isChecked()));
- Settings->setValueToGroup("StatusBar", "ShowDHT", QVariant(ui.checkBoxShowDHTStatus->isChecked()));
- Settings->setValueToGroup("StatusBar", "ShowHashing", QVariant(ui.checkBoxShowHashingStatus->isChecked()));
- Settings->setValueToGroup("StatusBar", "ShowDisc", QVariant(ui.checkBoxShowDiscStatus->isChecked()));
- Settings->setValueToGroup("StatusBar", "ShowRate", QVariant(ui.checkBoxShowRateStatus->isChecked()));
- Settings->setValueToGroup("StatusBar", "ShowOpMode", QVariant(ui.checkBoxShowOpModeStatus->isChecked()));
- Settings->setValueToGroup("StatusBar", "ShowSound", QVariant(ui.checkBoxShowSoundStatus->isChecked()));
- Settings->setValueToGroup("StatusBar", "ShowToaster", QVariant(ui.checkBoxShowToasterDisable->isChecked()));
- Settings->setValueToGroup("StatusBar", "ShowSysTrayOnStatusBar", QVariant(ui.checkBoxShowSystrayOnStatus->isChecked()));
-
- return true;
}
+void AppearancePage::updateStyle() { Rshare::setStyle(ui.cmboStyle->currentText()); }
+
/** Loads the settings for this page */
void AppearancePage::load()
{
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.h b/retroshare-gui/src/gui/settings/AppearancePage.h
index 2ae6ce212..a80b97d1a 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.h
+++ b/retroshare-gui/src/gui/settings/AppearancePage.h
@@ -34,8 +34,6 @@ public:
/** Default Constructor */
AppearancePage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
/** Loads the settings for this page */
virtual void load();
@@ -60,8 +58,20 @@ private slots:
void switch_status_ShowToaster(bool) ;
void switch_status_ShowSystray(bool) ;
+ void updateLanguageCode() ;
+ void updateInterfaceStyle() ;
+ void updateSheetName() ;
+ void updateRbtPageOnToolBar();
+ void updateActionButtonLoc() ;
+ void updateStatusToolTip() ;
+
+ void updateCmboToolButtonStyle();
+ void updateCmboToolButtonSize();
+ void updateCmboListItemSize();
+
+ void updateStyle() ;
private:
- void switch_status(MainWindow::StatusElement s,bool b);
+ void switch_status(MainWindow::StatusElement s,const QString& key,bool b);
/** Qt Designer generated object */
Ui::AppearancePage ui;
diff --git a/retroshare-gui/src/gui/settings/ChatPage.h b/retroshare-gui/src/gui/settings/ChatPage.h
index f6445d4d5..838fcc2ad 100644
--- a/retroshare-gui/src/gui/settings/ChatPage.h
+++ b/retroshare-gui/src/gui/settings/ChatPage.h
@@ -35,8 +35,6 @@ class ChatPage : public ConfigPage
/** Default Destructor */
~ChatPage() {}
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
/** Loads the settings for this page */
virtual void load();
diff --git a/retroshare-gui/src/gui/settings/MessagePage.cpp b/retroshare-gui/src/gui/settings/MessagePage.cpp
index 89dcaa0ac..14ab9791d 100644
--- a/retroshare-gui/src/gui/settings/MessagePage.cpp
+++ b/retroshare-gui/src/gui/settings/MessagePage.cpp
@@ -51,8 +51,12 @@ MessagePage::MessagePage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(distantMsgsComboBoxChanged(int)));
+ connect(ui.setMsgToReadOnActivate,SIGNAL(toggled(bool)), this,SLOT(updateMsgToReadOnActivate()));
+ connect(ui.loadEmbeddedImages, SIGNAL(toggled(bool)), this,SLOT(updateLoadEmbededImages() ));
+ connect(ui.openComboBox, SIGNAL(currentItemChanged(int)),this,SLOT(updateMsgOpen() ));
+ connect(ui.comboBox, SIGNAL(currebtItemChanged(int)),this,SLOT(updateDistantMsgs() ));
- //ui.encryptedMsgs_CB->setEnabled(false) ;
+ connect(ui.comboBox, SIGNAL(currebtItemChanged(int)),this,SLOT(updateMsgTags() ));
}
MessagePage::~MessagePage()
@@ -79,17 +83,13 @@ void MessagePage::distantMsgsComboBoxChanged(int i)
}
-/** Saves the changes on this page */
-bool
-MessagePage::save(QString &/*errmsg*/)
-{
- Settings->setMsgSetToReadOnActivate(ui.setMsgToReadOnActivate->isChecked());
- Settings->setMsgLoadEmbeddedImages(ui.loadEmbeddedImages->isChecked());
- Settings->setMsgOpen((RshareSettings::enumMsgOpen) ui.openComboBox->itemData(ui.openComboBox->currentIndex()).toInt());
-
- // state of distant Message combobox
- Settings->setValue("DistantMessages", ui.comboBox->currentIndex());
+void MessagePage::updateMsgToReadOnActivate() { Settings->setMsgSetToReadOnActivate(ui.setMsgToReadOnActivate->isChecked()); }
+void MessagePage::updateLoadEmbededImages() { Settings->setMsgLoadEmbeddedImages(ui.loadEmbeddedImages->isChecked()); }
+void MessagePage::updateMsgOpen() { Settings->setMsgOpen((RshareSettings::enumMsgOpen) ui.openComboBox->itemData(ui.openComboBox->currentIndex()).toInt());}
+void MessagePage::updateDistantMsgs() { Settings->setValue("DistantMessages", ui.comboBox->currentIndex()); }
+void MessagePage::updateMsgTags()
+{
std::map >::iterator Tag;
for (Tag = m_pTags->types.begin(); Tag != m_pTags->types.end(); ++Tag) {
// check for changed tags
@@ -107,8 +107,6 @@ MessagePage::save(QString &/*errmsg*/)
}
}
}
-
- return true;
}
/** Loads the settings for this page */
@@ -166,6 +164,8 @@ void MessagePage::addTag()
m_changedTagIds.push_back(TagDlg.m_nId);
}
}
+
+ updateMsgTags();
}
void MessagePage::editTag()
@@ -196,6 +196,7 @@ void MessagePage::editTag()
}
}
}
+ updateMsgTags();
}
void MessagePage::deleteTag()
@@ -228,6 +229,7 @@ void MessagePage::deleteTag()
if (std::find(m_changedTagIds.begin(), m_changedTagIds.end(), nId) == m_changedTagIds.end()) {
m_changedTagIds.push_back(nId);
}
+ updateMsgTags();
}
void MessagePage::defaultTag()
@@ -244,6 +246,7 @@ void MessagePage::defaultTag()
}
}
+ updateMsgTags();
fillTags();
}
diff --git a/retroshare-gui/src/gui/settings/MessagePage.h b/retroshare-gui/src/gui/settings/MessagePage.h
index 99d3ca5f2..c58ab6e0f 100644
--- a/retroshare-gui/src/gui/settings/MessagePage.h
+++ b/retroshare-gui/src/gui/settings/MessagePage.h
@@ -37,8 +37,6 @@ public:
MessagePage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
~MessagePage();
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
/** Loads the settings for this page */
virtual void load();
@@ -56,6 +54,11 @@ private slots:
void currentRowChangedTag(int row);
void distantMsgsComboBoxChanged(int);
+ void updateMsgToReadOnActivate() ;
+ void updateLoadEmbededImages() ;
+ void updateMsgOpen() ;
+ void updateDistantMsgs() ;
+ void updateMsgTags() ;
private:
void fillTags();
diff --git a/retroshare-gui/src/gui/settings/NetworkPage.cpp b/retroshare-gui/src/gui/settings/NetworkPage.cpp
index 4bc31e1b2..0c0bd7f67 100755
--- a/retroshare-gui/src/gui/settings/NetworkPage.cpp
+++ b/retroshare-gui/src/gui/settings/NetworkPage.cpp
@@ -30,13 +30,6 @@ NetworkPage::NetworkPage(QWidget * parent, Qt::WindowFlags flags)
}
-/** Saves the changes on this page */
-bool
-NetworkPage::save(QString &/*errmsg*/)
-{
- return true;
-}
-
/** Loads the settings for this page */
void
NetworkPage::load()
diff --git a/retroshare-gui/src/gui/settings/NetworkPage.h b/retroshare-gui/src/gui/settings/NetworkPage.h
index 9244e99a0..fa1cf8968 100755
--- a/retroshare-gui/src/gui/settings/NetworkPage.h
+++ b/retroshare-gui/src/gui/settings/NetworkPage.h
@@ -31,8 +31,6 @@ public:
NetworkPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
~NetworkPage() {}
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
/** Loads the settings for this page */
virtual void load();
diff --git a/retroshare-gui/src/gui/settings/NotifyPage.cpp b/retroshare-gui/src/gui/settings/NotifyPage.cpp
index 1c31af679..2c9dbde5b 100755
--- a/retroshare-gui/src/gui/settings/NotifyPage.cpp
+++ b/retroshare-gui/src/gui/settings/NotifyPage.cpp
@@ -37,106 +37,151 @@
NotifyPage::NotifyPage(QWidget * parent, Qt::WindowFlags flags)
: ConfigPage(parent, flags)
{
- /* Invoke the Qt Designer generated object setup routine */
- ui.setupUi(this);
+ /* Invoke the Qt Designer generated object setup routine */
+ ui.setupUi(this);
- connect(ui.testFeedButton, SIGNAL(clicked()), this, SLOT(testFeed()));
- connect(ui.testToasterButton, SIGNAL(clicked()), this, SLOT(testToaster()));
- connect(ui.pushButtonDisableAll,SIGNAL(toggled(bool)), NotifyQt::getInstance(), SLOT(SetDisableAll(bool)));
- connect(NotifyQt::getInstance(),SIGNAL(disableAllChanged(bool)), ui.pushButtonDisableAll, SLOT(setChecked(bool)));
- connect(ui.chatLobbies_CountFollowingText,SIGNAL(toggled(bool)),ui.chatLobbies_TextToNotify,SLOT(setEnabled(bool)));
+ connect(ui.testFeedButton, SIGNAL(clicked()), this, SLOT(testFeed()));
+ connect(ui.testToasterButton, SIGNAL(clicked()), this, SLOT(testToaster()));
+ connect(ui.pushButtonDisableAll,SIGNAL(toggled(bool)), NotifyQt::getInstance(), SLOT(SetDisableAll(bool)));
+ connect(NotifyQt::getInstance(),SIGNAL(disableAllChanged(bool)), ui.pushButtonDisableAll, SLOT(setChecked(bool)));
+ connect(ui.chatLobbies_CountFollowingText,SIGNAL(toggled(bool)),ui.chatLobbies_TextToNotify,SLOT(setEnabled(bool)));
- ui.notify_Blogs->hide();
+ ui.notify_Blogs->hide();
- QFont font = ui.notify_Peers->font(); // use font from existing checkbox
+ QFont font = ui.notify_Peers->font(); // use font from existing checkbox
- /* add feed and Toaster notify */
- int rowFeed = 0;
- int rowToaster = 0;
- int pluginCount = rsPlugins->nbPlugins();
- for (int i = 0; i < pluginCount; ++i) {
- RsPlugin *rsPlugin = rsPlugins->plugin(i);
- if (rsPlugin) {
- FeedNotify *feedNotify = rsPlugin->qt_feedNotify();
- if (feedNotify) {
- QString name;
- if (feedNotify->hasSetting(name)) {
+ /* add feed and Toaster notify */
+ int rowFeed = 0;
+ int rowToaster = 0;
+ int pluginCount = rsPlugins->nbPlugins();
+ for (int i = 0; i < pluginCount; ++i)
+ {
+ RsPlugin *rsPlugin = rsPlugins->plugin(i);
+ if (rsPlugin) {
+ FeedNotify *feedNotify = rsPlugin->qt_feedNotify();
+ if (feedNotify) {
+ QString name;
+ if (feedNotify->hasSetting(name)) {
- QCheckBox *enabledCheckBox = new QCheckBox(name, this);
- enabledCheckBox->setFont(font);
- ui.feedLayout->addWidget(enabledCheckBox, rowFeed++);
+ QCheckBox *enabledCheckBox = new QCheckBox(name, this);
+ enabledCheckBox->setFont(font);
+ ui.feedLayout->addWidget(enabledCheckBox, rowFeed++);
- mFeedNotifySettingList.push_back(FeedNotifySetting(feedNotify, enabledCheckBox));
- }
- }
+ mFeedNotifySettingList.push_back(FeedNotifySetting(feedNotify, enabledCheckBox));
- ToasterNotify *toasterNotify = rsPlugin->qt_toasterNotify();
- if (toasterNotify) {
- QString name;
- if (toasterNotify->hasSetting(name)) {
+ connect(enabledCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateFeedNotifySettings())) ;
+ }
+ }
- QCheckBox *enabledCheckBox = new QCheckBox(name, this);
- enabledCheckBox->setFont(font);
- ui.toasterLayout->addWidget(enabledCheckBox, rowToaster++);
+ ToasterNotify *toasterNotify = rsPlugin->qt_toasterNotify();
+ if (toasterNotify) {
+ QString name;
+ if (toasterNotify->hasSetting(name)) {
- mToasterNotifySettingList.push_back(ToasterNotifySetting(toasterNotify, enabledCheckBox));
- }
+ QCheckBox *enabledCheckBox = new QCheckBox(name, this);
+ enabledCheckBox->setFont(font);
+ ui.toasterLayout->addWidget(enabledCheckBox, rowToaster++);
- QMap map;
- if (toasterNotify->hasSettings(name, map)) {
- if (!map.empty()){
- QWidget* widget = new QWidget();
- QVBoxLayout* vbLayout = new QVBoxLayout(widget);
- QLabel *label = new QLabel(name, this);
- QFont fontBold = QFont(font);
- fontBold.setBold(true);
- label->setFont(fontBold);
- vbLayout->addWidget(label);
- for (QMap::const_iterator it = map.begin(); it != map.end(); ++it){
- QCheckBox *enabledCheckBox = new QCheckBox(it.value(), this);
- enabledCheckBox->setAccessibleName(it.key());
- enabledCheckBox->setFont(font);
- vbLayout->addWidget(enabledCheckBox);
- mToasterNotifySettingList.push_back(ToasterNotifySetting(toasterNotify, enabledCheckBox));
- }
- ui.toasterLayout->addWidget(widget, rowToaster++);
- }
- }
- }
- }
- }
+ mToasterNotifySettingList.push_back(ToasterNotifySetting(toasterNotify, enabledCheckBox));
- /* add user notify */
- const QList &userNotifyList = MainWindow::getInstance()->getUserNotifyList();
- QList::const_iterator it;
- rowFeed = 0;
- mChatLobbyUserNotify = 0;
- for (it = userNotifyList.begin(); it != userNotifyList.end(); ++it) {
- UserNotify *userNotify = *it;
+ connect(enabledCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateToasterNotifySettings())) ;
+ }
- QString name;
- if (!userNotify->hasSetting(&name, NULL)) {
- continue;
- }
+ QMap map;
+ if (toasterNotify->hasSettings(name, map)) {
+ if (!map.empty()){
+ QWidget* widget = new QWidget();
+ QVBoxLayout* vbLayout = new QVBoxLayout(widget);
+ QLabel *label = new QLabel(name, this);
+ QFont fontBold = QFont(font);
+ fontBold.setBold(true);
+ label->setFont(fontBold);
+ vbLayout->addWidget(label);
+ for (QMap::const_iterator it = map.begin(); it != map.end(); ++it){
+ QCheckBox *enabledCheckBox = new QCheckBox(it.value(), this);
+ enabledCheckBox->setAccessibleName(it.key());
+ enabledCheckBox->setFont(font);
+ vbLayout->addWidget(enabledCheckBox);
+ mToasterNotifySettingList.push_back(ToasterNotifySetting(toasterNotify, enabledCheckBox));
- QCheckBox *enabledCheckBox = new QCheckBox(name, this);
- enabledCheckBox->setFont(font);
- ui.notifyLayout->addWidget(enabledCheckBox, rowFeed, 0, 0);
- connect(enabledCheckBox, SIGNAL(toggled(bool)), this, SLOT(notifyToggled()));
+ connect(enabledCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateToasterNotifySettings())) ;
+ }
+ ui.toasterLayout->addWidget(widget, rowToaster++);
+ }
+ }
+ }
+ }
- QCheckBox *combinedCheckBox = new QCheckBox(tr("Combined"), this);
- combinedCheckBox->setFont(font);
- ui.notifyLayout->addWidget(combinedCheckBox, rowFeed, 1);
+ }
- QCheckBox *blinkCheckBox = new QCheckBox(tr("Blink"), this);
- blinkCheckBox->setFont(font);
- ui.notifyLayout->addWidget(blinkCheckBox, rowFeed++, 2);
+ /* add user notify */
+ const QList &userNotifyList = MainWindow::getInstance()->getUserNotifyList();
+ QList::const_iterator it;
+ rowFeed = 0;
+ mChatLobbyUserNotify = 0;
+ for (it = userNotifyList.begin(); it != userNotifyList.end(); ++it) {
+ UserNotify *userNotify = *it;
- mUserNotifySettingList.push_back(UserNotifySetting(userNotify, enabledCheckBox, combinedCheckBox, blinkCheckBox));
+ QString name;
+ if (!userNotify->hasSetting(&name, NULL)) {
+ continue;
+ }
- //To get ChatLobbyUserNotify Settings
- if (!mChatLobbyUserNotify) mChatLobbyUserNotify = dynamic_cast(*it);
- }
+ QCheckBox *enabledCheckBox = new QCheckBox(name, this);
+ enabledCheckBox->setFont(font);
+ ui.notifyLayout->addWidget(enabledCheckBox, rowFeed, 0, 0);
+ connect(enabledCheckBox, SIGNAL(toggled(bool)), this, SLOT(notifyToggled()));
+
+ QCheckBox *combinedCheckBox = new QCheckBox(tr("Combined"), this);
+ combinedCheckBox->setFont(font);
+ ui.notifyLayout->addWidget(combinedCheckBox, rowFeed, 1);
+
+ QCheckBox *blinkCheckBox = new QCheckBox(tr("Blink"), this);
+ blinkCheckBox->setFont(font);
+ ui.notifyLayout->addWidget(blinkCheckBox, rowFeed++, 2);
+
+ mUserNotifySettingList.push_back(UserNotifySetting(userNotify, enabledCheckBox, combinedCheckBox, blinkCheckBox));
+
+ connect(enabledCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateUserNotifySettings())) ;
+ connect(blinkCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateUserNotifySettings())) ;
+ connect(combinedCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateUserNotifySettings())) ;
+
+ //To get ChatLobbyUserNotify Settings
+ if (!mChatLobbyUserNotify) mChatLobbyUserNotify = dynamic_cast(*it);
+ }
+
+ connect(ui.popup_Connect, SIGNAL(toggled(bool)), this, SLOT(updateNotifyFlags())) ;
+ connect(ui.popup_NewMsg, SIGNAL(toggled(bool)), this, SLOT(updateNotifyFlags())) ;
+ connect(ui.popup_DownloadFinished, SIGNAL(toggled(bool)), this, SLOT(updateNotifyFlags())) ;
+ connect(ui.popup_PrivateChat, SIGNAL(toggled(bool)), this, SLOT(updateNotifyFlags())) ;
+ connect(ui.popup_GroupChat, SIGNAL(toggled(bool)), this, SLOT(updateNotifyFlags())) ;
+ connect(ui.popup_ChatLobby, SIGNAL(toggled(bool)), this, SLOT(updateNotifyFlags())) ;
+ connect(ui.popup_ConnectAttempt, SIGNAL(toggled(bool)), this, SLOT(updateNotifyFlags())) ;
+
+ connect(ui.message_ConnectAttempt, SIGNAL(toggled(bool)), this, SLOT(updateMessageFlags())) ;
+
+ connect(ui.notify_Peers, SIGNAL(toggled(bool)), this, SLOT(updateNewsFeedFlags()));
+ connect(ui.notify_Channels, SIGNAL(toggled(bool)), this, SLOT(updateNewsFeedFlags()));
+ connect(ui.notify_Forums, SIGNAL(toggled(bool)), this, SLOT(updateNewsFeedFlags()));
+ connect(ui.notify_Posted, SIGNAL(toggled(bool)), this, SLOT(updateNewsFeedFlags()));
+ connect(ui.notify_Messages, SIGNAL(toggled(bool)), this, SLOT(updateNewsFeedFlags()));
+ connect(ui.notify_Chat, SIGNAL(toggled(bool)), this, SLOT(updateNewsFeedFlags()));
+ connect(ui.notify_Security, SIGNAL(toggled(bool)), this, SLOT(updateNewsFeedFlags()));
+ connect(ui.notify_SecurityIp, SIGNAL(toggled(bool)), this, SLOT(updateNewsFeedFlags()));
+
+ connect(ui.systray_ChatLobby, SIGNAL(toggled(bool)),this,SLOT(updateSystrayChatLobby()));
+ connect(ui.systray_GroupChat, SIGNAL(toggled(bool)),this,SLOT(updateSystrayGroupChat()));
+
+ connect(ui.spinBoxToasterXMargin, SIGNAL(valueChanged(int)),this, SLOT(updateToasterMargin())) ;
+ connect(ui.spinBoxToasterYMargin, SIGNAL(valueChanged(int)),this, SLOT(updateToasterMargin())) ;
+
+ connect(ui.comboBoxToasterPosition, SIGNAL(currentIndexChanged(int)),this, SLOT(updateToasterPosition())) ;
+
+ connect(ui.chatLobbies_CountUnRead, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ;
+ connect(ui.chatLobbies_CheckNickName, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ;
+ connect(ui.chatLobbies_CountFollowingText, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ;
+ connect(ui.chatLobbies_TextToNotify, SIGNAL(textChanged(QString)),this, SLOT(updateChatLobbyUserNotify()));
+ connect(ui.chatLobbies_TextCaseSensitive, SIGNAL(toggled(bool)),this, SLOT(updateChatLobbyUserNotify())) ;
}
NotifyPage::~NotifyPage()
@@ -203,64 +248,62 @@ uint NotifyPage::getNotifyFlags()
return notifyFlags;
}
-/** Saves the changes on this page */
-bool
-NotifyPage::save(QString &/*errmsg*/)
+
+void NotifyPage::updateFeedNotifySettings()
{
- /* extract from rsNotify the flags */
-
- uint messageflags = 0;
-
- if (ui.message_ConnectAttempt->isChecked())
- messageflags |= RS_MESSAGE_CONNECT_ATTEMPT;
-
- /* save feed notify */
- QList::iterator feedNotifyIt;
- for (feedNotifyIt = mFeedNotifySettingList.begin(); feedNotifyIt != mFeedNotifySettingList.end(); ++feedNotifyIt) {
- feedNotifyIt->mFeedNotify->setNotifyEnabled(feedNotifyIt->mEnabledCheckBox->isChecked());
- }
+ /* save feed notify */
+ QList::iterator feedNotifyIt;
+ for (feedNotifyIt = mFeedNotifySettingList.begin(); feedNotifyIt != mFeedNotifySettingList.end(); ++feedNotifyIt)
+ feedNotifyIt->mFeedNotify->setNotifyEnabled(feedNotifyIt->mEnabledCheckBox->isChecked());
+}
+void NotifyPage::updateToasterNotifySettings()
+{
/* save toaster notify */
QList::iterator toasterNotifyIt;
for (toasterNotifyIt = mToasterNotifySettingList.begin(); toasterNotifyIt != mToasterNotifySettingList.end(); ++toasterNotifyIt) {
- if(toasterNotifyIt->mEnabledCheckBox->accessibleName().isEmpty()){
+ if(toasterNotifyIt->mEnabledCheckBox->accessibleName().isEmpty())
toasterNotifyIt->mToasterNotify->setNotifyEnabled(toasterNotifyIt->mEnabledCheckBox->isChecked()) ;
- } else {
+ else
toasterNotifyIt->mToasterNotify->setNotifyEnabled(toasterNotifyIt->mEnabledCheckBox->accessibleName(), toasterNotifyIt->mEnabledCheckBox->isChecked()) ;
- }
}
+}
- /* save user notify */
- QList::iterator notifyIt;
- for (notifyIt = mUserNotifySettingList.begin(); notifyIt != mUserNotifySettingList.end(); ++notifyIt) {
- notifyIt->mUserNotify->setNotifyEnabled(notifyIt->mEnabledCheckBox->isChecked(), notifyIt->mCombinedCheckBox->isChecked(), notifyIt->mBlinkCheckBox->isChecked());
- }
+void NotifyPage::updateUserNotifySettings()
+{
+ /* save user notify */
+ QList::iterator notifyIt;
+ for (notifyIt = mUserNotifySettingList.begin(); notifyIt != mUserNotifySettingList.end(); ++notifyIt)
+ notifyIt->mUserNotify->setNotifyEnabled(notifyIt->mEnabledCheckBox->isChecked(), notifyIt->mCombinedCheckBox->isChecked(), notifyIt->mBlinkCheckBox->isChecked());
- Settings->setNotifyFlags(getNotifyFlags());
- Settings->setNewsFeedFlags(getNewsFlags());
- Settings->setMessageFlags(messageflags);
+ MainWindow::installNotifyIcons();
+}
- Settings->setDisplayTrayChatLobby(ui.systray_ChatLobby->isChecked());
- Settings->setDisplayTrayGroupChat(ui.systray_GroupChat->isChecked());
- MainWindow::installGroupChatNotifier();
- MainWindow::installNotifyIcons();
+void NotifyPage::updateMessageFlags() { Settings->setMessageFlags( ui.message_ConnectAttempt->isChecked()? RS_MESSAGE_CONNECT_ATTEMPT : 0); }
+void NotifyPage::updateNotifyFlags() { Settings->setNotifyFlags(getNotifyFlags()); }
+void NotifyPage::updateNewsFeedFlags(){ Settings->setNewsFeedFlags(getNewsFlags()); }
+void NotifyPage::updateSystrayChatLobby() { Settings->setDisplayTrayChatLobby(ui.systray_ChatLobby->isChecked()); }
+void NotifyPage::updateSystrayGroupChat() { Settings->setDisplayTrayGroupChat(ui.systray_GroupChat->isChecked()); MainWindow::installGroupChatNotifier(); }
+void NotifyPage::updateToasterMargin() { Settings->setToasterMargin(QPoint(ui.spinBoxToasterXMargin->value(), ui.spinBoxToasterYMargin->value())); }
+
+void NotifyPage::updateToasterPosition()
+{
int index = ui.comboBoxToasterPosition->currentIndex();
- if (index != -1) {
+ if (index != -1)
Settings->setToasterPosition((RshareSettings::enumToasterPosition) ui.comboBoxToasterPosition->itemData(index).toInt());
- }
+}
- Settings->setToasterMargin(QPoint(ui.spinBoxToasterXMargin->value(), ui.spinBoxToasterYMargin->value()));
+void NotifyPage::updateChatLobbyUserNotify()
+{
+ if(!mChatLobbyUserNotify)
+ return ;
- if (mChatLobbyUserNotify){
- mChatLobbyUserNotify->setCountUnRead(ui.chatLobbies_CountUnRead->isChecked()) ;
- mChatLobbyUserNotify->setCheckForNickName(ui.chatLobbies_CheckNickName->isChecked()) ;
- mChatLobbyUserNotify->setCountSpecificText(ui.chatLobbies_CountFollowingText->isChecked()) ;
- mChatLobbyUserNotify->setTextToNotify(ui.chatLobbies_TextToNotify->document()->toPlainText());
- mChatLobbyUserNotify->setTextCaseSensitive(ui.chatLobbies_TextCaseSensitive->isChecked());
- }
- load();
- return true;
+ mChatLobbyUserNotify->setCountUnRead(ui.chatLobbies_CountUnRead->isChecked()) ;
+ mChatLobbyUserNotify->setCheckForNickName(ui.chatLobbies_CheckNickName->isChecked()) ;
+ mChatLobbyUserNotify->setCountSpecificText(ui.chatLobbies_CountFollowingText->isChecked()) ;
+ mChatLobbyUserNotify->setTextToNotify(ui.chatLobbies_TextToNotify->document()->toPlainText());
+ mChatLobbyUserNotify->setTextCaseSensitive(ui.chatLobbies_TextCaseSensitive->isChecked());
}
/** Loads the settings for this page */
diff --git a/retroshare-gui/src/gui/settings/NotifyPage.h b/retroshare-gui/src/gui/settings/NotifyPage.h
index 900c8efb6..547af2767 100755
--- a/retroshare-gui/src/gui/settings/NotifyPage.h
+++ b/retroshare-gui/src/gui/settings/NotifyPage.h
@@ -76,8 +76,6 @@ public:
/** Default Destructor */
~NotifyPage();
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
/** Loads the settings for this page */
virtual void load();
@@ -90,6 +88,20 @@ private slots:
void testToaster();
void testFeed();
+ void updateFeedNotifySettings();
+ void updateToasterNotifySettings();
+ void updateUserNotifySettings();
+ void updateMessageFlags() ;
+ void updateNotifyFlags() ;
+ void updateNewsFeedFlags();
+
+ void updateSystrayChatLobby();
+ void updateSystrayGroupChat();
+ void updateToasterMargin();
+
+ void updateToasterPosition();
+ void updateChatLobbyUserNotify();
+
private:
uint getNewsFlags();
uint getNotifyFlags();
diff --git a/retroshare-gui/src/gui/settings/PeoplePage.cpp b/retroshare-gui/src/gui/settings/PeoplePage.cpp
index 66265f4de..8f95b2b2f 100644
--- a/retroshare-gui/src/gui/settings/PeoplePage.cpp
+++ b/retroshare-gui/src/gui/settings/PeoplePage.cpp
@@ -29,28 +29,26 @@ PeoplePage::PeoplePage(QWidget * parent, Qt::WindowFlags flags)
{
ui.setupUi(this);
setAttribute(Qt::WA_QuitOnClose, false);
+
+ connect(ui.autoPositiveOpinion_CB,SIGNAL(toggled(bool)),this,SLOT(updateAutoPositiveOpinion())) ;
+ connect(ui.thresholdForPositive_SB,SIGNAL(valueChanged(int)),this,SLOT(updateThresholdForRemotelyPositiveReputation()));
+ connect(ui.thresholdForNegative_SB,SIGNAL(valueChanged(int)),this,SLOT(updateThresholdForRemotelyNegativeReputation()));
+ connect(ui.preventReloadingBannedIdentitiesFor_SB,SIGNAL(valueChanged(int)),this,SLOT(updateRememberDeletedNodes()));
+ connect(ui.deleteBannedIdentitiesAfter_SB,SIGNAL(valueChanged(int)),this,SLOT(updateDeleteBannedNodesThreshold()));
}
+void PeoplePage::updateAutoPositiveOpinion() { rsReputations->setNodeAutoPositiveOpinionForContacts(ui.autoPositiveOpinion_CB->isChecked()) ; }
+
+void PeoplePage::updateThresholdForRemotelyPositiveReputation() { rsReputations->setThresholdForRemotelyPositiveReputation(ui.thresholdForPositive_SB->value()); }
+void PeoplePage::updateThresholdForRemotelyNegativeReputation() { rsReputations->setThresholdForRemotelyNegativeReputation(ui.thresholdForNegative_SB->value()); }
+
+void PeoplePage::updateRememberDeletedNodes() { rsReputations->setRememberDeletedNodesThreshold(ui.preventReloadingBannedIdentitiesFor_SB->value()); }
+void PeoplePage::updateDeleteBannedNodesThreshold() { rsIdentity->setDeleteBannedNodesThreshold(ui.deleteBannedIdentitiesAfter_SB->value());}
+
PeoplePage::~PeoplePage()
{
}
-/** Saves the changes on this page */
-bool PeoplePage::save(QString &/*errmsg*/)
-{
- if(ui.autoPositiveOpinion_CB->isChecked())
- rsReputations->setNodeAutoPositiveOpinionForContacts(true) ;
- else
- rsReputations->setNodeAutoPositiveOpinionForContacts(false) ;
-
- rsReputations->setThresholdForRemotelyPositiveReputation(ui.thresholdForPositive_SB->value());
- rsReputations->setThresholdForRemotelyNegativeReputation(ui.thresholdForNegative_SB->value());
- rsReputations->setRememberDeletedNodesThreshold(ui.preventReloadingBannedIdentitiesFor_SB->value());
- rsIdentity->setDeleteBannedNodesThreshold(ui.deleteBannedIdentitiesAfter_SB->value());
-
- return true;
-}
-
/** Loads the settings for this page */
void PeoplePage::load()
{
diff --git a/retroshare-gui/src/gui/settings/PeoplePage.h b/retroshare-gui/src/gui/settings/PeoplePage.h
index 393436f57..b3e14adfa 100644
--- a/retroshare-gui/src/gui/settings/PeoplePage.h
+++ b/retroshare-gui/src/gui/settings/PeoplePage.h
@@ -33,8 +33,6 @@ public:
PeoplePage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
~PeoplePage();
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
/** Loads the settings for this page */
virtual void load();
@@ -42,6 +40,15 @@ public:
virtual QString pageName() const { return tr("People") ; }
virtual QString helpText() const { return ""; }
+protected slots:
+ void updateAutoPositiveOpinion() ;
+
+ void updateThresholdForRemotelyPositiveReputation();
+ void updateThresholdForRemotelyNegativeReputation();
+
+ void updateRememberDeletedNodes();
+ void updateDeleteBannedNodesThreshold() ;
+
private:
Ui::PeoplePage ui;
};
diff --git a/retroshare-gui/src/gui/settings/ServerPage.cpp b/retroshare-gui/src/gui/settings/ServerPage.cpp
index 8ece6d7cd..c80a56bbe 100755
--- a/retroshare-gui/src/gui/settings/ServerPage.cpp
+++ b/retroshare-gui/src/gui/settings/ServerPage.cpp
@@ -58,11 +58,6 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
- connect( ui.netModeComboBox, SIGNAL( activated ( int ) ), this, SLOT( toggleUPnP( ) ) );
- connect( ui.allowIpDeterminationCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleIpDetermination(bool) ) );
- connect( ui.cleanKnownIPs_PB, SIGNAL( clicked( ) ), this, SLOT( clearKnownAddressList() ) );
- connect( ui.testIncoming_PB, SIGNAL( clicked( ) ), this, SLOT( updateInProxyIndicator() ) );
-
manager = NULL ;
ui.filteredIpsTable->setHorizontalHeaderItem(COLUMN_RANGE,new QTableWidgetItem(tr("IP Range"))) ;
@@ -107,11 +102,32 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
ui.hiddenpage_incoming->setVisible(false);
+ connect( ui.netModeComboBox, SIGNAL( activated ( int ) ), this, SLOT( toggleUPnP( ) ) );
+ connect( ui.allowIpDeterminationCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleIpDetermination(bool) ) );
+ connect( ui.cleanKnownIPs_PB, SIGNAL( clicked( ) ), this, SLOT( clearKnownAddressList() ) );
+ connect( ui.testIncoming_PB, SIGNAL( clicked( ) ), this, SLOT( updateInProxyIndicator() ) );
+ connect( ui.showDiscStatusBar,SIGNAL(toggled(bool)),this,SLOT(updateShowDiscStatusBar())) ;
+
#ifdef SERVER_DEBUG
std::cerr << "ServerPage::ServerPage() called";
std::cerr << std::endl;
#endif
+
+ connect(ui.netModeComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(saveAddresses()));
+ connect(ui.discComboBox, SIGNAL(currentIndexChanged(int)),this,SLOT(saveAddresses()));
+ connect(ui.localAddress, SIGNAL(textChanged(QString)),this,SLOT(saveAddresses()));
+ connect(ui.extAddress, SIGNAL(textChanged(QString)),this,SLOT(saveAddresses()));
+ connect(ui.dynDNS, SIGNAL(textChanged(QString)),this,SLOT(saveAddresses()));
+
+ connect(ui.hiddenpage_proxyAddress_tor, SIGNAL(textChanged(QString)),this,SLOT(saveAddresses()));
+ connect(ui.hiddenpage_proxyPort_tor, SIGNAL(textChanged(QString)),this,SLOT(saveAddresses()));
+ connect(ui.hiddenpage_proxyAddress_i2p, SIGNAL(textChanged(QString)),this,SLOT(saveAddresses()));
+ connect(ui.hiddenpage_proxyPort_i2p, SIGNAL(textChanged(QString)),this,SLOT(saveAddresses()));
+
+ connect(ui.totalDownloadRate,SIGNAL(valueChanged(int)),this,SLOT(saveRates()));
+ connect(ui.totalUploadRate, SIGNAL(valueChanged(int)),this,SLOT(saveRates()));
}
+
void ServerPage::checkIpRange(const QString& ipstr)
{
QColor color;
@@ -183,22 +199,7 @@ void ServerPage::toggleTunnelConnection(bool b)
//rsPeers->allowTunnelConnection(b) ;
}
-/** Saves the changes on this page */
-bool
-ServerPage::save(QString &/*errmsg*/)
-{
- Settings->setStatusBarFlag(STATUSBAR_DISC, ui.showDiscStatusBar->isChecked());
-
-/* save the server address */
-/* save local address */
-/* save the url for DNS access */
-
-/* restart server */
-
-/* save all? */
- saveAddresses();
- return true;
-}
+void ServerPage::updateShowDiscStatusBar() { Settings->setStatusBarFlag(STATUSBAR_DISC, ui.showDiscStatusBar->isChecked()); }
/** Loads the settings for this page */
void ServerPage::load()
@@ -815,7 +816,6 @@ void ServerPage::saveAddresses()
}
rsPeers->setDynDNS(ownId, ui.dynDNS->text().toStdString());
- rsConfig->SetMaxDataRates( ui.totalDownloadRate->value(), ui.totalUploadRate->value() );
// HANDLE PROXY SERVER.
std::string orig_proxyaddr, new_proxyaddr;
@@ -846,6 +846,10 @@ void ServerPage::saveAddresses()
load();
}
+void ServerPage::saveRates()
+{
+ rsConfig->SetMaxDataRates( ui.totalDownloadRate->value(), ui.totalUploadRate->value() );
+}
/***********************************************************************************/
/***********************************************************************************/
diff --git a/retroshare-gui/src/gui/settings/ServerPage.h b/retroshare-gui/src/gui/settings/ServerPage.h
index 4561cd7ca..02685bfc0 100755
--- a/retroshare-gui/src/gui/settings/ServerPage.h
+++ b/retroshare-gui/src/gui/settings/ServerPage.h
@@ -47,8 +47,6 @@ public:
ServerPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
~ServerPage() {}
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
/** Loads the settings for this page */
virtual void load();
@@ -81,6 +79,8 @@ private slots:
// server
void saveAddresses();
+ void saveRates();
+ void updateShowDiscStatusBar() ;
void toggleUPnP();
void toggleIpDetermination(bool) ;
void toggleTunnelConnection(bool) ;
diff --git a/retroshare-gui/src/gui/settings/ServicePermissionsPage.h b/retroshare-gui/src/gui/settings/ServicePermissionsPage.h
index abc54c9b0..b8559bbef 100644
--- a/retroshare-gui/src/gui/settings/ServicePermissionsPage.h
+++ b/retroshare-gui/src/gui/settings/ServicePermissionsPage.h
@@ -35,8 +35,6 @@ public:
ServicePermissionsPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
~ServicePermissionsPage() {}
- /** Saves the changes on this page */
- virtual bool save(QString &/*errmsg*/) { return true ;}
/** Loads the settings for this page */
virtual void load() {}
diff --git a/retroshare-gui/src/gui/settings/SoundPage.h b/retroshare-gui/src/gui/settings/SoundPage.h
index 831233784..0fc8b315c 100644
--- a/retroshare-gui/src/gui/settings/SoundPage.h
+++ b/retroshare-gui/src/gui/settings/SoundPage.h
@@ -37,8 +37,6 @@ public:
/** Default Destructor */
~SoundPage();
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
/** Loads the settings for this page */
virtual void load();
diff --git a/retroshare-gui/src/gui/settings/TransferPage.h b/retroshare-gui/src/gui/settings/TransferPage.h
index 75cab1b4c..eca52ace5 100644
--- a/retroshare-gui/src/gui/settings/TransferPage.h
+++ b/retroshare-gui/src/gui/settings/TransferPage.h
@@ -35,8 +35,6 @@ class TransferPage: public ConfigPage
TransferPage(QWidget * parent = 0, Qt::WindowFlags flags = 0);
~TransferPage() {}
- /** Saves the changes on this page */
- virtual bool save(QString &/*errmsg*/) { return true ; }
/** Loads the settings for this page */
virtual void load() {}
diff --git a/retroshare-gui/src/gui/settings/WebuiPage.h b/retroshare-gui/src/gui/settings/WebuiPage.h
index 3ff6a45a9..6d14500a5 100644
--- a/retroshare-gui/src/gui/settings/WebuiPage.h
+++ b/retroshare-gui/src/gui/settings/WebuiPage.h
@@ -20,8 +20,6 @@ public:
/** Default Destructor */
~WebuiPage();
- /** Saves the changes on this page */
- virtual bool save(QString &errmsg);
/** Loads the settings for this page */
virtual void load();
From 66bbf4d61c2c1af78d12daa5c4266e1bb81d862d Mon Sep 17 00:00:00 2001
From: csoler
Date: Mon, 30 Jan 2017 21:38:06 +0100
Subject: [PATCH 37/90] converted the last CONFIG pages to interactive mode
---
retroshare-gui/src/gui/settings/ChatPage.cpp | 289 +++++++++++-------
retroshare-gui/src/gui/settings/ChatPage.h | 11 +
retroshare-gui/src/gui/settings/SoundPage.cpp | 5 +-
retroshare-gui/src/gui/settings/SoundPage.h | 1 +
retroshare-gui/src/gui/settings/WebuiPage.cpp | 4 +-
retroshare-gui/src/gui/settings/WebuiPage.h | 2 +
6 files changed, 201 insertions(+), 111 deletions(-)
diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp
index 8f74c69d9..b2f5d8478 100644
--- a/retroshare-gui/src/gui/settings/ChatPage.cpp
+++ b/retroshare-gui/src/gui/settings/ChatPage.cpp
@@ -93,6 +93,117 @@ static QString loadStyleInfo(ChatStyle::enumStyleType type, QListWidget *listWid
}
return stylePath;
}
+void ChatPage::updateFontsAndEmotes()
+{
+ Settings->beginGroup(QString("Chat"));
+ Settings->setValue("Emoteicons_PrivatChat", ui.checkBox_emoteprivchat->isChecked());
+ Settings->setValue("Emoteicons_GroupChat", ui.checkBox_emotegroupchat->isChecked());
+ Settings->setValue("EnableCustomFonts", ui.checkBox_enableCustomFonts->isChecked());
+ Settings->setValue("EnableCustomFontSize", ui.checkBox_enableCustomFontSize->isChecked());
+ Settings->setValue("MinimumFontSize", ui.minimumFontSize->value());
+ Settings->setValue("EnableBold", ui.checkBox_enableBold->isChecked());
+ Settings->setValue("EnableItalics", ui.checkBox_enableItalics->isChecked());
+ Settings->setValue("MinimumContrast", ui.minimumContrast->value());
+ Settings->endGroup();
+}
+
+/** Saves the changes on this page */
+void ChatPage::updateChatParams()
+{
+ // state of distant Chat combobox
+ Settings->setValue("DistantChat", ui.distantChatComboBox->currentIndex());
+
+ Settings->setChatScreenFont(fontTempChat.toString());
+ NotifyQt::getInstance()->notifyChatFontChanged();
+
+ Settings->setChatSendMessageWithCtrlReturn(ui.sendMessageWithCtrlReturn->isChecked());
+ Settings->setChatSendAsPlainTextByDef(ui.sendAsPlainTextByDef->isChecked());
+ Settings->setChatLoadEmbeddedImages(ui.loadEmbeddedImages->isChecked());
+ Settings->setChatDoNotSendIsTyping(ui.DontSendTyping->isChecked());
+}
+
+void ChatPage::updateChatSearchParams()
+{
+ Settings->setChatSearchCharToStartSearch(ui.sbSearch_CharToStart->value());
+ Settings->setChatSearchCaseSensitively(ui.cbSearch_CaseSensitively->isChecked());
+ Settings->setChatSearchWholeWords(ui.cbSearch_WholeWords->isChecked());
+ Settings->setChatSearchMoveToCursor(ui.cbSearch_MoveToCursor->isChecked());
+ Settings->setChatSearchSearchWithoutLimit(ui.cbSearch_WithoutLimit->isChecked());
+ Settings->setChatSearchMaxSearchLimitColor(ui.sbSearch_MaxLimitColor->value());
+ Settings->setChatSearchFoundColor(rgbChatSearchFoundColor);
+}
+
+void ChatPage::updateDefaultLobbyIdentity()
+{
+ RsGxsId chosen_id ;
+ switch(ui.chatLobbyIdentity_IC->getChosenId(chosen_id))
+ {
+ case GxsIdChooser::KnowId:
+ case GxsIdChooser::UnKnowId:
+ rsMsgs->setDefaultIdentityForChatLobby(chosen_id) ;
+ break ;
+
+ default:;
+ }
+}
+
+
+void ChatPage::updateHistoryParams()
+{
+ Settings->setPublicChatHistoryCount(ui.publicChatLoadCount->value());
+ Settings->setPrivateChatHistoryCount(ui.privateChatLoadCount->value());
+ Settings->setLobbyChatHistoryCount(ui.lobbyChatLoadCount->value());
+
+ rsHistory->setEnable(RS_HISTORY_TYPE_PUBLIC , ui.publicChatEnable->isChecked());
+ rsHistory->setEnable(RS_HISTORY_TYPE_PRIVATE, ui.privateChatEnable->isChecked());
+ rsHistory->setEnable(RS_HISTORY_TYPE_LOBBY , ui.lobbyChatEnable->isChecked());
+
+ rsHistory->setSaveCount(RS_HISTORY_TYPE_PUBLIC , ui.publicChatSaveCount->value());
+ rsHistory->setSaveCount(RS_HISTORY_TYPE_PRIVATE, ui.privateChatSaveCount->value());
+ rsHistory->setSaveCount(RS_HISTORY_TYPE_LOBBY , ui.lobbyChatSaveCount->value());
+}
+
+void ChatPage::updatePublicStyle()
+{
+ ChatStyleInfo info;
+ QListWidgetItem *item = ui.publicList->currentItem();
+ if (item) {
+ info = item->data(Qt::UserRole).value();
+ if (publicStylePath != info.stylePath || publicStyleVariant != ui.publicComboBoxVariant->currentText()) {
+ Settings->setPublicChatStyle(info.stylePath, ui.publicComboBoxVariant->currentText());
+ NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_PUBLIC);
+ }
+ }
+}
+
+void ChatPage::updatePrivateStyle()
+{
+ ChatStyleInfo info;
+ QListWidgetItem *item = ui.privateList->currentItem();
+ if (item) {
+ info = item->data(Qt::UserRole).value();
+ if (privateStylePath != info.stylePath || privateStyleVariant != ui.privateComboBoxVariant->currentText()) {
+ Settings->setPrivateChatStyle(info.stylePath, ui.privateComboBoxVariant->currentText());
+ NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_PRIVATE);
+ }
+ }
+}
+
+void ChatPage::updateHistoryStyle()
+{
+ ChatStyleInfo info;
+ QListWidgetItem *item = ui.historyList->currentItem();
+ if (item) {
+ info = item->data(Qt::UserRole).value();
+ if (historyStylePath != info.stylePath || historyStyleVariant != ui.historyComboBoxVariant->currentText()) {
+ Settings->setHistoryChatStyle(info.stylePath, ui.historyComboBoxVariant->currentText());
+ NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_HISTORY);
+ }
+ }
+}
+
+void ChatPage::updateHistoryStorage() { rsHistory->setMaxStorageDuration(ui.max_storage_period->value() * 86400) ; }
+
/** Constructor */
ChatPage::ChatPage(QWidget * parent, Qt::WindowFlags flags)
@@ -101,121 +212,87 @@ ChatPage::ChatPage(QWidget * parent, Qt::WindowFlags flags)
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
- connect(ui.distantChatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(distantChatComboBoxChanged(int)));
-
#if QT_VERSION < 0x040600
ui.minimumContrastLabel->hide();
ui.minimumContrast->hide();
#endif
+ connect(ui.distantChatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(distantChatComboBoxChanged(int)));
+
+ connect(ui.checkBox_emoteprivchat, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes()));
+ connect(ui.checkBox_emotegroupchat, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes()));
+ connect(ui.checkBox_enableCustomFonts, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes()));
+ connect(ui.minimumFontSize, SIGNAL(valueChanged(int)), this, SLOT(updateFontsAndEmotes()));
+ connect(ui.checkBox_enableBold, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes()));
+ connect(ui.checkBox_enableItalics, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes()));
+ connect(ui.minimumContrast, SIGNAL(valueChanged(int)), this, SLOT(updateFontsAndEmotes()));
+
+ connect(ui.distantChatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateChatParams()));
+ connect(ui.sendMessageWithCtrlReturn, SIGNAL(toggled(bool)), this, SLOT(updateChatParams()));
+ connect(ui.sendAsPlainTextByDef, SIGNAL(toggled(bool)), this, SLOT(updateChatParams()));
+ connect(ui.loadEmbeddedImages, SIGNAL(toggled(bool)), this, SLOT(updateChatParams()));
+ connect(ui.DontSendTyping, SIGNAL(toggled(bool)), this, SLOT(updateChatParams()));
+
+ connect(ui.sbSearch_CharToStart, SIGNAL(valueChanged(int)), this, SLOT(updateChatSearchParams()));
+ connect(ui.cbSearch_CaseSensitively, SIGNAL(toggled(bool)), this, SLOT(updateChatSearchParams()));
+ connect(ui.cbSearch_WholeWords, SIGNAL(toggled(bool)), this, SLOT(updateChatSearchParams()));
+ connect(ui.cbSearch_MoveToCursor, SIGNAL(toggled(bool)), this, SLOT(updateChatSearchParams()));
+ connect(ui.cbSearch_WithoutLimit, SIGNAL(toggled(bool)), this, SLOT(updateChatSearchParams()));
+ connect(ui.sbSearch_MaxLimitColor, SIGNAL(valueChanged(int)), this, SLOT(updateChatSearchParams()));
+
+ connect(ui.chatLobbyIdentity_IC, SIGNAL(currentIndexChanged(int)), this, SLOT(updateDefaultLobbyIdentity()));
+
+ connect(ui.publicChatLoadCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
+ connect(ui.privateChatLoadCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
+ connect(ui.lobbyChatLoadCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
+ connect(ui.publicChatEnable, SIGNAL(toggled(bool)), this, SLOT(updateHistoryParams()));
+ connect(ui.privateChatEnable, SIGNAL(toggled(bool)), this, SLOT(updateHistoryParams()));
+ connect(ui.lobbyChatEnable, SIGNAL(toggled(bool)), this, SLOT(updateHistoryParams()));
+ connect(ui.publicChatSaveCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
+ connect(ui.privateChatSaveCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
+ connect(ui.lobbyChatSaveCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
+
+ connect(ui.publicList, SIGNAL(currentRowChanged(int)), this, SLOT(updatePublicStyle())) ;
+ connect(ui.publicComboBoxVariant, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePublicStyle())) ;
+
+ connect(ui.privateList, SIGNAL(currentRowChanged(int)), this, SLOT(updatePrivateStyle())) ;
+ connect(ui.privateComboBoxVariant, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePrivateStyle())) ;
+
+ connect(ui.historyList, SIGNAL(currentRowChanged(int)), this, SLOT(updateHistoryStyle())) ;
+ connect(ui.historyComboBoxVariant, SIGNAL(currentIndexChanged(int)), this, SLOT(updateHistoryStyle())) ;
+
+ connect(ui.max_storage_period, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryStorage())) ;
+
+ connect(ui.chat_NewWindow, SIGNAL(toggled(bool)), this, SLOT(updateChatFlags()));
+ connect(ui.chat_Focus, SIGNAL(toggled(bool)), this, SLOT(updateChatFlags()));
+ connect(ui.chat_tabbedWindow, SIGNAL(toggled(bool)), this, SLOT(updateChatFlags()));
+ connect(ui.chat_Blink, SIGNAL(toggled(bool)), this, SLOT(updateChatFlags()));
+
+ connect(ui.chatLobby_Blink, SIGNAL(toggled(bool)), this, SLOT(updateChatLobbyFlags()));
+}
+void ChatPage::updateChatFlags()
+{
+ uint chatflags = 0;
+
+ if (ui.chat_NewWindow->isChecked())
+ chatflags |= RS_CHAT_OPEN;
+ if (ui.chat_Focus->isChecked())
+ chatflags |= RS_CHAT_FOCUS;
+ if (ui.chat_tabbedWindow->isChecked())
+ chatflags |= RS_CHAT_TABBED_WINDOW;
+ if (ui.chat_Blink->isChecked())
+ chatflags |= RS_CHAT_BLINK;
+
+ Settings->setChatFlags(chatflags);
}
-/** Saves the changes on this page */
-bool
-ChatPage::save(QString &/*errmsg*/)
+void ChatPage::updateChatLobbyFlags()
{
- Settings->beginGroup(QString("Chat"));
- Settings->setValue("Emoteicons_PrivatChat", ui.checkBox_emoteprivchat->isChecked());
- Settings->setValue("Emoteicons_GroupChat", ui.checkBox_emotegroupchat->isChecked());
- Settings->setValue("EnableCustomFonts", ui.checkBox_enableCustomFonts->isChecked());
- Settings->setValue("EnableCustomFontSize", ui.checkBox_enableCustomFontSize->isChecked());
- Settings->setValue("MinimumFontSize", ui.minimumFontSize->value());
- Settings->setValue("EnableBold", ui.checkBox_enableBold->isChecked());
- Settings->setValue("EnableItalics", ui.checkBox_enableItalics->isChecked());
- Settings->setValue("MinimumContrast", ui.minimumContrast->value());
- Settings->endGroup();
- // state of distant Chat combobox
- Settings->setValue("DistantChat", ui.distantChatComboBox->currentIndex());
+ uint chatLobbyFlags = 0;
- Settings->setChatScreenFont(fontTempChat.toString());
- NotifyQt::getInstance()->notifyChatFontChanged();
+ if (ui.chatLobby_Blink->isChecked())
+ chatLobbyFlags |= RS_CHATLOBBY_BLINK;
- Settings->setChatSendMessageWithCtrlReturn(ui.sendMessageWithCtrlReturn->isChecked());
- Settings->setChatSendAsPlainTextByDef(ui.sendAsPlainTextByDef->isChecked());
- Settings->setChatLoadEmbeddedImages(ui.loadEmbeddedImages->isChecked());
- Settings->setChatDoNotSendIsTyping(ui.DontSendTyping->isChecked());
-
- Settings->setChatSearchCharToStartSearch(ui.sbSearch_CharToStart->value());
- Settings->setChatSearchCaseSensitively(ui.cbSearch_CaseSensitively->isChecked());
- Settings->setChatSearchWholeWords(ui.cbSearch_WholeWords->isChecked());
- Settings->setChatSearchMoveToCursor(ui.cbSearch_MoveToCursor->isChecked());
- Settings->setChatSearchSearchWithoutLimit(ui.cbSearch_WithoutLimit->isChecked());
- Settings->setChatSearchMaxSearchLimitColor(ui.sbSearch_MaxLimitColor->value());
- Settings->setChatSearchFoundColor(rgbChatSearchFoundColor);
-
- Settings->setPublicChatHistoryCount(ui.publicChatLoadCount->value());
- Settings->setPrivateChatHistoryCount(ui.privateChatLoadCount->value());
- Settings->setLobbyChatHistoryCount(ui.lobbyChatLoadCount->value());
-
- rsHistory->setEnable(RS_HISTORY_TYPE_PUBLIC , ui.publicChatEnable->isChecked());
- rsHistory->setEnable(RS_HISTORY_TYPE_PRIVATE, ui.privateChatEnable->isChecked());
- rsHistory->setEnable(RS_HISTORY_TYPE_LOBBY , ui.lobbyChatEnable->isChecked());
-
- rsHistory->setSaveCount(RS_HISTORY_TYPE_PUBLIC , ui.publicChatSaveCount->value());
- rsHistory->setSaveCount(RS_HISTORY_TYPE_PRIVATE, ui.privateChatSaveCount->value());
- rsHistory->setSaveCount(RS_HISTORY_TYPE_LOBBY , ui.lobbyChatSaveCount->value());
-
- RsGxsId chosen_id ;
- switch(ui.chatLobbyIdentity_IC->getChosenId(chosen_id))
- {
- case GxsIdChooser::KnowId:
- case GxsIdChooser::UnKnowId:
- rsMsgs->setDefaultIdentityForChatLobby(chosen_id) ;
- break ;
-
- default:;
- }
-
- ChatStyleInfo info;
- QListWidgetItem *item = ui.publicList->currentItem();
- if (item) {
- info = item->data(Qt::UserRole).value();
- if (publicStylePath != info.stylePath || publicStyleVariant != ui.publicComboBoxVariant->currentText()) {
- Settings->setPublicChatStyle(info.stylePath, ui.publicComboBoxVariant->currentText());
- NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_PUBLIC);
- }
- }
-
- item = ui.privateList->currentItem();
- if (item) {
- info = item->data(Qt::UserRole).value();
- if (privateStylePath != info.stylePath || privateStyleVariant != ui.privateComboBoxVariant->currentText()) {
- Settings->setPrivateChatStyle(info.stylePath, ui.privateComboBoxVariant->currentText());
- NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_PRIVATE);
- }
- }
-
- item = ui.historyList->currentItem();
- if (item) {
- info = item->data(Qt::UserRole).value();
- if (historyStylePath != info.stylePath || historyStyleVariant != ui.historyComboBoxVariant->currentText()) {
- Settings->setHistoryChatStyle(info.stylePath, ui.historyComboBoxVariant->currentText());
- NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_HISTORY);
- }
- }
-
- rsHistory->setMaxStorageDuration(ui.max_storage_period->value() * 86400) ;
-
- uint chatflags = 0;
-
- if (ui.chat_NewWindow->isChecked())
- chatflags |= RS_CHAT_OPEN;
- if (ui.chat_Focus->isChecked())
- chatflags |= RS_CHAT_FOCUS;
- if (ui.chat_tabbedWindow->isChecked())
- chatflags |= RS_CHAT_TABBED_WINDOW;
- if (ui.chat_Blink->isChecked())
- chatflags |= RS_CHAT_BLINK;
-
- Settings->setChatFlags(chatflags);
-
- uint chatLobbyFlags = 0;
-
- if (ui.chatLobby_Blink->isChecked())
- chatLobbyFlags |= RS_CHATLOBBY_BLINK;
-
- Settings->setChatLobbyFlags(chatLobbyFlags);
-
- return true;
+ Settings->setChatLobbyFlags(chatLobbyFlags);
}
/** Loads the settings for this page */
diff --git a/retroshare-gui/src/gui/settings/ChatPage.h b/retroshare-gui/src/gui/settings/ChatPage.h
index 838fcc2ad..8f7048e2c 100644
--- a/retroshare-gui/src/gui/settings/ChatPage.h
+++ b/retroshare-gui/src/gui/settings/ChatPage.h
@@ -56,6 +56,17 @@ class ChatPage : public ConfigPage
void distantChatComboBoxChanged(int);
+ void updateFontsAndEmotes();
+ void updateChatParams();
+ void updateChatSearchParams();
+ void updateDefaultLobbyIdentity() ;
+ void updateHistoryParams();
+ void updatePublicStyle() ;
+ void updatePrivateStyle() ;
+ void updateHistoryStyle() ;
+ void updateHistoryStorage();
+ void updateChatFlags();
+ void updateChatLobbyFlags();
private:
void setPreviewMessages(QString &stylePath, QString styleVariant, QTextBrowser *textBrowser);
diff --git a/retroshare-gui/src/gui/settings/SoundPage.cpp b/retroshare-gui/src/gui/settings/SoundPage.cpp
index ef93c7679..8b3f79a39 100644
--- a/retroshare-gui/src/gui/settings/SoundPage.cpp
+++ b/retroshare-gui/src/gui/settings/SoundPage.cpp
@@ -46,6 +46,7 @@ SoundPage::SoundPage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.defaultButton, SIGNAL(clicked()), this, SLOT(defaultButtonClicked()));
connect(ui.browseButton, SIGNAL(clicked()), this, SLOT(browseButtonClicked()));
connect(ui.playButton, SIGNAL(clicked()), this, SLOT(playButtonClicked()));
+ connect(ui.eventTreeWidget, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(updateSounds()));
ui.eventTreeWidget->setColumnCount(COLUMN_COUNT);
@@ -100,7 +101,7 @@ QTreeWidgetItem *SoundPage::addItem(QTreeWidgetItem *groupItem, const QString &n
}
/** Saves the changes on this page */
-bool SoundPage::save(QString &/*errmsg*/)
+void SoundPage::updateSounds()
{
QTreeWidgetItemIterator itemIterator(ui.eventTreeWidget);
QTreeWidgetItem *item = NULL;
@@ -113,8 +114,6 @@ bool SoundPage::save(QString &/*errmsg*/)
SoundManager::setEventFilename(event, item->text(COLUMN_FILENAME));
}
}
-
- return true;
}
/** Loads the settings for this page */
diff --git a/retroshare-gui/src/gui/settings/SoundPage.h b/retroshare-gui/src/gui/settings/SoundPage.h
index 0fc8b315c..989fcc1a2 100644
--- a/retroshare-gui/src/gui/settings/SoundPage.h
+++ b/retroshare-gui/src/gui/settings/SoundPage.h
@@ -50,6 +50,7 @@ private slots:
void defaultButtonClicked();
void browseButtonClicked();
void playButtonClicked();
+ void updateSounds();
private:
QTreeWidgetItem *addGroup(const QString &name);
diff --git a/retroshare-gui/src/gui/settings/WebuiPage.cpp b/retroshare-gui/src/gui/settings/WebuiPage.cpp
index f8923a174..dc168057b 100644
--- a/retroshare-gui/src/gui/settings/WebuiPage.cpp
+++ b/retroshare-gui/src/gui/settings/WebuiPage.cpp
@@ -33,7 +33,7 @@ WebuiPage::~WebuiPage()
}
-bool WebuiPage::save(QString &errmsg)
+bool WebuiPage::updateParams(QString &errmsg)
{
std::cerr << "WebuiPage::save()" << std::endl;
bool ok = true;
@@ -153,7 +153,7 @@ void WebuiPage::onEnableCBClicked(bool checked)
void WebuiPage::onApplyClicked()
{
QString errmsg;
- bool ok = save(errmsg);
+ bool ok = updateParams(errmsg);
if(!ok)
{
QMessageBox::warning(0, tr("failed to start Webinterface"), "Failed to start the webinterface.");
diff --git a/retroshare-gui/src/gui/settings/WebuiPage.h b/retroshare-gui/src/gui/settings/WebuiPage.h
index 6d14500a5..c7e167ff8 100644
--- a/retroshare-gui/src/gui/settings/WebuiPage.h
+++ b/retroshare-gui/src/gui/settings/WebuiPage.h
@@ -45,6 +45,8 @@ private:
/** Qt Designer generated object */
Ui::WebuiPage ui;
+ bool updateParams(QString &errmsg);
+
static resource_api::ApiServer* apiServer;
static resource_api::ApiServerMHD* apiServerMHD;
#ifdef LIBRESAPI_LOCAL_SERVER
From a357c52124eca42d436751de995606ab07a2a02b Mon Sep 17 00:00:00 2001
From: csoler
Date: Tue, 31 Jan 2017 21:51:16 +0100
Subject: [PATCH 38/90] fixed a few things in options
---
libretroshare/src/services/p3gxsreputation.cc | 3 +--
.../src/gui/settings/AppearancePage.cpp | 18 +++++++++++-------
.../src/gui/settings/GeneralPage.cpp | 13 +++++++++++--
3 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/libretroshare/src/services/p3gxsreputation.cc b/libretroshare/src/services/p3gxsreputation.cc
index aa64bec14..bf3dabfcb 100644
--- a/libretroshare/src/services/p3gxsreputation.cc
+++ b/libretroshare/src/services/p3gxsreputation.cc
@@ -1063,9 +1063,8 @@ bool p3GxsReputation::saveList(bool& cleanup, std::list &savelist)
cleanup = true;
RsStackMutex stack(mReputationMtx); /****** LOCKED MUTEX *******/
-#ifdef DEBUG_REPUTATION
std::cerr << "p3GxsReputation::saveList()" << std::endl;
-#endif
+
/* save */
std::map::iterator it;
for(it = mConfig.begin(); it != mConfig.end(); ++it)
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.cpp b/retroshare-gui/src/gui/settings/AppearancePage.cpp
index 819997f25..f3157fb05 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.cpp
+++ b/retroshare-gui/src/gui/settings/AppearancePage.cpp
@@ -84,12 +84,12 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
ui.cmboStyleSheet->addItem(name, styleSheets[name]);
}
- connect(ui.cmboTollButtonsSize, SIGNAL(currentItemChanged(int)), this, SLOT(updateCmboToolButtonSize() ));
- connect(ui.cmboListItemSize, SIGNAL(currentItemChanged(int)), this, SLOT(updateCmboListItemSize() ));
- connect(ui.cmboTollButtonsStyle, SIGNAL(currentItemChanged(int)), this, SLOT(updateCmboToolButtonStyle()));
- connect(ui.cmboLanguage, SIGNAL(currentItemChanged(int)), this, SLOT(updateLanguageCode() ));
- connect(ui.cmboStyle, SIGNAL(currentItemChanged(int)), this, SLOT(updateInterfaceStyle() ));
- connect(ui.cmboStyleSheet, SIGNAL(currentItemChanged(int)), this, SLOT(updateSheetName() ));
+ connect(ui.cmboTollButtonsSize, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCmboToolButtonSize() ));
+ connect(ui.cmboListItemSize, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCmboListItemSize() ));
+ connect(ui.cmboTollButtonsStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCmboToolButtonStyle()));
+ connect(ui.cmboLanguage, SIGNAL(currentIndexChanged(int)), this, SLOT(updateLanguageCode() ));
+ connect(ui.cmboStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updateInterfaceStyle() ));
+ connect(ui.cmboStyleSheet, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSheetName() ));
connect(ui.rbtPageOnToolBar, SIGNAL(toggled(bool)), this, SLOT(updateRbtPageOnToolBar() ));
connect(ui.rbtActionOnToolBar, SIGNAL(toggled(bool)), this, SLOT(updateActionButtonLoc() ));
connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), this, SLOT(updateStatusToolTip() ));
@@ -122,7 +122,11 @@ void AppearancePage::switch_status(MainWindow::StatusElement s,const QString& ke
}
void AppearancePage::updateLanguageCode() { Settings->setLanguageCode(LanguageSupport::languageCode(ui.cmboLanguage->currentText())); }
-void AppearancePage::updateInterfaceStyle() { Settings->setInterfaceStyle(ui.cmboStyle->currentText()); }
+void AppearancePage::updateInterfaceStyle()
+{
+ Rshare::setStyle(ui.cmboStyle->currentText());
+ Settings->setInterfaceStyle(ui.cmboStyle->currentText());
+}
void AppearancePage::updateSheetName() { Settings->setSheetName(ui.cmboStyleSheet->itemData(ui.cmboStyleSheet->currentIndex()).toString()); }
void AppearancePage::updateRbtPageOnToolBar() { Settings->setPageButtonLoc(ui.rbtPageOnToolBar->isChecked());}
void AppearancePage::updateActionButtonLoc() { Settings->setActionButtonLoc(ui.rbtActionOnToolBar->isChecked()); }
diff --git a/retroshare-gui/src/gui/settings/GeneralPage.cpp b/retroshare-gui/src/gui/settings/GeneralPage.cpp
index a4a8b461d..deed5a031 100755
--- a/retroshare-gui/src/gui/settings/GeneralPage.cpp
+++ b/retroshare-gui/src/gui/settings/GeneralPage.cpp
@@ -82,8 +82,17 @@ GeneralPage::GeneralPage(QWidget * parent, Qt::WindowFlags flags) :
#endif // RS_AUTOLOGIN
/* Connect signals */
- connect(ui.runStartWizard_PB,SIGNAL(clicked()), this,SLOT(runStartWizard())) ;
- connect(ui.checkAdvanced,SIGNAL(toggled(bool)), this,SLOT(updateAdvancedMode())) ;
+ connect(ui.useLocalServer, SIGNAL(toggled(bool)), this,SLOT(updateUseLocalServer())) ;
+ connect(ui.idleSpinBox, SIGNAL(valueChanged(int)), this,SLOT(updateMaxTimeBeforeIdle())) ;
+ connect(ui.checkStartMinimized, SIGNAL(toggled(bool)), this,SLOT(updateStartMinimized())) ;
+ connect(ui.checkQuit, SIGNAL(toggled(bool)), this,SLOT(updateDoQuit())) ;
+ connect(ui.checkCloseToTray, SIGNAL(toggled(bool)), this,SLOT(updateCloseToTray())) ;
+ connect(ui.autoLogin, SIGNAL(toggled(bool)), this,SLOT(updateAutoLogin())) ;
+ connect(ui.chkRunRetroshareAtSystemStartup, SIGNAL(toggled(bool)), this,SLOT(updateRunRSOnBoot())) ;
+ connect(ui.chkRunRetroshareAtSystemStartupMinimized, SIGNAL(toggled(bool)), this,SLOT(updateRunRSOnBoot())) ;
+ connect(ui.runStartWizard_PB, SIGNAL(clicked()), this,SLOT(runStartWizard())) ;
+ connect(ui.checkAdvanced, SIGNAL(toggled(bool)), this,SLOT(updateAdvancedMode())) ;
+ connect(ui.registerRetroShareProtocol, SIGNAL(toggled(bool)), this,SLOT(updateRegisterRSProtocol())) ;
}
/** Destructor */
From 79ef4031f7d031fa8a5db38faf6cb4b3be4bc354 Mon Sep 17 00:00:00 2001
From: csoler
Date: Tue, 31 Jan 2017 23:07:59 +0100
Subject: [PATCH 39/90] tested/fixed all option buttons
---
.../src/gui/settings/AppearancePage.cpp | 28 ++-
.../src/gui/settings/AppearancePage.ui | 194 +++++++-----------
.../src/gui/settings/ChannelPage.cpp | 3 +-
.../src/gui/settings/MessagePage.cpp | 5 +-
.../gui/settings/ServicePermissionsPage.cpp | 16 +-
retroshare-gui/src/gui/settings/WebuiPage.cpp | 3 +
6 files changed, 111 insertions(+), 138 deletions(-)
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.cpp b/retroshare-gui/src/gui/settings/AppearancePage.cpp
index f3157fb05..92747816b 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.cpp
+++ b/retroshare-gui/src/gui/settings/AppearancePage.cpp
@@ -31,6 +31,7 @@
#include "AppearancePage.h"
#include "rsharesettings.h"
#include "gui/MainWindow.h"
+#include "gui/notifyqt.h"
#include "gui/statusbar/peerstatus.h"
#include "gui/statusbar/natstatus.h"
#include "gui/statusbar/dhtstatus.h"
@@ -90,9 +91,10 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.cmboLanguage, SIGNAL(currentIndexChanged(int)), this, SLOT(updateLanguageCode() ));
connect(ui.cmboStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updateInterfaceStyle() ));
connect(ui.cmboStyleSheet, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSheetName() ));
- connect(ui.rbtPageOnToolBar, SIGNAL(toggled(bool)), this, SLOT(updateRbtPageOnToolBar() ));
- connect(ui.rbtActionOnToolBar, SIGNAL(toggled(bool)), this, SLOT(updateActionButtonLoc() ));
connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), this, SLOT(updateStatusToolTip() ));
+
+ connect(ui.mainPageButtonType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(updateRbtPageOnToolBar() ));
+ connect(ui.menuItemsButtonType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(updateActionButtonLoc() ));
}
void AppearancePage::switch_status_grpStatus(bool b) { switch_status(MainWindow::StatusGrpStatus ,"ShowStatusBar", b) ; }
@@ -128,8 +130,16 @@ void AppearancePage::updateInterfaceStyle()
Settings->setInterfaceStyle(ui.cmboStyle->currentText());
}
void AppearancePage::updateSheetName() { Settings->setSheetName(ui.cmboStyleSheet->itemData(ui.cmboStyleSheet->currentIndex()).toString()); }
-void AppearancePage::updateRbtPageOnToolBar() { Settings->setPageButtonLoc(ui.rbtPageOnToolBar->isChecked());}
-void AppearancePage::updateActionButtonLoc() { Settings->setActionButtonLoc(ui.rbtActionOnToolBar->isChecked()); }
+void AppearancePage::updateRbtPageOnToolBar()
+{
+ Settings->setPageButtonLoc(!ui.mainPageButtonType_CB->currentIndex());
+ NotifyQt::getInstance()->notifySettingsChanged();
+}
+void AppearancePage::updateActionButtonLoc()
+{
+ Settings->setActionButtonLoc(!ui.menuItemsButtonType_CB->currentIndex());
+ NotifyQt::getInstance()->notifySettingsChanged();
+}
void AppearancePage::updateStatusToolTip() { MainWindow::getInstance()->toggleStatusToolTip(ui.checkBoxDisableSysTrayToolTip->isChecked()); }
void AppearancePage::updateCmboToolButtonStyle()
@@ -149,6 +159,7 @@ void AppearancePage::updateCmboToolButtonStyle()
default:
Settings->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
}
+ NotifyQt::getInstance()->notifySettingsChanged();
}
void AppearancePage::updateCmboToolButtonSize()
@@ -174,6 +185,7 @@ void AppearancePage::updateCmboToolButtonSize()
case 5:
Settings->setToolButtonSize(128);
}
+ NotifyQt::getInstance()->notifySettingsChanged();
}
void AppearancePage::updateCmboListItemSize()
{
@@ -198,6 +210,7 @@ void AppearancePage::updateCmboListItemSize()
case 5:
Settings->setListItemIconSize(128);
}
+ NotifyQt::getInstance()->notifySettingsChanged();
}
void AppearancePage::updateStyle() { Rshare::setStyle(ui.cmboStyle->currentText()); }
@@ -218,10 +231,9 @@ void AppearancePage::load()
}
ui.cmboStyleSheet->setCurrentIndex(index);
- ui.rbtPageOnToolBar->setChecked(Settings->getPageButtonLoc());
- ui.rbtPageOnListItem->setChecked(!Settings->getPageButtonLoc());
- ui.rbtActionOnToolBar->setChecked(Settings->getActionButtonLoc());
- ui.rbtActionOnListItem->setChecked(!Settings->getActionButtonLoc());
+ ui.mainPageButtonType_CB->setCurrentIndex(!Settings->getPageButtonLoc());
+ ui.menuItemsButtonType_CB->setCurrentIndex(!Settings->getActionButtonLoc());
+
switch (Settings->getToolButtonStyle())
{
case Qt::ToolButtonIconOnly:
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.ui b/retroshare-gui/src/gui/settings/AppearancePage.ui
index dface3903..f05634f8f 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.ui
+++ b/retroshare-gui/src/gui/settings/AppearancePage.ui
@@ -7,7 +7,7 @@
0
0
1160
- 608
+ 897
@@ -44,13 +44,6 @@
Language
- -
-
-
- Changes to language will only take effect after restarting RetroShare!
-
-
-
-
@@ -70,7 +63,7 @@
- -
+
-
Qt::Horizontal
@@ -83,6 +76,13 @@
+ -
+
+
+ (Needs restart)
+
+
+
@@ -198,124 +198,84 @@
Tool Bar
-
- -
-
-
- QFrame::StyledPanel
-
-
- QFrame::Plain
-
-
-
- 2
-
-
- 2
-
-
- 2
-
-
- 2
-
-
-
-
+
+
-
+
+
-
+
+
+ Main page items:
+
+
+
+ -
+
+
-
- On Tool Bar
+ Buttons
-
-
- -
-
+
+ -
- On List Ite&m
+ Item list
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 300
- 16
-
-
-
-
-
-
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 300
+ 16
+
+
+
+
+
- -
-
-
- Where do you want to have the buttons for menu?
-
-
-
- -
-
-
- QFrame::StyledPanel
-
-
- QFrame::Plain
-
-
-
- 2
-
-
- 2
-
-
- 2
-
-
- 2
-
-
-
-
+
-
+
+
-
+
+
+ Menu items:
+
+
+
+ -
+
+
-
- On Tool Bar
+ Buttons
-
-
- -
-
+
+ -
- On List Item
+ Item list
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 300
- 16
-
-
-
-
-
-
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 300
+ 16
+
+
+
+
+
- -
-
-
- Where do you want to have the buttons for the page?
-
-
-
- -
+
-
diff --git a/retroshare-gui/src/gui/settings/ChannelPage.cpp b/retroshare-gui/src/gui/settings/ChannelPage.cpp
index c0de1ac60..b58035a01 100644
--- a/retroshare-gui/src/gui/settings/ChannelPage.cpp
+++ b/retroshare-gui/src/gui/settings/ChannelPage.cpp
@@ -30,10 +30,9 @@ ChannelPage::ChannelPage(QWidget * parent, Qt::WindowFlags flags)
/* Initialize GroupFrameSettingsWidget */
ui.groupFrameSettingsWidget->setOpenAllInNewTabText(tr("Open each channel in a new tab"));
+ ui.groupFrameSettingsWidget->setType(GroupFrameSettings::Channel) ;
connect(ui.loadThreadCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateLoadThread)) ;
-
- ui.groupFrameSettingsWidget->setType(GroupFrameSettings::Channel) ;
}
void ChannelPage::updateLoadThread() { Settings->setChannelLoadThread(ui.loadThreadCheckBox->isChecked()); }
diff --git a/retroshare-gui/src/gui/settings/MessagePage.cpp b/retroshare-gui/src/gui/settings/MessagePage.cpp
index 14ab9791d..1aa4509f0 100644
--- a/retroshare-gui/src/gui/settings/MessagePage.cpp
+++ b/retroshare-gui/src/gui/settings/MessagePage.cpp
@@ -53,10 +53,7 @@ MessagePage::MessagePage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.setMsgToReadOnActivate,SIGNAL(toggled(bool)), this,SLOT(updateMsgToReadOnActivate()));
connect(ui.loadEmbeddedImages, SIGNAL(toggled(bool)), this,SLOT(updateLoadEmbededImages() ));
- connect(ui.openComboBox, SIGNAL(currentItemChanged(int)),this,SLOT(updateMsgOpen() ));
- connect(ui.comboBox, SIGNAL(currebtItemChanged(int)),this,SLOT(updateDistantMsgs() ));
-
- connect(ui.comboBox, SIGNAL(currebtItemChanged(int)),this,SLOT(updateMsgTags() ));
+ connect(ui.openComboBox, SIGNAL(currentIndexChanged(int)),this,SLOT(updateMsgOpen() ));
}
MessagePage::~MessagePage()
diff --git a/retroshare-gui/src/gui/settings/ServicePermissionsPage.cpp b/retroshare-gui/src/gui/settings/ServicePermissionsPage.cpp
index 5ded8fb80..d608c24af 100644
--- a/retroshare-gui/src/gui/settings/ServicePermissionsPage.cpp
+++ b/retroshare-gui/src/gui/settings/ServicePermissionsPage.cpp
@@ -31,16 +31,18 @@
ServicePermissionsPage::ServicePermissionsPage(QWidget * parent, Qt::WindowFlags flags) :
ConfigPage(parent, flags)
{
- /* Invoke the Qt Designer generated object setup routine */
- ui.setupUi(this);
+ /* Invoke the Qt Designer generated object setup routine */
+ ui.setupUi(this);
- connect(ui.cb_hideOffline, SIGNAL(toggled(bool)), ui.frame, SLOT(setHideOffline(bool)));
- //QObject::connect(ui.tableWidget,SIGNAL(itemChanged(QTableWidgetItem *)), this, SLOT(tableItemChanged(QTableWidgetItem *)));
+ ui.cb_hideOffline->setChecked(true);
- ui.frame->setHideOffline(ui.cb_hideOffline->isChecked());
+ connect(ui.cb_hideOffline, SIGNAL(toggled(bool)), ui.frame, SLOT(setHideOffline(bool)));
+ //QObject::connect(ui.tableWidget,SIGNAL(itemChanged(QTableWidgetItem *)), this, SLOT(tableItemChanged(QTableWidgetItem *)));
- // Not implemented?
- ui.pushButton->hide();
+ ui.frame->setHideOffline(ui.cb_hideOffline->isChecked());
+
+ // Not implemented?
+ ui.pushButton->hide();
}
QString ServicePermissionsPage::helpText() const
diff --git a/retroshare-gui/src/gui/settings/WebuiPage.cpp b/retroshare-gui/src/gui/settings/WebuiPage.cpp
index dc168057b..4afad5968 100644
--- a/retroshare-gui/src/gui/settings/WebuiPage.cpp
+++ b/retroshare-gui/src/gui/settings/WebuiPage.cpp
@@ -148,6 +148,9 @@ void WebuiPage::onEnableCBClicked(bool checked)
ui.params_GB->setEnabled(false);
ui.applyStartBrowser_PB->setEnabled(false);
}
+
+ QString S;
+ updateParams(S);
}
void WebuiPage::onApplyClicked()
From 2a36d6bad02cbde333cf28830465381a026b2b9c Mon Sep 17 00:00:00 2001
From: csoler
Date: Wed, 1 Feb 2017 21:55:06 +0100
Subject: [PATCH 40/90] re-working on the node creation wizard (unfinished)
---
retroshare-gui/src/gui/GenCertDialog.cpp | 228 ++---
retroshare-gui/src/gui/GenCertDialog.h | 3 +-
retroshare-gui/src/gui/GenCertDialog.ui | 1086 +++++++++++-----------
3 files changed, 597 insertions(+), 720 deletions(-)
diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp
index d9b2c7c75..e11fcdb04 100644
--- a/retroshare-gui/src/gui/GenCertDialog.cpp
+++ b/retroshare-gui/src/gui/GenCertDialog.cpp
@@ -136,48 +136,31 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
ui.headerFrame->setHeaderImage(QPixmap(":/icons/svg/profile.svg"));
ui.headerFrame->setHeaderText(tr("Create a new profile"));
- connect(ui.new_gpg_key_checkbox, SIGNAL(clicked()), this, SLOT(newGPGKeyGenUiSetup()));
- connect(ui.adv_checkbox, SIGNAL(clicked()), this, SLOT(updateUiSetup()));
- connect(ui.hidden_checkbox, SIGNAL(clicked()), this, SLOT(updateUiSetup()));
+ connect(ui.reuse_existing_node_CB, SIGNAL(clicked()), this, SLOT(setupState()));
+ connect(ui.adv_checkbox, SIGNAL(clicked()), this, SLOT(setupState()));
+ connect(ui.nodeType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(setupState()));
connect(ui.genButton, SIGNAL(clicked()), this, SLOT(genPerson()));
connect(ui.importIdentity_PB, SIGNAL(clicked()), this, SLOT(importIdentity()));
connect(ui.exportIdentity_PB, SIGNAL(clicked()), this, SLOT(exportIdentity()));
- //ui.genName->setFocus(Qt::OtherFocusReason);
-
-// QObject *obj = QCoreApplication::eventFilter() ;
-// std::cerr << "Event filter : " << obj << std::endl;
-// QCoreApplication::instance()->setEventFilter(MyEventFilter) ;
-
entropy_timer = new QTimer ;
entropy_timer->start(20) ;
QObject::connect(entropy_timer,SIGNAL(timeout()),this,SLOT(grabMouse())) ;
-// EntropyCollectorWidget *ecw = new EntropyCollectorWidget(ui.entropy_bar,this) ;
-// ecw->resize(size()) ;
-// ecw->move(0,0) ;
-//
-// QGraphicsOpacityEffect *effect = new QGraphicsOpacityEffect ;
-// effect->setOpacity(0.2) ;
-// ecw->setGraphicsEffect(effect) ;
- //ecw->setBackgroundColor(QColor::fromRGB(1,1,1)) ;
-// ecw->show() ;
-
ui.entropy_bar->setValue(0) ;
// make sure that QVariant always takes an 'int' otherwise the program will crash!
- ui.keylength_comboBox->addItem("default (2048 bits, recommended)", QVariant(2048));
- ui.keylength_comboBox->addItem("high (3072 bits)", QVariant(3072));
- ui.keylength_comboBox->addItem("insane (4096 bits)", QVariant(4096));
+ ui.keylength_comboBox->addItem("Default (2048 bits, recommended)", QVariant(2048));
+ ui.keylength_comboBox->addItem("High (3072 bits)", QVariant(3072));
+ ui.keylength_comboBox->addItem("Very high (4096 bits)", QVariant(4096));
#if QT_VERSION >= 0x040700
- ui.email_input->setPlaceholderText(tr("[Optional] Visible to your friends, and friends of friends.")) ;
ui.node_input->setPlaceholderText(tr("[Required] Examples: Home, Laptop,...")) ;
ui.hiddenaddr_input->setPlaceholderText(tr("[Required] Tor/I2P address - Examples: xa76giaf6ifda7ri63i263.onion (obtained by you from Tor)")) ;
ui.name_input->setPlaceholderText(tr("[Required] Visible to your friends, and friends of friends."));
ui.nickname_input->setPlaceholderText(tr("[Optional] Used when you write in chat lobbies, forums and channel comments. Can be setup later if you need one."));
- ui.password_input->setPlaceholderText(tr("[Required] This password protects your private PGP key."));
+ ui.password_input->setPlaceholderText(tr("[Required] This password protects your node key."));
ui.password_input_2->setPlaceholderText(tr("[Required] Type the same password again here."));
#endif
@@ -185,9 +168,6 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
ui.node_input->setToolTip(tr("Enter a meaningful node description. e.g. : home, laptop, etc. \nThis field will be used to differentiate different installations with\nthe same profile (PGP key pair).")) ;
- ui.email_input->hide() ;
- ui.email_label->hide() ;
-
/* get all available pgp private certificates....
* mark last one as default.
*/
@@ -231,7 +211,7 @@ void GenCertDialog::init()
if (haveGPGKeys) {
ui.no_gpg_key_label->hide();
ui.header_label->show();
- ui.new_gpg_key_checkbox->setChecked(false);
+ ui.reuse_existing_node_CB->setChecked(false);
setWindowTitle(tr("Create new node"));
ui.genButton->setText(tr("Generate new node"));
ui.headerFrame->setHeaderText(tr("Create a new node"));
@@ -239,8 +219,8 @@ void GenCertDialog::init()
} else {
ui.no_gpg_key_label->setVisible(!mOnlyGenerateIdentity);
ui.header_label->setVisible(mOnlyGenerateIdentity);
- ui.new_gpg_key_checkbox->setChecked(true);
- ui.new_gpg_key_checkbox->setEnabled(true);
+ ui.reuse_existing_node_CB->setChecked(true);
+ ui.reuse_existing_node_CB->setEnabled(true);
setWindowTitle(tr("Create new profile"));
ui.genButton->setText(tr("Generate new profile and node"));
ui.headerFrame->setHeaderText(tr("Create a new profile and node"));
@@ -263,7 +243,7 @@ void GenCertDialog::init()
}
ui.header_label->setText(text);
#endif
- newGPGKeyGenUiSetup();
+ setupState();
//updateUiSetup();
}
@@ -274,152 +254,62 @@ void GenCertDialog::mouseMoveEvent(QMouseEvent *e)
QDialog::mouseMoveEvent(e) ;
}
-void GenCertDialog::newGPGKeyGenUiSetup() {
- bool adv_state = ui.adv_checkbox->isChecked();
- bool hidden_state = ui.hidden_checkbox->isChecked();
+void GenCertDialog::setupState()
+{
+ bool adv_state = ui.adv_checkbox->isChecked();
+ bool hidden_state = ui.nodeType_CB->currentIndex()==1;
+ bool generate_new = !ui.reuse_existing_node_CB->isChecked();
+
+ genNewGPGKey = generate_new;
+
ui.no_node_label->setVisible(false);
- if (ui.new_gpg_key_checkbox->isChecked()) {
- genNewGPGKey = true;
- setWindowTitle(tr("Create new profile"));
- ui.headerFrame->setHeaderText(tr("Create a new profile and node"));
- if (!mOnlyGenerateIdentity) {
- ui.header_label->setVisible(haveGPGKeys);
- }
- ui.genprofileinfo_label->setVisible(false);
- ui.no_gpg_key_label->setText(tr("Welcome to Retroshare. Before you can proceed you need to create a profile and associate a node with it. To do so please fill out this form.\nAlternatively you can import a (previously exported) profile. Just uncheck \"Create a new profile\""));
+ setWindowTitle(generate_new?tr("Create new profile and node"):tr("Create new node"));
+ ui.headerFrame->setHeaderText(generate_new?tr("Create a new profile and node"):tr("Create a new node"));
- ui.importIdentity_PB->hide() ;
- ui.exportIdentity_PB->hide();
- ui.adv_checkbox->setVisible(true);
+ ui.label_nodeType->setVisible(adv_state) ;
+ ui.nodeType_CB->setVisible(adv_state) ;
+ ui.reuse_existing_node_CB->setVisible(adv_state) ;
+ ui.importIdentity_PB->setVisible(adv_state) ;
+ ui.exportIdentity_PB->setVisible(adv_state) ;
- ui.genPGPuserlabel->hide();
- ui.genPGPuser->hide();
- ui.name_label->show();
- ui.name_input->show();
- ui.nickname_label->setVisible(!mOnlyGenerateIdentity);
- ui.nickname_input->setVisible(!mOnlyGenerateIdentity);
- ui.node_label->setVisible(true);
- ui.node_input->setVisible(true);
-// ui.email_label->show();
-// ui.email_input->show();
- ui.password_label->show();
- ui.password_label_2->show();
- ui.password_input->show();
- ui.password_input_2->show();
- //ui.keylength_label->show();
- //ui.keylength_comboBox->show();
+ ui.genPGPuser->setVisible(adv_state && haveGPGKeys) ;
- ui.entropy_label->setVisible(true);
- ui.entropy_bar->setVisible(true);
+ ui.genprofileinfo_label->setVisible(false);
+ ui.no_gpg_key_label->setText(tr("Welcome to Retroshare. Before you can proceed you need to create a profile and associate a node with it. To do so please fill out this form.\nAlternatively you can import a (previously exported) profile. Just uncheck \"Create a new profile\""));
+ ui.no_gpg_key_label->setVisible(false);
- ui.genButton->setVisible(true);
- ui.genButton->setText(tr("Generate new profile and node"));
- } else {
- genNewGPGKey = false;
- setWindowTitle(tr("Create new node"));
- ui.headerFrame->setHeaderText(tr("Create a new node"));
- ui.header_label->setVisible(false);
- //haveGPGKeys = (ui.genPGPuser->count() != 0)?true:false;
- if (haveGPGKeys) {
- QVariant data = ui.genPGPuser->itemData(ui.genPGPuser->currentIndex());
- if (!rsAccounts->selectAccountByString(data.toString().toStdString())) {
- ui.no_node_label->setText(tr("No node is associated with the profile named") + " " + ui.genPGPuser->currentText() + ". " +tr("Please create a node for it by providing a node name."));
- ui.no_node_label->setVisible(true);
- } else {
- ui.genprofileinfo_label->show();
- }
- }
- //ui.genprofileinfo_label->show();
- ui.no_gpg_key_label->setText(tr("Welcome to Retroshare. Before you can proceed you need to import a profile and after that associate a node with it."));
+ ui.nickname_label->setVisible(adv_state) ;
+ ui.nickname_input->setVisible(adv_state) ;
- ui.importIdentity_PB->setVisible(!mOnlyGenerateIdentity);
- ui.exportIdentity_PB->setVisible(haveGPGKeys);
- ui.exportIdentity_PB->setEnabled(haveGPGKeys);
- ui.adv_checkbox->setVisible(haveGPGKeys);
- ui.adv_checkbox->setChecked(haveGPGKeys && adv_state);
+ ui.name_label->setVisible(!generate_new);
+ ui.name_input->setVisible(!generate_new);
- //ui.genPGPuserlabel->show();
- //ui.genPGPuser->show();
- ui.genPGPuserlabel->setVisible(haveGPGKeys);
- ui.genPGPuser->setVisible(haveGPGKeys);
- ui.name_label->hide();
- ui.name_input->hide();
- ui.nickname_label->setVisible(!mOnlyGenerateIdentity && haveGPGKeys);
- ui.nickname_input->setVisible(!mOnlyGenerateIdentity && haveGPGKeys);
- ui.node_label->setVisible(haveGPGKeys);
- ui.node_input->setVisible(haveGPGKeys);
-// ui.email_label->hide();
-// ui.email_input->hide();
- ui.password_label->hide();
- ui.password_input->hide();
- ui.password_label_2->hide();
- ui.password_input_2->hide();
- ui.keylength_label->hide();
- ui.keylength_comboBox->hide();
+ ui.nickname_label->setVisible(adv_state && !mOnlyGenerateIdentity);
+ ui.nickname_input->setVisible(adv_state && !mOnlyGenerateIdentity);
- ui.entropy_label->setVisible(haveGPGKeys);
- ui.entropy_bar->setVisible(haveGPGKeys);
+ ui.node_label->setVisible(true);
+ ui.node_input->setVisible(true);
- ui.genButton->setText(tr("Generate new node"));
- ui.genButton->setVisible(haveGPGKeys);
- }
- updateUiSetup();
- ui.adv_checkbox->setChecked(adv_state);
- ui.hidden_checkbox->setChecked(hidden_state);
-}
+ ui.password_label->setVisible(true);
+ ui.password_label_2->setVisible(true);
+ ui.password_input->setVisible(true);
+ ui.password_input_2->setVisible(true);
-void GenCertDialog::updateUiSetup()
-{
- if (ui.adv_checkbox->isChecked())
- {
- ui.hidden_checkbox->show();
+ ui.keylength_label->setVisible(adv_state);
+ ui.keylength_comboBox->setVisible(adv_state);
- if (ui.new_gpg_key_checkbox->isChecked())
- {
- // key length is only for pgp key creation
- ui.keylength_label->show();
- ui.keylength_comboBox->show();
- }
- else
- {
- ui.keylength_label->hide();
- ui.keylength_comboBox->hide();
- }
+ ui.entropy_label->setVisible(true);
+ ui.entropy_bar->setVisible(true);
- if(ui.hidden_checkbox->isChecked())
- {
- ui.hiddenaddr_input->show();
- ui.hiddenaddr_label->show();
- ui.label_hiddenaddr->show();
- ui.hiddenport_label->show();
- ui.hiddenport_spinBox->show();
- }
- else
- {
- ui.hiddenaddr_input->hide();
- ui.hiddenaddr_label->hide();
- ui.label_hiddenaddr->hide();
- ui.hiddenport_label->hide();
- ui.hiddenport_spinBox->hide();
- }
- }
- else
- {
- ui.hiddenaddr_input->hide();
- ui.hiddenaddr_label->hide();
- ui.label_hiddenaddr->hide();
- ui.hiddenport_label->hide();
- ui.hiddenport_spinBox->hide();
-
- ui.hidden_checkbox->hide();
- ui.keylength_label->hide();
- ui.keylength_comboBox->hide();
-
- if(ui.hidden_checkbox->isChecked())
- ui.hidden_checkbox->setChecked(false) ;
- }
+ ui.genButton->setVisible(true);
+ ui.genButton->setText(generate_new?tr("Generate new profile and node"):tr("Generate new node"));
+ ui.hiddenaddr_input->setVisible(hidden_state);
+ ui.hiddenaddr_label->setVisible(hidden_state);
+ ui.label_hiddenaddr->setVisible(hidden_state);
+ ui.hiddenport_label->setVisible(hidden_state);
+ ui.hiddenport_spinBox->setVisible(hidden_state);
}
void GenCertDialog::exportIdentity()
@@ -498,7 +388,7 @@ void GenCertDialog::genPerson()
}
}
- if (ui.hidden_checkbox->isChecked())
+ if (ui.nodeType_CB->currentIndex()==1)
{
std::string hl = ui.hiddenaddr_input->text().toStdString();
uint16_t port = ui.hiddenport_spinBox->value();
@@ -555,27 +445,25 @@ void GenCertDialog::genPerson()
}
//generate a new gpg key
std::string err_string;
- ui.no_gpg_key_label->setText(tr("Generating new PGP key pair, please be patient: this process needs generating large prime numbers, and can take some minutes on slow computers. \n\nFill in your PGP password when asked, to sign your new key."));
+ ui.no_gpg_key_label->setText(tr("Generating new node key, please be patient: this process needs generating large prime numbers, and can take some minutes on slow computers. \n\nFill in your password when asked, to sign your new key."));
ui.no_gpg_key_label->show();
- ui.new_gpg_key_checkbox->hide();
+ ui.reuse_existing_node_CB->hide();
ui.name_label->hide();
ui.name_input->hide();
ui.nickname_label->hide();
ui.nickname_input->hide();
-// ui.email_label->hide();
-// ui.email_input->hide();
ui.password_label_2->hide();
ui.password_input_2->hide();
ui.password_label->hide();
ui.password_input->hide();
- ui.genPGPuserlabel->hide();
+ //ui.genPGPuserlabel->hide();
ui.genPGPuser->hide();
ui.node_label->hide();
ui.node_input->hide();
ui.genButton->hide();
ui.importIdentity_PB->hide();
ui.genprofileinfo_label->hide();
- ui.hidden_checkbox->hide();
+ ui.nodeType_CB->hide();
ui.adv_checkbox->hide();
ui.keylength_label->hide();
ui.keylength_comboBox->hide();
diff --git a/retroshare-gui/src/gui/GenCertDialog.h b/retroshare-gui/src/gui/GenCertDialog.h
index c66445ebb..f84d29f17 100644
--- a/retroshare-gui/src/gui/GenCertDialog.h
+++ b/retroshare-gui/src/gui/GenCertDialog.h
@@ -41,9 +41,8 @@ private slots:
void genPerson();
void importIdentity();
void exportIdentity();
- void newGPGKeyGenUiSetup();
+ void setupState();
void grabMouse();
- void updateUiSetup();
private:
void init();
diff --git a/retroshare-gui/src/gui/GenCertDialog.ui b/retroshare-gui/src/gui/GenCertDialog.ui
index 0229cf023..06c17f778 100644
--- a/retroshare-gui/src/gui/GenCertDialog.ui
+++ b/retroshare-gui/src/gui/GenCertDialog.ui
@@ -6,8 +6,8 @@
0
0
- 855
- 572
+ 1745
+ 1193
@@ -60,196 +60,24 @@
QFrame::Raised
-
-
-
-
-
- No node exists for this profile.
-
-
- true
-
-
-
- -
-
-
- It looks like no profile (PGP keys) exists. Please fill in the form below to create one, or import an existing profile.
-
-
- true
-
-
-
- -
-
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
-
- true
-
-
- QFrame::Box
-
-
- You can create and run Retroshare nodes on different computers using the same profile. To do so just export the selected profile, import it on the other computer and create a new node with it.
-
-
- true
-
-
-
- -
-
-
-
-
-
- Use profile
+
+
-
+
+
-
+
+
+ Qt::Horizontal
-
-
- -
-
-
+
- 0
- 0
+ 40
+ 20
-
- 64
-
-
+
- -
-
-
- Node name
-
-
-
- -
-
-
- This password is for PGP
-
-
- Confirm
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Put a strong password here. This password protects your private PGP key.
-
-
-
-
-
- 1024
-
-
- QLineEdit::Password
-
-
-
- -
-
-
- Your profile is associated with a PGP key pair. RetroShare currently ignores DSA keys.
-
-
-
- -
-
-
- Name
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 0
- 0
-
-
+
-
+
16777215
@@ -257,371 +85,42 @@
- Enter your nickname here
-
-
- 64
-
-
-
- -
-
-
-
+ <html><head/><body><p>Use this if you need to import an existing profile, if you want to generate a new node with an already existing key, or if you want to create a TOR/I2P hidden node.</p></body></html>
- Nickname
+ Advanced options
-
-
- -
-
-
- You can have one or more identities. They are used when you write in chat lobbies, forums and channel comments. They act as the destination for distant chat and the Retroshare distant mail system.
+
+
+ :/icons/settings/general.svg:/icons/settings/general.svg
-
-
- -
-
-
- Email
-
-
-
- -
-
-
- Be careful: this email will be visible to your friends and friends
-of your friends. This information is required by PGP, but to stay
-anonymous, you can use a fake email.
-
-
- 64
-
-
-
- -
-
-
- This password is for PGP
-
-
- Password
-
-
-
- -
-
-
- Put a strong password here. This password protects your private PGP key.
-
-
-
-
-
- 1024
-
-
- QLineEdit::Password
-
-
-
- -
-
-
- hidden address
-
-
-
- -
-
-
- 6
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 16777215
- 32
-
-
-
- 64
-
-
-
- -
-
-
- Port
-
-
-
- -
-
-
- <html><head/><body><p>This is your connection port.</p><p>Any value between 1024 and 65535 </p><p>should be ok. You can change it later.</p></body></html>
-
-
- 1
-
-
- 65535
-
-
- 7812
-
-
-
-
-
- -
-
-
- <html><head/><body><p>This can be a Tor Onion address of the form: xa76giaf6ifda7ri63i263.onion <br/>or an I2P address in the form: [52 characters].b32.i2p </p><p>In order to get one, you must configure either Tor or I2P to create a new hidden service / server tunnel. If you do not yet have one, you can still go on, and make it right later in RetroShare's Options->Network->Hidden Service configuration panel.</p></body></html>
-
-
- true
-
-
-
- -
-
-
- PGP key length
-
-
-
- -
-
-
- -
-
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
-
- true
-
-
- QFrame::Box
-
-
- <html><head/><body><p align="justify">Before proceeding, move your mouse around to help Retroshare collect as much randomness as possible. Filling the progressbar to 20% is needed, 100% is advised.</p></body></html>
-
-
- true
-
-
-
- -
-
-
- 24
-
-
-
- -
-
-
-
-
-
-
- 16777215
- 32
-
-
-
- Your profile is associated with a PGP key pair
-
-
- Create a new profile
-
-
-
- :/icons/svg/profile.svg:/icons/svg/profile.svg
-
-
-
- 32
- 32
-
-
-
- false
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Import new profile
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Export selected profile
-
-
-
- -
-
-
-
- 16777215
- 32
-
-
-
- Your profile is associated with a PGP key pair
-
-
- Advanced options
-
-
-
- :/icons/settings/general.svg:/icons/settings/general.svg
-
-
-
- 24
- 24
-
-
-
- false
-
-
-
- -
-
-
- Create a hidden node
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
- -
-
-
+
- 16777215
- 26
+ 24
+ 24
-
-
- 50
- false
-
-
-
-
-
-
- Create new profile
+
+ false
- -
+
-
+
+
+
+
+
+ :/images/logo/logo_splash.png
+
+
+ Qt::AlignCenter
+
+
+
+ -
@@ -702,6 +201,505 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
+ -
+
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+ 255
+ 255
+ 178
+
+
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+ 255
+ 255
+ 178
+
+
+
+
+
+
+
+
+ 255
+ 255
+ 178
+
+
+
+
+
+
+ 255
+ 255
+ 178
+
+
+
+
+
+
+
+ true
+
+
+ QFrame::Box
+
+
+ You can create and run Retroshare nodes on different computers using the same profile. To do so just export the selected profile, import it on the other computer and create a new node with it.
+
+
+ true
+
+
+
+ -
+
+
+ It looks like no profile (PGP keys) exists. Please fill in the form below to create one, or import an existing profile.
+
+
+ true
+
+
+
+ -
+
+
+ No node exists for this profile.
+
+
+ true
+
+
+
+ -
+
+
-
+
+
+ Node type
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ This password is for PGP
+
+
+ Password (check)
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Put a strong password here. This password protects your private PGP key.
+
+
+
+
+
+ 1024
+
+
+ QLineEdit::Password
+
+
+
+ -
+
+
+ Profile name
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ 24
+
+
+
+ -
+
+
+ You can have one or more identities. They are used when you write in chat lobbies, forums and channel comments. They act as the destination for distant chat and the Retroshare distant mail system.
+
+
+
+ -
+
+
+
+
+
+ Chat identity
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ This password is for PGP
+
+
+ Password
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ -
+
+
+ Put a strong password here. This password protects your private PGP key.
+
+
+
+
+
+ 1024
+
+
+ QLineEdit::Password
+
+
+
+ -
+
+
+ hidden address
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ 6
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 16777215
+ 32
+
+
+
+ 64
+
+
+
+ -
+
+
+ Port
+
+
+
+ -
+
+
+ <html><head/><body><p>This is your connection port.</p><p>Any value between 1024 and 65535 </p><p>should be ok. You can change it later.</p></body></html>
+
+
+ 1
+
+
+ 65535
+
+
+ 7812
+
+
+
+
+
+ -
+
+
+ <html><head/><body><p>This can be a Tor Onion address of the form: xa76giaf6ifda7ri63i263.onion <br/>or an I2P address in the form: [52 characters].b32.i2p </p><p>In order to get one, you must configure either Tor or I2P to create a new hidden service / server tunnel. If you do not yet have one, you can still go on, and make it right later in RetroShare's Options->Network->Hidden Service configuration panel.</p></body></html>
+
+
+ true
+
+
+
+ -
+
+
+ PGP key length
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+ 255
+ 255
+ 178
+
+
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+ 255
+ 255
+ 178
+
+
+
+
+
+
+
+
+ 255
+ 255
+ 178
+
+
+
+
+
+
+ 255
+ 255
+ 178
+
+
+
+
+
+
+
+ true
+
+
+ QFrame::Box
+
+
+ <html><head/><body><p align="justify">Before proceeding, move your mouse around to help Retroshare collect as much randomness as possible. Filling the progressbar to 20% is needed, 100% is advised.</p></body></html>
+
+
+ true
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ 64
+
+
+
+ -
+
+
+
+
+
+ Go!
+
+
+
+ -
+
+
-
+
+ Standard node
+
+
+ -
+
+ TOR/I2P Hidden node
+
+
+
+
+ -
+
+
+ Node name
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 16777215
+ 32
+
+
+
+ Enter your nickname here
+
+
+
+
+
+ 64
+
+
+
+ -
+
+
+ Your profile is associated with a PGP key pair. RetroShare currently ignores DSA keys.
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Export this profle
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Import new profile
+
+
+
+ -
+
+
+ Re-use existing profile
+
+
+
+
+
+
+
@@ -734,17 +732,9 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
- new_gpg_key_checkbox
- importIdentity_PB
- exportIdentity_PB
- adv_checkbox
- genPGPuser
- name_input
nickname_input
- email_input
password_input
password_input_2
- node_input
hiddenaddr_input
hiddenport_spinBox
From 89a27aef8a0d2b5f8d3257ee8b2aae7733f5ac2d Mon Sep 17 00:00:00 2001
From: csoler
Date: Wed, 1 Feb 2017 23:08:57 +0100
Subject: [PATCH 41/90] finished new profile creation window
---
retroshare-gui/src/gui/GenCertDialog.cpp | 117 +++++++---------
retroshare-gui/src/gui/GenCertDialog.h | 5 +-
retroshare-gui/src/gui/GenCertDialog.ui | 162 +++++++++++------------
3 files changed, 133 insertions(+), 151 deletions(-)
diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp
index e11fcdb04..12aeb937d 100644
--- a/retroshare-gui/src/gui/GenCertDialog.cpp
+++ b/retroshare-gui/src/gui/GenCertDialog.cpp
@@ -136,7 +136,7 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
ui.headerFrame->setHeaderImage(QPixmap(":/icons/svg/profile.svg"));
ui.headerFrame->setHeaderText(tr("Create a new profile"));
- connect(ui.reuse_existing_node_CB, SIGNAL(clicked()), this, SLOT(setupState()));
+ connect(ui.reuse_existing_node_CB, SIGNAL(clicked()), this, SLOT(switchReuseExistingNode()));
connect(ui.adv_checkbox, SIGNAL(clicked()), this, SLOT(setupState()));
connect(ui.nodeType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(setupState()));
@@ -172,7 +172,8 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
* mark last one as default.
*/
- init();
+ initKeyList();
+ setupState();
}
GenCertDialog::~GenCertDialog()
@@ -180,7 +181,21 @@ GenCertDialog::~GenCertDialog()
entropy_timer->stop() ;
}
-void GenCertDialog::init()
+void GenCertDialog::switchReuseExistingNode()
+{
+ if(ui.reuse_existing_node_CB->isChecked())
+ {
+ // import an existing identity if needed. If none is available, keep the box unchecked.
+
+ if(!haveGPGKeys && !importIdentity())
+ ui.reuse_existing_node_CB->setChecked(false);
+ }
+
+ initKeyList();
+ setupState();
+}
+
+void GenCertDialog::initKeyList()
{
std::cerr << "Finding PGPUsers" << std::endl;
@@ -189,62 +204,19 @@ void GenCertDialog::init()
std::list pgpIds;
std::list::iterator it;
haveGPGKeys = false;
-#ifdef TO_REMOVE
- /* replace with true/false below */
- if (!mOnlyGenerateIdentity) {
-#endif
- if (RsAccounts::GetPGPLogins(pgpIds)) {
- for(it = pgpIds.begin(); it != pgpIds.end(); ++it)
- {
- QVariant userData(QString::fromStdString( (*it).toStdString() ));
- std::string name, email;
- RsAccounts::GetPGPLoginDetails(*it, name, email);
- std::cerr << "Adding PGPUser: " << name << " id: " << *it << std::endl;
- QString gid = QString::fromStdString( (*it).toStdString()).right(8) ;
- ui.genPGPuser->addItem(QString::fromUtf8(name.c_str()) + " <" + QString::fromUtf8(email.c_str()) + "> (" + gid + ")", userData);
- haveGPGKeys = true;
- }
+
+ if (RsAccounts::GetPGPLogins(pgpIds)) {
+ for(it = pgpIds.begin(); it != pgpIds.end(); ++it)
+ {
+ QVariant userData(QString::fromStdString( (*it).toStdString() ));
+ std::string name, email;
+ RsAccounts::GetPGPLoginDetails(*it, name, email);
+ std::cerr << "Adding PGPUser: " << name << " id: " << *it << std::endl;
+ QString gid = QString::fromStdString( (*it).toStdString()).right(8) ;
+ ui.genPGPuser->addItem(QString::fromUtf8(name.c_str()) + " <" + QString::fromUtf8(email.c_str()) + "> (" + gid + ")", userData);
+ haveGPGKeys = true;
}
-#ifdef TO_REMOVE
}
-#endif
- if (haveGPGKeys) {
- ui.no_gpg_key_label->hide();
- ui.header_label->show();
- ui.reuse_existing_node_CB->setChecked(false);
- setWindowTitle(tr("Create new node"));
- ui.genButton->setText(tr("Generate new node"));
- ui.headerFrame->setHeaderText(tr("Create a new node"));
- genNewGPGKey = false;
- } else {
- ui.no_gpg_key_label->setVisible(!mOnlyGenerateIdentity);
- ui.header_label->setVisible(mOnlyGenerateIdentity);
- ui.reuse_existing_node_CB->setChecked(true);
- ui.reuse_existing_node_CB->setEnabled(true);
- setWindowTitle(tr("Create new profile"));
- ui.genButton->setText(tr("Generate new profile and node"));
- ui.headerFrame->setHeaderText(tr("Create a new profile and node"));
- genNewGPGKey = true;
- }
-
-#ifdef TO_REMOVE
- QString text; /* = ui.header_label->text() + "\n";*/
- text += tr("You can create a new profile with this form.");
-
- if (mOnlyGenerateIdentity) {
- ui.new_gpg_key_checkbox->setChecked(true);
- ui.new_gpg_key_checkbox->hide();
-#endif
- ui.genprofileinfo_label->hide();
-#ifdef TO_REMOVE
- } else {
- text += "\n";
- text += tr("Alternatively you can use an existing profile. Just uncheck \"Create a new profile\"");
- }
- ui.header_label->setText(text);
-#endif
- setupState();
- //updateUiSetup();
}
void GenCertDialog::mouseMoveEvent(QMouseEvent *e)
@@ -257,6 +229,13 @@ void GenCertDialog::mouseMoveEvent(QMouseEvent *e)
void GenCertDialog::setupState()
{
bool adv_state = ui.adv_checkbox->isChecked();
+
+ if(!adv_state)
+ {
+ ui.reuse_existing_node_CB->setChecked(false) ;
+ ui.nodeType_CB->setCurrentIndex(0) ;
+ ui.keylength_comboBox->setCurrentIndex(0) ;
+ }
bool hidden_state = ui.nodeType_CB->currentIndex()==1;
bool generate_new = !ui.reuse_existing_node_CB->isChecked();
@@ -270,10 +249,10 @@ void GenCertDialog::setupState()
ui.label_nodeType->setVisible(adv_state) ;
ui.nodeType_CB->setVisible(adv_state) ;
ui.reuse_existing_node_CB->setVisible(adv_state) ;
- ui.importIdentity_PB->setVisible(adv_state) ;
- ui.exportIdentity_PB->setVisible(adv_state) ;
+ ui.importIdentity_PB->setVisible(adv_state && !generate_new) ;
+ ui.exportIdentity_PB->setVisible(adv_state && !generate_new) ;
- ui.genPGPuser->setVisible(adv_state && haveGPGKeys) ;
+ ui.genPGPuser->setVisible(adv_state && haveGPGKeys && !generate_new) ;
ui.genprofileinfo_label->setVisible(false);
ui.no_gpg_key_label->setText(tr("Welcome to Retroshare. Before you can proceed you need to create a profile and associate a node with it. To do so please fill out this form.\nAlternatively you can import a (previously exported) profile. Just uncheck \"Create a new profile\""));
@@ -282,8 +261,10 @@ void GenCertDialog::setupState()
ui.nickname_label->setVisible(adv_state) ;
ui.nickname_input->setVisible(adv_state) ;
- ui.name_label->setVisible(!generate_new);
- ui.name_input->setVisible(!generate_new);
+ ui.name_label->setVisible(true);
+ ui.name_input->setVisible(generate_new);
+
+ ui.header_label->setVisible(false) ;
ui.nickname_label->setVisible(adv_state && !mOnlyGenerateIdentity);
ui.nickname_input->setVisible(adv_state && !mOnlyGenerateIdentity);
@@ -328,14 +309,14 @@ void GenCertDialog::exportIdentity()
QMessageBox::information(this,tr("Profile not saved"),tr("Your profile was not saved. An error occurred.")) ;
}
-void GenCertDialog::importIdentity()
+bool GenCertDialog::importIdentity()
{
QString fname ;
if(!misc::getOpenFileName(this,RshareSettings::LASTDIR_CERT,tr("Import profile"), tr("RetroShare profile files (*.asc);;All files (*)"),fname))
- return ;
+ return false;
if(fname.isNull())
- return ;
+ return false;
RsPgpId gpg_id ;
std::string err_string ;
@@ -343,7 +324,7 @@ void GenCertDialog::importIdentity()
if(!RsAccounts::ImportIdentity(fname.toStdString(),gpg_id,err_string))
{
QMessageBox::information(this,tr("Profile not loaded"),tr("Your profile was not loaded properly:")+" \n "+QString::fromStdString(err_string)) ;
- return ;
+ return false;
}
else
{
@@ -353,9 +334,9 @@ void GenCertDialog::importIdentity()
std::cerr << "Adding PGPUser: " << name << " id: " << gpg_id << std::endl;
QMessageBox::information(this,tr("New profile imported"),tr("Your profile was imported successfully:")+" \n"+"\nName :"+QString::fromStdString(name)+"\nemail: " + QString::fromStdString(email)+"\nKey ID: "+QString::fromStdString(gpg_id.toStdString())+"\n\n"+tr("You can use it now to create a new node.")) ;
- }
- init() ;
+ return true ;
+ }
}
void GenCertDialog::genPerson()
diff --git a/retroshare-gui/src/gui/GenCertDialog.h b/retroshare-gui/src/gui/GenCertDialog.h
index f84d29f17..51cfaa19c 100644
--- a/retroshare-gui/src/gui/GenCertDialog.h
+++ b/retroshare-gui/src/gui/GenCertDialog.h
@@ -39,13 +39,14 @@ public:
QString getGXSNickname() {return mGXSNickname;}
private slots:
void genPerson();
- void importIdentity();
+ bool importIdentity();
void exportIdentity();
void setupState();
+ void switchReuseExistingNode();
void grabMouse();
private:
- void init();
+ void initKeyList();
/** Qt Designer generated object */
Ui::GenCertDialog ui;
diff --git a/retroshare-gui/src/gui/GenCertDialog.ui b/retroshare-gui/src/gui/GenCertDialog.ui
index 06c17f778..45c93e39d 100644
--- a/retroshare-gui/src/gui/GenCertDialog.ui
+++ b/retroshare-gui/src/gui/GenCertDialog.ui
@@ -496,86 +496,6 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
- -
-
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
-
- true
-
-
- QFrame::Box
-
-
- <html><head/><body><p align="justify">Before proceeding, move your mouse around to help Retroshare collect as much randomness as possible. Filling the progressbar to 20% is needed, 100% is advised.</p></body></html>
-
-
- true
-
-
-
-
@@ -685,7 +605,7 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
- Import new profile
+ Import profile
@@ -700,6 +620,86 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
+ -
+
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+ 255
+ 255
+ 178
+
+
+
+
+
+
+
+
+ 255
+ 255
+ 255
+
+
+
+
+
+
+ 255
+ 255
+ 178
+
+
+
+
+
+
+
+
+ 255
+ 255
+ 178
+
+
+
+
+
+
+ 255
+ 255
+ 178
+
+
+
+
+
+
+
+ true
+
+
+ QFrame::Box
+
+
+ <html><head/><body><p align="justify">Before proceeding, move your mouse around to help Retroshare collect as much randomness as possible. Filling the progressbar to 20% is required, 100% is advised.</p></body></html>
+
+
+ true
+
+
+
From a9b7ed31a1463d917dad9b956cbb366343ec49eb Mon Sep 17 00:00:00 2001
From: csoler
Date: Thu, 2 Feb 2017 21:48:18 +0100
Subject: [PATCH 42/90] attempt to make the login creation window look better
---
retroshare-gui/src/gui/GenCertDialog.ui | 70 ++++++++++---------
.../src/gui/qss/stylesheet/Standard.qss | 7 +-
2 files changed, 42 insertions(+), 35 deletions(-)
diff --git a/retroshare-gui/src/gui/GenCertDialog.ui b/retroshare-gui/src/gui/GenCertDialog.ui
index 45c93e39d..066e26c67 100644
--- a/retroshare-gui/src/gui/GenCertDialog.ui
+++ b/retroshare-gui/src/gui/GenCertDialog.ui
@@ -7,7 +7,7 @@
0
0
1745
- 1193
+ 1296
@@ -36,7 +36,7 @@
-
- -
-
-
- 24
-
-
-
-
@@ -478,6 +471,12 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
-
+
+
+ 0
+ 0
+
+
<html><head/><body><p>This can be a Tor Onion address of the form: xa76giaf6ifda7ri63i263.onion <br/>or an I2P address in the form: [52 characters].b32.i2p </p><p>In order to get one, you must configure either Tor or I2P to create a new hidden service / server tunnel. If you do not yet have one, you can still go on, and make it right later in RetroShare's Options->Network->Hidden Service configuration panel.</p></body></html>
@@ -509,16 +508,6 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
- -
-
-
-
-
-
- Go!
-
-
-
-
-
@@ -620,6 +609,19 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
-
@@ -700,22 +702,26 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
+ -
+
+
+ 24
+
+
+
+ -
+
+
+
+
+
+ Go!
+
+
+
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss
index 365a8f9f1..28c4906bf 100644
--- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss
+++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss
@@ -295,13 +295,14 @@ GetStartedDialog QTextEdit {
/* GenCertDialog */
-GenCertDialog > QFrame#headerFrame {
+/* GenCertDialog > QFrame#headerFrame {
background-image: url(:/images/genbackground.png);
}
GenCertDialog > QFrame#headerFrame > QLabel#headerLabel {
color: rgb(255, 255, 255);
}
+*/
/* ConnectFriendWizard */
@@ -642,8 +643,8 @@ IdEditDialog QLabel#info_label
GenCertDialog QPushButton#genButton {
border-image: url(:/images/btn_blue.png) 4;
border-width: 4;
- padding: 0px 6px;
- font-size: 16px;
+/* padding: 0px 6px;*/
+/* font-size: 16px; */
font: bold;
color: white;
}
From 389eff04002bbf381c893b20e3658e9d56e63701 Mon Sep 17 00:00:00 2001
From: csoler
Date: Thu, 2 Feb 2017 22:05:28 +0100
Subject: [PATCH 43/90] improved the qss and look of login window
---
retroshare-gui/src/gui/GenCertDialog.cpp | 14 +++---
retroshare-gui/src/gui/GenCertDialog.ui | 27 +---------
.../src/gui/qss/stylesheet/Standard.qss | 49 ++++++++++++++++++-
3 files changed, 56 insertions(+), 34 deletions(-)
diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp
index 12aeb937d..21c5e893e 100644
--- a/retroshare-gui/src/gui/GenCertDialog.cpp
+++ b/retroshare-gui/src/gui/GenCertDialog.cpp
@@ -133,8 +133,8 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
/* Invoke Qt Designer generated QObject setup routine */
ui.setupUi(this);
- ui.headerFrame->setHeaderImage(QPixmap(":/icons/svg/profile.svg"));
- ui.headerFrame->setHeaderText(tr("Create a new profile"));
+ //ui.headerFrame->setHeaderImage(QPixmap(":/icons/svg/profile.svg"));
+ //ui.headerFrame->setHeaderText(tr("Create a new profile"));
connect(ui.reuse_existing_node_CB, SIGNAL(clicked()), this, SLOT(switchReuseExistingNode()));
connect(ui.adv_checkbox, SIGNAL(clicked()), this, SLOT(setupState()));
@@ -158,15 +158,15 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
#if QT_VERSION >= 0x040700
ui.node_input->setPlaceholderText(tr("[Required] Examples: Home, Laptop,...")) ;
ui.hiddenaddr_input->setPlaceholderText(tr("[Required] Tor/I2P address - Examples: xa76giaf6ifda7ri63i263.onion (obtained by you from Tor)")) ;
- ui.name_input->setPlaceholderText(tr("[Required] Visible to your friends, and friends of friends."));
+ ui.name_input->setPlaceholderText(tr("[Required] Identifies your Retrohare node(s). Visible to your friends, and friends of friends."));
ui.nickname_input->setPlaceholderText(tr("[Optional] Used when you write in chat lobbies, forums and channel comments. Can be setup later if you need one."));
- ui.password_input->setPlaceholderText(tr("[Required] This password protects your node key."));
+ ui.password_input->setPlaceholderText(tr("[Required] This password protects your data and is required when re-start."));
ui.password_input_2->setPlaceholderText(tr("[Required] Type the same password again here."));
#endif
ui.nickname_input->setMaxLength(RSID_MAXIMUM_NICKNAME_SIZE);
- ui.node_input->setToolTip(tr("Enter a meaningful node description. e.g. : home, laptop, etc. \nThis field will be used to differentiate different installations with\nthe same profile (PGP key pair).")) ;
+ ui.node_input->setToolTip(tr("Enter a meaningful node description. e.g. : home, laptop, etc. \nThis field will be used to differentiate different Retroshare nodes for\nthe same profile.")) ;
/* get all available pgp private certificates....
* mark last one as default.
@@ -243,8 +243,8 @@ void GenCertDialog::setupState()
ui.no_node_label->setVisible(false);
- setWindowTitle(generate_new?tr("Create new profile and node"):tr("Create new node"));
- ui.headerFrame->setHeaderText(generate_new?tr("Create a new profile and node"):tr("Create a new node"));
+ setWindowTitle(generate_new?tr("Create new profile and new Retroshare node"):tr("Create new Retroshare node"));
+ //ui.headerFrame->setHeaderText(generate_new?tr("Create a new profile and node"):tr("Create a new node"));
ui.label_nodeType->setVisible(adv_state) ;
ui.nodeType_CB->setVisible(adv_state) ;
diff --git a/retroshare-gui/src/gui/GenCertDialog.ui b/retroshare-gui/src/gui/GenCertDialog.ui
index 066e26c67..ffef7a78c 100644
--- a/retroshare-gui/src/gui/GenCertDialog.ui
+++ b/retroshare-gui/src/gui/GenCertDialog.ui
@@ -33,25 +33,6 @@
0
- -
-
-
-
@@ -601,7 +582,7 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
-
- Re-use existing profile
+ Re-use an existing profile
@@ -725,12 +706,6 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
-
- HeaderFrame
- QFrame
-
- 1
-
StyledLabel
QLabel
diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss
index 28c4906bf..288024a42 100644
--- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss
+++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss
@@ -639,7 +639,54 @@ IdEditDialog QLabel#info_label
background: #FFFFD7;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFD7, stop:1 #FFFFB2);
}
-
+GenCertDialog QComboBox#genPGPuser {
+ border: 2px solid #0099cc;
+ border-radius: 6px;
+ background: white;
+ font: bold;
+}
+GenCertDialog QSpinBox#hiddenport_spinBox {
+ border: 2px solid #0099cc;
+ border-radius: 6px;
+ background: white;
+ font: bold;
+}
+GenCertDialog QLineEdit#hiddenaddr_input {
+ border: 2px solid #0099cc;
+ border-radius: 6px;
+ background: white;
+ font: bold;
+}
+GenCertDialog QLineEdit#password_input_2 {
+ border: 2px solid #0099cc;
+ border-radius: 6px;
+ background: white;
+ font: bold;
+}
+GenCertDialog QLineEdit#password_input {
+ border: 2px solid #0099cc;
+ border-radius: 6px;
+ background: white;
+ font: bold;
+}
+GenCertDialog QLineEdit#nickname_input {
+ border: 2px solid #0099cc;
+ border-radius: 6px;
+ background: white;
+ font: bold;
+}
+GenCertDialog QLineEdit#node_input {
+ border: 2px solid #0099cc;
+ border-radius: 6px;
+ background: white;
+ font: bold;
+}
+GenCertDialog QLineEdit#name_input {
+ border: 2px solid #0099cc;
+ border-radius: 6px;
+ background: white;
+ font: bold;
+}
GenCertDialog QPushButton#genButton {
border-image: url(:/images/btn_blue.png) 4;
border-width: 4;
From 80e6742ab52eece3e149824c7ee6e8c62bdcfa22 Mon Sep 17 00:00:00 2001
From: csoler
Date: Fri, 3 Feb 2017 11:45:00 +0100
Subject: [PATCH 44/90] teaking of the css file
---
.../src/gui/qss/stylesheet/Standard.qss | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss
index 288024a42..e5727104a 100644
--- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss
+++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss
@@ -640,49 +640,49 @@ IdEditDialog QLabel#info_label
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFFFD7, stop:1 #FFFFB2);
}
GenCertDialog QComboBox#genPGPuser {
- border: 2px solid #0099cc;
+ border: 4px solid #0099cc;
border-radius: 6px;
background: white;
font: bold;
}
GenCertDialog QSpinBox#hiddenport_spinBox {
- border: 2px solid #0099cc;
+ border: 4px solid #0099cc;
border-radius: 6px;
background: white;
font: bold;
}
GenCertDialog QLineEdit#hiddenaddr_input {
- border: 2px solid #0099cc;
+ border: 4px solid #0099cc;
border-radius: 6px;
background: white;
font: bold;
}
GenCertDialog QLineEdit#password_input_2 {
- border: 2px solid #0099cc;
+ border: 4px solid #0099cc;
border-radius: 6px;
background: white;
font: bold;
}
GenCertDialog QLineEdit#password_input {
- border: 2px solid #0099cc;
+ border: 4px solid #0099cc;
border-radius: 6px;
background: white;
font: bold;
}
GenCertDialog QLineEdit#nickname_input {
- border: 2px solid #0099cc;
+ border: 4px solid #0099cc;
border-radius: 6px;
background: white;
font: bold;
}
GenCertDialog QLineEdit#node_input {
- border: 2px solid #0099cc;
+ border: 4px solid #0099cc;
border-radius: 6px;
background: white;
font: bold;
}
GenCertDialog QLineEdit#name_input {
- border: 2px solid #0099cc;
+ border: 4px solid #0099cc;
border-radius: 6px;
background: white;
font: bold;
From ccacba797f45f77705974e7bddd15b0288fe44c4 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sun, 12 Feb 2017 15:27:13 +0100
Subject: [PATCH 45/90] added pgp passphrase temporary caching in order to
avoid re-asking for password at location creation time
---
libretroshare/src/pqi/p3notify.cc | 29 ++++++++++++++++++++++++
libretroshare/src/pqi/p3notify.h | 5 ++++
libretroshare/src/retroshare/rsnotify.h | 3 +++
retroshare-gui/src/gui/GenCertDialog.cpp | 7 ++++++
retroshare-gui/src/gui/notifyqt.cpp | 2 +-
5 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/libretroshare/src/pqi/p3notify.cc b/libretroshare/src/pqi/p3notify.cc
index 53109a6d1..c110665f8 100644
--- a/libretroshare/src/pqi/p3notify.cc
+++ b/libretroshare/src/pqi/p3notify.cc
@@ -245,8 +245,37 @@ void p3Notify::notifyDownloadComplete (const std::string& fileHash )
void p3Notify::notifyDownloadCompleteCount (uint32_t count ) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyDownloadCompleteCount (count) ; }
void p3Notify::notifyHistoryChanged (uint32_t msgId , int type) { FOR_ALL_NOTIFY_CLIENTS (*it)->notifyHistoryChanged (msgId,type) ; }
+bool p3Notify::cachePgpPassphrase(const std::string& s)
+{
+ clearPgpPassphrase() ;
+ cached_pgp_passphrase = s ;
+
+ std::cerr << "(WW) Caching PGP passphrase." << std::endl;
+ return true ;
+}
+bool p3Notify::clearPgpPassphrase()
+{
+ std::cerr << "(WW) Clearing PGP passphrase." << std::endl;
+
+ // Just whipe out the memory instead of just releasing it.
+
+ for(uint32_t i=0;iaskForPassword(title,key_details,prev_is_bad,password,*cancelled))
return true ;
diff --git a/libretroshare/src/pqi/p3notify.h b/libretroshare/src/pqi/p3notify.h
index f91450f22..60b3759a6 100644
--- a/libretroshare/src/pqi/p3notify.h
+++ b/libretroshare/src/pqi/p3notify.h
@@ -124,6 +124,9 @@ class p3Notify: public RsNotify
bool askForPassword (const std::string& title, const std::string& /* key_details */, bool /* prev_is_bad */, std::string&, bool *cancelled /* password */ ) ;
bool askForPluginConfirmation (const std::string& /* plugin_filename */, const std::string& /* plugin_file_hash */) ;
+ virtual bool cachePgpPassphrase (const std::string& /* pgp_passphrase */) ;
+ virtual bool clearPgpPassphrase () ;
+
private:
RsMutex noteMtx;
@@ -134,6 +137,8 @@ class p3Notify: public RsNotify
std::list pendingNewsFeed;
std::list notifyClients ;
+
+ std::string cached_pgp_passphrase ;
};
diff --git a/libretroshare/src/retroshare/rsnotify.h b/libretroshare/src/retroshare/rsnotify.h
index 991ba338e..fd09218bd 100644
--- a/libretroshare/src/retroshare/rsnotify.h
+++ b/libretroshare/src/retroshare/rsnotify.h
@@ -199,6 +199,9 @@ class RsNotify
virtual bool NotifyLogMessage(uint32_t &sysid, uint32_t &type, std::string &title, std::string &msg) = 0;
virtual bool GetFeedItem(RsFeedItem &item) = 0;
+
+ virtual bool cachePgpPassphrase (const std::string& /* pgp_passphrase */) { return false ; }
+ virtual bool clearPgpPassphrase () { return false ; }
};
class NotifyClient
diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp
index 21c5e893e..7412519ba 100644
--- a/retroshare-gui/src/gui/GenCertDialog.cpp
+++ b/retroshare-gui/src/gui/GenCertDialog.cpp
@@ -36,6 +36,7 @@
#include
#include
+#include
#include
#include
@@ -469,6 +470,10 @@ void GenCertDialog::genPerson()
err_string);
setCursor(Qt::ArrowCursor) ;
+
+ // now cache the PGP password so that it's not asked again for immediately signing the key
+
+ rsNotify->cachePgpPassphrase(ui.password_input->text().toUtf8().constData()) ;
}
//generate a random ssl password
@@ -484,6 +489,8 @@ void GenCertDialog::genPerson()
std::cout << "RsAccounts::GenerateSSLCertificate" << std::endl;
bool okGen = RsAccounts::GenerateSSLCertificate(PGPId, "", genLoc, "", isHiddenLoc, sslPasswd, sslId, err);
+ rsNotify->clearPgpPassphrase() ;
+
if (okGen)
{
/* complete the process */
diff --git a/retroshare-gui/src/gui/notifyqt.cpp b/retroshare-gui/src/gui/notifyqt.cpp
index e3e02e02c..9f05f7c44 100644
--- a/retroshare-gui/src/gui/notifyqt.cpp
+++ b/retroshare-gui/src/gui/notifyqt.cpp
@@ -278,7 +278,7 @@ bool NotifyQt::askForPassword(const std::string& title, const std::string& key_d
dialog.setWindowTitle(QString::fromStdString(title));
}
- dialog.setLabelText((prev_is_bad ? QString("%1\n\n").arg(tr("Wrong password !")) : QString()) + QString("%1:\n %2").arg(tr("Please enter your PGP password for key"), QString::fromUtf8(key_details.c_str())));
+ dialog.setLabelText((prev_is_bad ? QString("%1\n\n").arg(tr("Wrong password !")) : QString()) + QString("%1:\n\n (%2)\n\n").arg(tr("Please enter your Retroshare password"), QString::fromUtf8(key_details.c_str())));
dialog.setTextEchoMode(QLineEdit::Password);
dialog.setModal(true);
From 5069ba86dd33d411e3ce0f253ca59f33c83f3e22 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sun, 12 Feb 2017 21:45:22 +0100
Subject: [PATCH 46/90] improved style/layout of gen cert dialog
---
retroshare-gui/src/gui/GenCertDialog.cpp | 45 +-
retroshare-gui/src/gui/GenCertDialog.h | 1 +
retroshare-gui/src/gui/GenCertDialog.ui | 628 ++++++++++--------
.../src/gui/qss/stylesheet/Standard.qss | 4 +-
4 files changed, 397 insertions(+), 281 deletions(-)
diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp
index 7412519ba..40a2bb74c 100644
--- a/retroshare-gui/src/gui/GenCertDialog.cpp
+++ b/retroshare-gui/src/gui/GenCertDialog.cpp
@@ -44,6 +44,9 @@
#include
#include
+#define IMAGE_GOOD ":/images/accepted16.png"
+#define IMAGE_BAD ":/images/deletemail24.png"
+
class EntropyCollectorWidget: public QTextBrowser
{
public:
@@ -110,12 +113,15 @@ void GenCertDialog::grabMouse()
ui.genButton->setEnabled(false) ;
//ui.genButton->setIcon(QIcon(":/images/delete.png")) ;
ui.genButton->setToolTip(tr("Currently disabled. Please move your mouse around until you reach at least 20%")) ;
+
+ ui.randomness_check_LB->setPixmap(QPixmap(IMAGE_BAD)) ;
}
else
{
ui.genButton->setEnabled(true) ;
//ui.genButton->setIcon(QIcon(":/images/resume.png")) ;
ui.genButton->setToolTip(tr("Click to create your node and/or profile")) ;
+ ui.randomness_check_LB->setPixmap(QPixmap(IMAGE_GOOD)) ;
}
RsInit::collectEntropy(E+(F << 16)) ;
@@ -145,6 +151,11 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
connect(ui.importIdentity_PB, SIGNAL(clicked()), this, SLOT(importIdentity()));
connect(ui.exportIdentity_PB, SIGNAL(clicked()), this, SLOT(exportIdentity()));
+ connect(ui.password_input, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels()));
+ connect(ui.password_input_2, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels()));
+ connect(ui.name_input, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels()));
+ connect(ui.node_input, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels()));
+
entropy_timer = new QTimer ;
entropy_timer->start(20) ;
QObject::connect(entropy_timer,SIGNAL(timeout()),this,SLOT(grabMouse())) ;
@@ -158,7 +169,7 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
#if QT_VERSION >= 0x040700
ui.node_input->setPlaceholderText(tr("[Required] Examples: Home, Laptop,...")) ;
- ui.hiddenaddr_input->setPlaceholderText(tr("[Required] Tor/I2P address - Examples: xa76giaf6ifda7ri63i263.onion (obtained by you from Tor)")) ;
+ ui.hiddenaddr_input->setPlaceholderText(tr("[Optional] Tor/I2P address - Examples: xa76giaf6ifda7ri63i263.onion (obtained by you from Tor)")) ;
ui.name_input->setPlaceholderText(tr("[Required] Identifies your Retrohare node(s). Visible to your friends, and friends of friends."));
ui.nickname_input->setPlaceholderText(tr("[Optional] Used when you write in chat lobbies, forums and channel comments. Can be setup later if you need one."));
ui.password_input->setPlaceholderText(tr("[Required] This password protects your data and is required when re-start."));
@@ -273,15 +284,15 @@ void GenCertDialog::setupState()
ui.node_label->setVisible(true);
ui.node_input->setVisible(true);
- ui.password_label->setVisible(true);
- ui.password_label_2->setVisible(true);
ui.password_input->setVisible(true);
- ui.password_input_2->setVisible(true);
+ ui.password_label->setVisible(true);
+
+ ui.password_input_2->setVisible(generate_new);
+ ui.password_label_2->setVisible(generate_new);
ui.keylength_label->setVisible(adv_state);
ui.keylength_comboBox->setVisible(adv_state);
- ui.entropy_label->setVisible(true);
ui.entropy_bar->setVisible(true);
ui.genButton->setVisible(true);
@@ -289,9 +300,10 @@ void GenCertDialog::setupState()
ui.hiddenaddr_input->setVisible(hidden_state);
ui.hiddenaddr_label->setVisible(hidden_state);
- ui.label_hiddenaddr->setVisible(hidden_state);
ui.hiddenport_label->setVisible(hidden_state);
ui.hiddenport_spinBox->setVisible(hidden_state);
+
+ updateCheckLabels();
}
void GenCertDialog::exportIdentity()
@@ -310,6 +322,17 @@ void GenCertDialog::exportIdentity()
QMessageBox::information(this,tr("Profile not saved"),tr("Your profile was not saved. An error occurred.")) ;
}
+void GenCertDialog::updateCheckLabels()
+{
+ QPixmap good( IMAGE_GOOD ) ;
+ QPixmap bad ( IMAGE_BAD ) ;
+
+ ui.node_name_check_LB ->setPixmap( (ui.node_input->text().length() > 3)?good:bad ) ;
+ ui.profile_name_check_LB->setPixmap( (ui.name_input->text().length() > 3)?good:bad ) ;
+ ui.password_check_LB ->setPixmap( (ui.password_input->text().length() > 3)?good:bad ) ;
+ ui.password2_check_LB ->setPixmap( (ui.password_input->text().length() > 3 && ui.password_input->text() == ui.password_input_2->text())?good:bad) ;
+}
+
bool GenCertDialog::importIdentity()
{
QString fname ;
@@ -386,7 +409,9 @@ void GenCertDialog::genPerson()
isHiddenLoc = true;
}
- if (!genNewGPGKey) {
+
+ if (!genNewGPGKey)
+ {
if (genLoc.length() < 3) {
/* Message Dialog */
QMessageBox::warning(this,
@@ -470,11 +495,9 @@ void GenCertDialog::genPerson()
err_string);
setCursor(Qt::ArrowCursor) ;
-
- // now cache the PGP password so that it's not asked again for immediately signing the key
-
- rsNotify->cachePgpPassphrase(ui.password_input->text().toUtf8().constData()) ;
}
+ // now cache the PGP password so that it's not asked again for immediately signing the key
+ rsNotify->cachePgpPassphrase(ui.password_input->text().toUtf8().constData()) ;
//generate a random ssl password
std::string sslPasswd = RSRandom::random_alphaNumericString(RsInit::getSslPwdLen()) ;
diff --git a/retroshare-gui/src/gui/GenCertDialog.h b/retroshare-gui/src/gui/GenCertDialog.h
index 51cfaa19c..c9c1c2699 100644
--- a/retroshare-gui/src/gui/GenCertDialog.h
+++ b/retroshare-gui/src/gui/GenCertDialog.h
@@ -44,6 +44,7 @@ private slots:
void setupState();
void switchReuseExistingNode();
void grabMouse();
+ void updateCheckLabels();
private:
void initKeyList();
diff --git a/retroshare-gui/src/gui/GenCertDialog.ui b/retroshare-gui/src/gui/GenCertDialog.ui
index ffef7a78c..fd87030b1 100644
--- a/retroshare-gui/src/gui/GenCertDialog.ui
+++ b/retroshare-gui/src/gui/GenCertDialog.ui
@@ -6,7 +6,7 @@
0
0
- 1745
+ 1278
1296
@@ -35,6 +35,12 @@
-
+
+
+ 0
+ 0
+
+
QFrame::StyledPanel
@@ -42,6 +48,19 @@
QFrame::Raised
+
-
+
+
+
+
+
+ :/images/logo/logo_splash.png
+
+
+ Qt::AlignCenter
+
+
+
-
-
@@ -88,19 +107,6 @@
- -
-
-
-
-
-
- :/images/logo/logo_splash.png
-
-
- Qt::AlignCenter
-
-
-
-
@@ -284,75 +290,10 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
-
-
-
-
+
-
+
- Node type
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- This password is for PGP
-
-
- Password (check)
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Put a strong password here. This password protects your private PGP key.
-
-
-
-
-
- 1024
-
-
- QLineEdit::Password
-
-
-
- -
-
-
- Profile name
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- You can have one or more identities. They are used when you write in chat lobbies, forums and channel comments. They act as the destination for distant chat and the Retroshare distant mail system.
-
-
-
- -
-
-
-
-
-
- Chat identity
+ hidden address
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
@@ -372,101 +313,93 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
- -
-
-
- -
-
-
- Put a strong password here. This password protects your private PGP key.
-
-
-
-
-
- 1024
-
-
- QLineEdit::Password
+
-
+
+
+
+ 0
+ 0
+
- -
-
+
-
+
+
+ This password is for PGP
+
- hidden address
+ Password (check)
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
- -
-
-
- 6
+
-
+
+
+
-
-
-
-
-
- 0
- 0
-
-
-
-
- 16777215
- 32
-
-
-
- 64
-
-
-
- -
-
-
- Port
-
-
-
- -
-
-
- <html><head/><body><p>This is your connection port.</p><p>Any value between 1024 and 65535 </p><p>should be ok. You can change it later.</p></body></html>
-
-
- 1
-
-
- 65535
-
-
- 7812
-
-
-
-
+
- -
-
+
-
+
-
+
0
0
-
- <html><head/><body><p>This can be a Tor Onion address of the form: xa76giaf6ifda7ri63i263.onion <br/>or an I2P address in the form: [52 characters].b32.i2p </p><p>In order to get one, you must configure either Tor or I2P to create a new hidden service / server tunnel. If you do not yet have one, you can still go on, and make it right later in RetroShare's Options->Network->Hidden Service configuration panel.</p></body></html>
-
-
- true
+
+ You can have one or more identities. They are used when you write in chat lobbies, forums and channel comments. They act as the destination for distant chat and the Retroshare distant mail system.
- -
+
-
+
+
+
+ 0
+ 0
+
+
+
+ <html><head/><body><p>Please move your mouse around in order to collect as much randomness as possible. A minimum of 20% is needed to create your node keys.</p></body></html>
+
+
+ 24
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+ Chat identity
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
PGP key length
@@ -478,6 +411,12 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
-
+
+
+ 0
+ 0
+
+
0
@@ -489,20 +428,6 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
- -
-
-
-
-
- Standard node
-
-
- -
-
- TOR/I2P Hidden node
-
-
-
-
-
@@ -513,12 +438,39 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
+ -
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
-
+
+ Standard node
+
+
+ -
+
+ TOR/I2P Hidden node
+
+
+
+
-
-
-
+
0
0
@@ -548,6 +500,12 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
-
+
+
+ 0
+ 0
+
+
Your profile is associated with a PGP key pair. RetroShare currently ignores DSA keys.
@@ -556,7 +514,7 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
-
-
+
0
0
@@ -569,7 +527,7 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
-
-
+
0
0
@@ -581,6 +539,12 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
-
+
+
+ 0
+ 0
+
+
Re-use an existing profile
@@ -588,6 +552,157 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
+ -
+
+
+ 6
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+
+ 16777215
+ 32
+
+
+
+ <html><head/><body><p>This should be a Tor Onion address of the form: xa76giaf6ifda7ri63i263.onion <br/>or an I2P address in the form: [52 characters].b32.i2p </p><p>In order to get one, you must configure either Tor or I2P to create a new hidden service / server tunnel. </p><p>You can also leave this blank now, but your node will only work if you correctly set the Tor/I2P service address in Options->Network->Hidden Service configuration panel.</p></body></html>
+
+
+ 64
+
+
+
+ -
+
+
+ Port
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ <html><head/><body><p>This is your connection port.</p><p>Any value between 1024 and 65535 </p><p>should be ok. You can change it later.</p></body></html>
+
+
+ 1
+
+
+ 65535
+
+
+ 7812
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+ Put a strong password here. This password protects your private PGP key.
+
+
+
+
+
+ 1024
+
+
+ QLineEdit::Password
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Put a strong password here. This password protects your private PGP key.
+
+
+
+
+
+ 1024
+
+
+ QLineEdit::Password
+
+
+
+ -
+
+
+ Profile name
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ Node type
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ Randomness
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
-
@@ -604,101 +719,70 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
-
-
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
-
-
- 255
- 255
- 255
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
- 255
- 255
- 178
-
-
-
-
-
-
-
- true
-
-
- QFrame::Box
-
-
- <html><head/><body><p align="justify">Before proceeding, move your mouse around to help Retroshare collect as much randomness as possible. Filling the progressbar to 20% is required, 100% is advised.</p></body></html>
-
-
- true
-
-
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+ Go!
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
-
-
-
- 24
+
+
+ Qt::Vertical
-
-
- -
-
-
-
+
+
+ 20
+ 40
+
-
- Go!
-
-
+
@@ -713,15 +797,25 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
- nickname_input
+ name_input
+ node_input
password_input
password_input_2
+ adv_checkbox
+ keylength_comboBox
+ nodeType_CB
+ exportIdentity_PB
+ reuse_existing_node_CB
+ nickname_input
+ genPGPuser
hiddenaddr_input
hiddenport_spinBox
+ genButton
+ importIdentity_PB
-
+
diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss
index f4fbd36e5..b183eb77c 100644
--- a/retroshare-gui/src/gui/qss/stylesheet/Standard.qss
+++ b/retroshare-gui/src/gui/qss/stylesheet/Standard.qss
@@ -715,8 +715,6 @@ GenCertDialog QLineEdit#name_input {
GenCertDialog QPushButton#genButton {
border-image: url(:/images/btn_blue.png) 4;
border-width: 4;
-/* padding: 0px 6px;*/
-/* font-size: 16px; */
font: bold;
color: white;
}
@@ -727,7 +725,7 @@ GenCertDialog QPushButton#genButton:hover {
GenCertDialog QPushButton#genButton:disabled {
border-image: url(:/images/btn_27.png) 4;
- font-size: 16px;
+/* font-size: 16px; */
font: bold;
color: black;
}
From 59f428f096b7225ec6702b8e2625b44936de0c01 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sun, 12 Feb 2017 23:35:43 +0100
Subject: [PATCH 47/90] fixed the update of check icons in genCertDialog
---
retroshare-gui/src/gui/GenCertDialog.cpp | 87 +++++++++++++++++-------
retroshare-gui/src/gui/GenCertDialog.h | 2 +
retroshare-gui/src/gui/GenCertDialog.ui | 13 ++--
3 files changed, 72 insertions(+), 30 deletions(-)
diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp
index 40a2bb74c..a5c38bf2d 100644
--- a/retroshare-gui/src/gui/GenCertDialog.cpp
+++ b/retroshare-gui/src/gui/GenCertDialog.cpp
@@ -108,20 +108,10 @@ void GenCertDialog::grabMouse()
ui.entropy_bar->setValue(count*100/2048) ;
- if(ui.entropy_bar->value() < 20)
+ if(!mEntropyOk && ui.entropy_bar->value() >= 20)
{
- ui.genButton->setEnabled(false) ;
- //ui.genButton->setIcon(QIcon(":/images/delete.png")) ;
- ui.genButton->setToolTip(tr("Currently disabled. Please move your mouse around until you reach at least 20%")) ;
-
- ui.randomness_check_LB->setPixmap(QPixmap(IMAGE_BAD)) ;
- }
- else
- {
- ui.genButton->setEnabled(true) ;
- //ui.genButton->setIcon(QIcon(":/images/resume.png")) ;
- ui.genButton->setToolTip(tr("Click to create your node and/or profile")) ;
- ui.randomness_check_LB->setPixmap(QPixmap(IMAGE_GOOD)) ;
+ mEntropyOk = true ;
+ updateCheckLabels();
}
RsInit::collectEntropy(E+(F << 16)) ;
@@ -168,22 +158,23 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
ui.keylength_comboBox->addItem("Very high (4096 bits)", QVariant(4096));
#if QT_VERSION >= 0x040700
- ui.node_input->setPlaceholderText(tr("[Required] Examples: Home, Laptop,...")) ;
- ui.hiddenaddr_input->setPlaceholderText(tr("[Optional] Tor/I2P address - Examples: xa76giaf6ifda7ri63i263.onion (obtained by you from Tor)")) ;
- ui.name_input->setPlaceholderText(tr("[Required] Identifies your Retrohare node(s). Visible to your friends, and friends of friends."));
- ui.nickname_input->setPlaceholderText(tr("[Optional] Used when you write in chat lobbies, forums and channel comments. Can be setup later if you need one."));
- ui.password_input->setPlaceholderText(tr("[Required] This password protects your data and is required when re-start."));
+ ui.node_input->setPlaceholderText(tr("[Required] Examples: Home, Laptop,...(Visible to friends).")) ;
+ ui.hiddenaddr_input->setPlaceholderText(tr("[Optional] Tor/I2P address (Example: xa76giaf6ifda7ri63i263.onion)")) ;
+ ui.name_input->setPlaceholderText(tr("[Required] Visible to friends, and friends of friends."));
+ ui.nickname_input->setPlaceholderText(tr("[Optional] Used to write in chat rooms and forums. Can be set later."));
+ ui.password_input->setPlaceholderText(tr("[Required] This password protects your data. Dont forget it!"));
ui.password_input_2->setPlaceholderText(tr("[Required] Type the same password again here."));
#endif
ui.nickname_input->setMaxLength(RSID_MAXIMUM_NICKNAME_SIZE);
- ui.node_input->setToolTip(tr("Enter a meaningful node description. e.g. : home, laptop, etc. \nThis field will be used to differentiate different Retroshare nodes for\nthe same profile.")) ;
-
/* get all available pgp private certificates....
* mark last one as default.
*/
+ mAllFieldsOk = false ;
+ mEntropyOk = false ;
+
initKeyList();
setupState();
}
@@ -303,7 +294,18 @@ void GenCertDialog::setupState()
ui.hiddenport_label->setVisible(hidden_state);
ui.hiddenport_spinBox->setVisible(hidden_state);
- updateCheckLabels();
+ if(mEntropyOk && mAllFieldsOk)
+ {
+ ui.genButton->setEnabled(true) ;
+ ui.genButton->setIcon(QIcon(":/images/resume.png")) ;
+ ui.genButton->setToolTip(tr("Click to create your node and/or profile")) ;
+ }
+ else
+ {
+ ui.genButton->setEnabled(false) ;
+ ui.genButton->setIcon(QIcon(":/images/delete.png")) ;
+ ui.genButton->setToolTip(tr("Disabled until all fields correctly set and enough randomness collected.")) ;
+ }
}
void GenCertDialog::exportIdentity()
@@ -327,10 +329,45 @@ void GenCertDialog::updateCheckLabels()
QPixmap good( IMAGE_GOOD ) ;
QPixmap bad ( IMAGE_BAD ) ;
- ui.node_name_check_LB ->setPixmap( (ui.node_input->text().length() > 3)?good:bad ) ;
- ui.profile_name_check_LB->setPixmap( (ui.name_input->text().length() > 3)?good:bad ) ;
- ui.password_check_LB ->setPixmap( (ui.password_input->text().length() > 3)?good:bad ) ;
- ui.password2_check_LB ->setPixmap( (ui.password_input->text().length() > 3 && ui.password_input->text() == ui.password_input_2->text())?good:bad) ;
+ mAllFieldsOk = true ;
+
+ if(ui.node_input->text().length() > 3)
+ ui.node_name_check_LB ->setPixmap(good) ;
+ else
+ {
+ mAllFieldsOk = false ;
+ ui.node_name_check_LB ->setPixmap(bad) ;
+ }
+
+ if(ui.name_input->text().length() > 3)
+ ui.profile_name_check_LB ->setPixmap(good) ;
+ else
+ {
+ mAllFieldsOk = false ;
+ ui.profile_name_check_LB ->setPixmap(bad) ;
+ }
+
+ if(ui.password_input->text().length() > 3)
+ ui.password_check_LB ->setPixmap(good) ;
+ else
+ {
+ mAllFieldsOk = false ;
+ ui.password_check_LB ->setPixmap(bad) ;
+ }
+ if(ui.password_input->text().length() > 3 && ui.password_input->text() == ui.password_input_2->text())
+ ui.password2_check_LB ->setPixmap(good) ;
+ else
+ {
+ mAllFieldsOk = false ;
+ ui.password2_check_LB ->setPixmap(bad) ;
+ }
+
+ if(mEntropyOk)
+ ui.randomness_check_LB->setPixmap(QPixmap(IMAGE_GOOD)) ;
+ else
+ ui.randomness_check_LB->setPixmap(QPixmap(IMAGE_BAD)) ;
+
+ setupState();
}
bool GenCertDialog::importIdentity()
diff --git a/retroshare-gui/src/gui/GenCertDialog.h b/retroshare-gui/src/gui/GenCertDialog.h
index c9c1c2699..f32aa4166 100644
--- a/retroshare-gui/src/gui/GenCertDialog.h
+++ b/retroshare-gui/src/gui/GenCertDialog.h
@@ -55,6 +55,8 @@ private:
bool genNewGPGKey;
bool haveGPGKeys;
bool mOnlyGenerateIdentity;
+ bool mAllFieldsOk ;
+ bool mEntropyOk ;
QString mGXSNickname;
QTimer *entropy_timer ;
diff --git a/retroshare-gui/src/gui/GenCertDialog.ui b/retroshare-gui/src/gui/GenCertDialog.ui
index fd87030b1..d77dc8481 100644
--- a/retroshare-gui/src/gui/GenCertDialog.ui
+++ b/retroshare-gui/src/gui/GenCertDialog.ui
@@ -352,7 +352,7 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
- You can have one or more identities. They are used when you write in chat lobbies, forums and channel comments. They act as the destination for distant chat and the Retroshare distant mail system.
+ <html><head/><body><p>Identities are used when you write in chat rooms, forums and channel comments. </p><p>They also receive/send email over the Retroshare network. You can create</p><p>a signed identity now, or do it later on when you get to need it.</p></body></html>
@@ -423,6 +423,9 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
0
+
+ <html><head/><body><p>Your node name designates the Retroshare instance that</p><p>will run on this computer.</p></body></html>
+
64
@@ -488,7 +491,7 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
- Enter your nickname here
+ <html><head/><body><p>The profile name identifies you over the network.</p><p>It is used by your friends to accept connections from you.</p><p>You can create multiple Retroshare nodes with the</p><p>same profile on different computers.</p><p><br/></p></body></html>
@@ -501,7 +504,7 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
-
-
+
0
0
@@ -631,7 +634,7 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
- Put a strong password here. This password protects your private PGP key.
+ <html><head/><body><p>Put a strong password here. This password protects your private node key!</p></body></html>
@@ -660,7 +663,7 @@ Alternatively you can use an existing profile. Just uncheck "Create a new p
- Put a strong password here. This password protects your private PGP key.
+ <html><head/><body><p>Put a strong password here. This password protects your private node key!</p></body></html>
From b81764893aadb072b5fd86975b74283ddf929296 Mon Sep 17 00:00:00 2001
From: csoler
Date: Wed, 15 Feb 2017 19:17:41 +0100
Subject: [PATCH 48/90] fixed a few bugs in cert creation window
---
retroshare-gui/src/gui/GenCertDialog.cpp | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp
index a5c38bf2d..a41dea21d 100644
--- a/retroshare-gui/src/gui/GenCertDialog.cpp
+++ b/retroshare-gui/src/gui/GenCertDialog.cpp
@@ -145,6 +145,7 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
connect(ui.password_input_2, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels()));
connect(ui.name_input, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels()));
connect(ui.node_input, SIGNAL(textChanged(QString)), this, SLOT(updateCheckLabels()));
+ connect(ui.reuse_existing_node_CB, SIGNAL(toggled(bool)), this, SLOT(updateCheckLabels()));
entropy_timer = new QTimer ;
entropy_timer->start(20) ;
@@ -177,6 +178,7 @@ GenCertDialog::GenCertDialog(bool onlyGenerateIdentity, QWidget *parent)
initKeyList();
setupState();
+ updateCheckLabels();
}
GenCertDialog::~GenCertDialog()
@@ -278,6 +280,7 @@ void GenCertDialog::setupState()
ui.password_input->setVisible(true);
ui.password_label->setVisible(true);
+ ui.password2_check_LB->setVisible(generate_new);
ui.password_input_2->setVisible(generate_new);
ui.password_label_2->setVisible(generate_new);
@@ -297,13 +300,13 @@ void GenCertDialog::setupState()
if(mEntropyOk && mAllFieldsOk)
{
ui.genButton->setEnabled(true) ;
- ui.genButton->setIcon(QIcon(":/images/resume.png")) ;
+ ui.genButton->setIcon(QIcon(IMAGE_GOOD)) ;
ui.genButton->setToolTip(tr("Click to create your node and/or profile")) ;
}
else
{
ui.genButton->setEnabled(false) ;
- ui.genButton->setIcon(QIcon(":/images/delete.png")) ;
+ ui.genButton->setIcon(QIcon(IMAGE_BAD)) ;
ui.genButton->setToolTip(tr("Disabled until all fields correctly set and enough randomness collected.")) ;
}
}
@@ -329,6 +332,7 @@ void GenCertDialog::updateCheckLabels()
QPixmap good( IMAGE_GOOD ) ;
QPixmap bad ( IMAGE_BAD ) ;
+ bool generate_new = !ui.reuse_existing_node_CB->isChecked();
mAllFieldsOk = true ;
if(ui.node_input->text().length() > 3)
@@ -339,7 +343,7 @@ void GenCertDialog::updateCheckLabels()
ui.node_name_check_LB ->setPixmap(bad) ;
}
- if(ui.name_input->text().length() > 3)
+ if(!generate_new || ui.name_input->text().length() > 3)
ui.profile_name_check_LB ->setPixmap(good) ;
else
{
@@ -358,7 +362,9 @@ void GenCertDialog::updateCheckLabels()
ui.password2_check_LB ->setPixmap(good) ;
else
{
- mAllFieldsOk = false ;
+ if(generate_new)
+ mAllFieldsOk = false ;
+
ui.password2_check_LB ->setPixmap(bad) ;
}
@@ -498,6 +504,8 @@ void GenCertDialog::genPerson()
ui.nickname_input->hide();
ui.password_label_2->hide();
ui.password_input_2->hide();
+ ui.password2_check_LB->hide();
+ ui.password_check_LB->hide();
ui.password_label->hide();
ui.password_input->hide();
//ui.genPGPuserlabel->hide();
From 391ef3e4c6c32b9acc42955565d4b828b001df4f Mon Sep 17 00:00:00 2001
From: csoler
Date: Wed, 15 Feb 2017 19:25:46 +0100
Subject: [PATCH 49/90] improved passphrase window
---
retroshare-gui/src/gui/StartDialog.ui | 6 +++---
retroshare-gui/src/gui/notifyqt.cpp | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/retroshare-gui/src/gui/StartDialog.ui b/retroshare-gui/src/gui/StartDialog.ui
index df48acbe8..ae198d4a7 100644
--- a/retroshare-gui/src/gui/StartDialog.ui
+++ b/retroshare-gui/src/gui/StartDialog.ui
@@ -6,8 +6,8 @@
0
0
- 291
- 433
+ 430
+ 552
@@ -220,7 +220,7 @@
-
- Name (PGP Id) - location:
+ Profile - Location
diff --git a/retroshare-gui/src/gui/notifyqt.cpp b/retroshare-gui/src/gui/notifyqt.cpp
index 9f05f7c44..ec2c7454b 100644
--- a/retroshare-gui/src/gui/notifyqt.cpp
+++ b/retroshare-gui/src/gui/notifyqt.cpp
@@ -269,7 +269,7 @@ bool NotifyQt::askForPassword(const std::string& title, const std::string& key_d
QInputDialog dialog;
if (title == "") {
- dialog.setWindowTitle(tr("PGP key passphrase"));
+ dialog.setWindowTitle(tr("Passphrase required"));
} else if (title == "AuthSSLimpl::SignX509ReqWithGPG()") {
dialog.setWindowTitle(tr("You need to sign your node's certificate."));
} else if (title == "p3IdService::service_CreateGroup()") {
@@ -278,7 +278,7 @@ bool NotifyQt::askForPassword(const std::string& title, const std::string& key_d
dialog.setWindowTitle(QString::fromStdString(title));
}
- dialog.setLabelText((prev_is_bad ? QString("%1\n\n").arg(tr("Wrong password !")) : QString()) + QString("%1:\n\n (%2)\n\n").arg(tr("Please enter your Retroshare password"), QString::fromUtf8(key_details.c_str())));
+ dialog.setLabelText((prev_is_bad ? QString("%1\n\n").arg(tr("Wrong password !")) : QString()) + QString("%1
Profile: %2\n").arg(tr("Please enter your Retroshare passphrase"), QString::fromUtf8(key_details.c_str())));
dialog.setTextEchoMode(QLineEdit::Password);
dialog.setModal(true);
From 7c8f8efbade6caf7ddff5bbaee349c13178d1572 Mon Sep 17 00:00:00 2001
From: csoler
Date: Wed, 15 Feb 2017 21:30:49 +0100
Subject: [PATCH 50/90] pass over settings to improve layouts
---
retroshare-gui/src/gui/settings/ChatPage.cpp | 109 ++---
retroshare-gui/src/gui/settings/ChatPage.h | 2 +-
retroshare-gui/src/gui/settings/ChatPage.ui | 437 ++++++++----------
.../src/gui/settings/PluginsPage.ui | 49 +-
retroshare-gui/src/gui/settings/RelayPage.ui | 57 ++-
retroshare-gui/src/gui/settings/ServerPage.ui | 33 +-
.../src/gui/settings/TransferPage.ui | 17 +-
7 files changed, 363 insertions(+), 341 deletions(-)
diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp
index b2f5d8478..d90bb308c 100644
--- a/retroshare-gui/src/gui/settings/ChatPage.cpp
+++ b/retroshare-gui/src/gui/settings/ChatPage.cpp
@@ -45,12 +45,11 @@
#define IMAGE_CHAT_DELETE ":/images/deletemail24.png"
#define IMAGE_CHAT_COPY ":/images/copyrslink.png"
-static QString loadStyleInfo(ChatStyle::enumStyleType type, QListWidget *listWidget, QComboBox *comboBox, QString &styleVariant)
+static QString loadStyleInfo(ChatStyle::enumStyleType type, QComboBox *style_CB, QComboBox *comboBox, QString &styleVariant)
{
QList styles;
QList::iterator style;
- QListWidgetItem *item;
- QListWidgetItem *activeItem = NULL;
+ int activeItem = 0;
QString stylePath;
@@ -69,17 +68,22 @@ static QString loadStyleInfo(ChatStyle::enumStyleType type, QListWidget *listWid
}
ChatStyle::getAvailableStyles(type, styles);
- for (style = styles.begin(); style != styles.end(); ++style) {
- item = new QListWidgetItem(style->styleName);
- item->setData(Qt::UserRole, qVariantFromValue(*style));
- listWidget->addItem(item);
+
+ while(style_CB->count())
+ style_CB->removeItem(0) ;
+
+ int n=0;
+ for (style = styles.begin(); style != styles.end(); ++style,++n)
+ {
+ style_CB->insertItem(n,style->styleName);
+ style_CB->setItemData(n, qVariantFromValue(*style),Qt::UserRole);
if (style->stylePath == stylePath) {
- activeItem = item;
+ activeItem = n;
}
}
- listWidget->setCurrentItem(activeItem);
+ style_CB->setCurrentIndex(activeItem);
/* now the combobox should be filled */
@@ -165,40 +169,31 @@ void ChatPage::updateHistoryParams()
void ChatPage::updatePublicStyle()
{
- ChatStyleInfo info;
- QListWidgetItem *item = ui.publicList->currentItem();
- if (item) {
- info = item->data(Qt::UserRole).value();
- if (publicStylePath != info.stylePath || publicStyleVariant != ui.publicComboBoxVariant->currentText()) {
- Settings->setPublicChatStyle(info.stylePath, ui.publicComboBoxVariant->currentText());
- NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_PUBLIC);
- }
+ ChatStyleInfo info = ui.publicStyle->itemData(ui.historyStyle->currentIndex(),Qt::UserRole).value();
+
+ if (publicStylePath != info.stylePath || publicStyleVariant != ui.publicComboBoxVariant->currentText()) {
+ Settings->setPublicChatStyle(info.stylePath, ui.publicComboBoxVariant->currentText());
+ NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_PUBLIC);
}
}
void ChatPage::updatePrivateStyle()
{
- ChatStyleInfo info;
- QListWidgetItem *item = ui.privateList->currentItem();
- if (item) {
- info = item->data(Qt::UserRole).value();
- if (privateStylePath != info.stylePath || privateStyleVariant != ui.privateComboBoxVariant->currentText()) {
- Settings->setPrivateChatStyle(info.stylePath, ui.privateComboBoxVariant->currentText());
- NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_PRIVATE);
- }
+ ChatStyleInfo info = ui.privateStyle->itemData(ui.historyStyle->currentIndex(),Qt::UserRole).value();
+
+ if (privateStylePath != info.stylePath || privateStyleVariant != ui.privateComboBoxVariant->currentText()) {
+ Settings->setPrivateChatStyle(info.stylePath, ui.privateComboBoxVariant->currentText());
+ NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_PRIVATE);
}
}
void ChatPage::updateHistoryStyle()
{
- ChatStyleInfo info;
- QListWidgetItem *item = ui.historyList->currentItem();
- if (item) {
- info = item->data(Qt::UserRole).value();
- if (historyStylePath != info.stylePath || historyStyleVariant != ui.historyComboBoxVariant->currentText()) {
- Settings->setHistoryChatStyle(info.stylePath, ui.historyComboBoxVariant->currentText());
- NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_HISTORY);
- }
+ ChatStyleInfo info = ui.historyStyle->itemData(ui.historyStyle->currentIndex(),Qt::UserRole).value();
+
+ if (historyStylePath != info.stylePath || historyStyleVariant != ui.historyComboBoxVariant->currentText()) {
+ Settings->setHistoryChatStyle(info.stylePath, ui.historyComboBoxVariant->currentText());
+ NotifyQt::getInstance()->notifyChatStyleChanged(ChatStyle::TYPE_HISTORY);
}
}
@@ -251,13 +246,13 @@ ChatPage::ChatPage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.privateChatSaveCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
connect(ui.lobbyChatSaveCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams()));
- connect(ui.publicList, SIGNAL(currentRowChanged(int)), this, SLOT(updatePublicStyle())) ;
+ connect(ui.publicStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePublicStyle())) ;
connect(ui.publicComboBoxVariant, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePublicStyle())) ;
- connect(ui.privateList, SIGNAL(currentRowChanged(int)), this, SLOT(updatePrivateStyle())) ;
+ connect(ui.privateStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePrivateStyle())) ;
connect(ui.privateComboBoxVariant, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePrivateStyle())) ;
- connect(ui.historyList, SIGNAL(currentRowChanged(int)), this, SLOT(updateHistoryStyle())) ;
+ connect(ui.historyStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updateHistoryStyle())) ;
connect(ui.historyComboBoxVariant, SIGNAL(currentIndexChanged(int)), this, SLOT(updateHistoryStyle())) ;
connect(ui.max_storage_period, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryStorage())) ;
@@ -268,6 +263,10 @@ ChatPage::ChatPage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.chat_Blink, SIGNAL(toggled(bool)), this, SLOT(updateChatFlags()));
connect(ui.chatLobby_Blink, SIGNAL(toggled(bool)), this, SLOT(updateChatLobbyFlags()));
+
+ connect(ui.publicStyle, SIGNAL(currentIndexChanged(int)), this,SLOT(on_publicList_currentRowChanged(int)));
+ connect(ui.privateStyle, SIGNAL(currentIndexChanged(int)), this,SLOT(on_privateList_currentRowChanged(int)));
+ connect(ui.historyStyle, SIGNAL(currentIndexChanged(int)), this,SLOT(on_historyList_currentRowChanged(int)));
}
void ChatPage::updateChatFlags()
{
@@ -359,9 +358,9 @@ ChatPage::load()
ui.max_storage_period->setValue(rsHistory->getMaxStorageDuration()/86400) ;
/* Load styles */
- publicStylePath = loadStyleInfo(ChatStyle::TYPE_PUBLIC, ui.publicList, ui.publicComboBoxVariant, publicStyleVariant);
- privateStylePath = loadStyleInfo(ChatStyle::TYPE_PRIVATE, ui.privateList, ui.privateComboBoxVariant, privateStyleVariant);
- historyStylePath = loadStyleInfo(ChatStyle::TYPE_HISTORY, ui.historyList, ui.historyComboBoxVariant, historyStyleVariant);
+ publicStylePath = loadStyleInfo(ChatStyle::TYPE_PUBLIC, ui.publicStyle, ui.publicComboBoxVariant, publicStyleVariant);
+ privateStylePath = loadStyleInfo(ChatStyle::TYPE_PRIVATE, ui.privateStyle, ui.privateComboBoxVariant, privateStyleVariant);
+ historyStylePath = loadStyleInfo(ChatStyle::TYPE_HISTORY, ui.historyStyle, ui.historyComboBoxVariant, historyStyleVariant);
RsGxsId gxs_id ;
rsMsgs->getDefaultIdentityForChatLobby(gxs_id) ;
@@ -438,23 +437,17 @@ void ChatPage::setPreviewMessages(QString &stylePath, QString styleVariant, QTex
textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_OUTGOING, tr("UserName"), timestmp, tr("/me is sending a message with /me"), 0, backgroundColor));
}
-void ChatPage::fillPreview(QListWidget *listWidget, QComboBox *comboBox, QTextBrowser *textBrowser)
+void ChatPage::fillPreview(QComboBox *listWidget, QComboBox *comboBox, QTextBrowser *textBrowser)
{
- QListWidgetItem *item = listWidget->currentItem();
- if (item) {
- ChatStyleInfo info = item->data(Qt::UserRole).value();
+ ChatStyleInfo info = listWidget->itemData(listWidget->currentIndex(),Qt::UserRole).value();
- setPreviewMessages(info.stylePath, comboBox->currentText(), textBrowser);
- } else {
- textBrowser->clear();
- }
+ setPreviewMessages(info.stylePath, comboBox->currentText(), textBrowser);
}
void ChatPage::on_publicList_currentRowChanged(int currentRow)
{
if (currentRow != -1) {
- QListWidgetItem *item = ui.publicList->item(currentRow);
- ChatStyleInfo info = item->data(Qt::UserRole).value();
+ ChatStyleInfo info = ui.publicStyle->itemData(currentRow,Qt::UserRole).value();
QString author = info.authorName;
if (info.authorEmail.isEmpty() == false) {
@@ -483,14 +476,13 @@ void ChatPage::on_publicList_currentRowChanged(int currentRow)
ui.publicComboBoxVariant->setDisabled(true);
}
- fillPreview(ui.publicList, ui.publicComboBoxVariant, ui.publicPreview);
+ fillPreview(ui.publicStyle, ui.publicComboBoxVariant, ui.publicPreview);
}
void ChatPage::on_privateList_currentRowChanged(int currentRow)
{
if (currentRow != -1) {
- QListWidgetItem *item = ui.privateList->item(currentRow);
- ChatStyleInfo info = item->data(Qt::UserRole).value();
+ ChatStyleInfo info = ui.privateStyle->itemData(ui.privateStyle->currentIndex(),Qt::UserRole).value();
QString author = info.authorName;
if (info.authorEmail.isEmpty() == false) {
@@ -519,14 +511,13 @@ void ChatPage::on_privateList_currentRowChanged(int currentRow)
ui.privateComboBoxVariant->setDisabled(true);
}
- fillPreview(ui.privateList, ui.privateComboBoxVariant, ui.privatePreview);
+ fillPreview(ui.privateStyle, ui.privateComboBoxVariant, ui.privatePreview);
}
void ChatPage::on_historyList_currentRowChanged(int currentRow)
{
if (currentRow != -1) {
- QListWidgetItem *item = ui.historyList->item(currentRow);
- ChatStyleInfo info = item->data(Qt::UserRole).value();
+ ChatStyleInfo info = ui.historyStyle->itemData(ui.historyStyle->currentIndex(),Qt::UserRole).value();
QString author = info.authorName;
if (info.authorEmail.isEmpty() == false) {
@@ -555,22 +546,22 @@ void ChatPage::on_historyList_currentRowChanged(int currentRow)
ui.historyComboBoxVariant->setDisabled(true);
}
- fillPreview(ui.historyList, ui.historyComboBoxVariant, ui.historyPreview);
+ fillPreview(ui.historyStyle, ui.historyComboBoxVariant, ui.historyPreview);
}
void ChatPage::on_publicComboBoxVariant_currentIndexChanged(int /*index*/)
{
- fillPreview(ui.publicList, ui.publicComboBoxVariant, ui.publicPreview);
+ fillPreview(ui.publicStyle, ui.publicComboBoxVariant, ui.publicPreview);
}
void ChatPage::on_privateComboBoxVariant_currentIndexChanged(int /*index*/)
{
- fillPreview(ui.privateList, ui.privateComboBoxVariant, ui.privatePreview);
+ fillPreview(ui.privateStyle, ui.privateComboBoxVariant, ui.privatePreview);
}
void ChatPage::on_historyComboBoxVariant_currentIndexChanged(int /*index*/)
{
- fillPreview(ui.historyList, ui.historyComboBoxVariant, ui.historyPreview);
+ fillPreview(ui.historyStyle, ui.historyComboBoxVariant, ui.historyPreview);
}
void ChatPage::on_cbSearch_WithoutLimit_toggled(bool checked)
diff --git a/retroshare-gui/src/gui/settings/ChatPage.h b/retroshare-gui/src/gui/settings/ChatPage.h
index 8f7048e2c..40ef1d8c9 100644
--- a/retroshare-gui/src/gui/settings/ChatPage.h
+++ b/retroshare-gui/src/gui/settings/ChatPage.h
@@ -70,7 +70,7 @@ class ChatPage : public ConfigPage
private:
void setPreviewMessages(QString &stylePath, QString styleVariant, QTextBrowser *textBrowser);
- void fillPreview(QListWidget *listWidget, QComboBox *comboBox, QTextBrowser *textBrowser);
+ void fillPreview(QComboBox *listWidget, QComboBox *comboBox, QTextBrowser *textBrowser);
QFont fontTempChat;
diff --git a/retroshare-gui/src/gui/settings/ChatPage.ui b/retroshare-gui/src/gui/settings/ChatPage.ui
index de8ffbdb4..152e3530e 100644
--- a/retroshare-gui/src/gui/settings/ChatPage.ui
+++ b/retroshare-gui/src/gui/settings/ChatPage.ui
@@ -6,15 +6,15 @@
0
0
- 635
- 600
+ 1216
+ 1107
-
- 0
+ 2
@@ -866,109 +866,75 @@
QTabWidget::North
- 0
+ 2
Group chat
-
+
-
-
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
-
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 170
- 16777215
-
-
-
-
- -
-
-
-
-
-
-
- 0
- 0
-
-
-
- Variant
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
+
+
+ Style:
+
+
-
-
+
+
+ -
+
-
+
+ 0
+ 0
+
+
+
+ Variant:
+
+
+
+ -
+
+
+
0
0
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
-
-
-
-
-
- QLayout::SetFixedSize
-
-
-
-
-
-
- 0
- 0
-
-
-
- Author:
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Description:
-
-
-
-
-
-
-
@@ -999,6 +965,19 @@
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
@@ -1007,103 +986,69 @@
Private chat
-
+
-
-
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
-
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 170
- 16777215
-
-
-
-
- -
-
-
-
-
-
-
- 0
- 0
-
-
-
- Variant
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
+
+
+ Style:
+
+
-
-
+
+
+ -
+
-
+
+ 0
+ 0
+
+
+
+ Variant:
+
+
+
+ -
+
+
+
0
0
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
-
-
-
-
-
- QLayout::SetFixedSize
-
-
-
-
-
-
- 0
- 0
-
-
-
- Author:
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Description:
-
-
-
-
-
-
-
@@ -1134,6 +1079,19 @@
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
@@ -1142,103 +1100,69 @@
History
-
+
-
-
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
-
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 170
- 16777215
-
-
-
-
- -
-
-
-
-
-
-
- 0
- 0
-
-
-
- Variant
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
-
+
+
+ Style:
+
+
-
-
+
+
+ -
+
-
+
+ 0
+ 0
+
+
+
+ Variant:
+
+
+
+ -
+
+
+
0
0
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
-
-
-
-
-
- QLayout::SetFixedSize
-
-
-
-
-
-
- 0
- 0
-
-
-
- Author:
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Description:
-
-
-
-
-
-
-
@@ -1269,6 +1193,19 @@
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
diff --git a/retroshare-gui/src/gui/settings/PluginsPage.ui b/retroshare-gui/src/gui/settings/PluginsPage.ui
index 895bafed7..3da9a5696 100644
--- a/retroshare-gui/src/gui/settings/PluginsPage.ui
+++ b/retroshare-gui/src/gui/settings/PluginsPage.ui
@@ -7,7 +7,7 @@
0
0
423
- 340
+ 514
@@ -16,6 +16,12 @@
-
+
+
+ 0
+ 0
+
+
Authorize all plugins
@@ -29,6 +35,12 @@
-
+
+
+ 0
+ 0
+
+
QFrame::NoFrame
@@ -40,7 +52,7 @@
0
0
- 920
+ 345
16
@@ -54,7 +66,16 @@
3
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
@@ -71,11 +92,31 @@
-
-
+
+
+
+ 0
+ 0
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
diff --git a/retroshare-gui/src/gui/settings/RelayPage.ui b/retroshare-gui/src/gui/settings/RelayPage.ui
index 78e7a7074..f753b0c49 100644
--- a/retroshare-gui/src/gui/settings/RelayPage.ui
+++ b/retroshare-gui/src/gui/settings/RelayPage.ui
@@ -6,8 +6,8 @@
0
0
- 486
- 360
+ 794
+ 546
@@ -64,7 +64,16 @@
Relay options
-
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
0
@@ -318,25 +327,6 @@
Relay Server Setup
-
- 6
-
-
- 0
-
-
- 0
-
- -
-
-
- HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH;
-
-
-
-
-
-
-
@@ -357,6 +347,16 @@
+ -
+
+
+ HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
+
+
+
+
+
+
-
@@ -376,6 +376,19 @@
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
diff --git a/retroshare-gui/src/gui/settings/ServerPage.ui b/retroshare-gui/src/gui/settings/ServerPage.ui
index 894545470..1893bdc7e 100755
--- a/retroshare-gui/src/gui/settings/ServerPage.ui
+++ b/retroshare-gui/src/gui/settings/ServerPage.ui
@@ -6,8 +6,8 @@
0
0
- 724
- 568
+ 1220
+ 884
@@ -26,7 +26,7 @@
-
- 0
+ 2
@@ -506,11 +506,25 @@ behind a firewall or a VPN.
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
showDiscStatusBar
allowIpDeterminationCB
IPServersLV
ipAddressList
+ verticalSpacer
@@ -765,6 +779,19 @@ behind a firewall or a VPN.
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
diff --git a/retroshare-gui/src/gui/settings/TransferPage.ui b/retroshare-gui/src/gui/settings/TransferPage.ui
index 9819b267e..5d69fcdba 100644
--- a/retroshare-gui/src/gui/settings/TransferPage.ui
+++ b/retroshare-gui/src/gui/settings/TransferPage.ui
@@ -6,8 +6,8 @@
0
0
- 741
- 422
+ 754
+ 512
@@ -181,6 +181,19 @@ p, li { white-space: pre-wrap; }
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
From 3c75135f917f48c0a149b092fba7eb5b14c16da9 Mon Sep 17 00:00:00 2001
From: csoler
Date: Wed, 15 Feb 2017 21:50:53 +0100
Subject: [PATCH 51/90] pass over AppearancePage to fit to the removal of tool
buttons
---
.../src/gui/settings/AppearancePage.cpp | 112 +++++++++---------
.../src/gui/settings/AppearancePage.h | 4 +-
.../src/gui/settings/AppearancePage.ui | 87 +-------------
3 files changed, 60 insertions(+), 143 deletions(-)
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.cpp b/retroshare-gui/src/gui/settings/AppearancePage.cpp
index 92747816b..bea9959d9 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.cpp
+++ b/retroshare-gui/src/gui/settings/AppearancePage.cpp
@@ -86,7 +86,7 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
}
connect(ui.cmboTollButtonsSize, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCmboToolButtonSize() ));
- connect(ui.cmboListItemSize, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCmboListItemSize() ));
+// connect(ui.cmboListItemSize, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCmboListItemSize() ));
connect(ui.cmboTollButtonsStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updateCmboToolButtonStyle()));
connect(ui.cmboLanguage, SIGNAL(currentIndexChanged(int)), this, SLOT(updateLanguageCode() ));
connect(ui.cmboStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(updateInterfaceStyle() ));
@@ -94,7 +94,7 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), this, SLOT(updateStatusToolTip() ));
connect(ui.mainPageButtonType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(updateRbtPageOnToolBar() ));
- connect(ui.menuItemsButtonType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(updateActionButtonLoc() ));
+// connect(ui.menuItemsButtonType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(updateActionButtonLoc() ));
}
void AppearancePage::switch_status_grpStatus(bool b) { switch_status(MainWindow::StatusGrpStatus ,"ShowStatusBar", b) ; }
@@ -133,11 +133,7 @@ void AppearancePage::updateSheetName() { Settings->setSheetName(ui.cmboSt
void AppearancePage::updateRbtPageOnToolBar()
{
Settings->setPageButtonLoc(!ui.mainPageButtonType_CB->currentIndex());
- NotifyQt::getInstance()->notifySettingsChanged();
-}
-void AppearancePage::updateActionButtonLoc()
-{
- Settings->setActionButtonLoc(!ui.menuItemsButtonType_CB->currentIndex());
+ Settings->setActionButtonLoc(!ui.mainPageButtonType_CB->currentIndex());
NotifyQt::getInstance()->notifySettingsChanged();
}
void AppearancePage::updateStatusToolTip() { MainWindow::getInstance()->toggleStatusToolTip(ui.checkBoxDisableSysTrayToolTip->isChecked()); }
@@ -168,50 +164,56 @@ void AppearancePage::updateCmboToolButtonSize()
{
case 0:
Settings->setToolButtonSize(8);
- break;
- case 1:
- Settings->setToolButtonSize(16);
- break;
- case 2:
- default:
- Settings->setToolButtonSize(24);
- break;
- case 3:
- Settings->setToolButtonSize(32);
- break;
- case 4:
- Settings->setToolButtonSize(64);
- break;
- case 5:
- Settings->setToolButtonSize(128);
- }
- NotifyQt::getInstance()->notifySettingsChanged();
-}
-void AppearancePage::updateCmboListItemSize()
-{
- switch (ui.cmboListItemSize->currentIndex())
- {
- case 0:
Settings->setListItemIconSize(8);
break;
case 1:
+ Settings->setToolButtonSize(16);
Settings->setListItemIconSize(16);
break;
case 2:
default:
+ Settings->setToolButtonSize(24);
Settings->setListItemIconSize(24);
break;
case 3:
+ Settings->setToolButtonSize(32);
Settings->setListItemIconSize(32);
break;
case 4:
- Settings->setListItemIconSize(64);
+ Settings->setToolButtonSize(64);
+ Settings->setListItemIconSize(64);
break;
case 5:
- Settings->setListItemIconSize(128);
+ Settings->setToolButtonSize(128);
+ Settings->setListItemIconSize(128);
}
NotifyQt::getInstance()->notifySettingsChanged();
}
+// void AppearancePage::updateCmboListItemSize()
+// {
+// switch (ui.cmboListItemSize->currentIndex())
+// {
+// case 0:
+// Settings->setListItemIconSize(8);
+// break;
+// case 1:
+// Settings->setListItemIconSize(16);
+// break;
+// case 2:
+// default:
+// Settings->setListItemIconSize(24);
+// break;
+// case 3:
+// Settings->setListItemIconSize(32);
+// break;
+// case 4:
+// Settings->setListItemIconSize(64);
+// break;
+// case 5:
+// Settings->setListItemIconSize(128);
+// }
+// NotifyQt::getInstance()->notifySettingsChanged();
+// }
void AppearancePage::updateStyle() { Rshare::setStyle(ui.cmboStyle->currentText()); }
@@ -232,7 +234,7 @@ void AppearancePage::load()
ui.cmboStyleSheet->setCurrentIndex(index);
ui.mainPageButtonType_CB->setCurrentIndex(!Settings->getPageButtonLoc());
- ui.menuItemsButtonType_CB->setCurrentIndex(!Settings->getActionButtonLoc());
+// ui.menuItemsButtonType_CB->setCurrentIndex(!Settings->getActionButtonLoc());
switch (Settings->getToolButtonStyle())
{
@@ -270,27 +272,27 @@ void AppearancePage::load()
case 128:
ui.cmboTollButtonsSize->setCurrentIndex(5);
}
- switch (Settings->getListItemIconSize())
- {
- case 8:
- ui.cmboListItemSize->setCurrentIndex(0);
- break;
- case 16:
- ui.cmboListItemSize->setCurrentIndex(1);
- break;
- case 24:
- default:
- ui.cmboListItemSize->setCurrentIndex(2);
- break;
- case 32:
- ui.cmboListItemSize->setCurrentIndex(3);
- break;
- case 64:
- ui.cmboListItemSize->setCurrentIndex(4);
- break;
- case 128:
- ui.cmboListItemSize->setCurrentIndex(5);
- }
+// switch (Settings->getListItemIconSize())
+// {
+// case 8:
+// ui.cmboListItemSize->setCurrentIndex(0);
+// break;
+// case 16:
+// ui.cmboListItemSize->setCurrentIndex(1);
+// break;
+// case 24:
+// default:
+// ui.cmboListItemSize->setCurrentIndex(2);
+// break;
+// case 32:
+// ui.cmboListItemSize->setCurrentIndex(3);
+// break;
+// case 64:
+// ui.cmboListItemSize->setCurrentIndex(4);
+// break;
+// case 128:
+// ui.cmboListItemSize->setCurrentIndex(5);
+// }
ui.grpStatus->setChecked(Settings->valueFromGroup("StatusBar", "ShowStatusBar", QVariant(true)).toBool());
ui.checkBoxStatusCompactMode->setChecked(Settings->valueFromGroup("StatusBar", "CompactMode", QVariant(false)).toBool());
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.h b/retroshare-gui/src/gui/settings/AppearancePage.h
index a80b97d1a..09610a22d 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.h
+++ b/retroshare-gui/src/gui/settings/AppearancePage.h
@@ -62,12 +62,12 @@ private slots:
void updateInterfaceStyle() ;
void updateSheetName() ;
void updateRbtPageOnToolBar();
- void updateActionButtonLoc() ;
+// void updateActionButtonLoc() ;
void updateStatusToolTip() ;
void updateCmboToolButtonStyle();
void updateCmboToolButtonSize();
- void updateCmboListItemSize();
+// void updateCmboListItemSize();
void updateStyle() ;
private:
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.ui b/retroshare-gui/src/gui/settings/AppearancePage.ui
index f05634f8f..4eecd3e3d 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.ui
+++ b/retroshare-gui/src/gui/settings/AppearancePage.ui
@@ -6,7 +6,7 @@
0
0
- 1160
+ 1170
897
@@ -237,44 +237,6 @@
- -
-
-
-
-
-
- Menu items:
-
-
-
- -
-
-
-
-
- Buttons
-
-
- -
-
- Item list
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 300
- 16
-
-
-
-
-
-
-
@@ -324,19 +286,6 @@
- -
-
-
-
- 0
- 0
-
-
-
- Choose the style of List Items.
-
-
-
-
-
@@ -371,40 +320,6 @@
- -
-
-
-
-
- Icon Size = 8x8
-
-
- -
-
- Icon Size = 16x16
-
-
- -
-
- Icon Size = 24x24
-
-
- -
-
- Icon Size = 32x32
-
-
- -
-
- Icon Size = 64x64
-
-
- -
-
- Icon Size = 128x128
-
-
-
-
From dcab611d779a8f48e398076cb39a6a9cf3be7a21 Mon Sep 17 00:00:00 2001
From: csoler
Date: Thu, 16 Feb 2017 09:53:54 +0100
Subject: [PATCH 52/90] improved layout of Home page
---
retroshare-gui/src/gui/ChatLobbyWidget.cpp | 4 +-
retroshare-gui/src/gui/HomePage.ui | 201 +++++++++++----------
2 files changed, 105 insertions(+), 100 deletions(-)
diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp
index 904bb8c4f..37dd2c734 100644
--- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp
+++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp
@@ -847,7 +847,7 @@ void ChatLobbyWidget::showBlankPage(ChatLobbyId id)
if( (*it).lobby_flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED)
text += "\n\n"+tr("You will need to create a non anonymous identity in order to join this chat room.") ;
else
- text += "\n\n"+tr("You will need to create an identity in order to join chat lobbies.") ;
+ text += "\n\n"+tr("You will need to create an identity in order to join chat rooms.") ;
}
ui.lobbyInfoLabel->setText(text);
@@ -861,7 +861,7 @@ void ChatLobbyWidget::showBlankPage(ChatLobbyId id)
ui.lobbypeers_lineEdit->clear();
ui.lobbysec_lineEdit->clear();
- QString text = tr("No chat room selected. \nSelect chat rooms at left to show details.\nDouble click lobbies to enter and chat.") ;
+ QString text = tr("No chat room selected. \nSelect chat rooms at left to show details.\nDouble click a chat room to enter and chat.") ;
ui.lobbyInfoLabel->setText(text) ;
}
diff --git a/retroshare-gui/src/gui/HomePage.ui b/retroshare-gui/src/gui/HomePage.ui
index 6a53ecbc9..ec327d40f 100644
--- a/retroshare-gui/src/gui/HomePage.ui
+++ b/retroshare-gui/src/gui/HomePage.ui
@@ -6,8 +6,8 @@
0
0
- 886
- 584
+ 1558
+ 699
@@ -17,7 +17,7 @@
-
-
+
0
0
@@ -33,6 +33,71 @@
+ -
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
+ -
+
+
+
+
+
+
-
+
+
+
+ 11
+
+
+
+
+
+
+ Did you receive a certificate from a friend?
+
+
+
+ -
+
+
+ Add friends certificate
+
+
+
+ :/icons/png/invite.png:/icons/png/invite.png
+
+
+
+ 24
+ 24
+
+
+
+ Qt::ToolButtonTextBesideIcon
+
+
+ false
+
+
+
+
+
+
-
@@ -44,6 +109,33 @@
2
+
-
+
+
+
+ Courier New
+
+
+
+
+
+
+
+
+
+ QPlainTextEdit::NoWrap
+
+
+ true
+
+
+ 80
+
+
+ false
+
+
+
-
@@ -58,7 +150,7 @@
- The text below is your Retroshare certificate. Copy and share it with your friends
+ The text below is your own Retroshare certificate. Send it to your friends
Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft
@@ -97,53 +189,8 @@
- -
-
-
-
- Courier New
-
-
-
-
-
-
-
-
-
- QPlainTextEdit::NoWrap
-
-
- true
-
-
- 80
-
-
- false
-
-
-
- -
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
@@ -152,7 +199,7 @@
- RetroShare is an Open Source cross-platform,
+ Open Source cross-platform,
private and secure decentralized commmunication platform.
@@ -161,58 +208,16 @@ private and secure decentralized commmunication platform.
- -
-
-
-
-
-
-
-
-
-
-
- 11
-
-
-
-
-
-
- You get certificate from your friend?
-
-
-
- -
-
-
- Add friends certificate
-
-
-
- :/icons/png/invite.png:/icons/png/invite.png
-
-
-
- 24
- 24
-
-
-
- Qt::ToolButtonTextBesideIcon
-
-
- false
-
-
-
-
-
-
+ label
+ addFrame
+ label_2
+ addframe
+ label_3
-
+
From f9f79d430690b308231398f4e63d3fa169c207d2 Mon Sep 17 00:00:00 2001
From: csoler
Date: Thu, 16 Feb 2017 10:17:29 +0100
Subject: [PATCH 53/90] removed some mentions to PGP
---
retroshare-gui/src/gui/FriendsDialog.h | 2 +-
.../src/gui/connect/ConfCertDialog.cpp | 2 +-
.../src/gui/connect/ConfCertDialog.ui | 83 +++++++++----------
.../src/gui/connect/ConnectFriendWizard.ui | 2 +-
.../src/gui/connect/PGPKeyDialog.cpp | 2 +-
.../src/gui/connect/PGPKeyDialog.ui | 20 ++---
6 files changed, 52 insertions(+), 59 deletions(-)
diff --git a/retroshare-gui/src/gui/FriendsDialog.h b/retroshare-gui/src/gui/FriendsDialog.h
index d37e395a7..6b464c130 100644
--- a/retroshare-gui/src/gui/FriendsDialog.h
+++ b/retroshare-gui/src/gui/FriendsDialog.h
@@ -57,7 +57,7 @@ public:
~FriendsDialog ();
virtual QIcon iconPixmap() const { return QIcon(IMAGE_NETWORK) ; } //MainPage
- virtual QString pageName() const { return tr("Friends") ; } //MainPage
+ virtual QString pageName() const { return tr("Trusted nodes") ; } //MainPage
virtual QString helpText() const { return ""; } //MainPage
virtual UserNotify *getUserNotify(QObject *parent);
diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp
index 9dba69c27..958b2be54 100644
--- a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp
+++ b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp
@@ -287,7 +287,7 @@ void ConfCertDialog::loadInvitePage()
//infotext += tr("Use this certificate to make new friends. Send it by email, or give it hand to hand.
") ;
infotext += tr("This certificate contains:") ;
infotext += "
" ;
- infotext += "- a PGP public key";
+ infotext += "
- a Profile key";
infotext += " (" + QString::fromUtf8(detail.name.c_str()) + "@" + detail.gpg_id.toStdString().c_str()+") " ;
if(ui._shouldAddSignatures_CB->isChecked())
infotext += tr("with")+" "+QString::number(detail.gpgSigners.size()-1)+" "+tr("external signatures
") ;
diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.ui b/retroshare-gui/src/gui/connect/ConfCertDialog.ui
index 66724a7a7..469bae218 100644
--- a/retroshare-gui/src/gui/connect/ConfCertDialog.ui
+++ b/retroshare-gui/src/gui/connect/ConfCertDialog.ui
@@ -7,7 +7,7 @@
0
0
722
- 546
+ 651
@@ -69,7 +69,7 @@
-
- 0
+ 1
@@ -270,13 +270,13 @@
:/images/kcmsystem24.png:/images/kcmsystem24.png
- Advanced
+ Connectivity
-
- 0
+ 1
@@ -424,51 +424,44 @@
-
-
- Retroshare Certificate
-
-
- -
-
-
- Use this certificate to make friends:
-
-
-
- -
-
-
- -
-
-
-
-
-
- Include signatures
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
-
-
+
+
+ Retroshare Certificate
+
+
+ -
+
+
+ -
+
+
-
+
+
+ Include signatures
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+
+
diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui b/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui
index dbe8220b1..cea2104de 100644
--- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui
+++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.ui
@@ -333,7 +333,7 @@
- <html><head/><body><p>This box expects your friend's Retroshare certificate. WARNING: this is different from your friend's PGP key. Do not paste your friend's PGP key here (not even a part of it). It's not going to work.</p></body></html>
+ <html><head/><body><p>This box expects your friend's Retroshare certificate. WARNING: this is different from your friend's profile key. Do not paste your friend's profile key here (not even a part of it). It's not going to work.</p></body></html>
diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp
index 310ff55c8..d99300706 100644
--- a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp
+++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp
@@ -75,7 +75,7 @@ PGPKeyDialog::PGPKeyDialog(const RsPeerId& id, const RsPgpId &pgp_id, QWidget *p
// }
ui.headerFrame->setHeaderImage(QPixmap(":/images/user/identityinfo64.png"));
- ui.headerFrame->setHeaderText(tr("PGP Key details"));
+ ui.headerFrame->setHeaderText(tr("Retroshare profile"));
//ui._chat_CB->hide() ;
diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.ui b/retroshare-gui/src/gui/connect/PGPKeyDialog.ui
index 0d34ca4bb..065575e7e 100644
--- a/retroshare-gui/src/gui/connect/PGPKeyDialog.ui
+++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.ui
@@ -6,8 +6,8 @@
0
0
- 990
- 668
+ 1071
+ 718
@@ -27,11 +27,11 @@
-
- 0
+ 1
- PGP Key info
+ Profile info
-
@@ -41,7 +41,7 @@
-
- PGP name :
+ Name :
@@ -153,7 +153,7 @@
- This key has signed your own PGP key
+ This profile has signed your own profile key
@@ -197,7 +197,7 @@ p, li { white-space: pre-wrap; }
<p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Signing a friend's key is a way to express your trust into this friend, to your other friends. It helps them to decide whether to allow connections from that key based on your own trust. Signing a key is absolutely optional and cannot be undone, so do it wisely.</span></p></body></html>
- Sign this PGP key
+ Sign this key
@@ -301,13 +301,13 @@ p, li { white-space: pre-wrap; }
- ASCII format
+ PGP key
-
- Below is the node's PGP key. It identifies the node and all its locations. A "Retroshare certificate" that you can exchange in order to make friends, is in the the "details" of each separate location.
+ Below is the node's profile key in PGP ascii format. It identifies all nodes of the same profile. A "Retroshare certificate" that you can exchange in order to make friends, is in the the "details" of each separate node.
true
@@ -348,7 +348,7 @@ p, li { white-space: pre-wrap; }
-
- These options apply to all locations of the same node:
+ These options apply to all nodes of the profile:
From cda3c744af2cc63371fcbbb5ee57055530f0e400 Mon Sep 17 00:00:00 2001
From: cyril soler
Date: Fri, 17 Feb 2017 09:17:22 +0100
Subject: [PATCH 54/90] attempt at fixing a bug that can cause a crash in
p3filelists.cc
---
libretroshare/src/file_sharing/p3filelists.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libretroshare/src/file_sharing/p3filelists.cc b/libretroshare/src/file_sharing/p3filelists.cc
index a673247b7..f87cb0d6e 100644
--- a/libretroshare/src/file_sharing/p3filelists.cc
+++ b/libretroshare/src/file_sharing/p3filelists.cc
@@ -896,9 +896,9 @@ uint32_t p3FileDatabase::getType(void *ref) const
if(e == 0)
return DIR_TYPE_PERSON ;
- if(fi == 0)
+ if(fi == 0 && mLocalSharedDirs != NULL)
return mLocalSharedDirs->getEntryType(e) ;
- else if(mRemoteDirectories[fi-1]!=NULL)
+ else if(fi-1 < mRemoteDirectories.size() && mRemoteDirectories[fi-1]!=NULL)
return mRemoteDirectories[fi-1]->getEntryType(e) ;
else
return DIR_TYPE_ROOT ;// some failure case. Should not happen
From 63a221007c62b14e40995a94a351452d4b0501d0 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sat, 18 Feb 2017 14:40:44 +0100
Subject: [PATCH 55/90] fixing compilation with openssl-1.1.0 (part 1)
---
openpgpsdk/src/openpgpsdk/openssl_crypto.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/openpgpsdk/src/openpgpsdk/openssl_crypto.c b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
index a9457208c..afb92f22d 100644
--- a/openpgpsdk/src/openpgpsdk/openssl_crypto.c
+++ b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
@@ -45,10 +45,17 @@ void test_secret_key(const ops_secret_key_t *skey)
{
RSA* test=RSA_new();
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
test->n=BN_dup(skey->public_key.key.rsa.n);
test->e=BN_dup(skey->public_key.key.rsa.e);
-
test->d=BN_dup(skey->key.rsa.d);
+#else
+ RSA_set0_key(test,
+ BN_dup(skey->public_key.key.rsa.n),
+ BN_dup(skey->public_key.key.rsa.e),
+ BN_dup(skey->key.rsa.d));
+#endif
+
test->p=BN_dup(skey->key.rsa.p);
test->q=BN_dup(skey->key.rsa.q);
@@ -392,8 +399,13 @@ ops_boolean_t ops_dsa_verify(const unsigned char *hash,size_t hash_length,
int ret;
osig=DSA_SIG_new();
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
osig->r=sig->r;
osig->s=sig->s;
+#else
+ DSA_SIG_set0(osig,sig->r,sig->s) ;
+#endif
if(BN_num_bits(dsa->q) != 160)
{
From ba52b059686abbd80982025045ca04be44725ff8 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sat, 18 Feb 2017 15:28:27 +0100
Subject: [PATCH 56/90] fixing compilation for openssl-1.1.0 (part 2)
---
openpgpsdk/src/openpgpsdk/openssl_crypto.c | 29 ++++++++++++----------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/openpgpsdk/src/openpgpsdk/openssl_crypto.c b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
index afb92f22d..c68f13021 100644
--- a/openpgpsdk/src/openpgpsdk/openssl_crypto.c
+++ b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
@@ -49,15 +49,17 @@ void test_secret_key(const ops_secret_key_t *skey)
test->n=BN_dup(skey->public_key.key.rsa.n);
test->e=BN_dup(skey->public_key.key.rsa.e);
test->d=BN_dup(skey->key.rsa.d);
+
+ test->p=BN_dup(skey->key.rsa.p);
+ test->q=BN_dup(skey->key.rsa.q);
#else
RSA_set0_key(test,
BN_dup(skey->public_key.key.rsa.n),
BN_dup(skey->public_key.key.rsa.e),
BN_dup(skey->key.rsa.d));
-#endif
- test->p=BN_dup(skey->key.rsa.p);
- test->q=BN_dup(skey->key.rsa.q);
+ RSA_set0_factors(test, BN_dup(skey->key.rsa.p), BN_dup(skey->key.rsa.q));
+#endif
assert(RSA_check_key(test)==1);
RSA_free(test);
@@ -401,10 +403,10 @@ ops_boolean_t ops_dsa_verify(const unsigned char *hash,size_t hash_length,
osig=DSA_SIG_new();
#if OPENSSL_VERSION_NUMBER < 0x10100000L
- osig->r=sig->r;
- osig->s=sig->s;
+ osig->r=BN_dup(sig->r);
+ osig->s=BN_dup(sig->s);
#else
- DSA_SIG_set0(osig,sig->r,sig->s) ;
+ DSA_SIG_set0(osig,BN_dup(sig->r),BN_dup(sig->s)) ;
#endif
if(BN_num_bits(dsa->q) != 160)
@@ -414,15 +416,18 @@ ops_boolean_t ops_dsa_verify(const unsigned char *hash,size_t hash_length,
fprintf(stderr,"(WW) ops_dsa_verify: openssl does only supports 'q' of 160 bits. Current is %d bits.\n",BN_num_bits(dsa->q)) ;
already_said=ops_true ;
}
- osig->r=osig->s=NULL;
DSA_SIG_free(osig);
return ops_false ;
}
odsa=DSA_new();
- odsa->p=dsa->p;
- odsa->q=dsa->q;
- odsa->g=dsa->g;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ odsa->p=BN_dup(dsa->p);
+ odsa->q=BN_dup(dsa->q);
+ odsa->g=BN_dup(dsa->g);
+#else
+ DSA_set0_pqg(BN_dup(dsa->p),BN_dup(dsa->q),BN_dup(dsa->g));
+#endif
odsa->pub_key=dsa->y;
if (debug)
@@ -457,10 +462,8 @@ ops_boolean_t ops_dsa_verify(const unsigned char *hash,size_t hash_length,
return ops_false ;
}
- odsa->p=odsa->q=odsa->g=odsa->pub_key=NULL;
+ odsa->pub_key=NULL;
DSA_free(odsa);
-
- osig->r=osig->s=NULL;
DSA_SIG_free(osig);
return ret != 0;
From 262fa9c593304b74aae7434ae9e5b5be139ff783 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sat, 18 Feb 2017 15:45:45 +0100
Subject: [PATCH 57/90] fixing compilation for openssl-1.1.0 (part 3)
---
openpgpsdk/src/openpgpsdk/openssl_crypto.c | 42 +++++++++++++++++-----
1 file changed, 33 insertions(+), 9 deletions(-)
diff --git a/openpgpsdk/src/openpgpsdk/openssl_crypto.c b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
index c68f13021..2f61285a8 100644
--- a/openpgpsdk/src/openpgpsdk/openssl_crypto.c
+++ b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
@@ -403,10 +403,10 @@ ops_boolean_t ops_dsa_verify(const unsigned char *hash,size_t hash_length,
osig=DSA_SIG_new();
#if OPENSSL_VERSION_NUMBER < 0x10100000L
- osig->r=BN_dup(sig->r);
- osig->s=BN_dup(sig->s);
+ osig->r=sig->r;
+ osig->s=sig->s;
#else
- DSA_SIG_set0(osig,BN_dup(sig->r),BN_dup(sig->s)) ;
+ DSA_SIG_set0(osig,sig->r,sig->s) ;
#endif
if(BN_num_bits(dsa->q) != 160)
@@ -422,13 +422,15 @@ ops_boolean_t ops_dsa_verify(const unsigned char *hash,size_t hash_length,
odsa=DSA_new();
#if OPENSSL_VERSION_NUMBER < 0x10100000L
- odsa->p=BN_dup(dsa->p);
- odsa->q=BN_dup(dsa->q);
- odsa->g=BN_dup(dsa->g);
-#else
- DSA_set0_pqg(BN_dup(dsa->p),BN_dup(dsa->q),BN_dup(dsa->g));
-#endif
+ odsa->p=dsa->p;
+ odsa->q=dsa->q;
+ odsa->g=dsa->g;
+
odsa->pub_key=dsa->y;
+#else
+ DSA_set0_pqg(odsa,dsa->p,dsa->q,dsa->g);
+ DSA_set0_key(odsa,dsa->y,NULL) ;
+#endif
if (debug)
{
@@ -462,7 +464,21 @@ ops_boolean_t ops_dsa_verify(const unsigned char *hash,size_t hash_length,
return ops_false ;
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ osig->r=NULL;
+ osig->s=NULL;
+
+ odsa->p=NULL;
+ odsa->q=NULL;
+ odsa->g=NULL;
odsa->pub_key=NULL;
+#else
+ DSA_SIG_set0(osig,NULL,NULL) ;
+
+ DSA_set0_pqg(odsa,NULL,NULL,NULL);
+ DSA_set0_key(odsa,NULL,NULL) ;
+#endif
+
DSA_free(odsa);
DSA_SIG_free(osig);
@@ -485,12 +501,20 @@ int ops_rsa_public_decrypt(unsigned char *out,const unsigned char *in,
int n;
orsa=RSA_new();
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
orsa->n=rsa->n;
orsa->e=rsa->e;
+#else
+ RSA_set0_key(orsa,rsa->n,rsa->e,NULL) ;
+#endif
n=RSA_public_decrypt(length,in,out,orsa,RSA_NO_PADDING);
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
orsa->n=orsa->e=NULL;
+#else
+ RSA_set0_key(orsa,NULL,NULL,NULL) ;
+#endif
RSA_free(orsa);
return n;
From 13a8389f6825a342828b5bab858daf839d918e5f Mon Sep 17 00:00:00 2001
From: csoler
Date: Sat, 18 Feb 2017 16:21:17 +0100
Subject: [PATCH 58/90] fixing compilation for openssl-1.1.0 (part 4)
---
openpgpsdk/src/openpgpsdk/openssl_crypto.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/openpgpsdk/src/openpgpsdk/openssl_crypto.c b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
index 2f61285a8..f4cb28f05 100644
--- a/openpgpsdk/src/openpgpsdk/openssl_crypto.c
+++ b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
@@ -444,7 +444,8 @@ ops_boolean_t ops_dsa_verify(const unsigned char *hash,size_t hash_length,
}
//printf("hash_length=%ld\n", hash_length);
//printf("Q=%d\n", BN_num_bytes(odsa->q));
- unsigned int qlen=BN_num_bytes(odsa->q);
+ unsigned int qlen=BN_num_bytes(dsa->q);
+
if (qlen < hash_length)
hash_length=qlen;
// ret=DSA_do_verify(hash,hash_length,osig,odsa);
@@ -538,6 +539,7 @@ int ops_rsa_private_encrypt(unsigned char *out,const unsigned char *in,
int n;
orsa=RSA_new();
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
orsa->n=rsa->n; // XXX: do we need n?
orsa->d=srsa->d;
orsa->p=srsa->q;
@@ -545,17 +547,31 @@ int ops_rsa_private_encrypt(unsigned char *out,const unsigned char *in,
/* debug */
orsa->e=rsa->e;
+
// If this isn't set, it's very likely that the programmer hasn't
// decrypted the secret key. RSA_check_key segfaults in that case.
// Use ops_decrypt_secret_key_from_data() to do that.
assert(orsa->d);
+#else
+ RSA_set0_key(orsa,rsa->n,rsa->e,rsa->d) ;
+ RSA_set0_factors(orsa,rsa->p,rsa->q);
+#endif
+
assert(RSA_check_key(orsa) == 1);
orsa->e=NULL;
/* end debug */
+ // WARNING: this function should *never* be called for direct encryption, because of the padding.
+ // It's actually only called in the signature function now, where an adapted padding is placed.
+
n=RSA_private_encrypt(length,in,out,orsa,RSA_NO_PADDING);
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
orsa->n=orsa->d=orsa->p=orsa->q=NULL;
+#else
+ RSA_set0_key(orsa,NULL,NULL,NULL);
+ RSA_set0_factors(orsa,NULL,NULL);
+#endif
RSA_free(orsa);
return n;
From 70e2a67786a924479039da43c66d64b7288a1dc5 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sat, 18 Feb 2017 16:40:38 +0100
Subject: [PATCH 59/90] fixing compilation for openssl-1.1.0 (part 5)
---
openpgpsdk/src/openpgpsdk/openssl_crypto.c | 31 ++++++++++------------
1 file changed, 14 insertions(+), 17 deletions(-)
diff --git a/openpgpsdk/src/openpgpsdk/openssl_crypto.c b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
index f4cb28f05..ad8a235ee 100644
--- a/openpgpsdk/src/openpgpsdk/openssl_crypto.c
+++ b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
@@ -406,7 +406,7 @@ ops_boolean_t ops_dsa_verify(const unsigned char *hash,size_t hash_length,
osig->r=sig->r;
osig->s=sig->s;
#else
- DSA_SIG_set0(osig,sig->r,sig->s) ;
+ DSA_SIG_set0(osig,BN_dup(sig->r),BN_dup(sig->s)) ;
#endif
if(BN_num_bits(dsa->q) != 160)
@@ -428,8 +428,8 @@ ops_boolean_t ops_dsa_verify(const unsigned char *hash,size_t hash_length,
odsa->pub_key=dsa->y;
#else
- DSA_set0_pqg(odsa,dsa->p,dsa->q,dsa->g);
- DSA_set0_key(odsa,dsa->y,NULL) ;
+ DSA_set0_pqg(odsa,BN_dup(dsa->p),BN_dup(dsa->q),BN_dup(dsa->g));
+ DSA_set0_key(odsa,BN_dup(dsa->y),NULL) ;
#endif
if (debug)
@@ -473,11 +473,6 @@ ops_boolean_t ops_dsa_verify(const unsigned char *hash,size_t hash_length,
odsa->q=NULL;
odsa->g=NULL;
odsa->pub_key=NULL;
-#else
- DSA_SIG_set0(osig,NULL,NULL) ;
-
- DSA_set0_pqg(odsa,NULL,NULL,NULL);
- DSA_set0_key(odsa,NULL,NULL) ;
#endif
DSA_free(odsa);
@@ -506,15 +501,13 @@ int ops_rsa_public_decrypt(unsigned char *out,const unsigned char *in,
orsa->n=rsa->n;
orsa->e=rsa->e;
#else
- RSA_set0_key(orsa,rsa->n,rsa->e,NULL) ;
+ RSA_set0_key(orsa,BN_dup(rsa->n),BN_dup(rsa->e),NULL) ;
#endif
n=RSA_public_decrypt(length,in,out,orsa,RSA_NO_PADDING);
#if OPENSSL_VERSION_NUMBER < 0x10100000L
orsa->n=orsa->e=NULL;
-#else
- RSA_set0_key(orsa,NULL,NULL,NULL) ;
#endif
RSA_free(orsa);
@@ -553,12 +546,11 @@ int ops_rsa_private_encrypt(unsigned char *out,const unsigned char *in,
// Use ops_decrypt_secret_key_from_data() to do that.
assert(orsa->d);
#else
- RSA_set0_key(orsa,rsa->n,rsa->e,rsa->d) ;
- RSA_set0_factors(orsa,rsa->p,rsa->q);
+ RSA_set0_key(orsa,BN_dup(rsa->n),BN_dup(rsa->e),BN_dup(srsa->d)) ;
+ RSA_set0_factors(orsa,BN_dup(srsa->p),BN_dup(srsa->q));
#endif
assert(RSA_check_key(orsa) == 1);
- orsa->e=NULL;
/* end debug */
// WARNING: this function should *never* be called for direct encryption, because of the padding.
@@ -568,9 +560,7 @@ int ops_rsa_private_encrypt(unsigned char *out,const unsigned char *in,
#if OPENSSL_VERSION_NUMBER < 0x10100000L
orsa->n=orsa->d=orsa->p=orsa->q=NULL;
-#else
- RSA_set0_key(orsa,NULL,NULL,NULL);
- RSA_set0_factors(orsa,NULL,NULL);
+ orsa->e=NULL;
#endif
RSA_free(orsa);
@@ -858,15 +848,22 @@ DSA_SIG* ops_dsa_sign(unsigned char* hashbuf, unsigned hashsize, const ops_dsa_s
DSA_SIG *dsasig;
odsa=DSA_new();
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
odsa->p=dsa->p;
odsa->q=dsa->q;
odsa->g=dsa->g;
odsa->pub_key=dsa->y;
odsa->priv_key=sdsa->x;
+#else
+ DSA_set0_pqg(odsa,BN_dup(dsa->p),BN_dup(dsa->q),BN_dup(dsa->g));
+ DSA_set0_key(odsa,BN_dup(dsa->y),BN_dup(sdsa->x));
+#endif
dsasig=DSA_do_sign(hashbuf,hashsize,odsa);
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
odsa->p=odsa->q=odsa->g=odsa->pub_key=odsa->priv_key=NULL;
+#endif
DSA_free(odsa);
return dsasig;
From 5951f460f663727570c59d70b7df8576ce760c75 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sat, 18 Feb 2017 16:49:35 +0100
Subject: [PATCH 60/90] fixing compilation for openssl-1.1.0 (part 6)
---
openpgpsdk/src/openpgpsdk/openssl_crypto.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/openpgpsdk/src/openpgpsdk/openssl_crypto.c b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
index ad8a235ee..7d5555ca3 100644
--- a/openpgpsdk/src/openpgpsdk/openssl_crypto.c
+++ b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
@@ -586,15 +586,19 @@ int ops_rsa_private_decrypt(unsigned char *out,const unsigned char *in,
char errbuf[1024];
orsa=RSA_new();
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
orsa->n=rsa->n; // XXX: do we need n?
orsa->d=srsa->d;
orsa->p=srsa->q;
orsa->q=srsa->p;
+ orsa->e=rsa->e;
+#else
+ RSA_set0_key(orsa,BN_dup(rsa->n),BN_dup(rsa->e),BN_dup(srsa->d)) ;
+ RSA_set0_factors(orsa,BN_dup(srsa->p),BN_dup(srsa->q));
+#endif
/* debug */
- orsa->e=rsa->e;
assert(RSA_check_key(orsa) == 1);
- orsa->e=NULL;
/* end debug */
n=RSA_private_decrypt(length,in,out,orsa,RSA_NO_PADDING);
@@ -608,7 +612,10 @@ int ops_rsa_private_decrypt(unsigned char *out,const unsigned char *in,
ERR_error_string(err,&errbuf[0]);
fprintf(stderr,"openssl error : %s\n",errbuf);
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
orsa->n=orsa->d=orsa->p=orsa->q=NULL;
+ orsa->e=NULL;
+#endif
RSA_free(orsa);
return n;
@@ -631,8 +638,12 @@ int ops_rsa_public_encrypt(unsigned char *out,const unsigned char *in,
// printf("ops_rsa_public_encrypt: length=%ld\n", length);
orsa=RSA_new();
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
orsa->n=rsa->n;
orsa->e=rsa->e;
+#else
+ RSA_set0_key(orsa,BN_dup(rsa->n),BN_dup(rsa->e),NULL);
+#endif
// printf("len: %ld\n", length);
// ops_print_bn("n: ", orsa->n);
@@ -647,7 +658,9 @@ int ops_rsa_public_encrypt(unsigned char *out,const unsigned char *in,
BIO_free(fd_out) ;
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
orsa->n=orsa->e=NULL;
+#endif
RSA_free(orsa);
return n;
From deb3a49b6a97379b22b92aa07c7413261f4a2136 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sat, 18 Feb 2017 17:00:46 +0100
Subject: [PATCH 61/90] fixing compilation for openssl-1.1.0 (part 7)
---
openpgpsdk/src/openpgpsdk/openssl_crypto.c | 23 +++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/openpgpsdk/src/openpgpsdk/openssl_crypto.c b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
index 7d5555ca3..768abab8e 100644
--- a/openpgpsdk/src/openpgpsdk/openssl_crypto.c
+++ b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
@@ -738,8 +738,19 @@ ops_boolean_t ops_rsa_generate_keypair(const int numbits, const unsigned long e,
skey->public_key.days_valid=0;
skey->public_key.algorithm= OPS_PKA_RSA;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
skey->public_key.key.rsa.n=BN_dup(rsa->n);
skey->public_key.key.rsa.e=BN_dup(rsa->e);
+ skey->key.rsa.d=BN_dup(rsa->d);
+#else
+ BIGNUM *nn=NULL,*ee=NULL,*dd=NULL ;
+
+ RSA_get0_key(rsa,&nn,&ee,&dd) ;
+
+ skey->public_key.key.rsa.n=BN_dup(nn) ;
+ skey->public_key.key.rsa.e=BN_dup(ee) ;
+ skey->public_key.key.rsa.e=BN_dup(dd) ;
+#endif
skey->s2k_usage=OPS_S2KU_ENCRYPTED_AND_HASHED;
skey->s2k_specifier=OPS_S2KS_SALTED;
@@ -749,10 +760,20 @@ ops_boolean_t ops_rsa_generate_keypair(const int numbits, const unsigned long e,
skey->octet_count=0;
skey->checksum=0;
- skey->key.rsa.d=BN_dup(rsa->d);
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
skey->key.rsa.p=BN_dup(rsa->p);
skey->key.rsa.q=BN_dup(rsa->q);
skey->key.rsa.u=BN_mod_inverse(NULL,rsa->p, rsa->q, ctx);
+#else
+ BIGNUM *pp=NULL,*qq=NULL ;
+
+ RSA_get0_factors(rsa,&pp,&qq) ;
+
+ skey->key.rsa.p=BN_dup(pp);
+ skey->key.rsa.q=BN_dup(qq);
+
+ skey->key.rsa.u=BN_mod_inverse(NULL,pp,qq, ctx);
+#endif
assert(skey->key.rsa.u);
BN_CTX_free(ctx);
From d5e679299c51f7ce7410873a5abf86dab9bd87ae Mon Sep 17 00:00:00 2001
From: csoler
Date: Sat, 18 Feb 2017 18:09:49 +0100
Subject: [PATCH 62/90] fixing compilation for openssl-1.1.0 (part 8)
---
openpgpsdk/src/openpgpsdk/signature.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/openpgpsdk/src/openpgpsdk/signature.c b/openpgpsdk/src/openpgpsdk/signature.c
index 87b4def70..109d39fc7 100644
--- a/openpgpsdk/src/openpgpsdk/signature.c
+++ b/openpgpsdk/src/openpgpsdk/signature.c
@@ -298,8 +298,18 @@ static ops_boolean_t dsa_sign(ops_hash_t *hash, const ops_dsa_public_key_t *dsa,
dsasig=ops_dsa_sign(hashbuf, hashsize, sdsa, dsa);
// convert and write the sig out to memory
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
ops_write_mpi(dsasig->r, cinfo);
ops_write_mpi(dsasig->s, cinfo);
+#else
+ BIGNUM *rr=NULL,*ss=NULL ;
+
+ DSA_SIG_get0(&rr,&ss) ;
+
+ ops_write_mpi(rr, cinfo);
+ ops_write_mpi(ss, cinfo);
+#endif
+
DSA_SIG_free(dsasig);
return ops_true ;
From fc1a792a12219148f7fdfcb9d9d1edcc74f13b91 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sat, 18 Feb 2017 18:16:10 +0100
Subject: [PATCH 63/90] fixing compilation for openssl-1.1.0 (part 9)
---
openpgpsdk/src/openpgpsdk/signature.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/openpgpsdk/src/openpgpsdk/signature.c b/openpgpsdk/src/openpgpsdk/signature.c
index 109d39fc7..e6820e325 100644
--- a/openpgpsdk/src/openpgpsdk/signature.c
+++ b/openpgpsdk/src/openpgpsdk/signature.c
@@ -302,9 +302,9 @@ static ops_boolean_t dsa_sign(ops_hash_t *hash, const ops_dsa_public_key_t *dsa,
ops_write_mpi(dsasig->r, cinfo);
ops_write_mpi(dsasig->s, cinfo);
#else
- BIGNUM *rr=NULL,*ss=NULL ;
+ const BIGNUM *rr=NULL,*ss=NULL ;
- DSA_SIG_get0(&rr,&ss) ;
+ DSA_SIG_get0(dsasig,&rr,&ss) ;
ops_write_mpi(rr, cinfo);
ops_write_mpi(ss, cinfo);
From 01e89bb0d8e346b812275889c82e6f4723812d53 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sat, 18 Feb 2017 23:47:47 +0100
Subject: [PATCH 64/90] fixing compilation for openssl-1.1.0 (part 10)
---
openpgpsdk/src/openpgpsdk/signature.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/openpgpsdk/src/openpgpsdk/signature.c b/openpgpsdk/src/openpgpsdk/signature.c
index e6820e325..7195d8007 100644
--- a/openpgpsdk/src/openpgpsdk/signature.c
+++ b/openpgpsdk/src/openpgpsdk/signature.c
@@ -302,7 +302,7 @@ static ops_boolean_t dsa_sign(ops_hash_t *hash, const ops_dsa_public_key_t *dsa,
ops_write_mpi(dsasig->r, cinfo);
ops_write_mpi(dsasig->s, cinfo);
#else
- const BIGNUM *rr=NULL,*ss=NULL ;
+ BIGNUM *rr=NULL,*ss=NULL ;
DSA_SIG_get0(dsasig,&rr,&ss) ;
From 0c77a102248c237d97b1845201b09ab2a853d821 Mon Sep 17 00:00:00 2001
From: csoler
Date: Sat, 18 Feb 2017 23:47:53 +0100
Subject: [PATCH 65/90] fixing compilation for openssl-1.1.0 (part 11)
---
libretroshare/src/tcponudp/bss_tou.c | 59 ++++++++++++++++------------
1 file changed, 33 insertions(+), 26 deletions(-)
diff --git a/libretroshare/src/tcponudp/bss_tou.c b/libretroshare/src/tcponudp/bss_tou.c
index f96abb19d..1637b4c65 100644
--- a/libretroshare/src/tcponudp/bss_tou.c
+++ b/libretroshare/src/tcponudp/bss_tou.c
@@ -90,7 +90,13 @@ static int clear_tou_socket_error(int s);
#include "tou.h"
-
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+static int BIO_get_shutdown(BIO *a) { return a->shutdown; }
+static void BIO_set_shutdown(BIO *a,int s) { a->shutdown=s; }
+static int BIO_get_init(BIO *a) { return a->init; }
+static void BIO_set_init(BIO *a,int i) { a->init=i; }
+static void BIO_set_data(BIO *a,void *p) { a->ptr = p; }
+#endif
static BIO_METHOD methods_tou_sockp=
{
@@ -132,10 +138,10 @@ static int tou_socket_new(BIO *bi)
#ifdef DEBUG_TOU_BIO
fprintf(stderr, "tou_socket_new()\n");
#endif
- bi->init=0;
- bi->num=0;
- bi->ptr=NULL;
- bi->flags=0;
+ BIO_set_init(bi,0) ;
+ BIO_set_data(bi,NULL) ; // sets bi->ptr
+ BIO_set_flags(bi,0) ;
+ BIO_set_fd(bi,0,0) ;
return(1);
}
@@ -145,14 +151,15 @@ static int tou_socket_free(BIO *a)
fprintf(stderr, "tou_socket_free()\n");
#endif
if (a == NULL) return(0);
- if (a->shutdown)
+
+ if(BIO_get_shutdown(a))
{
- if (a->init)
+ if(BIO_get_init(a))
{
- tou_close(a->num);
+ tou_close(BIO_get_fd(a,NULL));
}
- a->init=0;
- a->flags=0;
+ BIO_set_init(a,0) ;
+ BIO_set_flags(a,0) ;
}
return(1);
}
@@ -166,13 +173,13 @@ static int tou_socket_read(BIO *b, char *out, int outl)
if (out != NULL)
{
- clear_tou_socket_error(b->num);
+ clear_tou_socket_error(BIO_get_fd(b,NULL));
/* call tou library */
- ret=tou_read(b->num,out,outl);
+ ret=tou_read(BIO_get_fd(b,NULL),out,outl);
BIO_clear_retry_flags(b);
if (ret <= 0)
{
- if (BIO_tou_socket_should_retry(b->num, ret))
+ if (BIO_tou_socket_should_retry(BIO_get_fd(b,NULL), ret))
BIO_set_retry_read(b);
}
}
@@ -189,13 +196,13 @@ static int tou_socket_write(BIO *b, const char *in, int inl)
fprintf(stderr, "tou_socket_write(%p,%p,%d)\n",b,in,inl);
#endif
- clear_tou_socket_error(b->num);
+ clear_tou_socket_error(BIO_get_fd(b,NULL));
/* call tou library */
- ret=tou_write(b->num,in,inl);
+ ret=tou_write(BIO_get_fd(b,NULL),in,inl);
BIO_clear_retry_flags(b);
if (ret <= 0)
{
- if (BIO_tou_socket_should_retry(b->num,ret))
+ if (BIO_tou_socket_should_retry(BIO_get_fd(b,NULL),ret))
{
BIO_set_retry_write(b);
#ifdef DEBUG_TOU_BIO
@@ -230,34 +237,34 @@ static long tou_socket_ctrl(BIO *b, int cmd, long num, void *ptr)
break;
case BIO_C_SET_FD:
tou_socket_free(b);
- b->num= *((int *)ptr);
- b->shutdown=(int)num;
- b->init=1;
+ BIO_set_fd(b,*((int *)ptr),0);
+ BIO_set_shutdown(b,(int)num) ;
+ BIO_set_init(b,1) ;
break;
case BIO_C_GET_FD:
- if (b->init)
+ if (BIO_get_init(b))
{
ip=(int *)ptr;
- if (ip != NULL) *ip=b->num;
- ret=b->num;
+ if (ip != NULL) *ip=BIO_get_fd(b,NULL);
+ ret=BIO_get_fd(b,NULL);
}
else
ret= -1;
break;
case BIO_CTRL_GET_CLOSE:
- ret=b->shutdown;
+ ret=BIO_get_shutdown(b);
break;
case BIO_CTRL_SET_CLOSE:
- b->shutdown=(int)num;
+ BIO_set_shutdown(b,(int)num) ;
break;
case BIO_CTRL_PENDING:
- ret = tou_maxread(b->num);
+ ret = tou_maxread(BIO_get_fd(b,NULL));
#ifdef DEBUG_TOU_BIO
fprintf(stderr, "tou_pending = %ld\n", ret);
#endif
break;
case BIO_CTRL_WPENDING:
- ret = tou_maxwrite(b->num);
+ ret = tou_maxwrite(BIO_get_fd(b,NULL));
#ifdef DEBUG_TOU_BIO
fprintf(stderr, "tou_wpending = %ld\n", ret);
#endif
From 175664e10e89707c7a2f13070e807e596050bf7a Mon Sep 17 00:00:00 2001
From: csoler
Date: Sat, 18 Feb 2017 23:58:47 +0100
Subject: [PATCH 66/90] fixing compilation for openssl-1.1.0 (part 12)
---
libretroshare/src/tcponudp/bss_tou.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/libretroshare/src/tcponudp/bss_tou.c b/libretroshare/src/tcponudp/bss_tou.c
index 1637b4c65..34b935e0e 100644
--- a/libretroshare/src/tcponudp/bss_tou.c
+++ b/libretroshare/src/tcponudp/bss_tou.c
@@ -96,6 +96,20 @@ static void BIO_set_shutdown(BIO *a,int s) { a->shutdown=s; }
static int BIO_get_init(BIO *a) { return a->init; }
static void BIO_set_init(BIO *a,int i) { a->init=i; }
static void BIO_set_data(BIO *a,void *p) { a->ptr = p; }
+#else
+typedef struct bio_method_st {
+ int type;
+ const char *name;
+ int (*bwrite) (BIO *, const char *, int);
+ int (*bread) (BIO *, char *, int);
+ int (*bputs) (BIO *, const char *);
+ int (*bgets) (BIO *, char *, int);
+ long (*ctrl) (BIO *, int, long, void *);
+ int (*create) (BIO *);
+ int (*destroy) (BIO *);
+ long (*callback_ctrl) (BIO *, int, bio_info_cb *);
+} BIO_METHOD;
+
#endif
static BIO_METHOD methods_tou_sockp=
From d7bfc3264bf03ce0ac87414aa0bb1e4efccfbb6e Mon Sep 17 00:00:00 2001
From: csoler
Date: Sun, 19 Feb 2017 10:56:33 +0100
Subject: [PATCH 67/90] fixing compilation for openssl-1.1.0 (chacha20.cc, HMAC
structure)
---
libretroshare/src/crypto/chacha20.cpp | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/libretroshare/src/crypto/chacha20.cpp b/libretroshare/src/crypto/chacha20.cpp
index bee4f034e..612533130 100644
--- a/libretroshare/src/crypto/chacha20.cpp
+++ b/libretroshare/src/crypto/chacha20.cpp
@@ -537,6 +537,7 @@ bool AEAD_chacha20_sha256(uint8_t key[32], uint8_t nonce[12],uint8_t *data,uint3
uint8_t computed_tag[EVP_MAX_MD_SIZE];
unsigned int md_size ;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
HMAC_CTX hmac_ctx ;
HMAC_CTX_init(&hmac_ctx) ;
@@ -544,6 +545,17 @@ bool AEAD_chacha20_sha256(uint8_t key[32], uint8_t nonce[12],uint8_t *data,uint3
HMAC_Update(&hmac_ctx,aad,aad_size) ;
HMAC_Update(&hmac_ctx,data,data_size) ;
HMAC_Final(&hmac_ctx,computed_tag,&md_size) ;
+#else
+ HMAC_CTX *hmac_ctx = HMAC_CTX_new();
+
+ HMAC_Init_ex(hmac_ctx,key,32,EVP_sha256()) ;
+ HMAC_Update(hmac_ctx,aad,aad_size) ;
+ HMAC_Update(hmac_ctx,data,data_size) ;
+ HMAC_Final(hmac_ctx,computed_tag,&md_size) ;
+
+ HMAC_CTX_free(hmac_ctx) ;
+ hmac_ctx=NULL;
+#endif
assert(md_size >= 16);
@@ -556,6 +568,7 @@ bool AEAD_chacha20_sha256(uint8_t key[32], uint8_t nonce[12],uint8_t *data,uint3
uint8_t computed_tag[EVP_MAX_MD_SIZE];
unsigned int md_size ;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
HMAC_CTX hmac_ctx ;
HMAC_CTX_init(&hmac_ctx) ;
@@ -563,6 +576,14 @@ bool AEAD_chacha20_sha256(uint8_t key[32], uint8_t nonce[12],uint8_t *data,uint3
HMAC_Update(&hmac_ctx,aad,aad_size) ;
HMAC_Update(&hmac_ctx,data,data_size) ;
HMAC_Final(&hmac_ctx,computed_tag,&md_size) ;
+#else
+ HMAC_CTX *hmac_ctx = HMAC_CTX_new();
+
+ HMAC_Init_ex(hmac_ctx,key,32,EVP_sha256()) ;
+ HMAC_Update(hmac_ctx,aad,aad_size) ;
+ HMAC_Update(hmac_ctx,data,data_size) ;
+ HMAC_Final(hmac_ctx,computed_tag,&md_size) ;
+#endif
// decrypt
From 57bbd158936f1fa1a29bee03eca05e17095a0e8f Mon Sep 17 00:00:00 2001
From: csoler
Date: Sun, 19 Feb 2017 11:10:25 +0100
Subject: [PATCH 68/90] fixing compilation for openssl-1.1.0 (chacha20.cc, HMAC
structure, part 2)
---
libretroshare/src/crypto/chacha20.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libretroshare/src/crypto/chacha20.cpp b/libretroshare/src/crypto/chacha20.cpp
index 612533130..5219983a4 100644
--- a/libretroshare/src/crypto/chacha20.cpp
+++ b/libretroshare/src/crypto/chacha20.cpp
@@ -548,7 +548,7 @@ bool AEAD_chacha20_sha256(uint8_t key[32], uint8_t nonce[12],uint8_t *data,uint3
#else
HMAC_CTX *hmac_ctx = HMAC_CTX_new();
- HMAC_Init_ex(hmac_ctx,key,32,EVP_sha256()) ;
+ HMAC_Init_ex(hmac_ctx,key,32,EVP_sha256(),NULL) ;
HMAC_Update(hmac_ctx,aad,aad_size) ;
HMAC_Update(hmac_ctx,data,data_size) ;
HMAC_Final(hmac_ctx,computed_tag,&md_size) ;
@@ -579,7 +579,7 @@ bool AEAD_chacha20_sha256(uint8_t key[32], uint8_t nonce[12],uint8_t *data,uint3
#else
HMAC_CTX *hmac_ctx = HMAC_CTX_new();
- HMAC_Init_ex(hmac_ctx,key,32,EVP_sha256()) ;
+ HMAC_Init_ex(hmac_ctx,key,32,EVP_sha256(),NULL) ;
HMAC_Update(hmac_ctx,aad,aad_size) ;
HMAC_Update(hmac_ctx,data,data_size) ;
HMAC_Final(hmac_ctx,computed_tag,&md_size) ;
From 5c95b880956b575af37e868d91ebb7c2e827fe6e Mon Sep 17 00:00:00 2001
From: csoler
Date: Sun, 19 Feb 2017 22:38:02 +0100
Subject: [PATCH 69/90] compilation fix for openssl-1.1.0 (pqissl+authssl part)
---
libretroshare/src/crypto/chacha20.cpp | 3 +
libretroshare/src/pqi/authssl.cc | 149 ++++++++++++++++++------
libretroshare/src/pqi/pqissl.cc | 9 ++
libretroshare/src/pqi/pqissllistener.cc | 9 ++
libretroshare/src/pqi/pqistreamer.cc | 1 +
libretroshare/src/pqi/sslfns.cc | 18 ++-
libretroshare/src/util/rsaes.cc | 34 +++---
libretroshare/src/util/rsrecogn.cc | 16 +++
retroshare.pri | 3 +
9 files changed, 190 insertions(+), 52 deletions(-)
diff --git a/libretroshare/src/crypto/chacha20.cpp b/libretroshare/src/crypto/chacha20.cpp
index 5219983a4..2653a7046 100644
--- a/libretroshare/src/crypto/chacha20.cpp
+++ b/libretroshare/src/crypto/chacha20.cpp
@@ -583,6 +583,9 @@ bool AEAD_chacha20_sha256(uint8_t key[32], uint8_t nonce[12],uint8_t *data,uint3
HMAC_Update(hmac_ctx,aad,aad_size) ;
HMAC_Update(hmac_ctx,data,data_size) ;
HMAC_Final(hmac_ctx,computed_tag,&md_size) ;
+
+ HMAC_CTX_free(hmac_ctx) ;
+ hmac_ctx=NULL;
#endif
// decrypt
diff --git a/libretroshare/src/pqi/authssl.cc b/libretroshare/src/pqi/authssl.cc
index 07c12b942..bbe99b2a6 100644
--- a/libretroshare/src/pqi/authssl.cc
+++ b/libretroshare/src/pqi/authssl.cc
@@ -245,12 +245,18 @@ sslcert::sslcert(X509 *x509, const RsPeerId& pid)
{
certificate = x509;
id = pid;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
name = getX509CNString(x509->cert_info->subject);
org = getX509OrgString(x509->cert_info->subject);
location = getX509LocString(x509->cert_info->subject);
- email = "";
-
issuer = RsPgpId(std::string(getX509CNString(x509->cert_info->issuer)));
+#else
+ name = getX509CNString(X509_get_subject_name(x509));
+ org = getX509OrgString(X509_get_subject_name(x509));
+ location = getX509LocString(X509_get_subject_name(x509));
+ issuer = RsPgpId(std::string(getX509CNString(X509_get_issuer_name(x509))));
+#endif
+ email = "";
authed = false;
}
@@ -371,8 +377,17 @@ static int initLib = 0;
if (dh)
{
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
BN_hex2bn(&dh->p,dh_prime_4096_hex.c_str()) ;
BN_hex2bn(&dh->g,"5") ;
+#else
+ BIGNUM *pp=NULL,*gg=NULL ;
+
+ BN_hex2bn(&pp,dh_prime_4096_hex.c_str()) ;
+ BN_hex2bn(&gg,"5");
+
+ DH_set0_pqg(dh,pp,NULL,gg) ;
+#endif
std::cout.flush() ;
@@ -776,47 +791,74 @@ X509 *AuthSSLimpl::SignX509ReqWithGPG(X509_REQ *req, long /*days*/)
std::cerr << "X509 Cert, prepared for signing" << std::endl;
/*** NOW The Manual signing bit (HACKED FROM asn1/a_sign.c) ***/
+ //
+ // The code has been copied in order to use the PGP signing instead of supplying the
+ // private EVP_KEY to ASN1_sign(), which would be another alternative.
+
int (*i2d)(X509_CINF*, unsigned char**) = i2d_X509_CINF;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
X509_ALGOR *algor1 = x509->cert_info->signature;
X509_ALGOR *algor2 = x509->sig_alg;
ASN1_BIT_STRING *signature = x509->signature;
X509_CINF *data = x509->cert_info;
+#else
+ const X509_ALGOR *algor1 = X509_get0_tbs_sigalg(x509) ;
+ const X509_ALGOR *algor2 = NULL ;
+
+ const ASN1_BIT_STRING *tmp_signature = NULL ;
+
+ X509_get0_signature(&tmp_signature,&algor2,x509);
+
+ ASN1_BIT_STRING *signature = const_cast(tmp_signature);
+#endif
//EVP_PKEY *pkey = NULL;
const EVP_MD *type = EVP_sha1();
- EVP_MD_CTX ctx;
+ EVP_MD_CTX *ctx = EVP_MD_CTX_new();
unsigned char *p,*buf_in=NULL;
unsigned char *buf_hashout=NULL,*buf_sigout=NULL;
int inl=0,hashoutl=0;
int sigoutl=0;
X509_ALGOR *a;
- EVP_MD_CTX_init(&ctx);
+ EVP_MD_CTX_init(ctx);
/* FIX ALGORITHMS */
- a = algor1;
+ a = const_cast(algor1);
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
ASN1_TYPE_free(a->parameter);
a->parameter=ASN1_TYPE_new();
a->parameter->type=V_ASN1_NULL;
ASN1_OBJECT_free(a->algorithm);
a->algorithm=OBJ_nid2obj(type->pkey_type);
+#else
+ X509_ALGOR_set0(a,OBJ_nid2obj(EVP_MD_pkey_type(type)),V_ASN1_NULL,NULL);
+#endif
- a = algor2;
+ a = const_cast(algor2);
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
ASN1_TYPE_free(a->parameter);
a->parameter=ASN1_TYPE_new();
a->parameter->type=V_ASN1_NULL;
ASN1_OBJECT_free(a->algorithm);
- a->algorithm=OBJ_nid2obj(type->pkey_type);
+ a->algorithm=OBJ_nid2obj(type->pkey_type);
+#else
+ X509_ALGOR_set0(a,OBJ_nid2obj(EVP_MD_pkey_type(type)),V_ASN1_NULL,NULL);
+#endif
std::cerr << "Algorithms Fixed" << std::endl;
/* input buffer */
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
inl=i2d(data,NULL);
buf_in=(unsigned char *)OPENSSL_malloc((unsigned int)inl);
+#else
+ inl=i2d_re_X509_tbs(x509,&buf_in) ; // this does the i2d over x509->cert_info
+#endif
hashoutl=EVP_MD_size(type);
buf_hashout=(unsigned char *)OPENSSL_malloc((unsigned int)hashoutl);
@@ -831,15 +873,17 @@ X509 *AuthSSLimpl::SignX509ReqWithGPG(X509_REQ *req, long /*days*/)
fprintf(stderr, "AuthSSLimpl::SignX509Req: ASN1err(ASN1_F_ASN1_SIGN,ERR_R_MALLOC_FAILURE)\n");
goto err;
}
- p=buf_in;
-
std::cerr << "Buffers Allocated" << std::endl;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ p=buf_in;
i2d(data,&p);
+#endif
+
/* data in buf_in, ready to be hashed */
- EVP_DigestInit_ex(&ctx,type, NULL);
- EVP_DigestUpdate(&ctx,(unsigned char *)buf_in,inl);
- if (!EVP_DigestFinal(&ctx,(unsigned char *)buf_hashout,
+ EVP_DigestInit_ex(ctx,type, NULL);
+ EVP_DigestUpdate(ctx,(unsigned char *)buf_in,inl);
+ if (!EVP_DigestFinal(ctx,(unsigned char *)buf_hashout,
(unsigned int *)&hashoutl))
{
hashoutl=0;
@@ -879,6 +923,8 @@ X509 *AuthSSLimpl::SignX509ReqWithGPG(X509_REQ *req, long /*days*/)
std::cerr << "Certificate Complete" << std::endl;
+ EVP_MD_CTX_free(ctx) ;
+
return x509;
/* XXX CLEANUP */
@@ -915,7 +961,11 @@ bool AuthSSLimpl::AuthX509WithGPG(X509 *x509,uint32_t& diagnostic)
}
/* extract CN for peer Id */
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
RsPgpId issuer(std::string(getX509CNString(x509->cert_info->issuer)));
+#else
+ RsPgpId issuer(std::string(getX509CNString(X509_get_issuer_name(x509))));
+#endif
RsPeerDetails pd;
#ifdef AUTHSSL_DEBUG
std::cerr << "Checking GPG issuer : " << issuer.toStdString() << std::endl ;
@@ -930,22 +980,33 @@ bool AuthSSLimpl::AuthX509WithGPG(X509 *x509,uint32_t& diagnostic)
/*** NOW The Manual signing bit (HACKED FROM asn1/a_sign.c) ***/
int (*i2d)(X509_CINF*, unsigned char**) = i2d_X509_CINF;
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
ASN1_BIT_STRING *signature = x509->signature;
X509_CINF *data = x509->cert_info;
+#else
+ const ASN1_BIT_STRING *signature = NULL ;
+ const X509_ALGOR *algor2=NULL;
+
+ X509_get0_signature(&signature,&algor2,x509);
+#endif
+
+
const EVP_MD *type = EVP_sha1();
- EVP_MD_CTX ctx;
+ EVP_MD_CTX *ctx = EVP_MD_CTX_new();
unsigned char *p,*buf_in=NULL;
unsigned char *buf_hashout=NULL,*buf_sigout=NULL;
int inl=0,hashoutl=0;
int sigoutl=0;
- //X509_ALGOR *a;
-
- EVP_MD_CTX_init(&ctx);
/* input buffer */
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
inl=i2d(data,NULL);
buf_in=(unsigned char *)OPENSSL_malloc((unsigned int)inl);
+#else
+ inl=i2d_re_X509_tbs(x509,&buf_in) ; // this does the i2d over x509->cert_info
+#endif
hashoutl=EVP_MD_size(type);
buf_hashout=(unsigned char *)OPENSSL_malloc((unsigned int)hashoutl);
@@ -973,11 +1034,13 @@ bool AuthSSLimpl::AuthX509WithGPG(X509 *x509,uint32_t& diagnostic)
std::cerr << "Buffers Allocated" << std::endl;
#endif
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
i2d(data,&p);
+#endif
/* data in buf_in, ready to be hashed */
- EVP_DigestInit_ex(&ctx,type, NULL);
- EVP_DigestUpdate(&ctx,(unsigned char *)buf_in,inl);
- if (!EVP_DigestFinal(&ctx,(unsigned char *)buf_hashout,
+ EVP_DigestInit_ex(ctx,type, NULL);
+ EVP_DigestUpdate(ctx,(unsigned char *)buf_in,inl);
+ if (!EVP_DigestFinal(ctx,(unsigned char *)buf_hashout,
(unsigned int *)&hashoutl))
{
hashoutl=0;
@@ -1017,6 +1080,7 @@ bool AuthSSLimpl::AuthX509WithGPG(X509 *x509,uint32_t& diagnostic)
#ifdef AUTHSSL_DEBUG
std::cerr << "AuthSSLimpl::AuthX509() X509 authenticated" << std::endl;
#endif
+ EVP_MD_CTX_free(ctx) ;
OPENSSL_free(buf_in) ;
OPENSSL_free(buf_hashout) ;
@@ -1093,21 +1157,34 @@ static int verify_x509_callback(int preverify_ok, X509_STORE_CTX *ctx)
if(x509 != NULL)
{
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
RsPgpId gpgid (std::string(getX509CNString(x509->cert_info->issuer)));
+#else
+ RsPgpId gpgid (std::string(getX509CNString(X509_get_issuer_name(x509))));
+#endif
+
if(gpgid.isNull())
{
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
std::cerr << "verify_x509_callback(): wrong PGP id \"" << std::string(getX509CNString(x509->cert_info->issuer)) << "\"" << std::endl;
+#else
+ std::cerr << "verify_x509_callback(): wrong PGP id \"" << std::string(getX509CNString(X509_get_issuer_name(x509))) << "\"" << std::endl;
+#endif
return false ;
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
std::string sslcn = getX509CNString(x509->cert_info->subject);
+#else
+ std::string sslcn = getX509CNString(X509_get_subject_name(x509));
+#endif
RsPeerId sslid ;
getX509id(x509,sslid);
if(sslid.isNull())
{
- std::cerr << "verify_x509_callback(): wrong SSL id \"" << std::string(getX509CNString(x509->cert_info->subject)) << "\"" << std::endl;
+ std::cerr << "verify_x509_callback(): wrong PGP id \"" << sslcn << "\"" << std::endl;
return false ;
}
@@ -1185,7 +1262,11 @@ int AuthSSLimpl::VerifyX509Callback(int preverify_ok, X509_STORE_CTX *ctx)
std::cerr << "(WW) Certificate was rejected because authentication failed. Diagnostic = " << auth_diagnostic << std::endl;
return false;
}
- RsPgpId pgpid = RsPgpId(std::string(getX509CNString(X509_STORE_CTX_get_current_cert(ctx)->cert_info->issuer)));
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ RsPgpId pgpid(std::string(getX509CNString(X509_STORE_CTX_get_current_cert(ctx)->cert_info->issuer)));
+#else
+ RsPgpId pgpid(std::string(getX509CNString(X509_get_issuer_name(X509_STORE_CTX_get_current_cert(ctx)))));
+#endif
if (pgpid != AuthGPG::getAuthGPG()->getGPGOwnId() && !AuthGPG::getAuthGPG()->isGPGAccepted(pgpid))
{
@@ -1258,15 +1339,18 @@ bool AuthSSLimpl::encrypt(void *&out, int &outlen, const void *in, int inlen,
#endif
return false;
} else {
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
public_key = mCerts[peerId]->certificate->cert_info->key->pkey;
+#else
+ public_key = X509_get0_pubkey(mCerts[peerId]->certificate) ;
+#endif
}
}
- EVP_CIPHER_CTX ctx;
+ EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
int eklen, net_ekl;
unsigned char *ek;
unsigned char iv[EVP_MAX_IV_LENGTH];
- EVP_CIPHER_CTX_init(&ctx);
int out_currOffset = 0;
int out_offset = 0;
@@ -1283,7 +1367,7 @@ bool AuthSSLimpl::encrypt(void *&out, int &outlen, const void *in, int inlen,
int max_outlen = inlen + cipher_block_size + EVP_MAX_IV_LENGTH + max_evp_key_size + size_net_ekl;
// intialize context and send store encrypted cipher in ek
- if(!EVP_SealInit(&ctx, EVP_aes_128_cbc(), &ek, &eklen, iv, &public_key, 1)) {
+ if(!EVP_SealInit(ctx, EVP_aes_128_cbc(), &ek, &eklen, iv, &public_key, 1)) {
free(ek);
return false;
}
@@ -1307,7 +1391,7 @@ bool AuthSSLimpl::encrypt(void *&out, int &outlen, const void *in, int inlen,
out_offset += EVP_MAX_IV_LENGTH;
// now encrypt actual data
- if(!EVP_SealUpdate(&ctx, (unsigned char*) out + out_offset, &out_currOffset, (unsigned char*) in, inlen)) {
+ if(!EVP_SealUpdate(ctx, (unsigned char*) out + out_offset, &out_currOffset, (unsigned char*) in, inlen)) {
free(ek);
free(out);
out = NULL;
@@ -1318,7 +1402,7 @@ bool AuthSSLimpl::encrypt(void *&out, int &outlen, const void *in, int inlen,
out_offset += out_currOffset;
// add padding
- if(!EVP_SealFinal(&ctx, (unsigned char*) out + out_offset, &out_currOffset)) {
+ if(!EVP_SealFinal(ctx, (unsigned char*) out + out_offset, &out_currOffset)) {
free(ek);
free(out) ;
out = NULL;
@@ -1334,7 +1418,7 @@ bool AuthSSLimpl::encrypt(void *&out, int &outlen, const void *in, int inlen,
// free encrypted key data
free(ek);
- EVP_CIPHER_CTX_cleanup(&ctx);
+ EVP_CIPHER_CTX_free(ctx);
outlen = out_offset;
@@ -1358,7 +1442,7 @@ bool AuthSSLimpl::decrypt(void *&out, int &outlen, const void *in, int inlen)
// out = malloc(inlen);
// memcpy(out, in, inlen);
// outlen = inlen;
- EVP_CIPHER_CTX ctx;
+ EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
int eklen = 0, net_ekl = 0;
unsigned char *ek = NULL;
unsigned char iv[EVP_MAX_IV_LENGTH];
@@ -1370,7 +1454,6 @@ bool AuthSSLimpl::decrypt(void *&out, int &outlen, const void *in, int inlen)
std::cerr << "(EE) Cannot allocate memory for " << ek_mkl << " bytes in " << __PRETTY_FUNCTION__ << std::endl;
return false ;
}
- EVP_CIPHER_CTX_init(&ctx);
int in_offset = 0, out_currOffset = 0;
int size_net_ekl = sizeof(net_ekl);
@@ -1402,7 +1485,7 @@ bool AuthSSLimpl::decrypt(void *&out, int &outlen, const void *in, int inlen)
const EVP_CIPHER* cipher = EVP_aes_128_cbc();
- if(0 == EVP_OpenInit(&ctx, cipher, ek, eklen, iv, mOwnPrivateKey)) {
+ if(0 == EVP_OpenInit(ctx, cipher, ek, eklen, iv, mOwnPrivateKey)) {
free(ek);
return false;
}
@@ -1414,7 +1497,7 @@ bool AuthSSLimpl::decrypt(void *&out, int &outlen, const void *in, int inlen)
free(ek) ;
return false ;
}
- if(!EVP_OpenUpdate(&ctx, (unsigned char*) out, &out_currOffset, (unsigned char*)in + in_offset, inlen - in_offset)) {
+ if(!EVP_OpenUpdate(ctx, (unsigned char*) out, &out_currOffset, (unsigned char*)in + in_offset, inlen - in_offset)) {
free(ek);
free(out) ;
out = NULL;
@@ -1424,7 +1507,7 @@ bool AuthSSLimpl::decrypt(void *&out, int &outlen, const void *in, int inlen)
in_offset += out_currOffset;
outlen += out_currOffset;
- if(!EVP_OpenFinal(&ctx, (unsigned char*)out + out_currOffset, &out_currOffset)) {
+ if(!EVP_OpenFinal(ctx, (unsigned char*)out + out_currOffset, &out_currOffset)) {
free(ek);
free(out) ;
out = NULL;
@@ -1436,7 +1519,7 @@ bool AuthSSLimpl::decrypt(void *&out, int &outlen, const void *in, int inlen)
if(ek != NULL)
free(ek);
- EVP_CIPHER_CTX_cleanup(&ctx);
+ EVP_CIPHER_CTX_free(ctx);
#ifdef AUTHSSL_DEBUG
std::cerr << "AuthSSLimpl::decrypt() finished with outlen : " << outlen << std::endl;
diff --git a/libretroshare/src/pqi/pqissl.cc b/libretroshare/src/pqi/pqissl.cc
index 795691586..b7709bb82 100644
--- a/libretroshare/src/pqi/pqissl.cc
+++ b/libretroshare/src/pqi/pqissl.cc
@@ -361,7 +361,11 @@ void pqissl::getCryptoParams(RsPeerCryptoParams& params)
bool pqissl::actAsServer()
{
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
return (bool)ssl_connection->server;
+#else
+ return (bool)SSL_is_server(ssl_connection);
+#endif
}
/* returns ...
@@ -1226,8 +1230,13 @@ int pqissl::Extract_Failed_SSL_Certificate()
RsPeerId sslid ;
getX509id(peercert, sslid) ;
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
RsPgpId gpgid(getX509CNString(peercert->cert_info->issuer));
std::string sslcn = getX509CNString(peercert->cert_info->subject);
+#else
+ RsPgpId gpgid(getX509CNString(X509_get_issuer_name(peercert)));
+ std::string sslcn = getX509CNString(X509_get_subject_name(peercert));
+#endif
AuthSSL::getAuthSSL()->FailedCertificate(peercert, gpgid,sslid,sslcn,remote_addr, false);
mLinkMgr->notifyDeniedConnection(gpgid, sslid, sslcn, remote_addr, false);
diff --git a/libretroshare/src/pqi/pqissllistener.cc b/libretroshare/src/pqi/pqissllistener.cc
index 189eb5dce..9c2040247 100644
--- a/libretroshare/src/pqi/pqissllistener.cc
+++ b/libretroshare/src/pqi/pqissllistener.cc
@@ -494,8 +494,13 @@ int pqissllistenbase::continueSSL(IncomingSSLInfo& incoming_connexion_info, bool
#endif
if(x509 != NULL)
{
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
incoming_connexion_info.gpgid = RsPgpId(std::string(getX509CNString(x509->cert_info->issuer)));
incoming_connexion_info.sslcn = getX509CNString(x509->cert_info->subject);
+#else
+ incoming_connexion_info.gpgid = RsPgpId(std::string(getX509CNString(X509_get_issuer_name(x509))));
+ incoming_connexion_info.sslcn = getX509CNString(X509_get_subject_name(x509));
+#endif
getX509id(x509,incoming_connexion_info.sslid);
@@ -888,7 +893,11 @@ int pqissllistener::completeConnection(int fd, IncomingSSLInfo& info)
AuthSSL::getAuthSSL()->CheckCertificate(newPeerId, peercert);
/* now need to get GPG id too */
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
RsPgpId pgpid(std::string(getX509CNString(peercert->cert_info->issuer)));
+#else
+ RsPgpId pgpid(std::string(getX509CNString(X509_get_issuer_name(peercert))));
+#endif
mPeerMgr->addFriend(newPeerId, pgpid);
X509_free(peercert);
diff --git a/libretroshare/src/pqi/pqistreamer.cc b/libretroshare/src/pqi/pqistreamer.cc
index 76f5b1581..626f1db76 100644
--- a/libretroshare/src/pqi/pqistreamer.cc
+++ b/libretroshare/src/pqi/pqistreamer.cc
@@ -26,6 +26,7 @@
#include "pqi/pqistreamer.h"
+#include // for gettimeofday
#include // for free, realloc, exit
#include // for memcpy, memset, memcmp
#include // for NULL, time, time_t
diff --git a/libretroshare/src/pqi/sslfns.cc b/libretroshare/src/pqi/sslfns.cc
index 07ec804a2..7cf742956 100644
--- a/libretroshare/src/pqi/sslfns.cc
+++ b/libretroshare/src/pqi/sslfns.cc
@@ -242,6 +242,7 @@ X509_REQ *GenerateX509Req(
#define SERIAL_RAND_BITS 64
+#ifdef UNUSED_CODE
X509 *SignX509Certificate(X509_NAME *issuer, EVP_PKEY *privkey, X509_REQ *req, long days)
{
const EVP_MD *digest = EVP_sha1();
@@ -369,6 +370,7 @@ X509 *SignX509Certificate(X509_NAME *issuer, EVP_PKEY *privkey, X509_REQ *req, l
return x509;
}
+#endif
/********************************************************************************/
/********************************************************************************/
@@ -600,7 +602,14 @@ bool getX509id(X509 *x509, RsPeerId& xid)
}
// get the signature from the cert, and copy to the array.
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
ASN1_BIT_STRING *signature = x509->signature;
+#else
+ const ASN1_BIT_STRING *signature = NULL ;
+ const X509_ALGOR *algor ;
+
+ X509_get0_signature(&signature,&algor,x509);
+#endif
int signlen = ASN1_STRING_length(signature);
if (signlen < CERTSIGNLEN)
{
@@ -612,12 +621,14 @@ bool getX509id(X509 *x509, RsPeerId& xid)
}
// else copy in the first CERTSIGNLEN.
- unsigned char *signdata = ASN1_STRING_data(signature);
+ unsigned char *signdata = ASN1_STRING_data(const_cast(signature));
/* switched to the other end of the signature. for
* more randomness
*/
+#warning this is cryptographically horrible. We should do a hash of the public key here!!!
+
xid = RsPeerId(&signdata[signlen - CERTSIGNLEN]) ;
//for(int i = signlen - CERTSIGNLEN; i < signlen; i++)
@@ -689,8 +700,13 @@ int LoadCheckX509(const char *cert_file, RsPgpId& issuerName, std::string &locat
if (valid)
{
// extract the name.
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
issuerName = RsPgpId(std::string(getX509CNString(x509->cert_info->issuer)));
location = getX509LocString(x509->cert_info->subject);
+#else
+ issuerName = RsPgpId(std::string(getX509CNString(X509_get_issuer_name(x509))));
+ location = getX509LocString(X509_get_subject_name(x509));
+#endif
}
#ifdef AUTHSSL_DEBUG
diff --git a/libretroshare/src/util/rsaes.cc b/libretroshare/src/util/rsaes.cc
index 1703c4d77..7be5175f9 100644
--- a/libretroshare/src/util/rsaes.cc
+++ b/libretroshare/src/util/rsaes.cc
@@ -52,9 +52,8 @@ bool RsAES::aes_crypt_8_16(const uint8_t *input_data,uint32_t input_data_length,
return false ;
}
- EVP_CIPHER_CTX e_ctx ;
- EVP_CIPHER_CTX_init(&e_ctx);
- EVP_EncryptInit_ex(&e_ctx, EVP_aes_256_cbc(), NULL, key, iv);
+ EVP_CIPHER_CTX *e_ctx = EVP_CIPHER_CTX_new();
+ EVP_EncryptInit_ex(e_ctx, EVP_aes_256_cbc(), NULL, key, iv);
/* max ciphertext len for a n bytes of plaintext is n + AES_BLOCK_SIZE -1 bytes */
int c_len = input_data_length + AES_BLOCK_SIZE ;
@@ -62,31 +61,31 @@ bool RsAES::aes_crypt_8_16(const uint8_t *input_data,uint32_t input_data_length,
if(output_data_length < (uint32_t)c_len)
{
- EVP_CIPHER_CTX_cleanup(&e_ctx) ;
+ EVP_CIPHER_CTX_free(e_ctx) ;
return false ;
}
/* update ciphertext, c_len is filled with the length of ciphertext generated,
*len is the size of plaintext in bytes */
- if(!EVP_EncryptUpdate(&e_ctx, output_data, &c_len, input_data, input_data_length))
+ if(!EVP_EncryptUpdate(e_ctx, output_data, &c_len, input_data, input_data_length))
{
std::cerr << "RsAES: decryption failed at end. Check padding." << std::endl;
- EVP_CIPHER_CTX_cleanup(&e_ctx) ;
+ EVP_CIPHER_CTX_free(e_ctx) ;
return false ;
}
/* update ciphertext with the final remaining bytes */
- if(!EVP_EncryptFinal_ex(&e_ctx, output_data+c_len, &f_len))
+ if(!EVP_EncryptFinal_ex(e_ctx, output_data+c_len, &f_len))
{
std::cerr << "RsAES: decryption failed at end. Check padding." << std::endl;
- EVP_CIPHER_CTX_cleanup(&e_ctx) ;
+ EVP_CIPHER_CTX_free(e_ctx) ;
return false ;
}
output_data_length = c_len + f_len;
- EVP_CIPHER_CTX_cleanup(&e_ctx) ;
+ EVP_CIPHER_CTX_free(e_ctx) ;
return true;
}
@@ -108,9 +107,8 @@ bool RsAES::aes_decrypt_8_16(const uint8_t *input_data,uint32_t input_data_lengt
return false ;
}
- EVP_CIPHER_CTX e_ctx ;
- EVP_CIPHER_CTX_init(&e_ctx);
- EVP_DecryptInit_ex(&e_ctx, EVP_aes_256_cbc(), NULL, key, iv);
+ EVP_CIPHER_CTX *e_ctx = EVP_CIPHER_CTX_new();
+ EVP_DecryptInit_ex(e_ctx, EVP_aes_256_cbc(), NULL, key, iv);
/* max ciphertext len for a n bytes of plaintext is n + AES_BLOCK_SIZE -1 bytes */
int c_len = input_data_length + AES_BLOCK_SIZE ;
@@ -118,7 +116,7 @@ bool RsAES::aes_decrypt_8_16(const uint8_t *input_data,uint32_t input_data_lengt
if(output_data_length < (uint32_t)c_len)
{
- EVP_CIPHER_CTX_cleanup(&e_ctx) ;
+ EVP_CIPHER_CTX_free(e_ctx) ;
return false ;
}
@@ -127,24 +125,24 @@ bool RsAES::aes_decrypt_8_16(const uint8_t *input_data,uint32_t input_data_lengt
/* update ciphertext, c_len is filled with the length of ciphertext generated,
*len is the size of plaintext in bytes */
- if(! EVP_DecryptUpdate(&e_ctx, output_data, &c_len, input_data, input_data_length))
+ if(! EVP_DecryptUpdate(e_ctx, output_data, &c_len, input_data, input_data_length))
{
std::cerr << "RsAES: decryption failed." << std::endl;
- EVP_CIPHER_CTX_cleanup(&e_ctx) ;
+ EVP_CIPHER_CTX_free(e_ctx) ;
return false ;
}
/* update ciphertext with the final remaining bytes */
- if(!EVP_DecryptFinal_ex(&e_ctx, output_data+c_len, &f_len))
+ if(!EVP_DecryptFinal_ex(e_ctx, output_data+c_len, &f_len))
{
std::cerr << "RsAES: decryption failed at end. Check padding." << std::endl;
- EVP_CIPHER_CTX_cleanup(&e_ctx) ;
+ EVP_CIPHER_CTX_free(e_ctx) ;
return false ;
}
output_data_length = c_len + f_len;
- EVP_CIPHER_CTX_cleanup(&e_ctx) ;
+ EVP_CIPHER_CTX_free(e_ctx) ;
return true;
}
diff --git a/libretroshare/src/util/rsrecogn.cc b/libretroshare/src/util/rsrecogn.cc
index f7c51b9e9..f42a4dd6f 100644
--- a/libretroshare/src/util/rsrecogn.cc
+++ b/libretroshare/src/util/rsrecogn.cc
@@ -28,6 +28,7 @@
#include "util/rsrecogn.h"
#include "util/radix64.h"
#include "util/rsstring.h"
+#include "util/rsdir.h"
#include "gxs/gxssecurity.h"
@@ -507,9 +508,23 @@ bool RsRecogn::itemToRadix64(RsItem *item, std::string &radstr)
std::string RsRecogn::getRsaKeyId(RSA *pubkey)
{
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
int len = BN_num_bytes(pubkey -> n);
unsigned char tmp[len];
BN_bn2bin(pubkey -> n, tmp);
+#else
+ const BIGNUM *nn=NULL ;
+ RSA_get0_key(pubkey,&nn,NULL,NULL) ;
+
+ int len = BN_num_bytes(nn);
+ unsigned char tmp[len];
+ BN_bn2bin(nn, tmp);
+#endif
+
+ return RsDirUtil::sha1sum(tmp,len).toStdString();
+
+#ifdef OLD_VERSION_REMOVED
+ // (cyril) I removed this because this is cryptographically insane, as it allows to easily forge a RSA key with the same ID.
// copy first CERTSIGNLEN bytes...
if (len > CERTSIGNLEN)
@@ -524,6 +539,7 @@ std::string RsRecogn::getRsaKeyId(RSA *pubkey)
}
return id;
+#endif
}
diff --git a/retroshare.pri b/retroshare.pri
index 498131aea..7642acc88 100644
--- a/retroshare.pri
+++ b/retroshare.pri
@@ -60,6 +60,9 @@ rs_nodeprecatedwarning:CONFIG -= no_rs_nodeprecatedwarning
CONFIG *= no_rs_nocppwarning
rs_nocppwarning:CONFIG -= no_rs_nocppwarning
+INCLUDEPATH += /usr/local/openssl/include
+LIBS += -L/usr/local/openssl/lib
+
unix {
isEmpty(PREFIX) { PREFIX = "/usr" }
isEmpty(BIN_DIR) { BIN_DIR = "$${PREFIX}/bin" }
From c3b49855e02b8525223c133858e2417deabb5779 Mon Sep 17 00:00:00 2001
From: csoler
Date: Mon, 20 Feb 2017 21:44:48 +0100
Subject: [PATCH 70/90] compilation fix for openssl-1.1.0
(gxssecurity+gxstunnel part)
---
libretroshare/src/gxs/gxssecurity.cc | 353 +++++++++++----------
libretroshare/src/gxstunnel/p3gxstunnel.cc | 16 +
2 files changed, 202 insertions(+), 167 deletions(-)
diff --git a/libretroshare/src/gxs/gxssecurity.cc b/libretroshare/src/gxs/gxssecurity.cc
index 20ddc1462..9591b3f9e 100644
--- a/libretroshare/src/gxs/gxssecurity.cc
+++ b/libretroshare/src/gxs/gxssecurity.cc
@@ -41,20 +41,31 @@ static const uint32_t MULTI_ENCRYPTION_FORMAT_v001_ENCRYPTED_KEY_SIZE = 256 ;
static RsGxsId getRsaKeyFingerprint_old_insecure_method(RSA *pubkey)
{
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
int lenn = BN_num_bytes(pubkey -> n);
RsTemporaryMemory tmp(lenn) ;
BN_bn2bin(pubkey -> n, tmp);
+#else
+ const BIGNUM *nn=NULL,*ee=NULL ;
+ RSA_get0_key(pubkey,&nn,&ee,NULL) ;
+
+ int lenn = BN_num_bytes(nn);
+
+ RsTemporaryMemory tmp(lenn) ;
+ BN_bn2bin(nn, tmp);
+#endif
// Copy first CERTSIGNLEN bytes from the hash of the public modulus and exponent
- // We should not be using strings here, but a real ID. To be done later.
+ // We should not be using strings here, but a real ID. To be done later.
- assert(lenn >= CERTSIGNLEN) ;
+ assert(lenn >= CERTSIGNLEN) ;
- return RsGxsId((unsigned char*)tmp) ;
+ return RsGxsId((unsigned char*)tmp) ;
}
static RsGxsId getRsaKeyFingerprint(RSA *pubkey)
{
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
int lenn = BN_num_bytes(pubkey -> n);
int lene = BN_num_bytes(pubkey -> e);
@@ -62,6 +73,18 @@ static RsGxsId getRsaKeyFingerprint(RSA *pubkey)
BN_bn2bin(pubkey -> n, tmp);
BN_bn2bin(pubkey -> e, &tmp[lenn]);
+#else
+ const BIGNUM *nn=NULL,*ee=NULL ;
+ RSA_get0_key(pubkey,&nn,&ee,NULL) ;
+
+ int lenn = BN_num_bytes(nn);
+ int lene = BN_num_bytes(ee);
+
+ RsTemporaryMemory tmp(lenn+lene) ;
+
+ BN_bn2bin(nn, tmp);
+ BN_bn2bin(ee, &tmp[lenn]);
+#endif
Sha1CheckSum s = RsDirUtil::sha1sum(tmp,lenn+lene) ;
@@ -530,11 +553,10 @@ bool GxsSecurity::encrypt(uint8_t *& out, uint32_t &outlen, const uint8_t *in, u
return false;
}
- EVP_CIPHER_CTX ctx;
+ EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
int eklen, net_ekl;
unsigned char *ek;
unsigned char iv[EVP_MAX_IV_LENGTH];
- EVP_CIPHER_CTX_init(&ctx);
int out_currOffset = 0;
int out_offset = 0;
@@ -551,7 +573,7 @@ bool GxsSecurity::encrypt(uint8_t *& out, uint32_t &outlen, const uint8_t *in, u
int max_outlen = inlen + cipher_block_size + EVP_MAX_IV_LENGTH + max_evp_key_size + size_net_ekl;
// intialize context and send store encrypted cipher in ek
- if(!EVP_SealInit(&ctx, EVP_aes_128_cbc(), &ek, &eklen, iv, &public_key, 1)) return false;
+ if(!EVP_SealInit(ctx, EVP_aes_128_cbc(), &ek, &eklen, iv, &public_key, 1)) return false;
// now assign memory to out accounting for data, and cipher block size, key length, and key length val
out = (uint8_t*)rs_malloc(inlen + cipher_block_size + size_net_ekl + eklen + EVP_MAX_IV_LENGTH) ;
@@ -570,7 +592,7 @@ bool GxsSecurity::encrypt(uint8_t *& out, uint32_t &outlen, const uint8_t *in, u
out_offset += EVP_MAX_IV_LENGTH;
// now encrypt actual data
- if(!EVP_SealUpdate(&ctx, (unsigned char*) out + out_offset, &out_currOffset, (unsigned char*) in, inlen))
+ if(!EVP_SealUpdate(ctx, (unsigned char*) out + out_offset, &out_currOffset, (unsigned char*) in, inlen))
{
free(out) ;
out = NULL ;
@@ -581,7 +603,7 @@ bool GxsSecurity::encrypt(uint8_t *& out, uint32_t &outlen, const uint8_t *in, u
out_offset += out_currOffset;
// add padding
- if(!EVP_SealFinal(&ctx, (unsigned char*) out + out_offset, &out_currOffset))
+ if(!EVP_SealFinal(ctx, (unsigned char*) out + out_offset, &out_currOffset))
{
free(out) ;
out = NULL ;
@@ -602,7 +624,7 @@ bool GxsSecurity::encrypt(uint8_t *& out, uint32_t &outlen, const uint8_t *in, u
// free encrypted key data
free(ek);
- EVP_CIPHER_CTX_cleanup(&ctx);
+ EVP_CIPHER_CTX_free(ctx);
outlen = out_offset;
return true;
@@ -613,152 +635,151 @@ bool GxsSecurity::encrypt(uint8_t *& out, uint32_t &outlen, const uint8_t *in, u
#ifdef DISTRIB_DEBUG
std::cerr << "GxsSecurity::encrypt() " << std::endl;
#endif
- // Encrypts (in,inlen) into (out,outlen) using the given RSA public key.
- // The format of the encrypted data is:
- //
- // [--- ID ---|--- number of encrypted keys---| n * (--- Encrypted session keys ---) |--- IV ---|---- Encrypted data ---]
- // 2 bytes 2 byte = n 256 bytes EVP_MAX_IV_LENGTH Rest of packet
- //
+ // Encrypts (in,inlen) into (out,outlen) using the given RSA public key.
+ // The format of the encrypted data is:
+ //
+ // [--- ID ---|--- number of encrypted keys---| n * (--- Encrypted session keys ---) |--- IV ---|---- Encrypted data ---]
+ // 2 bytes 2 byte = n 256 bytes EVP_MAX_IV_LENGTH Rest of packet
+ //
- out = NULL ;
- EVP_CIPHER_CTX ctx;
- EVP_CIPHER_CTX_init(&ctx);
- std::vector public_keys(keys.size(),NULL);
-
- try
- {
- for(uint32_t i=0;i ek(keys.size(),NULL) ;
- std::vector eklen(keys.size(),0) ;
-
- for(uint32_t i=0;i> 8) & 0xff ;
-
- // number of keys
-
- out[out_offset++] = keys.size() & 0xff ;
- out[out_offset++] = (keys.size() >> 8) & 0xff ;
-
- // encrypted keys, each preceeded with its length
-
- for(uint32_t i=0;i max_outlen)
- throw std::runtime_error("Memory used by encryption exceeds allocated memory block") ;
-
- // free encrypted key data
-
- for(uint32_t i=0;i public_keys(keys.size(),NULL);
+
+ try
+ {
+ for(uint32_t i=0;i ek(keys.size(),NULL) ;
+ std::vector eklen(keys.size(),0) ;
+
+ for(uint32_t i=0;i> 8) & 0xff ;
+
+ // number of keys
+
+ out[out_offset++] = keys.size() & 0xff ;
+ out[out_offset++] = (keys.size() >> 8) & 0xff ;
+
+ // encrypted keys, each preceeded with its length
+
+ for(uint32_t i=0;i max_outlen)
+ throw std::runtime_error("Memory used by encryption exceeds allocated memory block") ;
+
+ // free encrypted key data
+
+ for(uint32_t i=0;ipublic_key = BN_dup(dh->pub_key) ;
+#else
+ const BIGNUM *pub_key=NULL ;
+ DH_get0_key(dh,&pub_key,NULL) ;
+ dhitem->public_key = BN_dup(pub_key) ;
+#endif
// we should also sign the data and check the signature on the other end.
//
@@ -1133,8 +1139,18 @@ bool p3GxsTunnelService::locked_initDHSessionKey(DH *& dh)
return false ;
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
BN_hex2bn(&dh->p,dh_prime_2048_hex.c_str()) ;
BN_hex2bn(&dh->g,"5") ;
+#else
+ BIGNUM *pp=NULL ;
+ BIGNUM *gg=NULL ;
+
+ BN_hex2bn(&pp,dh_prime_2048_hex.c_str()) ;
+ BN_hex2bn(&gg,"5") ;
+
+ DH_set0_pqg(dh,pp,NULL,gg) ;
+#endif
int codes = 0 ;
From 4dac3b4f148ec865ec4c6c425303b4749e743afd Mon Sep 17 00:00:00 2001
From: csoler
Date: Mon, 20 Feb 2017 22:36:35 +0100
Subject: [PATCH 71/90] removed compilation tweak
---
retroshare.pri | 3 ---
1 file changed, 3 deletions(-)
diff --git a/retroshare.pri b/retroshare.pri
index 7642acc88..498131aea 100644
--- a/retroshare.pri
+++ b/retroshare.pri
@@ -60,9 +60,6 @@ rs_nodeprecatedwarning:CONFIG -= no_rs_nodeprecatedwarning
CONFIG *= no_rs_nocppwarning
rs_nocppwarning:CONFIG -= no_rs_nocppwarning
-INCLUDEPATH += /usr/local/openssl/include
-LIBS += -L/usr/local/openssl/lib
-
unix {
isEmpty(PREFIX) { PREFIX = "/usr" }
isEmpty(BIN_DIR) { BIN_DIR = "$${PREFIX}/bin" }
From 8c3f553579a88170f340744463001cac9cd0505b Mon Sep 17 00:00:00 2001
From: csoler
Date: Mon, 20 Feb 2017 22:54:25 +0100
Subject: [PATCH 72/90] fixed compilation with openssl1.0.1 broken by previous
commits
---
libretroshare/src/pqi/authssl.cc | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/libretroshare/src/pqi/authssl.cc b/libretroshare/src/pqi/authssl.cc
index bbe99b2a6..b74de49af 100644
--- a/libretroshare/src/pqi/authssl.cc
+++ b/libretroshare/src/pqi/authssl.cc
@@ -814,15 +814,13 @@ X509 *AuthSSLimpl::SignX509ReqWithGPG(X509_REQ *req, long /*days*/)
//EVP_PKEY *pkey = NULL;
const EVP_MD *type = EVP_sha1();
- EVP_MD_CTX *ctx = EVP_MD_CTX_new();
+ EVP_MD_CTX *ctx = EVP_MD_CTX_create();
unsigned char *p,*buf_in=NULL;
unsigned char *buf_hashout=NULL,*buf_sigout=NULL;
int inl=0,hashoutl=0;
int sigoutl=0;
X509_ALGOR *a;
- EVP_MD_CTX_init(ctx);
-
/* FIX ALGORITHMS */
a = const_cast(algor1);
@@ -923,7 +921,7 @@ X509 *AuthSSLimpl::SignX509ReqWithGPG(X509_REQ *req, long /*days*/)
std::cerr << "Certificate Complete" << std::endl;
- EVP_MD_CTX_free(ctx) ;
+ EVP_MD_CTX_destroy(ctx) ;
return x509;
@@ -994,7 +992,7 @@ bool AuthSSLimpl::AuthX509WithGPG(X509 *x509,uint32_t& diagnostic)
const EVP_MD *type = EVP_sha1();
- EVP_MD_CTX *ctx = EVP_MD_CTX_new();
+ EVP_MD_CTX *ctx = EVP_MD_CTX_create();
unsigned char *p,*buf_in=NULL;
unsigned char *buf_hashout=NULL,*buf_sigout=NULL;
int inl=0,hashoutl=0;
@@ -1080,7 +1078,7 @@ bool AuthSSLimpl::AuthX509WithGPG(X509 *x509,uint32_t& diagnostic)
#ifdef AUTHSSL_DEBUG
std::cerr << "AuthSSLimpl::AuthX509() X509 authenticated" << std::endl;
#endif
- EVP_MD_CTX_free(ctx) ;
+ EVP_MD_CTX_destroy(ctx) ;
OPENSSL_free(buf_in) ;
OPENSSL_free(buf_hashout) ;
From 9371521dd134559b5908e43cafa9d09699f7976b Mon Sep 17 00:00:00 2001
From: csoler
Date: Mon, 20 Feb 2017 23:19:29 +0100
Subject: [PATCH 73/90] fixed bug causing crash in openssl_crypto due to not
zeroing a field that was not duplicated before delete
---
openpgpsdk/src/openpgpsdk/openssl_crypto.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/openpgpsdk/src/openpgpsdk/openssl_crypto.c b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
index 768abab8e..4b36d2caf 100644
--- a/openpgpsdk/src/openpgpsdk/openssl_crypto.c
+++ b/openpgpsdk/src/openpgpsdk/openssl_crypto.c
@@ -416,6 +416,12 @@ ops_boolean_t ops_dsa_verify(const unsigned char *hash,size_t hash_length,
fprintf(stderr,"(WW) ops_dsa_verify: openssl does only supports 'q' of 160 bits. Current is %d bits.\n",BN_num_bits(dsa->q)) ;
already_said=ops_true ;
}
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ osig->r=NULL; // in this case, the values are not copied.
+ osig->s=NULL;
+#endif
+
DSA_SIG_free(osig);
return ops_false ;
}
From 8325c72153d58c342ed762f81d167996bf9d4c85 Mon Sep 17 00:00:00 2001
From: Phenom
Date: Mon, 20 Feb 2017 16:15:31 +0100
Subject: [PATCH 74/90] Fix UnitTest Compilation and Travis Error.
---
.travis.yml | 2 +-
.../gxs/data_service/rsdataservice_test.cc | 35 -------------------
.../libretroshare/gxs/common/data_support.cc | 9 ++---
.../gxs/data_service/rsdataservice_test.cc | 5 +++
.../gxs/gen_exchange/gxsteststats.cpp | 1 +
.../gxs/nxs_test/nxsdummyservices.h | 2 +-
.../libretroshare/serialiser/support.cc | 14 +++-----
7 files changed, 17 insertions(+), 51 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index a18ca2f2f..dc003da6d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,7 +13,7 @@ matrix:
before_install:
- if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get update; fi
- - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y build-essential checkinstall cmake libavutil-dev libavcodec-dev libavformat-dev libbz2-dev libcurl4-openssl-dev libcv-dev libopencv-highgui-dev libhighgui-dev libgnome-keyring-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libjasper-dev libjpeg-dev libmicrohttpd-dev libopencv-dev libprotobuf-dev libqt4-dev libspeex-dev libspeexdsp-dev libsqlite3-dev libssl-dev libswscale-dev libtbb-dev libtiff4-dev libupnp-dev libv4l-dev libxine-dev libxslt1-dev libxss-dev pkg-config protobuf-compiler python-dev qtmobility-dev; fi
+ - if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -y build-essential checkinstall cmake libavutil-dev libavcodec-dev libavformat-dev libbz2-dev libcurl4-openssl-dev libcv-dev libopencv-highgui-dev libhighgui-dev libgnome-keyring-dev libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libjasper-dev libjpeg-dev libmicrohttpd-dev libopencv-dev libprotobuf-dev libqt4-dev libspeex-dev libspeexdsp-dev libsqlite3-dev libssl-dev libswscale-dev libtbb-dev libtiff4-dev libupnp-dev libv4l-dev libxine-dev libxslt1-dev libxss-dev pkg-config protobuf-compiler python-dev qtmobility-dev gdb ; fi
# - if [ $TRAVIS_OS_NAME == osx ]; then xcode-select --install ; fi
diff --git a/libretroshare/src/tests/gxs/data_service/rsdataservice_test.cc b/libretroshare/src/tests/gxs/data_service/rsdataservice_test.cc
index 90f800355..4cb126cce 100644
--- a/libretroshare/src/tests/gxs/data_service/rsdataservice_test.cc
+++ b/libretroshare/src/tests/gxs/data_service/rsdataservice_test.cc
@@ -335,38 +335,3 @@ void tearDown(){
}
-
-
-bool operator ==(const RsGxsGrpMetaData& l, const RsGxsGrpMetaData& r)
-{
- if(!(l.signSet == r.signSet)) return false;
- if(!(l.keys == r.keys)) return false;
- if(l.mGroupFlags != r.mGroupFlags) return false;
- if(l.mPublishTs != r.mPublishTs) return false;
- if(l.mAuthorId != r.mAuthorId) return false;
- if(l.mGroupName != r.mGroupName) return false;
- if(l.mGroupId != r.mGroupId) return false;
- if(l.mGroupStatus != r.mGroupStatus) return false;
- if(l.mPop != r.mPop) return false;
- if(l.mMsgCount != r.mMsgCount) return false;
- if(l.mSubscribeFlags != r.mSubscribeFlags) return false;
-
- return true;
-}
-
-bool operator ==(const RsGxsMsgMetaData& l, const RsGxsMsgMetaData& r)
-{
-
- if(!(l.signSet == r.signSet)) return false;
- if(l.mGroupId != r.mGroupId) return false;
- if(l.mAuthorId != r.mAuthorId) return false;
- if(l.mParentId != r.mParentId) return false;
- if(l.mOrigMsgId != r.mOrigMsgId) return false;
- if(l.mThreadId != r.mThreadId) return false;
- if(l.mMsgId != r.mMsgId) return false;
- if(l.mMsgName != r.mMsgName) return false;
- if(l.mPublishTs != r.mPublishTs) return false;
- if(l.mMsgFlags != r.mMsgFlags) return false;
-
- return true;
-}
diff --git a/tests/unittests/libretroshare/gxs/common/data_support.cc b/tests/unittests/libretroshare/gxs/common/data_support.cc
index d77fa2ea6..1b64e8e8c 100644
--- a/tests/unittests/libretroshare/gxs/common/data_support.cc
+++ b/tests/unittests/libretroshare/gxs/common/data_support.cc
@@ -98,7 +98,7 @@ void init_item(RsGxsGrpMetaData* metaGrp)
randString(SHORT_STR, metaGrp->mGroupName);
randString(SHORT_STR, metaGrp->mServiceString);
- init_item(metaGrp->signSet);
+ init_item(metaGrp->signSet);// This is not stored in db.
init_item(metaGrp->keys);
metaGrp->mPublishTs = rand()%3452;
@@ -115,9 +115,10 @@ void init_item(RsGxsGrpMetaData* metaGrp)
metaGrp->mGroupStatus = rand()%313;
metaGrp->mRecvTS = rand()%313;
- metaGrp->mOriginator = RsPeerId::random() ;
- metaGrp->mInternalCircle = RsGxsCircleId::random() ;
- metaGrp->mHash = RsFileHash::random() ;
+ metaGrp->mOriginator = RsPeerId::random();
+ metaGrp->mInternalCircle = RsGxsCircleId::random();
+ metaGrp->mHash = RsFileHash::random();
+ metaGrp->mGrpSize = 0;// This was calculated on db read.
}
void init_item(RsGxsMsgMetaData* metaMsg)
diff --git a/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.cc b/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.cc
index 6cf0abeef..9720c1294 100644
--- a/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.cc
+++ b/tests/unittests/libretroshare/gxs/data_service/rsdataservice_test.cc
@@ -107,6 +107,11 @@ void test_groupStoreAndRetrieve(){
RsGxsGrpMetaData *l_Meta = mit->second,
*r_Meta = grpMetaR[grpId];
+ // assign signSet and mGrpSize
+ // to right as these values are not stored in db
+ r_Meta->signSet = l_Meta->signSet;
+ r_Meta->mGrpSize = l_Meta->mGrpSize;
+
if(!(*l_Meta == *r_Meta))
{
grpMetaMatch = false;
diff --git a/tests/unittests/libretroshare/gxs/gen_exchange/gxsteststats.cpp b/tests/unittests/libretroshare/gxs/gen_exchange/gxsteststats.cpp
index 8cfad6538..256777c1a 100644
--- a/tests/unittests/libretroshare/gxs/gen_exchange/gxsteststats.cpp
+++ b/tests/unittests/libretroshare/gxs/gen_exchange/gxsteststats.cpp
@@ -81,6 +81,7 @@ void GxsTestStats::testServiceStatistics()
RsDummyGrp* dgrp2 = new RsDummyGrp();
init(*dgrp1);
+ init(*dgrp2);
RsTokReqOptions opts;
opts.mReqType = 45000;
uint32_t token;
diff --git a/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.h b/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.h
index 9f42c4bbc..48eca0074 100644
--- a/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.h
+++ b/tests/unittests/libretroshare/gxs/nxs_test/nxsdummyservices.h
@@ -110,7 +110,7 @@ namespace rs_nxs_test
bool loadReputation(const RsGxsId &id, const std::list& peers);
bool getReputation(const RsGxsId &id, GixsReputation &rep);
- virtual RsReputations::ReputationLevel overallReputationLevel(const RsGxsId&) { return RsReputations::REPUTATION_NEUTRAL ; }
+ virtual RsReputations::ReputationLevel overallReputationLevel(const RsGxsId&,uint32_t */*identity_flags*/=NULL) { return RsReputations::REPUTATION_NEUTRAL ; }
private:
diff --git a/tests/unittests/libretroshare/serialiser/support.cc b/tests/unittests/libretroshare/serialiser/support.cc
index 2474b77fb..29d7d782e 100644
--- a/tests/unittests/libretroshare/serialiser/support.cc
+++ b/tests/unittests/libretroshare/serialiser/support.cc
@@ -68,14 +68,11 @@ void init_item(RsTlvSecurityKeySet& ks)
randString(SHORT_STR, ks.groupId);
for(int i=1; i
Date: Wed, 22 Feb 2017 22:06:00 +0100
Subject: [PATCH 75/90] fixed show/hide buttons in appearance settings page
---
retroshare-gui/src/gui/MainWindow.cpp | 1 +
retroshare-gui/src/gui/MainWindow.h | 3 +-
.../src/gui/settings/AppearancePage.cpp | 3 +-
.../src/gui/settings/AppearancePage.h | 1 +
.../src/gui/settings/AppearancePage.ui | 28 +++++++++----------
5 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp
index fa1f0ea12..b3c746fee 100644
--- a/retroshare-gui/src/gui/MainWindow.cpp
+++ b/retroshare-gui/src/gui/MainWindow.cpp
@@ -1498,6 +1498,7 @@ void MainWindow::switchVisibilityStatus(StatusElement e,bool b)
case StatusGrpStatus : getInstance()->statusBar() ->setVisible(b); break ;
case StatusCompactMode : getInstance()->setCompactStatusMode(b) ; break ;
case StatusShowToolTip : getInstance()->toggleStatusToolTip(b) ; break ;
+ case StatusShowCBox : getInstance()->statusComboBoxInstance() ->setVisible(b); break ;
case StatusShowStatus : getInstance()->peerstatusInstance() ->setVisible(b); break ;
case StatusShowPeer : getInstance()->natstatusInstance() ->setVisible(b); break ;
case StatusShowDHT : getInstance()->dhtstatusInstance() ->setVisible(b); break ;
diff --git a/retroshare-gui/src/gui/MainWindow.h b/retroshare-gui/src/gui/MainWindow.h
index 366c42173..00a6544cb 100644
--- a/retroshare-gui/src/gui/MainWindow.h
+++ b/retroshare-gui/src/gui/MainWindow.h
@@ -123,7 +123,8 @@ public:
StatusShowOpMode = 0x0a,
StatusShowSound = 0x0b,
StatusShowToaster = 0x0c,
- StatusShowSystray = 0x0d
+ StatusShowSystray = 0x0d,
+ StatusShowCBox = 0x0e
};
/** Create main window */
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.cpp b/retroshare-gui/src/gui/settings/AppearancePage.cpp
index bea9959d9..025828ee0 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.cpp
+++ b/retroshare-gui/src/gui/settings/AppearancePage.cpp
@@ -55,7 +55,7 @@ AppearancePage::AppearancePage(QWidget * parent, Qt::WindowFlags flags)
connect(ui.grpStatus, SIGNAL(toggled(bool)), this /* pMainWindow->statusBar(), */, SLOT(switch_status_grpStatus(bool)));
connect(ui.checkBoxStatusCompactMode, SIGNAL(toggled(bool)), this /* pMainWindow, */, SLOT(switch_status_compactMode(bool)));
connect(ui.checkBoxDisableSysTrayToolTip, SIGNAL(toggled(bool)), this /* pMainWindow, */, SLOT(switch_status_showToolTip(bool)));
- connect(ui.checkBoxShowStatusStatus, SIGNAL(toggled(bool)), this /* pMainWindow->statusComboBoxInstance(), */, SLOT(switch_status_ShowStatus(bool)));
+ connect(ui.checkBoxShowStatusStatus, SIGNAL(toggled(bool)), this /* pMainWindow->statusComboBoxInstance(), */, SLOT(switch_status_ShowCBox(bool)));
connect(ui.checkBoxShowPeerStatus, SIGNAL(toggled(bool)), this /* pMainWindow->peerstatusInstance(), */, SLOT(switch_status_ShowStatus(bool)));
connect(ui.checkBoxShowNATStatus, SIGNAL(toggled(bool)), this /* pMainWindow->natstatusInstance(), */, SLOT(switch_status_ShowPeer(bool)));
connect(ui.checkBoxShowDHTStatus, SIGNAL(toggled(bool)), this /* pMainWindow->dhtstatusInstance(), */, SLOT(switch_status_ShowDHT(bool)));
@@ -110,6 +110,7 @@ void AppearancePage::switch_status_ShowOpMode(bool b) { switch_status(Main
void AppearancePage::switch_status_ShowSound(bool b) { switch_status(MainWindow::StatusShowSound ,"ShowSound", b) ; }
void AppearancePage::switch_status_ShowToaster(bool b) { switch_status(MainWindow::StatusShowToaster,"ShowToaster", b) ; }
void AppearancePage::switch_status_ShowSystray(bool b) { switch_status(MainWindow::StatusShowSystray,"ShowSysTrayOnStatusBar",b) ; }
+void AppearancePage::switch_status_ShowCBox(bool b) { switch_status(MainWindow::StatusShowCBox, "ShowStatusCBox" ,b) ; }
void AppearancePage::switch_status(MainWindow::StatusElement s,const QString& key, bool b)
{
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.h b/retroshare-gui/src/gui/settings/AppearancePage.h
index 09610a22d..0259062f6 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.h
+++ b/retroshare-gui/src/gui/settings/AppearancePage.h
@@ -57,6 +57,7 @@ private slots:
void switch_status_ShowSound(bool) ;
void switch_status_ShowToaster(bool) ;
void switch_status_ShowSystray(bool) ;
+ void switch_status_ShowCBox(bool) ;
void updateLanguageCode() ;
void updateInterfaceStyle() ;
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.ui b/retroshare-gui/src/gui/settings/AppearancePage.ui
index 4eecd3e3d..66c732399 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.ui
+++ b/retroshare-gui/src/gui/settings/AppearancePage.ui
@@ -338,13 +338,6 @@
true
- -
-
-
- Show SysTray on Status Bar
-
-
-
-
@@ -359,13 +352,6 @@
- -
-
-
- Show Operating Mode Status
-
-
-
-
@@ -432,6 +418,20 @@
+ -
+
+
+ Show Operating Mode Status
+
+
+
+ -
+
+
+ Show SysTray on Status Bar
+
+
+
From 0e57874ad3cdba2a9d43424c2552d7d977563d24 Mon Sep 17 00:00:00 2001
From: csoler
Date: Wed, 22 Feb 2017 22:22:50 +0100
Subject: [PATCH 76/90] fixed loading of settings::Server page
---
libretroshare/src/pqi/pqissllistener.cc | 1 -
.../src/gui/settings/ServerPage.cpp | 160 +++++++++---------
retroshare-gui/src/gui/settings/ServerPage.ui | 4 +-
3 files changed, 86 insertions(+), 79 deletions(-)
diff --git a/libretroshare/src/pqi/pqissllistener.cc b/libretroshare/src/pqi/pqissllistener.cc
index 189eb5dce..9fadc092d 100644
--- a/libretroshare/src/pqi/pqissllistener.cc
+++ b/libretroshare/src/pqi/pqissllistener.cc
@@ -214,7 +214,6 @@ int pqissllistenbase::setuplisten()
if (!mPeerMgr->isHidden()) std::cerr << "Zeroed tmpaddr: " << sockaddr_storage_tostring(tmpaddr) << std::endl;
#endif
- exit(1);
return -1;
}
else
diff --git a/retroshare-gui/src/gui/settings/ServerPage.cpp b/retroshare-gui/src/gui/settings/ServerPage.cpp
index c80a56bbe..0aaac99cc 100755
--- a/retroshare-gui/src/gui/settings/ServerPage.cpp
+++ b/retroshare-gui/src/gui/settings/ServerPage.cpp
@@ -70,19 +70,6 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
ui.whiteListIpsTable->setColumnHidden(COLUMN_STATUS,true) ;
ui.whiteListIpsTable->verticalHeader()->hide() ;
- QObject::connect(ui.filteredIpsTable,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(ipFilterContextMenu(const QPoint&))) ;
- QObject::connect(ui.whiteListIpsTable,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(ipWhiteListContextMenu(const QPoint&))) ;
- QObject::connect(ui.denyAll_CB,SIGNAL(toggled(bool)),this,SLOT(toggleIpFiltering(bool)));
- QObject::connect(ui.includeFromDHT_CB,SIGNAL(toggled(bool)),this,SLOT(toggleAutoIncludeDHT(bool)));
- QObject::connect(ui.includeFromFriends_CB,SIGNAL(toggled(bool)),this,SLOT(toggleAutoIncludeFriends(bool)));
- QObject::connect(ui.groupIPRanges_CB,SIGNAL(toggled(bool)),this,SLOT(toggleGroupIps(bool)));
- QObject::connect(ui.groupIPRanges_SB,SIGNAL(valueChanged(int)),this,SLOT(setGroupIpLimit(int)));
- QObject::connect(ui.ipInputAddBlackList_PB,SIGNAL(clicked()),this,SLOT(addIpRangeToBlackList()));
- QObject::connect(ui.ipInputAddWhiteList_PB,SIGNAL(clicked()),this,SLOT(addIpRangeToWhiteList()));
- QObject::connect(ui.ipInput_LE,SIGNAL(textChanged(const QString&)),this,SLOT(checkIpRange(const QString&)));
- QObject::connect(ui.filteredIpsTable,SIGNAL(currentCellChanged(int,int,int,int)),this,SLOT(updateSelectedBlackListIP(int,int,int,int)));
- QObject::connect(ui.whiteListIpsTable,SIGNAL(currentCellChanged(int,int,int,int)),this,SLOT(updateSelectedWhiteListIP(int,int,int,int)));
-
QTimer *timer = new QTimer(this);
timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus()));
timer->start(1000);
@@ -102,6 +89,22 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
ui.hiddenpage_incoming->setVisible(false);
+ QObject::connect(ui.filteredIpsTable,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(ipFilterContextMenu(const QPoint&))) ;
+ QObject::connect(ui.whiteListIpsTable,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(ipWhiteListContextMenu(const QPoint&))) ;
+ QObject::connect(ui.denyAll_CB,SIGNAL(toggled(bool)),this,SLOT(toggleIpFiltering(bool)));
+ QObject::connect(ui.includeFromDHT_CB,SIGNAL(toggled(bool)),this,SLOT(toggleAutoIncludeDHT(bool)));
+ QObject::connect(ui.includeFromFriends_CB,SIGNAL(toggled(bool)),this,SLOT(toggleAutoIncludeFriends(bool)));
+ QObject::connect(ui.groupIPRanges_CB,SIGNAL(toggled(bool)),this,SLOT(toggleGroupIps(bool)));
+ QObject::connect(ui.groupIPRanges_SB,SIGNAL(valueChanged(int)),this,SLOT(setGroupIpLimit(int)));
+ QObject::connect(ui.ipInputAddBlackList_PB,SIGNAL(clicked()),this,SLOT(addIpRangeToBlackList()));
+ QObject::connect(ui.ipInputAddWhiteList_PB,SIGNAL(clicked()),this,SLOT(addIpRangeToWhiteList()));
+ QObject::connect(ui.ipInput_LE,SIGNAL(textChanged(const QString&)),this,SLOT(checkIpRange(const QString&)));
+ QObject::connect(ui.filteredIpsTable,SIGNAL(currentCellChanged(int,int,int,int)),this,SLOT(updateSelectedBlackListIP(int,int,int,int)));
+ QObject::connect(ui.whiteListIpsTable,SIGNAL(currentCellChanged(int,int,int,int)),this,SLOT(updateSelectedWhiteListIP(int,int,int,int)));
+
+ QObject::connect(ui.localPort,SIGNAL(valueChanged(int)),this,SLOT(saveAddresses()));
+ QObject::connect(ui.extPort,SIGNAL(valueChanged(int)),this,SLOT(saveAddresses()));
+
connect( ui.netModeComboBox, SIGNAL( activated ( int ) ), this, SLOT( toggleUPnP( ) ) );
connect( ui.allowIpDeterminationCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleIpDetermination(bool) ) );
connect( ui.cleanKnownIPs_PB, SIGNAL( clicked( ) ), this, SLOT( clearKnownAddressList() ) );
@@ -225,20 +228,28 @@ void ServerPage::load()
return;
}
- loadFilteredIps() ;
-
- ui.netModeComboBox->show() ;
- ui.textlabel_upnp->show();
- ui.iconlabel_upnp->show();
- ui.label_nat->show();
-
- ui.textlabel_hiddenMode->hide() ;
- ui.iconlabel_hiddenMode->hide() ;
-
- /* set net mode */
- int netIndex = 0;
- switch(detail.netMode)
+ // (csoler) Disabling some signals in this block in order to avoid
+ // some nasty feedback.
{
+ ui.localPort->blockSignals(true);
+ ui.extPort->blockSignals(true);
+ ui.localAddress->blockSignals(true);
+ ui.extAddress->blockSignals(true);
+
+ loadFilteredIps() ;
+
+ ui.netModeComboBox->show() ;
+ ui.textlabel_upnp->show();
+ ui.iconlabel_upnp->show();
+ ui.label_nat->show();
+
+ ui.textlabel_hiddenMode->hide() ;
+ ui.iconlabel_hiddenMode->hide() ;
+
+ /* set net mode */
+ int netIndex = 0;
+ switch(detail.netMode)
+ {
case RS_NETMODE_EXT:
netIndex = 2;
break;
@@ -249,80 +260,77 @@ void ServerPage::load()
case RS_NETMODE_UPNP:
netIndex = 0;
break;
- }
- ui.netModeComboBox->setCurrentIndex(netIndex);
+ }
+ ui.netModeComboBox->setCurrentIndex(netIndex);
- /* DHT + Discovery: (public)
+ /* DHT + Discovery: (public)
* Discovery only: (private)
* DHT only: (inverted)
* None: (dark net)
*/
- netIndex = 3; // NONE.
- if (detail.vs_dht != RS_VS_DHT_OFF)
- {
- if (detail.vs_disc != RS_VS_DISC_OFF)
+ netIndex = 3; // NONE.
+ if (detail.vs_dht != RS_VS_DHT_OFF)
{
- netIndex = 0; // PUBLIC
+ if (detail.vs_disc != RS_VS_DISC_OFF)
+ netIndex = 0; // PUBLIC
+ else
+ netIndex = 2; // INVERTED
}
else
{
- netIndex = 2; // INVERTED
+ if (detail.vs_disc != RS_VS_DISC_OFF)
+ netIndex = 1; // PRIVATE
+ else
+ netIndex = 3; // NONE
}
- }
- else
- {
- if (detail.vs_disc != RS_VS_DISC_OFF)
- {
- netIndex = 1; // PRIVATE
- }
- else
- {
- netIndex = 3; // NONE
- }
- }
- ui.discComboBox->setCurrentIndex(netIndex);
+ ui.discComboBox->setCurrentIndex(netIndex);
- int dlrate = 0;
- int ulrate = 0;
- rsConfig->GetMaxDataRates(dlrate, ulrate);
- ui.totalDownloadRate->setValue(dlrate);
- ui.totalUploadRate->setValue(ulrate);
+ int dlrate = 0;
+ int ulrate = 0;
+ rsConfig->GetMaxDataRates(dlrate, ulrate);
+ ui.totalDownloadRate->setValue(dlrate);
+ ui.totalUploadRate->setValue(ulrate);
- toggleUPnP();
+ toggleUPnP();
-
- /* Addresses must be set here - otherwise can't edit it */
+ /* Addresses must be set here - otherwise can't edit it */
/* set local address */
- ui.localAddress->setText(QString::fromStdString(detail.localAddr));
- ui.localPort -> setValue(detail.localPort);
+ ui.localAddress->setText(QString::fromStdString(detail.localAddr));
+ ui.localPort -> setValue(detail.localPort);
/* set the server address */
- ui.extAddress->setText(QString::fromStdString(detail.extAddr));
- ui.extPort -> setValue(detail.extPort);
- /* set DynDNS */
- ui.dynDNS -> setText(QString::fromStdString(detail.dyndns));
+ ui.extAddress->setText(QString::fromStdString(detail.extAddr));
+ ui.extPort -> setValue(detail.extPort);
+ /* set DynDNS */
+ ui.dynDNS -> setText(QString::fromStdString(detail.dyndns));
- ui.showDiscStatusBar->setChecked(Settings->getStatusBarFlags() & STATUSBAR_DISC);
+ ui.showDiscStatusBar->setChecked(Settings->getStatusBarFlags() & STATUSBAR_DISC);
ui.ipAddressList->clear();
for(std::list::const_iterator it(detail.ipAddressList.begin());it!=detail.ipAddressList.end();++it)
ui.ipAddressList->addItem(QString::fromStdString(*it));
- /* HIDDEN PAGE SETTINGS - only Proxy (outgoing) */
- std::string proxyaddr;
- uint16_t proxyport;
- uint32_t status ;
- // Tor
- rsPeers->getProxyServer(RS_HIDDEN_TYPE_TOR, proxyaddr, proxyport, status);
- ui.hiddenpage_proxyAddress_tor -> setText(QString::fromStdString(proxyaddr));
- ui.hiddenpage_proxyPort_tor -> setValue(proxyport);
- // I2P
- rsPeers->getProxyServer(RS_HIDDEN_TYPE_I2P, proxyaddr, proxyport, status);
- ui.hiddenpage_proxyAddress_i2p -> setText(QString::fromStdString(proxyaddr));
- ui.hiddenpage_proxyPort_i2p -> setValue(proxyport);
+ /* HIDDEN PAGE SETTINGS - only Proxy (outgoing) */
+ std::string proxyaddr;
+ uint16_t proxyport;
+ uint32_t status ;
+ // Tor
+ rsPeers->getProxyServer(RS_HIDDEN_TYPE_TOR, proxyaddr, proxyport, status);
+ ui.hiddenpage_proxyAddress_tor -> setText(QString::fromStdString(proxyaddr));
+ ui.hiddenpage_proxyPort_tor -> setValue(proxyport);
+ // I2P
+ rsPeers->getProxyServer(RS_HIDDEN_TYPE_I2P, proxyaddr, proxyport, status);
+ ui.hiddenpage_proxyAddress_i2p -> setText(QString::fromStdString(proxyaddr));
+ ui.hiddenpage_proxyPort_i2p -> setValue(proxyport);
- updateOutProxyIndicator();
+ updateOutProxyIndicator();
+
+ ui.localPort->blockSignals(false);
+ ui.extPort->blockSignals(false);
+ ui.localAddress->blockSignals(false);
+ ui.extAddress->blockSignals(false);
+ }
}
void ServerPage::toggleAutoIncludeFriends(bool b)
diff --git a/retroshare-gui/src/gui/settings/ServerPage.ui b/retroshare-gui/src/gui/settings/ServerPage.ui
index 1893bdc7e..fe2a638e2 100755
--- a/retroshare-gui/src/gui/settings/ServerPage.ui
+++ b/retroshare-gui/src/gui/settings/ServerPage.ui
@@ -7,7 +7,7 @@
0
0
1220
- 884
+ 896
@@ -26,7 +26,7 @@
-
- 2
+ 0
From fe2059fb075a34ec5575cd56faf2a81515eae92f Mon Sep 17 00:00:00 2001
From: csoler
Date: Wed, 22 Feb 2017 22:44:00 +0100
Subject: [PATCH 77/90] fixed update of GxsGroupWidget layout when changing
options
---
retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.cpp b/retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.cpp
index ad5e06c5c..cfbcd3783 100644
--- a/retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.cpp
+++ b/retroshare-gui/src/gui/settings/GroupFrameSettingsWidget.cpp
@@ -1,5 +1,6 @@
#include
+#include "gui/notifyqt.h"
#include "GroupFrameSettingsWidget.h"
#include "ui_GroupFrameSettingsWidget.h"
@@ -55,5 +56,7 @@ void GroupFrameSettingsWidget::saveSettings()
groupFrameSettings.mHideTabBarWithOneTab = ui->hideTabBarWithOneTabCheckBox->isChecked();
Settings->setGroupFrameSettings(mType, groupFrameSettings);
+
+ NotifyQt::getInstance()->notifySettingsChanged();
}
}
From dc51911fcef0bac3d4460e3064a80abe9cea8b99 Mon Sep 17 00:00:00 2001
From: csoler
Date: Wed, 22 Feb 2017 23:55:29 +0100
Subject: [PATCH 78/90] added welcome message to show on first start in
HomePage
---
retroshare-gui/src/gui/HomePage.cpp | 13 +++
retroshare-gui/src/gui/HomePage.ui | 89 ++++++++++--------
.../src/gui/common/FloatingHelpBrowser.cpp | 2 +-
retroshare-gui/src/gui/images.qrc | 1 +
retroshare-gui/src/gui/images/network_map.png | Bin 0 -> 47207 bytes
5 files changed, 66 insertions(+), 39 deletions(-)
create mode 100644 retroshare-gui/src/gui/images/network_map.png
diff --git a/retroshare-gui/src/gui/HomePage.cpp b/retroshare-gui/src/gui/HomePage.cpp
index f8f6f0383..f8401cc57 100644
--- a/retroshare-gui/src/gui/HomePage.cpp
+++ b/retroshare-gui/src/gui/HomePage.cpp
@@ -72,6 +72,19 @@ HomePage::HomePage(QWidget *parent) :
ui->shareButton->setMenu(menu);
+ int S = QFontMetricsF(font()).height();
+ QString help_str = tr(
+ "
Welcome to Retroshare!
\
+ The first thing you have to do is to make friends. Once you create a network of Retroshare nodes, or join an existing network,\
+ you'll be able to exchange files, chat, talk in forums, etc.
\
+ \
+
\
+
\
+ To do so, use the current page to exchange certificates with other persons you want your Retroshare node to connect to.
\
+ Another option is to search the internet for \"Retroshare chat servers\" (independently administrated). These servers allow you to exchange \
+ certificates with a dedicated Retroshare node, through which\
+ you will be able to meet other people anonymously.
").arg(QString::number(2*S)).arg(width()*0.5);
+ registerHelpButton(ui->helpButton,help_str) ;
}
HomePage::~HomePage()
diff --git a/retroshare-gui/src/gui/HomePage.ui b/retroshare-gui/src/gui/HomePage.ui
index ec327d40f..6e4f872b7 100644
--- a/retroshare-gui/src/gui/HomePage.ui
+++ b/retroshare-gui/src/gui/HomePage.ui
@@ -14,43 +14,6 @@
Form
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
- :/images/logo/logo_splash.png
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
@@ -95,6 +58,20 @@
+ -
+
+
+ ...
+
+
+
+ :/icons/help_64.png:/icons/help_64.png
+
+
+ true
+
+
+
@@ -191,6 +168,24 @@
+ -
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+
+
-
@@ -208,12 +203,30 @@ private and secure decentralized commmunication platform.
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+ :/images/logo/logo_splash.png
+
+
+ Qt::AlignCenter
+
+
+
label
addFrame
label_2
addframe
- label_3
diff --git a/retroshare-gui/src/gui/common/FloatingHelpBrowser.cpp b/retroshare-gui/src/gui/common/FloatingHelpBrowser.cpp
index 01d4b9dde..35c0e144f 100644
--- a/retroshare-gui/src/gui/common/FloatingHelpBrowser.cpp
+++ b/retroshare-gui/src/gui/common/FloatingHelpBrowser.cpp
@@ -77,7 +77,7 @@ void FloatingHelpBrowser::showHelp(bool state)
return;
}
- resize(p->size() * 0.5);
+ resize(p->size() * 0.75);
move(p->width() / 2 - width() / 2, p->height() / 2 - height() / 2);
update();
diff --git a/retroshare-gui/src/gui/images.qrc b/retroshare-gui/src/gui/images.qrc
index a1347372f..d451caec1 100644
--- a/retroshare-gui/src/gui/images.qrc
+++ b/retroshare-gui/src/gui/images.qrc
@@ -1,5 +1,6 @@
+ images/network_map.png
images/global_switch_on.png
images/global_switch_off.png
images/switch00.png
diff --git a/retroshare-gui/src/gui/images/network_map.png b/retroshare-gui/src/gui/images/network_map.png
new file mode 100644
index 0000000000000000000000000000000000000000..b5350762eea14129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