Compare commits

..

364 commits

Author SHA1 Message Date
Thunder
383fd86e68
Merge pull request #3010 from defnax/workflow-fix
Some checks are pending
MINGW64 Qt5 Build / build (push) Waiting to run
UCRT64 Qt5 Build / build (push) Waiting to run
Removed jsonapi & webui config from workflow
2025-08-03 14:04:02 +02:00
thunder2
5554e35e21 Updated msys2 installation for Windows build 2025-08-03 13:46:39 +02:00
thunder2
a5076d34d8 Removed appveyor configuration 2025-08-03 13:45:45 +02:00
defnax
e26ed4c3c3 Removed jsonapi & webui config from workflow 2025-08-03 00:29:06 +02:00
csoler
14fab2f6c5 updated submodule libretroshare
Some checks are pending
MINGW64 Qt5 Build / build (push) Waiting to run
UCRT64 Qt5 Build / build (push) Waiting to run
2025-08-02 22:46:42 +02:00
csoler
d07e61d1ad
Merge pull request #3005 from defnax/workflow-qt5-v3
Added Qt5 workflow
2025-08-02 22:01:17 +02:00
csoler
ee89b41183
Merge pull request #2997 from defnax/new-readme
Created new readme
2025-08-02 19:10:05 +02:00
csoler
6266627141
Merge pull request #2988 from defnax/Windows-compile-qt
Added Install Guide for qtcreator native build
2025-08-02 19:08:27 +02:00
csoler
27243704c1
Merge pull request #2978 from defnax/fix-filetransferinfowidget
Fixed hardcoded pen color
2025-08-02 18:58:24 +02:00
csoler
584df9010d
Merge pull request #2968 from defnax/networkgrapgh-darkmode
Fix for Standard Dark
2025-08-02 18:54:02 +02:00
defnax
9ec24f826f Added Qt5 workflow 2025-07-30 21:55:38 +02:00
thunder2
07ee6581e1 MSYS2: Use date of last git commit instead of current date for packed filename 2025-07-29 18:31:22 +02:00
thunder2
e4672d9a57 Windows native build: Enabled parallel build of external libraries 2025-07-28 18:32:13 +02:00
thunder2
93b232d7ae Windows native build: Removed external library libmicrohttpd 2025-07-28 18:31:49 +02:00
Thunder
dd8845f77e
Merge pull request #2989 from JohannesKleine/retroshare-gui.pro
Remove qt4, make x11extras for qt5 only in retroshare-gui.pro
2025-07-23 16:43:37 +02:00
Thunder
16a30dcbe3
Merge pull request #2995 from thunder2/fix-language
Fixed set of default language in LanguageSupport::localize. Use value…
2025-07-22 20:27:10 +02:00
Thunder
cbc1a89505
Merge pull request #2991 from thunder2/qt6-sprintf
Replaced deprecated QString::sprintf by QString::asprintf
2025-07-22 20:26:48 +02:00
Thunder
256b188861
Merge pull request #2990 from thunder2/qt6-setMargins
Replaced deprecated QLayout::setMargins by QLayout::setContentsMargins
2025-07-22 20:26:16 +02:00
defnax
48ffc59522 Created new readme 2025-07-21 21:50:48 +02:00
thunder2
eb4f482a4e Fixed set of default language in LanguageSupport::localize. Use value of language map instead of key. 2025-07-21 18:20:12 +02:00
Christoph Johannes Kleine
e3202de4ef CHANGE: remove qt4, make x11extras for qt5 only 2025-07-21 11:24:53 +02:00
thunder2
5bdcf59b5c Replaced deprecated QString::sprintf by QString::asprintf 2025-07-20 18:28:04 +02:00
thunder2
90041fc627 Replaced deprecated QLayout::setMargins by QLayout::setContentsMargins 2025-07-20 14:19:47 +02:00
thunder2
33fc4308c4 Use Qt::MouseButton::NoButton instead of 0 in edge.cpp 2025-07-20 14:19:46 +02:00
thunder2
04b741e70d Fixed linking on Windows with enabled wikipoos 2025-07-20 14:19:45 +02:00
thunder2
42b3b95fd8 Use QDateTime::fromSecsSinceEpoch in Qt 6 instead of QDateTime::fromTime_t 2025-07-20 14:15:27 +02:00
thunder2
a00c1375e5 Renamed QtVersion.h to RsQtVersion.h because of the same filename in Qt 6 2025-07-20 14:14:57 +02:00
thunder2
b93a31a33b Removed deprecated QDesktopWidget for Qt 6 2025-07-20 14:14:38 +02:00
thunder2
3a8f7d5a2d Use "Qt::WindowFlags flags = Qt::WindowFlags()" instead of "Qt::WindowFlags flags = 0" 2025-07-20 14:14:13 +02:00
defnax
a2eb40740f Added Install Guide for qtcreator native build 2025-07-20 13:11:23 +02:00
thunder2
e2e1a431ff Added Qt dependent macro for QString::SkipEmptyParts/Qt::SkipEmptyParts 2025-07-19 23:28:30 +02:00
thunder2
f38b72e7a3 Changed parameter of method enterEvent on ClickableLabel and ZoomableLabel for Qt 6 to QEnterEvent 2025-07-19 21:11:28 +02:00
thunder2
b2bec12a43 Fixed usage of deprecated method "const QPixmap *QLabel::pixmap() const;" 2025-07-19 18:57:29 +02:00
thunder2
fcd7a213e6 Use UIStates() instead of 0 in GxsMessageFrameWidget.cpp 2025-07-19 16:26:07 +02:00
thunder2
29443c4b78 Use QTextDocument::FindFlags() to initialize flags instead of 0 in helpbrowser.cpp 2025-07-19 16:03:02 +02:00
thunder2
8265c5ebec Use Qt::KeyboardModifier::NoModifier instead of 0 in RsButtonOnText.cpp 2025-07-19 14:56:55 +02:00
thunder2
9f607765bc Fixed crash in VOIP by initializing member _image_capture in constructor of QVideoInputDevice 2025-07-19 14:54:51 +02:00
thunder2
eaf2861cd0 Fixed usage of QFileInfo in RsCollectionDialog.cpp 2025-07-19 14:24:52 +02:00
thunder2
23289c4991 Use Qt::MouseButton::NoButton instead of 0 in arrow.cpp 2025-07-19 14:20:31 +02:00
thunder2
23f925f81e Fixed constructor of RsAction 2025-07-19 13:44:54 +02:00
thunder2
c4d1de06d0 Fixed converting number to QString 2025-07-19 13:42:50 +02:00
thunder2
e5c42e63b7 Added missing includes 2025-07-19 13:36:49 +02:00
thunder2
f53a30a0e4 Updated external libraries for Windows native build
- curl-8.9.1
- ffmpeg-4.4.6
- libxml2-2.14.5
- libxslt-1.1.43
- speex-1.2.1
- speexdsp-1.2.1
- xapian-core-1.4.29
2025-07-18 14:25:17 +02:00
Christoph Johannes Kleine
f3150e9d42 HomePage.cpp enable saveCert 2025-07-16 17:59:09 +02:00
thunder2
c850a30c1a Build libretroshare on Windows as shared library 2025-07-16 17:25:57 +02:00
thunder2
6c1eb35a47 MSYS2: Added toolchain to filename of packed files and installer 2025-07-16 17:23:01 +02:00
thunder2
1aec263bb9 MSYS2: Removed parameter "clang" from build. Use "clang32" or "clang64" instead. 2025-07-16 17:23:01 +02:00
defnax
e78367f12f Fixed hardcoded pen color 2025-07-14 19:39:24 +02:00
thunder2
ddb4300a60 FeedReader: Updated translation 2025-07-14 00:04:31 +02:00
thunder2
c8cea52b39 FeedReader: Reworked proxy setting 2025-07-14 00:04:31 +02:00
thunder2
1094e3e651 FeedReader: Moved proxy setting to own widget 2025-07-14 00:04:31 +02:00
defnax
8c26fa879d Added asio depency 2025-07-12 23:44:00 +02:00
defnax
42bd651fb3 Update MSYS2 packages 2025-07-12 23:44:00 +02:00
thunder2
500ab2098b Added asio as external library for Windows native compile 2025-07-11 23:17:12 +02:00
Thunder
5bf59b4376
Merge pull request #2973 from JohannesKleine/Windows-msys2
Windows-msys2 build.bat add asio
2025-07-11 22:10:00 +02:00
Christoph Johannes Kleine
d165a84b67
Windows-msys2 build.bat add asio 2025-07-11 16:35:19 +02:00
csoler
ef25a9079d fixed using the right version of cmake > 3.5 2025-07-08 22:06:28 +02:00
csoler
c3640306bd fixed restbed to stick to commit 6001a322809b5005b8bcccdf593fdda6f0173691 2025-07-07 23:37:29 +02:00
csoler
bfa3e557a4
Merge pull request #2963 from defnax/update-homelogo
Fix to load the right logo without restart too
2025-07-07 22:00:19 +02:00
csoler
06c2fd3947
Merge pull request #2955 from defnax/stylefix2
Fixed frame to get styled on system theme (Win/MacOS)
2025-07-07 21:56:56 +02:00
defnax
557e24a5dc Fix for Standard Dark 2025-07-07 21:45:00 +02:00
defnax
63d3dd1c08
Added override 2025-07-05 13:24:25 +02:00
csoler
b556ff8fc7
Merge pull request #2959 from defnax/move-backgroundimage
Moved background image to light skin
2025-07-04 23:21:49 +02:00
defnax
ad82a94cc7 Fix to load the right logo without restart too 2025-07-03 18:46:24 +02:00
defnax
24a7c2ae39
Merge branch 'RetroShare:master' into stylefix2 2025-07-01 19:23:43 +02:00
defnax
829a1db710 Fix system dark style issues 2025-07-01 18:10:00 +02:00
csoler
432e6970c4
Merge pull request #2953 from defnax/HomeLogo
Added for Dark Style new home logo
2025-07-01 11:16:26 +02:00
csoler
dc6440a72e
Merge pull request #2954 from defnax/patch-4
Update MacOS_X_InstallGuide
2025-07-01 11:13:45 +02:00
defnax
adc4bf90b5 Fix light skin issues 2025-06-25 20:02:19 +02:00
defnax
c05f6f5e52 Moved background image to light skin
*Moved backgrund image from login & profile creation page to light skin
2025-06-22 22:41:35 +02:00
defnax
915bf59d2e Fixed frames to get styles on system style 2025-06-19 18:33:51 +02:00
defnax
1190e45e6b Fixed green color get more contrast on dark style 2025-06-17 21:45:14 +02:00
defnax
1d4e997df2 Fixed frame to get styled on system theme 2025-06-14 17:20:19 +02:00
defnax
e146706a97
Update macports 2025-06-14 16:21:32 +02:00
defnax
751cc660a6
Update MacOS_X_InstallGuide.md 2025-06-14 14:39:12 +02:00
defnax
97304269a2 Added for Dark Style new home logo 2025-06-08 17:32:30 +02:00
csoler
5361bed037 updated submodules to latest 2025-06-05 23:22:57 +02:00
csoler
553761fb7c updated submodules to latest 2025-06-05 23:15:24 +02:00
csoler
f5183bc4eb
Merge pull request #2950 from defnax/patch-2
Added deepwiki badge
2025-06-05 22:55:17 +02:00
csoler
b66061d15b
Merge pull request #2948 from JohannesKleine/desktop-file
Desktop file remove 'Application'
2025-06-05 22:48:33 +02:00
csoler
74c9b9493d
Merge pull request #2942 from JohannesKleine/issue_2895
fix typo Stared -> Starred
2025-06-05 22:46:46 +02:00
defnax
12959c60cb
Added deepwiki badge 2025-06-04 21:13:22 +02:00
Christoph Johannes Kleine
d0c4827335
change .desktop file in build_scripts 2025-05-31 18:32:58 +02:00
Christoph Johannes Kleine
a0646c1b66
Desktop file remove 'Application' 2025-05-31 18:28:47 +02:00
csoler
d6228f381d updated submodules to latest commit 2025-05-30 20:54:40 +02:00
Christoph Johannes Kleine
6fe7f7842b
fix typo Stared -> Starred 2025-05-28 12:48:09 +02:00
csoler
1654ed0bc6
Merge pull request #2938 from csoler/v0.6-FriendList
fixed wrong implementation of parentRow() causing loss of selected elem…
2025-05-12 21:46:09 +02:00
csoler
e5273fb887 fixed wrong implementation of parentRow causing loss of selected elements 2025-04-29 21:10:27 +02:00
csoler
da0732b5ad
Merge pull request #2919 from csoler/v0.6-IdentityDialog
Identity list model for IdDialog
2025-04-27 21:31:01 +02:00
csoler
3ec931716a
Merge pull request #2934 from defnax/revert-2910-moved-backgroundimage
Revert "Moved background image to standard light"
2025-04-20 10:57:18 +02:00
csoler
1720a94a80 added fontSizeHandler for Identity list 2025-04-17 20:49:30 +02:00
csoler
39b062fecf fixed compilation 2025-04-17 20:31:18 +02:00
csoler
0b79668f73 fixed merging with master 2025-04-16 22:12:44 +02:00
csoler
2f02f6cd2d fixed coloring for insecure identities 2025-04-16 22:10:58 +02:00
defnax
9810008fc1
Revert "Moved background image to standard light" 2025-04-16 20:29:39 +02:00
csoler
71eba47fe7 fixed voting not working on right panel of People 2025-04-16 13:36:01 +02:00
Thunder
1d1138d0cb
Merge pull request #2932 from defnax/Fix-searches
Fix size & age column
2025-04-13 13:50:38 +02:00
Thunder
015b33b33f
Merge pull request #2931 from thunder2/fontsizehandler
FeedReader: Added FontSizeHandler
2025-04-12 22:20:10 +02:00
defnax
0b3f4a69b9 Fix size & age column 2025-04-12 18:01:38 +02:00
thunder2
bd7dfe957f FeedReader: Added FontSizeHandler 2025-04-12 15:50:43 +02:00
csoler
2b13abe2a9 fixed sizes in idTreeWidget 2025-04-10 21:11:28 +02:00
thunder2
f2bf2f04cc Added missing include for std::function in FontSizeHandler.h 2025-04-10 10:24:35 +02:00
csoler
42bbf785ea
Merge pull request #2918 from defnax/fontssettings
Fonts settings for Tree & list Views & Composer Fonts
2025-04-09 21:19:44 +02:00
csoler
f26fc5ab14
Merge pull request #2910 from defnax/moved-backgroundimage
Moved background image to standard light
2025-04-09 21:01:18 +02:00
csoler
06c0be19e9
Merge pull request #2913 from defnax/fonts-fix-v3
Fixed fonts for macos
2025-04-09 20:59:49 +02:00
csoler
a596acbcec removed uninitialized memory read causing random crashes 2025-04-09 16:54:35 +02:00
csoler
f4364bcaa6 fixed missing clear button in IDDialog search 2025-04-03 20:48:01 +02:00
csoler
aa268c8745 made identity list searchable by whatever is displayed 2025-04-01 22:34:13 +02:00
defnax
e87566ef92 set default font size to 11 2025-04-01 21:26:54 +02:00
csoler
85f411463b fixed display of total number of identities 2025-04-01 20:39:44 +02:00
csoler
c9d5a9ba30 fixed preserving of selection and expanded items 2025-03-31 22:09:55 +02:00
csoler
59d6592855 fixed show in people tab 2025-03-31 21:29:43 +02:00
csoler
c8f71072b0 removed test line 2025-03-29 15:37:18 +01:00
defnax
18b14a033a
Merge pull request #223 from thunder2/pr/2918
Pr/2918
2025-03-29 09:34:41 +01:00
thunder2
973246624f Replaced font handling by FontSizeHandler and reenabled deactivated item delegates 2025-03-28 23:52:54 +01:00
thunder2
93154fddc4 Added new class FontSizeHandler to set font size from settings 2025-03-28 22:14:46 +01:00
thunder2
cab91819d6 Added set and get of font size on RshareSettings 2025-03-28 22:14:45 +01:00
csoler
417f80d752 added some debug info 2025-03-23 17:17:08 +01:00
csoler
8c2c3188ef fixed sizeHint role 2025-03-15 16:07:48 +01:00
csoler
92290015eb added [Loading...] string when loading info in the item model 2025-03-15 15:01:00 +01:00
csoler
e77b4271fc limiting calls to getIdDetails to the bare minimum 2025-03-09 15:34:19 +01:00
csoler
60750812d9 fixed a few bugs 2025-03-06 20:39:29 +01:00
csoler
6fde55217c added async update of ID list 2025-03-04 16:52:29 +01:00
csoler
7c5a45335a fixed load/save of visible columns 2025-03-01 21:26:29 +01:00
csoler
06d9ea2398 enabled processSettings 2025-03-01 20:57:32 +01:00
csoler
e369ba3504 added new column for owner name/ID 2025-03-01 20:38:05 +01:00
defnax
95ea588c9f Fixed Subject column fonts 2025-02-28 17:38:14 +01:00
defnax
2644a0ccb7 Added for search list update fontsize 2025-02-26 17:56:38 +01:00
csoler
756ded0b5d fixed sorting 2025-02-24 20:39:13 +01:00
csoler
0bda8eeb8d fixed save/restore of expanded items 2025-02-23 18:43:48 +01:00
csoler
ee27c52825 improved save/restore of selection/expanded items 2025-02-23 16:33:47 +01:00
csoler
a826a8651c added filtering 2025-02-23 14:50:48 +01:00
csoler
37c0f16a27 fixed update of visible items 2025-02-19 12:05:21 +01:00
defnax
c61c939b2a Fixed to get fonts work in forums tree 2025-02-18 19:56:11 +01:00
csoler
ed6debb3c6 added save/load selection (not working yet) 2025-02-17 23:15:53 +01:00
csoler
80b9006620 fixed drop menus for header and data 2025-02-16 17:58:08 +01:00
csoler
3153df1123 fixed display of icons 2025-02-15 19:55:30 +01:00
csoler
ac620d9077 fixed display of reputation 2025-02-14 22:01:11 +01:00
csoler
40d6c3c973 first working version of IdentityModel 2025-02-14 16:54:02 +01:00
defnax
cd338613c1 Attempt for forums tree fonts settings 2025-02-12 19:26:16 +01:00
defnax
49242e185b Fixed fonts update 2025-02-12 18:36:13 +01:00
defnax
5005c0303d Fixed to update the fonts for MainWindow ListWidget 2025-02-11 18:51:20 +01:00
csoler
435e8ce50c continued implementation of IdentityListModel 2025-02-10 21:18:31 +01:00
defnax
a5752ec4d3 Fixed alignment for the attachment counter 2025-02-10 20:03:43 +01:00
defnax
6d394c9f55 Added for channel composer default size settings 2025-02-10 19:41:19 +01:00
csoler
43d64bf0c5 added abstract item model for identity 2025-02-09 21:05:11 +01:00
defnax
3ffa362079 Added for Composer fonts settings 2025-02-09 18:05:36 +01:00
defnax
b168110a58 Added for settings list fonts settings 2025-02-08 15:44:39 +01:00
defnax
7399c42dfb Fix settings 2025-02-08 15:13:43 +01:00
defnax
533caea81e Added Fonts settings 2025-02-06 20:20:28 +01:00
defnax
18f4ef5574 Fix fonts 2025-02-06 19:02:40 +01:00
defnax
e14fc66ca3 Settings for default tree & listwidget fonts 2025-02-05 20:55:03 +01:00
defnax
b99988385f Added brew packages for RNP 2025-01-30 19:53:59 +01:00
defnax
85b6d18094 Fixed fonts to use default system 2025-01-23 22:22:26 +01:00
defnax
86d96fe60c Fixed fonts for macos
Fixed Toolbar fonts
Fixed forum composer fonts
2025-01-22 23:21:32 +01:00
csoler
8fcc52b304
Merge pull request #2904 from defnax/fix-macos-v2
Fixed some frames to use StyledPanel to get styles on system theme
2025-01-19 17:41:39 +01:00
csoler
5f3f1c9c43
Merge pull request #2905 from defnax/fonts-fix-v2
remove font sizes from the ui files
2025-01-19 17:40:20 +01:00
defnax
e835385000 restore back changes 2025-01-18 16:06:03 +01:00
csoler
e44a216873
Merge pull request #2903 from csoler/v0.6-FT-001
removed unencrypted FT
2025-01-12 14:14:21 +01:00
csoler
4b5dd51681
Merge pull request #2911 from csoler/v0.6-RNP-submodule
added non-backward compatible flag change for v0.7 about sha1 certs
2025-01-12 14:12:36 +01:00
csoler
e18bb74a5e added non-backward compatible flag change for v0.7 about sha1 certs 2025-01-10 22:47:46 +01:00
defnax
c9599ea817 Moved background image to standard light 2025-01-09 19:43:35 +01:00
csoler
b2d05d7d8e
Merge pull request #2907 from dbear496/a-few-fixes
a few small fixes
2025-01-06 20:32:20 +01:00
David Bears
2c53c02319
omit newline after single link 2025-01-04 13:48:00 -05:00
David Bears
99053597a9
allow voting on own identities 2025-01-03 15:03:31 -05:00
defnax
e5f2ef2335 remove font sizes from the ui files 2025-01-03 19:10:45 +01:00
David Bears
0759359e06
Fix JSON API token removal 2025-01-02 22:38:46 -05:00
David Bears
2ca36f5957
Fix port settings for manual I2P 2025-01-02 22:27:43 -05:00
defnax
89ceba2f92 Fixed some frames to use StyledPanel to get styles on system theme
* update mac os section
2025-01-02 23:36:43 +01:00
csoler
41bb83054c removed unencrypted FT 2025-01-01 20:17:49 +01:00
csoler
f9ca8934db
Merge pull request #2902 from defnax/ui-fix-v16
Fixed some frames to get compatible for system style
2024-12-30 22:19:38 +01:00
defnax
01617da863 Fixed some frames to get compatible for system style
* Fixed some frames to get compatible for system style
* update macos package script
2024-12-30 21:36:04 +01:00
csoler
8d96bb920d
Merge pull request #2900 from csoler/v0.6-BugFixing_40
fixed bug causing own identity to not disappear when deleted
2024-12-30 14:15:57 +01:00
thunder2
b502dd71e2 Windows build: Fixed makefile for external libraries 2024-12-28 14:01:45 +01:00
csoler
359305c24f
Merge pull request #2888 from defnax/People-improve
Improve People View
2024-12-27 20:11:51 +01:00
csoler
ca2f8c5bed
Merge pull request #2901 from thunder2/fix_missing_premods
Added missing calls to preMods in RsFriendListModel::setDisplayStatus…
2024-12-27 19:59:09 +01:00
thunder2
ccd1cfbde6 Added missing calls to preMods in RsFriendListModel::setDisplayStatusString and RsFriendListModel::setDisplayStatusIcon 2024-12-27 15:03:36 +01:00
thunder2
32a43b1892 Windows build: Updated cmake to 3.31.3 2024-12-27 14:43:26 +01:00
thunder2
6cde715e66 Windows build: Updated MSYS2 installer to 20241208 2024-12-27 14:35:23 +01:00
thunder2
6825c7e925 Updated librnp submodule 2024-12-27 14:35:10 +01:00
csoler
433ab6514d fixed bug causing own identity to not disappear when deleted 2024-12-26 21:14:49 +01:00
csoler
142049a61e updated master branch to latest commit in libretroshare submodule 2024-12-26 18:42:18 +01:00
csoler
8cc2cf8cd2
Merge pull request #2894 from csoler/v0.6-RNP-submodule
V0.6 rnp submodule
2024-12-26 16:15:56 +01:00
csoler
cbd9dfc86a
Merge pull request #35 from thunder2/rnp
Fixed Windows build with librnp
2024-12-25 16:17:55 +01:00
csoler
675b430833
Merge pull request #2887 from thunder2/fix_msgs
Use all mails for the calculation of counts in MessagesDialog::update…
2024-12-25 14:56:53 +01:00
csoler
b17cb811d6
Merge pull request #2891 from fkobi/patch-1
Improve desktop icon
2024-12-25 14:44:27 +01:00
csoler
d6d2f09673 updated submodule url to comply with RS standard 2024-12-19 22:25:27 +01:00
thunder2
d79ce90c68 Fixed Windows build with librnp 2024-12-19 00:32:26 +01:00
csoler
38e82adaea
Merge pull request #2893 from fkobi/patch-2
Mention "desktop" instead of "GNOME"
2024-12-08 17:24:05 +01:00
csoler
5d7b235941 added back key certification with RNP 2024-12-07 16:37:37 +01:00
fkobi
8e94a99a53
Mention "desktop" instead of "GNOME" 2024-11-30 15:14:41 +00:00
csoler
6a77d6b7bc fixed retroshare.pri 2024-11-26 22:19:02 +01:00
csoler
e6f1878f1f Merge remote-tracking branch 'upstream/master' into v0.6-RNP-submodule 2024-11-26 20:46:19 +01:00
fkobi
9a7c94314c
Improve desktop icon
- add missing categories
- sort according to 
  https://specifications.freedesktop.org/menu-spec/latest/additional-category-registry.html
2024-11-25 19:58:52 +00:00
csoler
5c9bf3bf7c added commands to make rnp a submodule 2024-11-20 22:20:28 +01:00
defnax
d8d2243b9e Improve People View 2024-11-16 16:48:30 +01:00
thunder2
00241d6252 Use all mails for the calculation of counts in MessagesDialog::updateMessageSummaryList, not just the current selected box 2024-11-16 15:48:32 +01:00
csoler
3248a06134 updated master branch to latest version of submodules 2024-11-16 15:02:48 +01:00
csoler
ae1bd27ad1
Merge pull request #2885 from defnax/People-improve
Improved People view
2024-11-02 14:40:30 +01:00
defnax
9fefbb3b13 Improved People view
* Improved People View
* Update translations
2024-11-01 16:00:28 +01:00
csoler
ed0105f44c switched rs_usernp into rs_useopenpgpsdk 2024-10-22 19:25:11 +02:00
csoler
126ce6607e changed flag name to remove it from v07 changes list 2024-10-09 21:31:42 +02:00
csoler
e20a4c4e60 changed retroshare.pri to add V07_NON_BACKWARD_COMPATIBLE_CHANGE_005 by default 2024-09-18 21:15:44 +02:00
csoler
e888e89437
Merge pull request #2879 from zapek/fix-image-jpeg-uri-mimetype
Fix image data URI
2024-09-02 09:41:52 +02:00
David Gerber
bb4b8f0bc5
Fix image data URI
Make JPEG images use the image/jpeg mimetype instead of the wrong image/png one.
2024-09-01 22:51:22 +02:00
csoler
a9c87225e2 disabled certificate signature when using librnp 2024-08-19 18:53:25 +02:00
csoler
37261761dd fixed compilation 2024-08-11 23:32:11 +02:00
csoler
3361727a37 added switch to compile with rnp or openpgp-sdk 2024-08-11 16:43:20 +02:00
csoler
d222cfe8e0 added compilation flag for RNP 2024-07-26 11:10:52 +02:00
csoler
64f4d84e74
Merge pull request #2862 from defnax/statusicons-settings
Added optional display status icon from friendslist context menu
2024-07-07 20:10:52 +02:00
defnax
b90e75e912
Merge pull request #215 from thunder2/pr/2862
Pr/2862
2024-07-03 15:38:35 +02:00
thunder2
d72e46cfda Update NewFriendList on avatar and status change 2024-07-03 14:58:03 +02:00
thunder2
874748e7da Use avatar for profile in RsFriendListModel of best node 2024-07-03 14:58:03 +02:00
defnax
b5b2e77a7e set default idle color which has better contrast 2024-07-02 23:52:31 +02:00
defnax
afc4096740
Merge pull request #214 from thunder2/pr/2862
Pr/2862
2024-07-02 08:29:37 +02:00
thunder2
2c3b0a1c44 Fixed show best status icon for profile 2024-07-01 23:26:43 +02:00
thunder2
c8975bb2e9 Optimized avatar loading in RsFriendListModel 2024-07-01 16:48:52 +02:00
defnax
19d613edcc fix naming 2024-06-25 19:09:03 +02:00
defnax
56b6b0cb5a Added optional display status icon from friendslist context menu 2024-06-24 23:36:45 +02:00
csoler
3461da7c3a
Merge pull request #2860 from defnax/fixstatuscolors
Fixed status colors
2024-06-19 21:02:40 +02:00
defnax
332939c3f5 Fixed status colors 2024-06-17 22:07:18 +02:00
csoler
2fb9b3eb46
Merge pull request #2858 from csoler/v0.6-Collection
fixed bug showing peers offline when status service is remotely disabled
2024-06-13 21:38:01 +02:00
csoler
794ec3576c using statusRole instead of onlineRole to decide on node string 2024-06-13 11:08:28 +02:00
csoler
1b4886715d fixed usage of statusRole in FriendListModel 2024-06-09 21:25:43 +02:00
csoler
7dfd6de15f fixed bug showing peers offline when status service is remotely disabled 2024-06-07 11:26:35 +02:00
thunder2
a60f3f44f7 FeedReader: Don't add items as new item when pubDate less than storage time 2024-04-16 19:25:26 +02:00
thunder2
83b433a2e2 Revert changes in libbitdht of "Merge pull request #2852 from thunder2/fix_rscollection" 2024-04-04 00:58:34 +02:00
csoler
55c414b400
Merge pull request #2852 from thunder2/fix_rscollection
Renamed RsCollectionErrorCode::NO_ERROR to COLLECTION_NO_ERROR b…
2024-04-04 00:48:28 +02:00
thunder2
5a24fad354 Renamed RsCollectionErrorCode::NO_ERROR to COLLECTION_NO_ERROR because of double define of NO_ERROR in winerror.h 2024-04-03 22:20:33 +02:00
csoler
16d6d4d597 updated master to all submodules 2024-04-02 17:55:11 +02:00
csoler
d92404d047
Merge pull request #2846 from csoler/v0.6-Collection
Attempt at making RsCollection faster to use (Needs #144)
2024-04-01 18:32:39 +02:00
csoler
0b75abaa04 minor fixes to rscollection PR 2024-04-01 18:25:49 +02:00
csoler
3f9d49921d fixed bug asking for overwriting a non existant file 2024-03-30 18:37:20 +01:00
csoler
0551f4f819 fixed compilation after removal of RsCollection::downloadFiles 2024-03-28 22:14:46 +01:00
csoler
8366cbca59 removed dead code, and added check for incorrect file names when saving 2024-03-28 21:26:09 +01:00
csoler
20f4b51bb7 fixed conflicts with upstream/master 2024-03-26 21:07:57 +01:00
csoler
a02d2e63e2 fixed updating save filename, removal of files/dirs, and cleaning before save 2024-03-20 21:00:42 +01:00
csoler
2ebd7617fc added proper remove for files/dirs 2024-03-19 23:22:46 +01:00
csoler
5aa80f2f68 updated master of Retroshare/ to master of libretroshare 2024-03-18 22:52:46 +01:00
csoler
c7fe3059a5
Merge pull request #2849 from defnax/exportfriendslistv2
Added export Friendslist to Profile Page
2024-03-16 20:37:46 +01:00
defnax
5f748b3131 renaming button text 2024-03-16 20:23:28 +01:00
defnax
21c2312952 Added export Friendslist to Profile Page 2024-03-15 20:10:20 +01:00
csoler
a36f7221e7 added new folder capability in collection 2024-03-14 22:44:49 +01:00
csoler
27f0962654 fixed download from RsCollection dialog 2024-03-14 22:12:57 +01:00
csoler
094c80e046 disable save button when files are being hashed 2024-03-13 22:28:39 +01:00
csoler
0697116289 added green color for files being hashed 2024-03-13 22:20:21 +01:00
csoler
7ef81a37ff added auto-update of files being hashed 2024-03-12 21:39:05 +01:00
csoler
5e3434396c fixed a few bugs in counting and model parenting 2024-03-11 13:37:09 +01:00
csoler
c1a6b8fe12 added some debug info in RsCollectionModel 2024-03-10 23:41:10 +01:00
csoler
9ba4ac6362 fixed a few bugs in file counting 2024-03-09 18:31:01 +01:00
csoler
67ff37a0d4 using vectors instead of maps for mCollectionModel data. 2024-03-09 00:03:16 +01:00
csoler
f375912bc5 added checkable items in RsCollectionModel 2024-03-07 22:15:12 +01:00
csoler
80a5705aea
Merge pull request #2844 from csoler/v0.6-Params2
Cleaned up command line parameter handling (to be used with #143)
2024-03-04 23:33:50 +01:00
csoler
c0d222dedf more cleaning in PR 2844 2024-03-04 23:32:50 +01:00
csoler
2a5698c9d3 removed dead code 2024-03-04 23:22:03 +01:00
csoler
be96f417b3 fixed update of tree when changed 2024-03-04 23:00:25 +01:00
csoler
398db7dfe8
Merge pull request #34 from defnax/fixmacos
Fix for macos
2024-03-04 09:34:27 +01:00
csoler
e106959fbd fixed creating new collection 2024-03-01 23:00:17 +01:00
csoler
31c390aa27 simplified usage of RsCollectionDialog in shared files (removed duplicate functionality) 2024-02-29 22:07:52 +01:00
csoler
2ed72a146b fixed basic functionality of RsCollectionModel 2024-02-28 21:56:38 +01:00
defnax
790c169c02 Fix for macos 2024-02-28 19:47:01 +01:00
csoler
885eb640dc starting fixing RsCollection with the new model 2024-02-27 22:10:49 +01:00
csoler
eae4fe86aa added RsCollectionModel to RsCollectionDialog (unfiished) 2024-02-26 22:10:32 +01:00
csoler
a163f716b0
Merge pull request #2841 from defnax/update-trans
update translation
2024-02-25 21:34:23 +01:00
csoler
f425f2fa23
Merge pull request #2842 from defnax/macos_linedit
(macOS)Fixed iconsize issue with fontmetrics on macos
2024-02-25 21:33:29 +01:00
csoler
b0b3d51571
Merge pull request #2845 from defnax/update-invite-icon
update invite icon
2024-02-25 21:32:49 +01:00
csoler
eb0ef1e39b implemented RsCollectionModel 2024-02-25 17:58:51 +01:00
csoler
97309f2f9f started implementing RsCollectionModel 2024-02-24 21:49:50 +01:00
csoler
5bc071b03c fixed compilation 2024-02-24 20:27:18 +01:00
csoler
5071656209 started adapting RsCollectionDialog to the new API of RsCollection 2024-02-24 17:44:13 +01:00
csoler
206da93d99 fixed a few compilation errors in RsCollection handling 2024-02-24 15:55:21 +01:00
csoler
258fe58547 switch RsCollection to using RsfileTree as a base structure instead of a QDomDocument (not compiling yet) 2024-02-23 21:10:13 +01:00
csoler
eccfc7ba71 fixed handling of incoming rscollection files 2024-02-16 13:28:55 +01:00
csoler
142a8e2503 fixed proper handling of language parameter at startup 2024-02-16 10:33:41 +01:00
defnax
91ed9ed894 update readme 2024-02-13 19:04:38 +01:00
defnax
f4f51e53eb update invite icon 2024-02-13 18:46:30 +01:00
csoler
9210e52aae fixed compilation in parameter handling 2024-02-13 16:24:32 +01:00
csoler
c5aface2cb additional step in rewriting commandline parameter handling 2024-02-11 22:16:50 +01:00
csoler
4f56c7dd2f use argstream::usage() in the help message box 2024-02-04 18:26:47 +01:00
defnax
8db6076ce1 update translation 2024-02-04 16:10:35 +01:00
defnax
ae24db1da0 Fixed iconsize issue with fontmetrics on macos 2024-02-03 23:26:25 +01:00
defnax
b7414c078a update translation 2024-02-03 22:37:04 +01:00
csoler
8564a22bef
Merge pull request #2831 from defnax/downloadupload-treefixes
Improved Sharedfiles treesize and font fix for macos
2024-02-02 13:04:22 +01:00
csoler
9437bce60a
Merge pull request #2836 from defnax/chatlobby.fix
Removed "chat rooms" string from tree item
2024-02-01 21:17:46 +01:00
csoler
ed13a2f47f
Merge pull request #2838 from defnax/update-trans
update translations
2024-02-01 20:32:57 +01:00
defnax
388120956d update translations 2024-01-30 23:15:23 +01:00
defnax
e4da288b25
removed "chat rooms" string from tree item 2024-01-29 21:53:09 +01:00
defnax
a523d654ef Improved Sharedfiles treesize and font fix for macos 2024-01-16 14:54:04 +01:00
csoler
dc5131567f
Merge pull request #2830 from defnax/downloadupload-treefixes
Improved downloads and uploads tree display
2024-01-15 21:56:24 +01:00
defnax
3063e74e59 Improved downloads and uploads tree display 2024-01-15 21:43:09 +01:00
csoler
d9f7e96c68 updated master branch to sync with submodules 2024-01-14 16:26:07 +01:00
csoler
0c03e93a47
Merge pull request #2810 from defnax/macos-guide
[macOS] Fixes and Guide updates
2024-01-03 18:02:50 +01:00
defnax
020e9e5927
Enabled delete CFBundleGetInfoString, to update Version string 2024-01-02 15:30:32 +01:00
defnax
d3513ffed0
Merge branch 'RetroShare:master' into macos-guide 2024-01-02 14:58:07 +01:00
defnax
15f2ea4e29 Added to fix from Dock Icon to Show/Hide for macOS platform 2024-01-02 12:58:11 +01:00
csoler
91dd22d8d3
Merge pull request #2819 from thunder2/fix-chatlobby-traymenu
Fixed memory leak when using tray menu of chat lobby and removed doub…
2024-01-01 18:54:22 +01:00
thunder2
f00e8ba18e Fixed memory leak when using tray menu of chat lobby and removed double connect of signals 2024-01-01 15:58:44 +01:00
csoler
73f1da20f0
Merge pull request #2812 from defnax/fix-cmake-macos
[macOS] fix cmake compile on macos to find include and libs path
2024-01-01 15:41:21 +01:00
csoler
24f13a4b88
Merge pull request #2814 from defnax/comments-tree
Added show author for comments tree
2024-01-01 15:40:22 +01:00
csoler
249ff6e8c5
Merge pull request #2816 from defnax/changed-tray-notifyicon-broadcastchat
changed broadcast chat notify icon
2024-01-01 15:38:42 +01:00
csoler
aac9425626
Merge pull request #2820 from defnax/macos-fix
{macOS} Fix for macos alternative chat room notify
2024-01-01 15:36:40 +01:00
defnax
4982e4b664
Fix for macos alternative chat room notify 2023-12-30 16:01:43 +01:00
csoler
267ffc99af
Merge pull request #2765 from PYRET1C/new_token_service
[WIP] Added the new token service in this file
2023-12-30 15:23:25 +01:00
defnax
75ef4dceb5 Added close window shortcut 2023-12-30 00:15:28 +01:00
defnax
79977a0c37 Fixed minimize on macOS with CTRL + M shortcut 2023-12-29 21:34:54 +01:00
defnax
3615ebf05e
Added retroshare-service compile with cmake to guide 2023-12-27 22:50:22 +01:00
csoler
0caf8e79db
Merge pull request #2817 from vladpirlog/fix/friendlistmodel-index-bug
Add row count check in the RsFriendListModel::index method
2023-12-27 20:01:48 +01:00
Vlad Pirlog
b5d40f7964
Add row count check in the RsFriendListModel::index method
Fix bug occurring after login where the app would crash unexpectedly.
Turns out there was an index out of bounds exception occurring in
the RsFriendListModel::index method.
2023-12-27 12:41:25 +02:00
defnax
17407f7ea3
removed not needed dependency libmicrohttp 2023-12-26 17:53:53 +01:00
defnax
5c9c7e8cf6
changed broadcast chat notify icon 2023-12-26 15:54:40 +01:00
defnax
d1393acfa6
Added show author for comments tree 2023-12-26 12:35:29 +01:00
defnax
c0f9f14455
Update GxsCommentTreeWidget.h 2023-12-26 12:30:56 +01:00
defnax
4af12b14e1
Set fusion style for macos 2023-12-24 22:01:03 +01:00
defnax
d395be256b
fix cmake compile on macos to find include and libs path 2023-12-24 18:56:43 +01:00
defnax
eb4a5a4e4d
Fix show messages on macos 2023-12-24 14:54:05 +01:00
defnax
1374d4520f
Merge branch 'RetroShare:master' into macos-guide 2023-12-24 14:51:58 +01:00
csoler
081782c97c
Merge pull request #2806 from defnax/macos-fixes
Added logo for retroshare-service on macOS
2023-12-23 18:02:43 +01:00
defnax
0ec569216b
Added cmake install to the guide 2023-12-23 09:23:53 +01:00
defnax
48510e3818
Added Feedreader include path for libxml2 2023-12-20 12:30:42 -08:00
defnax
50c6b4a8aa
Added needed feedreader depencies 2023-12-20 21:12:18 +01:00
defnax
419d3895be Added a dock menu for macOS 2023-12-19 18:58:16 +01:00
csoler
883d9f9b52
Merge pull request #2801 from csoler/v0.6-BugFixing_30
removed some debug output
2023-12-18 20:48:07 +01:00
defnax
6f982a20ba
Added logo for retroshare-service on macOS 2023-12-18 13:09:11 +01:00
defnax
6fb53d823e
Added icon for retroshare-service for the macOS platform #2802 2023-12-18 13:07:36 +01:00
PYRET1C
351855a5bd Merge branch 'new_token_service' of https://github.com/PYRET1C/RetroShare into new_token_service 2023-12-15 00:05:48 +05:30
PYRET1C
b9e7bb5457 added the new token service in more funcitons and resolved the crash on posting a pulse 2023-12-15 00:05:41 +05:30
Tushar Garg
74e0692f69
Merge branch 'RetroShare:master' into new_token_service 2023-12-15 00:03:01 +05:30
csoler
852ddb96d8
Merge pull request #2763 from defnax/wirecroppicture
[Wire] Fix to hide picture browse button on republish & like view
2023-12-11 22:05:12 +01:00
csoler
7decd2b7b0 removed some debug output 2023-12-11 21:51:17 +01:00
csoler
d27616f28b
Merge pull request #2797 from defnax/improve-macosdoc
Improved macos guide
2023-12-08 21:33:08 +01:00
defnax
e00e94e87f
fix for line 2023-12-05 12:46:06 +01:00
defnax
493f89643c
Update MacOS_X_InstallGuide.md 2023-12-05 11:49:19 +01:00
defnax
ec35e74400
fix last commit 2023-12-01 22:31:01 +01:00
defnax
6fffb322ae
Improved makeOSXPackage.sh file
* Added to ship sounds dir
* Added CFBundleVersion & CFBundleShortVersionString string
* Added to get Git head string for package naming
2023-12-01 22:26:44 +01:00
defnax
31552b1119
Update MacOS_X_InstallGuide.md 2023-11-29 15:32:16 +01:00
defnax
5ee6f6a2e8
Update XCode part 2023-11-29 12:36:23 +01:00
Gioacchino Mazzurco
463a25a048
Update OBS submodule 2023-11-28 22:47:59 +01:00
Gioacchino Mazzurco
67762c1eb0
More attempts at fixing GitlabCI
See https://forum.gitlab.com/t/docker-dind-stops-working-after-12-1-0-update/28664/11
2023-11-27 02:08:21 +01:00
Gioacchino Mazzurco
3f40837b1c
Fix GitlabCI and improve CMake support
Do not use mirrors which may be out of sync
2023-11-27 00:06:12 +01:00
Gioacchino Mazzurco
678357ab2a
Update libretroshare submodule 2023-11-26 22:53:35 +01:00
Gioacchino Mazzurco
ea943369a0
Update libretroshare submodule 2023-11-26 21:56:37 +01:00
csoler
a1fdce2e58
Merge pull request #2795 from thunder2/fix-git-describe
Changed automatic version numbering with "git describe" to split the …
2023-11-26 18:21:38 +01:00
defnax
331cc2e374
added new improved macos package file 2023-11-26 18:09:56 +01:00
defnax
9ae8c7a196
Improved masos compile guide 2023-11-26 18:07:06 +01:00
Gioacchino Mazzurco
c0e564517e
Add script to ease tag cleanup for every developers 2023-11-26 09:52:25 +01:00
Gioacchino Mazzurco
e0873687a2
Update submodules and gitignore 2023-11-26 09:30:52 +01:00
thunder2
441ba17b53 Changed automatic version numbering with "git describe" to split the third part into mini version (leading numbers) and extra version (string after the numbers) 2023-11-26 00:19:59 +01:00
csoler
951be8f9a1 updated to latest commits in submodules 2023-11-25 17:25:16 +01:00
Gioacchino Mazzurco
737eecad9e
retroshare-service CMake fix icons install path 2023-11-20 11:29:13 +01:00
csoler
95ad01c4db
Merge pull request #2790 from defnax/Ui-fixes
UI fixes
2023-11-19 17:25:25 +01:00
csoler
8d243b964f
Merge pull request #2787 from defnax/master-2
Fixed led labels
2023-11-19 17:21:44 +01:00
csoler
6c22125980
Merge pull request #2788 from csoler/v0.6-BugFixing_30
attempt to fix bug in closing GxsChannelComment feed item
2023-11-19 17:21:14 +01:00
csoler
45c701c8e8 removed debug output 2023-11-19 17:16:48 +01:00
csoler
929c04edd5 fixing channel comment feed item crash 2023-11-18 23:46:32 +01:00
defnax
69a84c94a2
Cosmetic layout fixes 2023-11-17 17:10:18 +01:00
csoler
6555cc5792 attempt to fix bug in closing GxsChannelComment feed item 2023-11-17 14:10:14 +01:00
defnax
902f278a19
Fixed led labels 2023-11-15 20:42:56 +01:00
Gioacchino Mazzurco
533e711d47
Merge branch 'master' of github.com:RetroShare/RetroShare 2023-11-15 09:37:47 +01:00
Gioacchino Mazzurco
98c27fcf6d
Update libretroshare submodule 2023-10-18 18:57:11 +02:00
Gioacchino Mazzurco
d84b981e9a
Update libsam3 submodule 2023-10-18 18:56:04 +02:00
PYRET1C
5433e85323 added the new token service in this file 2023-08-20 18:19:05 +05:30
defnax
1b8bee4262 Removed hardcorded stylesheet from PulseReplySeperator
* Fixed some dark style issues
2023-08-15 23:12:54 +02:00
defnax
3a07a268ca Added to store last used group filter 2023-08-15 21:57:42 +02:00
defnax
4a20e1b4d2 Fix to hide picture browse button on republish & like view
* Fix to hide picture browse button on republish & like view
2023-08-14 21:27:46 +02:00
345 changed files with 60606 additions and 70339 deletions

70
.github/workflows/ci-mingw64.yml vendored Normal file
View file

@ -0,0 +1,70 @@
name: MINGW64 Qt5 Build
on:
push:
paths-ignore:
- '**/*.md'
pull_request:
paths-ignore:
- '**/*.md'
concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
runs-on: windows-latest
permissions:
actions: write
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup MSYS2
uses: msys2/setup-msys2@40677d36a502eb2cf0fb808cc9dec31bf6152638 # v2.28.0
with:
msystem: MINGW64
update: true
install: >-
base-devel
git
wget
p7zip
gcc
perl
ruby
doxygen
cmake
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-miniupnpc
mingw-w64-x86_64-libxslt
mingw-w64-x86_64-xapian-core
mingw-w64-x86_64-sqlcipher
mingw-w64-x86_64-qt5-base
mingw-w64-x86_64-qt5-multimedia
mingw-w64-x86_64-ccmake
mingw-w64-x86_64-rapidjson
mingw-w64-x86_64-json-c
mingw-w64-x86_64-libbotan
mingw-w64-x86_64-asio
- name: Checkout submodules
run: |
env
git submodule update --init --remote libbitdht/ libretroshare/ retroshare-webui/
git submodule update --init supportlibs/librnp supportlibs/rapidjson supportlibs/restbed
- name: CI-Build
run: |
qmake . -r -spec win32-g++ "CONFIG+=release" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3"
mingw32-make -j3

70
.github/workflows/ci-ucrt64.yml vendored Normal file
View file

@ -0,0 +1,70 @@
name: UCRT64 Qt5 Build
on:
push:
paths-ignore:
- '**/*.md'
pull_request:
paths-ignore:
- '**/*.md'
concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
runs-on: windows-latest
permissions:
actions: write
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup MSYS2
uses: msys2/setup-msys2@40677d36a502eb2cf0fb808cc9dec31bf6152638 # v2.28.0
with:
msystem: UCRT64
update: true
install: >-
base-devel
git
wget
p7zip
gcc
perl
ruby
doxygen
cmake
mingw-w64-ucrt-x86_64-toolchain
mingw-w64-ucrt-x86_64-miniupnpc
mingw-w64-ucrt-x86_64-libxslt
mingw-w64-ucrt-x86_64-xapian-core
mingw-w64-ucrt-x86_64-sqlcipher
mingw-w64-ucrt-x86_64-qt5-base
mingw-w64-ucrt-x86_64-qt5-multimedia
mingw-w64-ucrt-x86_64-ccmake
mingw-w64-ucrt-x86_64-rapidjson
mingw-w64-ucrt-x86_64-json-c
mingw-w64-ucrt-x86_64-libbotan
mingw-w64-ucrt-x86_64-asio
- name: Checkout submodules
run: |
env
git submodule update --init --remote libbitdht/ libretroshare/ retroshare-webui/
git submodule update --init supportlibs/librnp supportlibs/rapidjson supportlibs/restbed
- name: CI-Build
run: |
qmake . -r -spec win32-g++ "CONFIG+=release" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3"
mingw32-make -j3

2
.gitignore vendored
View file

@ -21,7 +21,7 @@ Thumbs.db
!supportlibs/libsam3/Makefile
# QtCreator cruft
*CMakeLists.txt.user
*CMakeLists.txt.user*
# Build artifacts
/jsonapi-generator/src/jsonapi-generator

View file

@ -1,7 +1,7 @@
image: docker:stable
image: docker:latest
services:
- docker:stable-dind
- docker:dind
stages:
- build
@ -18,6 +18,7 @@ variables:
build-ubuntu-test-image:
stage: build
script:
- docker --version
- >
docker login "$CI_REGISTRY"
--username "$CI_REGISTRY_USER"
@ -35,6 +36,7 @@ build-ubuntu-test-image:
test-ubuntu:
stage: test
script:
- docker --version
- >
docker login "$CI_REGISTRY"
--username "$CI_REGISTRY_USER"

5
.gitmodules vendored
View file

@ -36,3 +36,8 @@
[submodule "retroshare-webui"]
path = retroshare-webui
url = https://github.com/RetroShare/RSNewWebUI.git
branch = master
[submodule "supportlibs/librnp"]
path = supportlibs/librnp
url = https://github.com/rnpgp/rnp.git
branch = main

View file

@ -1,67 +0,0 @@
// SPDX-FileCopyrightText: Retroshare Team <contact@retroshare.cc>
// SPDX-License-Identifier: CC-BY-SA-4.0
= RetroShare
RetroShare is a decentralized, private, secure, cross-platform, communication
toolkit.
RetroShare provides file sharing, chat, messages, forums, channels and more.
.Build Status
|===============================================================================
|GNU/Linux (via Gitlab CI) | image:https://gitlab.com/RetroShare/RetroShare/badges/master/pipeline.svg[link="https://gitlab.com/RetroShare/RetroShare/-/commits/master",title="pipeline status"]
|Windows (via AppVeyor) | image:https://ci.appveyor.com/api/projects/status/github/RetroShare/RetroShare?svg=true[link="https://ci.appveyor.com/project/RetroShare58622/retroshare"]
|macOS, (via Travis CI) | image:https://app.travis-ci.com/RetroShare/RetroShare.svg?branch=master[link="https://app.travis-ci.com/github/RetroShare/RetroShare"]
|libretroshare GNU/Linux, Android (via Gitlab CI) | image:https://gitlab.com/RetroShare/libretroshare/badges/master/pipeline.svg[link="https://gitlab.com/RetroShare/libretroshare/-/commits/master",title="pipeline status"]
|===============================================================================
== Get the source
Clone this repository, enter the directory and then get the submodules with the
following command
[source,bash]
--------
git submodule update --init --remote --force libbitdht/ libretroshare/ openpgpsdk/
--------
== Compilation
Short of comprehensive and updated documentation on how to build RetroShare
(for the many supported platforms it runs on), scripts and recipes are provided
in the aim of creating packages for the supported platforms (and more)
in the `build_scripts` directory of this repository.
Those packaging receipts together with the continuous integration files
`.travis.yml` and `appveyor.yml` are a good source of knowledge on how to
compile RetroShare on different platforms.
== Using RetroShare on a headless computer with web UI
WARNING: This section is outdated need to be adapted to the new web UI
The web UI needs to be enabled as a parameter option to the retroshare-service:
[source,bash]
--------
./retroshare-nogui --webinterface 9090 --docroot /usr/share/retroshare/webui/
--------
The web UI is only accessible on localhost:9090. It is advised to keep it that way so that your RS
cannot be controlled using an untrusted connection.
To access your web UI from a distance, just open a SSH tunnel to it:
[source,bash]
--------
distant_machine:~/ > ssh rs_host -L 9090:localhost:9090 -N
--------
"rs_host" is the machine running `retroshare-nogui`. Then on the distant machine, access your web UI on
http://localhost:9090
(This can also be done from the RetroShare GUI.)

46
README.md Normal file
View file

@ -0,0 +1,46 @@
## RetroShare
RetroShare is a decentralized, private, secure, cross-platform, communication
toolkit.
RetroShare provides file sharing, chat, messages, forums, channels, boards and more.
[![GitHub release](https://img.shields.io/github/release/retroshare/retroshare.svg?label=latest%20release)](https://github.com/retroshare/retroshare/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/retroshare/retroshare/total)](https://github.com/retroshare/retroshare/releases/latest)
[![GNU/Linux (via Gitlab CI)](https://gitlab.com/RetroShare/RetroShare/badges/master/pipeline.svg)](https://gitlab.com/RetroShare/RetroShare/-/commits/master)
[![libretroshare GNU/Linux, Android (via Gitlab CI)](https://gitlab.com/RetroShare/libretroshare/badges/master/pipeline.svg)](https://gitlab.com/RetroShare/libretroshare/-/commits/master)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/RetroShare/RetroShare)
## Get the source
Clone this repository, enter the directory and then get the submodules with the
following command
git submodule update --init --remote --force libbitdht/ libretroshare/ openpgpsdk/
## Compilation
Short of comprehensive and updated documentation on how to build RetroShare
(for the many supported platforms it runs on), scripts and recipes are provided
in the aim of creating packages for the supported platforms (and more)
in the [build_scripts](https://github.com/RetroShare/RetroShare/tree/master/build_scripts) directory of this repository.
## Compilation on Windows
Follow this file : [WindowsMSys2_InstallGuide.md](https://github.com/RetroShare/RetroShare/blob/master/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md)
## Compilation on MacOSX
Follow this file : [MacOS_X_InstallGuide](https://github.com/RetroShare/RetroShare/blob/master/build_scripts/OSX/MacOS_X_InstallGuide.md)
## Releases
Latest release [here](https://github.com/RetroShare/RetroShare/releases)
Other Builds [RetroShare Downloads](https://retroshare.cc/downloads.html)
## Documentation
- [RetroShare Docs](https://retrosharedocs.readthedocs.io/en/latest/)

View file

@ -25,9 +25,6 @@ CONFIG += c++14
TEMPLATE = subdirs
SUBDIRS += openpgpsdk
openpgpsdk.file = openpgpsdk/src/openpgpsdk.pro
rs_jsonapi:isEmpty(JSONAPI_GENERATOR_EXE) {
SUBDIRS += jsonapi-generator
jsonapi-generator.file = jsonapi-generator/src/jsonapi-generator.pro
@ -36,7 +33,7 @@ rs_jsonapi:isEmpty(JSONAPI_GENERATOR_EXE) {
SUBDIRS += libbitdht
libbitdht.file = libbitdht/src/libbitdht.pro
libretroshare.depends += openpgpsdk libbitdht
libretroshare.depends += libbitdht
SUBDIRS += libretroshare
libretroshare.file = libretroshare/src/libretroshare.pro

View file

@ -1,312 +0,0 @@
# SPDX-FileCopyrightText: (C) 2004-2019 Retroshare Team <contact@retroshare.cc>
# SPDX-License-Identifier: CC0-1.0
# Notes:
# - Minimal appveyor.yml file is an empty file. All sections are optional.
# - Indent each level of configuration with 2 spaces. Do not use tabs!
# - All section names are case-sensitive.
# - Section names should be unique on each level.
# from example:
# https://github.com/Phonations/Joker/blob/master/appveyor.yml
# https://github.com/unicorn-engine/autobuild/blob/master/.appveyor.yml
#---------------------------------#
# general configuration #
#---------------------------------#
# version format
version: RetroShare-git-{branch}-{build}
image: Visual Studio 2019
# you can use {branch} name in version format too
# version: 1.0.{build}-{branch}
# branches to build
branches:
# whitelist
#only:
# - master
# blacklist
except:
- /^skipthisbranch$/
# Do not build on tags (GitHub only)
skip_tags: true
# Skipping commits with particular message or from user
skip_commits:
message: /Created.*\.(png|jpg|jpeg|bmp|gif)/ # Regex for matching commit message
#author: Anonymous # Commit author's username, name, email or regexp maching one of these.
#---------------------------------#
# environment configuration #
#---------------------------------#
# Operating system (build VM template)
#os: Windows Server 2012
# scripts that are called at very beginning, before repo cloning
init:
- git config --global core.autocrlf input
#To get RDP while compiling
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
on_finish:
#To get RDP running after compiling
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# clone directory
clone_folder: C:\projects\RetroShare
# fetch repository as zip archive
#shallow_clone: true # default is "false"
# set clone depth
clone_depth: 2000 # clone entire repository history if not defined
environment:
global:
## Qt: https://www.appveyor.com/docs/installed-software#qt
# QTDIR: C:\Qt\5.10.1\mingw53_32
MSYS2_ARCH: i686
TARGET: i686_32-pc-msys
MINGW_PREFIX: C:\msys64\mingw32
RS_DEPLOY: RetroShare_deploy
# build cache to preserve files/folders between builds
#cache:
# Disabled because it's bigger then supported by appveyor free plan
# - C:\msys64\var\cache\pacman\pkg
# scripts that run after cloning repository
#install:
# # by default, all script lines are interpreted as batch
# - echo This is batch
# # to run script as a PowerShell command prepend it with ps:
# - ps: Write-Host 'This is PowerShell'
# # batch commands start from cmd:
# - cmd: echo This is batch again
# - cmd: set MY_VAR=12345
install:
# We cannot get OBS submodule as it use illegal folder name for windows.
#- git submodule update --init
# Configuring MSys2
- set PATH=C:\msys64\usr\bin;%PATH%
- set PATH=C:\msys64\mingw32\bin;%PATH%
- >
pacman --noconfirm -Sy
mingw-w64-i686-qt5 mingw-w64-i686-miniupnpc mingw-w64-i686-rapidjson
mingw-w64-i686-sqlcipher mingw-w64-i686-xapian-core mingw-w64-i686-cmark
#- set PATH=C:\msys64\mingw32\qt5-static\bin\;%PATH%
# Configuring Qt
# - set PATH=%QTDIR%\bin;C:\Qt\Tools\mingw491_32\bin;%PATH%
# Hack for new MSys2
- copy C:\msys64\mingw32\i686-w64-mingw32\bin\ar.exe C:\msys64\mingw32\bin\i686-w64-mingw32-ar.exe
- copy C:\msys64\mingw32\i686-w64-mingw32\bin\ranlib.exe C:\msys64\mingw32\bin\i686-w64-mingw32-ranlib.exe
- copy C:\msys64\mingw32\bin\windres.exe C:\msys64\mingw32\bin\i686-w64-mingw32-windres.exe
- copy C:\msys64\mingw64\x86_64-w64-mingw32\bin\ar.exe C:\msys64\mingw64\bin\x86_64-w64-mingw32-ar.exe
- copy C:\msys64\mingw64\x86_64-w64-mingw32\bin\ranlib.exe C:\msys64\mingw64\bin\x86_64-w64-mingw32-ranlib.exe
- copy C:\msys64\mingw64\bin\windres.exe C:\msys64\mingw64\bin\x86_64-w64-mingw32-windres.exe
# Work-around linker looking for Qt dll in wrong place
- copy C:\msys64\mingw32\bin\Qt5PrintSupport.dll C:\msys64\mingw32\lib\Qt5PrintSupport.dll
- copy C:\msys64\mingw32\bin\Qt5Widgets.dll C:\msys64\mingw32\lib\Qt5Widgets.dll
- copy C:\msys64\mingw32\bin\Qt5Multimedia.dll C:\msys64\mingw32\lib\Qt5Multimedia.dll
- copy C:\msys64\mingw32\bin\Qt5Gui.dll C:\msys64\mingw32\lib\Qt5Gui.dll
- copy C:\msys64\mingw32\bin\Qt5Network.dll C:\msys64\mingw32\lib\Qt5Network.dll
- copy C:\msys64\mingw32\bin\Qt5Xml.dll C:\msys64\mingw32\lib\Qt5Xml.dll
- copy C:\msys64\mingw32\bin\Qt5Core.dll C:\msys64\mingw32\lib\Qt5Core.dll
#---------------------------------#
# build configuration #
#---------------------------------#
# build platform, i.e. x86, x64, Any CPU. This setting is optional.
platform: x86
# to add several platforms to build matrix:
#platform:
# - x86
# - Any CPU
# build Configuration, i.e. Debug, Release, etc.
configuration: Release
# to add several configurations to build matrix:
#configuration:
# - Debug
# - Release
# scripts to run before build
before_build:
- cd C:\projects\RetroShare
- git submodule update --init
- cd C:\projects\
- mkdir RetroShare-build
- cd RetroShare-build
# - find C:\ > filelist.txt
# scripts to run *after* solution is built and *before* automatic packaging occurs (web apps, NuGet packages, Azure Cloud Services)
before_package:
# to run your custom scripts instead of automatic MSBuild
build_script:
- env
- qmake ../RetroShare -spec win32-g++ "CONFIG+=debug"
- mingw32-make -j3
# scripts to run after build
after_build:
- find .
- mkdir %RS_DEPLOY%
- copy retroshare-gui\src\debug\retroshare.exe %RS_DEPLOY%\
- copy retroshare-service\src\debug\retroshare-service.exe %RS_DEPLOY%\
# - copy retroshare-service\src\retroshare-service.exe %RS_DEPLOY%\
# - copy retroshare-gui\src\retroshare.exe %RS_DEPLOY%\
## In Debug build winedeplyqt forget the non debug Qt libs
- copy C:\msys64\mingw32\bin\Qt5Svg.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\Qt5Core.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\Qt5Multimedia.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\Qt5Widgets.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\Qt5Xml.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\Qt5PrintSupport.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\Qt5Gui.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\Qt5Network.dll %RS_DEPLOY%\
- mkdir %RS_DEPLOY%\playlistformats\
- copy C:\msys64\mingw32\share\qt5\plugins\playlistformats\qtmultimedia_m3u.dll %RS_DEPLOY%\playlistformats
- mkdir %RS_DEPLOY%\printsupport\
- copy C:\msys64\mingw32\share\qt5\plugins\printsupport\windowsprintersupport.dll %RS_DEPLOY%\printsupport\
- mkdir %RS_DEPLOY%\iconengines\
- copy C:\msys64\mingw32\share\qt5\plugins\iconengines\qsvgicon.dll %RS_DEPLOY%\iconengines\
- mkdir %RS_DEPLOY%\bearer\
- copy C:\msys64\mingw32\share\qt5\plugins\bearer\qgenericbearer.dll %RS_DEPLOY%\bearer\
- mkdir %RS_DEPLOY%\mediaservice\
- copy C:\msys64\mingw32\share\qt5\plugins\mediaservice\qtmedia_audioengine.dll %RS_DEPLOY%\mediaservice\
- copy C:\msys64\mingw32\share\qt5\plugins\mediaservice\dsengine.dll %RS_DEPLOY%\mediaservice\
- mkdir %RS_DEPLOY%\styles\
- copy C:\msys64\mingw32\share\qt5\plugins\styles\qwindowsvistastyle.dll %RS_DEPLOY%\styles\
- mkdir %RS_DEPLOY%\imageformats\
- copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qwebp.dll %RS_DEPLOY%\imageformats\
- copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qicns.dll %RS_DEPLOY%\imageformats\
- copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qjpeg.dll %RS_DEPLOY%\imageformats\
- copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qtiff.dll %RS_DEPLOY%\imageformats\
- copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qtga.dll %RS_DEPLOY%\imageformats\
- copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qjp2.dll %RS_DEPLOY%\imageformats\
- copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qico.dll %RS_DEPLOY%\imageformats\
- copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qwbmp.dll %RS_DEPLOY%\imageformats\
- copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qicns.dll %RS_DEPLOY%\imageformats\
- copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qgif.dll %RS_DEPLOY%\imageformats\
- copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qsvg.dll %RS_DEPLOY%\imageformats\
- mkdir %RS_DEPLOY%\platforms\
- copy C:\msys64\mingw32\share\qt5\plugins\platforms\qwindows.dll %RS_DEPLOY%\platforms\
- mkdir %RS_DEPLOY%\audio\
- copy C:\msys64\mingw32\share\qt5\plugins\audio\qtaudio_windows.dll %RS_DEPLOY%\audio\
- windeployqt %RS_DEPLOY%\retroshare.exe
- copy C:\msys64\mingw32\bin\libbz2*.dll %RS_DEPLOY%\
#- copy C:\msys64\mingw32\bin\libeay32.dll %RS_DEPLOY%\
- copy C:\OpenSSL-Win32\libeay32.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libminiupnpc.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libsqlcipher*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libsqlite3*.dll %RS_DEPLOY%\
#- copy C:\msys64\mingw32\bin\ssleay32.dll %RS_DEPLOY%\
- copy C:\OpenSSL-Win32\ssleay32.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\zlib*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libgcc_s_dw2*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libstdc*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libwinpthread*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libicu*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libpcre*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libharfbuzz*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libpng*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libfreetype*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libglib*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libgraphite2.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libintl*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libiconv*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libjasper*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libjpeg*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libtiff*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libwebp*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libwebpdemux*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\liblzma*.dll %RS_DEPLOY%\
## Needed for cmark
- copy C:\msys64\mingw32\bin\libcmark*.dll %RS_DEPLOY%\
- copy C:\msys64\mingw32\bin\libdouble-conversion*.dll %RS_DEPLOY%\
# to disable automatic builds
#build: off
#---------------------------------#
# artifacts configuration #
#---------------------------------#
artifacts:
- path: '**\*.exe'
- path: filelist.txt
- path: $(RS_DEPLOY)
#
# # pushing a single file
# - path: test.zip
#
# # pushing a single file with environment variable in path and "Deployment name" specified
# - path: MyProject\bin\$(configuration)
# name: myapp
#
# # pushing entire folder as a zip archive
# - path: logs
#---------------------------------#
# deployment configuration #
#---------------------------------#
#No deployment under unknown computer!!!
#---------------------------------#
# global handlers #
#---------------------------------#
# on successful build
#on_success:
# - do something
# on build failure
#on_failure:
# - do something
# after build failure or success
#on_finish:
# - do something
#---------------------------------#
# notifications #
#---------------------------------#
notifications:
# Email
- provider: Email
to:
- retrosharephenom@gmail.com
subject: 'Build {{status}}' # optional
message: "{{message}}, {{commitId}}, ..." # optional
on_build_status_changed: true

View file

@ -40,18 +40,23 @@ RUN git clone --depth 1 https://github.com/aetilius/pHash.git && \
rm -rf pHash-build pHash
ARG FRESHCLONE=0
ARG REPO_URL=https://gitlab.com/RetroShare/RetroShare.git
ARG REPO_URL=https://github.com/RetroShare/RetroShare.git
ARG REPO_BRANCH=master
ARG REPO_DEPTH="--depth 2000"
RUN git clone $REPO_DEPTH $REPO_URL -b $REPO_BRANCH && cd RetroShare && \
RUN git clone $REPO_DEPTH $REPO_URL -b $REPO_BRANCH && \
cd RetroShare && \
git fetch --tags && \
git submodule update --init --remote --force \
libbitdht/ libretroshare/ openpgpsdk/ && \
cd ..
git submodule update --init \
libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ \
supportlibs/restbed/ && \
cd supportlibs/restbed/ && \
git submodule update --init \
dependency/asio/ dependency/kashmir/ && \
cd ../../../
RUN \
mkdir RetroShare-build && cd RetroShare-build && \
cmake -B. -S../RetroShare/retroshare-service \
-DRS_FORUM_DEEP_INDEX=ON -DRS_JSON_API=ON && \
-DRS_FORUM_DEEP_INDEX=ON -DRS_JSON_API=ON -DRS_WEBUI=ON && \
make -j$(nproc) && make install && \
cd .. && rm -rf RetroShare-build

View file

@ -2,19 +2,19 @@ FROM registry.gitlab.com/retroshare/retroshare:base
RUN apt-get update -y && apt-get upgrade -y
ARG REPO_URL=https://gitlab.com/RetroShare/RetroShare.git
ARG REPO_URL=https://github.com/RetroShare/RetroShare.git
ARG REPO_BRANCH=master
RUN \
cd RetroShare && git remote add testing $REPO_URL && \
git fetch --tags testing $REPO_BRANCH && \
git reset --hard testing/$REPO_BRANCH && \
git submodule update --init --remote --force \
libbitdht/ libretroshare/ openpgpsdk/ && \
git submodule update --init \
libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ && \
git --no-pager log --max-count 1
RUN \
mkdir RetroShare-build && cd RetroShare-build && \
cmake -B. -S../RetroShare/retroshare-service \
-DRS_FORUM_DEEP_INDEX=ON -DRS_JSON_API=ON \
-DRS_FORUM_DEEP_INDEX=ON -DRS_JSON_API=ON -DRS_WEBUI=ON \
-DRS_WARN_DEPRECATED=OFF -DRS_WARN_LESS=ON && \
make -j$(nproc) && make install && \
cd .. && rm -rf RetroShare-build

@ -1 +1 @@
Subproject commit 353596b0ee5ea76611eb663b90bf3ab1c9f34ad7
Subproject commit 0a3997cc1355b2c848161dca015b7e2df039707b

View file

@ -2,13 +2,15 @@
## Qt Installation
Install Qt via: [Qt Download](http://www.qt.io/download/)
Qt 5.15 is not available as install package.
Use default options. And add Qt Script support.
Download Qt 5.15.x from here: [Qt 5.15.17](https://download.qt.io/archive/qt/5.15/5.15.17/single/qt-everywhere-opensource-src-5.15.17.tar.xz)
Instruction howto Build Qt 5.15.x on macOS: [macOS Building](https://doc.qt.io/archives/qt-5.15/macos-building.html)
## Set the Environment Variables
Add to the PATH environment variable by editing your *~/.profile* file.
export PATH="/users/$USER/Qt/5.14.1/clang_64/bin:$PATH"
export PATH="/users/$USER/Qt/5.15.17/clang_64/bin:$PATH"
Depends on which version of Qt you use.
@ -30,32 +32,20 @@ In GitHub Desktop -> Clone Repository -> URL
Add Repository URL: https://github.com/RetroShare/RetroShare.git and Clone
## ***Choose if you use MacPort or HomeBrew***
## ***Get XCode & MacOSX SDK***
### MacPort Installation
To identify the correct version of Xcode to install, you need to know which OS you are running. Go to the [x] menu -> "About This Mac" and read the macOS version number.
Install MacPort and XCode following this guide: [MacPort and XCode](http://guide.macports.org/#installing.xcode)
If you are running macOS Ventura 13.5 or later, you can install Xcode directly from App Store using the instructions below.
Start XCode to get it updated and to able C compiler to create executables.
You can find older versions of Xcode at [Apple Developer Downloads](https://developer.apple.com/downloads/). Find the appropriate .xip file for your macOS version
#### Install libraries
To install from App Store:
$ sudo port -v selfupdate
$ sudo port install openssl
$ sudo port install miniupnpc
$ sudo port install libmicrohttpd
Select [x] menu - > "App Store…".
Search for Xcode. Download and install.
For VOIP Plugin:
$ sudo port install speex-devel
$ sudo port install opencv
$ sudo port install ffmpeg
Get Your OSX SDK if missing: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs)
### HOMEBREW Installation
Install HomeBrew following this guide: [HomeBrew](http://brew.sh/)
Once Xcode has installed, you must drag the XCode icon into your Applications folder. After you have done this, open Xcode from the Applications folder by double-clicking on the icon and then follow the remaining instructions below.
Install XCode command line developer tools:
@ -63,14 +53,34 @@ Install XCode command line developer tools:
Start XCode to get it updated and to able C compiler to create executables.
Older MacOSX SDK is available from here: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs)
### MacPort Installation
Install MacPort following this guide: [MacPort](http://guide.macports.org/#installing.xcode)
### HOMEBREW Installation
Install HomeBrew following this guide: [HomeBrew](http://brew.sh/)
#### Install libraries
$ brew install openssl
$ brew install miniupnpc
$ brew install libmicrohttpd
$ brew install rapidjson
$ brew install sqlcipher
For RNP lib:
$ brew install bzip2
$ brew install zlib
$ brew install json-c
$ brew install botan@2
#### Install CMake
$ brew install cmake
If you have error in linking, run this:
$sudo chown -R $(whoami) /usr/local/lib/pkgconfig
@ -85,8 +95,7 @@ For VOIP Plugin:
For FeedReader Plugin:
$ brew install libxslt
Get Your OSX SDK if missing: [MacOSX-SDKs](https://github.com/phracker/MacOSX-SDKs)
$ brew install libxml2
## Last Settings
@ -104,11 +113,8 @@ In QtCreator Projects -> Build -> Build Settings -> Build Steps -> Add Additiona
## Set your Mac OS SDK version
Edit RetroShare.pro
CONFIG += c++14 rs_macos11.1
and then retroshare.pri
Edit retroshare.pri and set your installed sdk version example for 11.1 -> rs_macos11.1 (line 135:)
macx:CONFIG *= rs_macos11.1
rs_macos10.8:CONFIG -= rs_macos11.1
@ -122,7 +128,7 @@ and then retroshare.pri
## Link Include & Libraries
Edit your retroshare.pri and add to macx-* section
When required edit your retroshare.pri macx-* section, check if the Include and Lib path are correct (macx-* section)
INCLUDEPATH += "/usr/local/opt/openssl/include"
QMAKE_LIBDIR += "/usr/local/opt/openssl/lib"
@ -131,13 +137,21 @@ Edit your retroshare.pri and add to macx-* section
alternative via Terminal
$ qmake INCLUDEPATH+="/usr/local/opt/openssl/include" QMAKE_LIBDIR+="/usr/local/opt/openssl/lib" QMAKE_LIBDIR+="/usr/local/opt/sqlcipher/lib" QMAKE_LIBDIR+="/usr/local/opt/miniupnpc/lib"
$ qmake
INCLUDEPATH+="/usr/local/opt/openssl/include" \
QMAKE_LIBDIR+="/usr/local/opt/openssl/lib" \
QMAKE_LIBDIR+="/usr/local/opt/sqlcipher/lib" \
QMAKE_LIBDIR+="/usr/local/opt/miniupnpc/lib" \
CONFIG+=rs_autologin \
CONFIG+=rs_use_native_dialogs \
CONFIG+=release \
..
For FeedReader Plugin:
INCLUDEPATH += "/usr/local/opt/libxml2/include/libxml2"
For building RetroShare with plugins:
With plugins:
$ qmake \
INCLUDEPATH+="/usr/local/opt/openssl/include" QMAKE_LIBDIR+="/usr/local/opt/openssl/lib" \
@ -159,13 +173,30 @@ For building RetroShare with plugins:
You can now compile RetroShare into Qt Creator or with Terminal
cd retroshare
qmake; make
$ cd /path/to/retroshare
$ qmake ..
$ make
You can change Target and SDK in *./retroshare.pri:82* changing value of QMAKE_MACOSX_DEPLOYMENT_TARGET and QMAKE_MAC_SDK
You can find the compiled application at *./retroshare/retroshare-gui/src/retroshare.app*
## Issues
If you have issues with openssl (Undefined symbols for architecture x86_64) try to add to *~/.profile* file this or via Terminal
export PATH="/usr/local/opt/openssl/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
For Qt Creator -> QtCreator Projects -> Build -> Build Settings -> Build Steps -> Add Additional arguments:
LDFLAGS="-L/usr/local/opt/openssl/lib"
CPPFLAGS="-I/usr/local/opt/openssl/include"
## Copy Plugins
$ cp \
@ -173,3 +204,13 @@ You can find the compiled application at *./retroshare/retroshare-gui/src/retros
./plugins/VOIP/lib/libVOIP.dylib \
./plugins/RetroChess/lib/libRetroChess.dylib \
./retroshare-gui/src/RetroShare.app/Contents/Resources/
### Compile Retroshare-Service & Webui with CMake
before you can compile overwrite the file "asio/include/asio/detail/config.hpp" here is a fix for macos [
asio fix](https://github.com/chriskohlhoff/asio/commit/68df16d560c68944809bb2947360fe8035e9ae0a)
$ cd retroshare-service
$ mkdir build-dir
$ cd build-dir
$ cmake -DRS_WEBUI=ON -DCMAKE_BUILD_TYPE=Release ..
$ make

View file

@ -0,0 +1,51 @@
#!/bin/sh
APP="RetroShare"
RSVERSION="0.6.7a"
QTVERSION="Qt-5.15.11"
# Install the 7z to create dmg archives.
#brew list p7zip || brew install p7zip
# Package your app
echo "Packaging retroshare..."
#cd ${project_dir}/build/macOS/clang/x86_64/release/
cd retroshare-gui/src/
# Remove build directories that you don't want to deploy
rm -rf moc
rm -rf obj
rm -rf qrc
# This sets the CFBundleVersion & CFBundleShortVersionString string
/usr/libexec/PlistBuddy -c "Delete :CFBundleGetInfoString" retroshare.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Add :CFBundleVersion string $RSVERSION" retroshare.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Add :CFBundleShortVersionString string $RSVERSION" retroshare.app/Contents/Info.plist
/usr/libexec/PlistBuddy -c "Delete :NSRequiresAquaSystemAppearance" retroshare.app/Contents/Info.plist
# This automatically creates retroshare.dmg
echo "Creating dmg archive..."
macdeployqt retroshare.app -dmg
DATE=`date +"%m-%d-%Y"`
MACVERSION=`sw_vers -productVersion`
#RSVERSION=`git describe --abbrev=0 --tags`
GITHEAD=`git rev-parse --short HEAD`
mv $APP.dmg "$APP-$RSVERSION-$GITHEAD-$DATE-MacOS-$MACVERSION-$QTVERSION.dmg"
# You can use the appdmg command line app to create your dmg file if
# you want to use a custom background and icon arrangement. I'm still
# working on this for my apps, myself. If you want to do this, you'll
# remove the -dmg option above.
# appdmg json-path YourApp_${TRAVIS_TAG}.dmg
# Copy other project files
cp "../../libbitdht/src/bitdht/bdboot.txt" "retroshare.app/Contents/Resources/"
cp "../../plugins/FeedReader/lib/libFeedReader.dylib" "retroshare.app/Contents/Resources/"
cp -R "sounds" "retroshare.app/Contents/Resources/sounds"
# cp "${project_dir}/README.md" "README.md"
# cp "${project_dir}/LICENSE" "LICENSE"
# cp "${project_dir}/Qt License" "Qt License"

View file

@ -1,10 +1,11 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Name=RetroShare
Comment=Securely share files with your friends
Comment=Securely communicate with your friends
Exec=/usr/bin/retroshare %U
Icon=/usr/share/pixmaps/retroshare.xpm
Terminal=false
Type=Application
Categories=Network;P2P;
Categories=Network;Email;InstantMessaging;Chat;Feed;FileTransfer;P2P
MimeType=x-scheme-handler/retroshare;

View file

@ -18,8 +18,8 @@ At the end, you'll get at ..\\*-msys2\deploy\ the Portable 7zip file.
### MSYS2 INSTALLATION (for editing or debugging)
Download MSYS2 from [MSYS2](http://www.msys2.org/). Get the i686 version
if you run a 32-bit Windows or the x86_64 if you run a 64-bit Windows.
Download MSYS2 from [MSYS2](http://www.msys2.org/). Installing
MSYS2 requires 64 bit Windows 10 or newer.
Run the installer and install MSYS2.
@ -40,26 +40,29 @@ Run MSYS2 MSYS again and finish updating with:
Install the default programs needed to build:
pacman -S base-devel git wget p7zip gcc perl ruby python2 doxygen cmake
pacman -S base-devel git wget p7zip gcc perl ruby doxygen cmake
Install the 32-bit toolchain:
Install the 64-bit toolchain:
pacman -S mingw-w64-i686-toolchain
pacman -S mingw-w64-x86_64-toolchain
Install all needed dependencies:
pacman -S mingw-w64-i686-miniupnpc
pacman -S mingw-w64-i686-libmicrohttpd
pacman -S mingw-w64-i686-libxslt
pacman -S mingw-w64-i686-xapian-core
pacman -S mingw-w64-i686-sqlcipher
pacman -S mingw-w64-i686-qt5
pacman -S mingw32/mingw-w64-i686-cmake
pacman -S mingw-w64-i686-rapidjson
pacman -S mingw-w64-x86_64-miniupnpc
pacman -S mingw-w64-x86_64-libxslt
pacman -S mingw-w64-x86_64-xapian-core
pacman -S mingw-w64-x86_64-sqlcipher
pacman -S mingw-w64-x86_64-qt5-base
pacman -S mingw-w64-x86_64-qt5-multimedia
pacman -S mingw-w64-x86_64-ccmake
pacman -S mingw-w64-x86_64-rapidjson
pacman -S mingw-w64-x86_64-json-c
pacman -S mingw-w64-x86_64-libbotan
pacman -S mingw-w64-x86_64-asio
If you want to use QtCreator as IDE, prefer using this one publish by MSYS2 as all build Kit are already setted.
pacman -S mingw-w64-i686-qt-creator
pacman -S mingw-w64-x86_64-qt-creator
*You can start it from MSYS2 terminal.*
@ -67,7 +70,7 @@ We're done installing MSYS2, close the shell terminal.
### BUILDING RETROSHARE
Now run the MSYS2 MinGW 32-bit shell terminal (it's in the start menu).
Now run the MSYS2 MinGW 64-bit shell terminal (it's in the start menu).
We will use it to checkout Retroshare and build it:
git clone https://github.com/RetroShare/RetroShare.git

View file

@ -43,6 +43,7 @@ set NSIS_PARAM=%NSIS_PARAM% /DDEPLOYDIR="%RsDeployPath%"
set NSIS_PARAM=%NSIS_PARAM% /DOUTDIR="%RsPackPath%"
set NSIS_PARAM=%NSIS_PARAM% /DINSTALLERADD="%RsArchiveAdd%"
set NSIS_PARAM=%NSIS_PARAM% /DARCHITECTURE="%RsArchitecture%"
set NSIS_PARAM=%NSIS_PARAM% /DTOOLCHAIN="%RsToolchain%"
set NSIS_PARAM=%NSIS_PARAM% /DREVISION=%RsVersion.Extra%
set QtMainVersion=%QtVersion:~0,1%

View file

@ -18,15 +18,17 @@ if errorlevel 1 goto error_env
if not "%ParamNoupdate%"=="1" (
:: Install needed things
%EnvMSYS2Cmd% "pacman --noconfirm --needed -S make git mingw-w64-%RsMSYS2Architecture%-toolchain mingw-w64-%RsMSYS2Architecture%-qt5 mingw-w64-%RsMSYS2Architecture%-miniupnpc mingw-w64-%RsMSYS2Architecture%-sqlcipher mingw-w64-%RsMSYS2Architecture%-cmake mingw-w64-%RsMSYS2Architecture%-rapidjson"
:: rnp
%EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-json-c mingw-w64-%RsMSYS2Architecture%-libbotan"
:: Webui
if "%ParamWebui%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-doxygen"
if "%ParamWebui%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-doxygen mingw-w64-%RsMSYS2Architecture%-asio"
:: Plugins
if "%ParamPlugins%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-speex mingw-w64-%RsMSYS2Architecture%-speexdsp mingw-w64-%RsMSYS2Architecture%-curl mingw-w64-%RsMSYS2Architecture%-libxslt mingw-w64-%RsMSYS2Architecture%-opencv mingw-w64-%RsMSYS2Architecture%-ffmpeg"
:: Clang
if "%ParamClang%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-clang"
if "%ClangCompiler%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-clang"
:: Indexing
if "%ParamIndexing%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-xapian-core mingw-w64-%RsMSYS2Architecture%-libvorbis mingw-w64-%RsMSYS2Architecture%-flac mingw-w64-%RsMSYS2Architecture%-taglib"
@ -77,11 +79,10 @@ echo %RsBuildConfig% >> buildinfo.txt
echo %RsArchitecture% >> buildinfo.txt
echo Qt %QtVersion% >> buildinfo.txt
echo %RsToolchain% >> buildinfo.txt
echo %RsCompiler% >> buildinfo.txt
call "%ToolsPath%\msys2-path.bat" "%SourcePath%" MSYS2SourcePath
call "%ToolsPath%\msys2-path.bat" "%EnvMSYS2Path%" MSYS2EnvMSYS2Path
if "%ParamClang%"=="1" (
if "%ClangCompiler%"=="1" (
%EnvMSYS2Cmd% "qmake "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-clang-g++ %RS_QMAKE_CONFIG%"
) else (
%EnvMSYS2Cmd% "qmake "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-g++ %RS_QMAKE_CONFIG%"

View file

@ -5,7 +5,7 @@ set ParamAutologin=0
set ParamPlugins=0
set ParamTor=0
set ParamWebui=0
set ParamClang=0
set ClangCompiler=0
set ParamIndexing=0
set ParamFriendserver=0
set ParamNoupdate=0
@ -55,8 +55,6 @@ if "%~1" NEQ "" (
set ParamWebui=1
) else if "%%~a"=="singlethread" (
set CoreCount=1
) else if "%%~a"=="clang" (
set ParamClang=1
) else if "%%~a"=="indexing" (
set ParamIndexing=1
) else if "%%~a"=="friendserver" (
@ -96,24 +94,18 @@ if "%RsToolchain%"=="mingw32" (
set RsArchitecture=x64
set RsMSYS2Architecture=clang-x86_64
set MSYSTEM=CLANG64
set ParamClang=1
set ClangCompiler=1
) else if "%RsToolchain%"=="clang32" (
set RsArchitecture=x86
set RsMSYS2Architecture=clang-i686
set MSYSTEM=CLANG32
set ParamClang=1
set ClangCompiler=1
) else if "%RsToolchain%"=="clangarm64" (
set RsArchitecture=arm64
set RsMSYS2Architecture=clang-aarch64
set MSYSTEM=CLANGARM64
)
if "%ParamClang%"=="1" (
set RsCompiler=Clang
) else (
set RsCompiler=GCC
)
if "%ParamRelease%"=="1" (
if "%ParamDebug%"=="1" (
echo.
@ -162,7 +154,6 @@ echo autologin Build with autologin
echo plugins Build plugins
echo webui Enable JsonAPI and pack webui files
echo singlethread Use only 1 thread for building
echo clang Use clang compiler instead of GCC
echo indexing Build with deep channel and file indexing support
echo friendserver Enable friendserver support
echo noupdate Skip updating the libraries

View file

@ -14,8 +14,8 @@ if "%QtVersion%"=="" %cecho% error "Cannot get Qt version." & exit /B 1
set RsMinGWPath=%EnvMSYS2BasePath%\%RsToolchain%
set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsToolchain%-%RsCompiler%-%RsBuildConfig%
set RsDeployPath=%DeployPath%\Qt-%QtVersion%%RsType%-%RsToolchain%-%RsCompiler%-%RsBuildConfig%
set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsToolchain%-%RsBuildConfig%
set RsDeployPath=%DeployPath%\Qt-%QtVersion%-%RsToolchain%%RsType%-%RsBuildConfig%
set RsPackPath=%DeployPath%
set RsArchiveAdd=
set RsWebuiBuildPath=%RsBuildPath%\retroshare-webui\webui

View file

@ -55,10 +55,11 @@ set RsVersion=%RsVersion.Major%.%RsVersion.Minor%.%RsVersion.Mini%
:: Check WMIC is available
wmic.exe alias /? >nul 2>&1 || echo WMIC is not available.&& goto error
:: Use WMIC to retrieve date in format YYYYMMDD
set RsDate=
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set RsDate=%%I
set RsDate=%RsDate:~0,4%%RsDate:~4,2%%RsDate:~6,2%
:: Get date
call "%ToolsPath%\get-rs-date.bat" "%SourcePath%" RsDate
if errorlevel 1 %cecho% error "Could not get date."& goto error
if "%RsDate%"=="" %cecho% error "Could not get date."& goto error
set QtMainVersion=%QtVersion:~0,1%
set QtSharePath=%RsMinGWPath%\share\qt%QtMainVersion%\
@ -71,9 +72,9 @@ if "%QtMainVersion%"=="4" set QtMainVersion2=4
if "%QtMainVersion%"=="5" set QtMainVersion1=5
if "%RsBuildConfig%" NEQ "release" (
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsArchitecture%-msys2%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsToolchain%-msys2%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z
) else (
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsArchitecture%-msys2%RsType%%RsArchiveAdd%.7z
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsToolchain%-msys2%RsType%%RsArchiveAdd%.7z
)
if exist "%Archive%" del /Q "%Archive%"
@ -105,6 +106,7 @@ copy "%RsBuildPath%\retroshare-nogui\src\%RsBuildConfig%\retroshare*-nogui.exe"
copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite%
copy "%RsBuildPath%\supportlibs\cmark\build\src\libcmark.dll" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" copy "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" copy "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\retroshare-friendserver\src\%RsBuildConfig%\retroshare-friendserver.exe" (
copy "%RsBuildPath%\retroshare-friendserver\src\%RsBuildConfig%\retroshare-friendserver.exe" "%RsDeployPath%" %Quite%
)

View file

@ -16,7 +16,7 @@ if "%~1"=="clean" (
goto exit
)
set MSYS2Version=20231026
set MSYS2Version=20250622
set MSYS2Install=msys2-base-x86_64-%MSYS2Version%.sfx.exe
set MSYS2Url=https://github.com/msys2/msys2-installer/releases/download/%MSYS2Version:~0,4%-%MSYS2Version:~4,2%-%MSYS2Version:~6,2%/%MSYS2Install%

View file

@ -9,6 +9,7 @@
;!define REVISION ""
;!define DEPLOYDIR ""
;!define ARCHITECTURE ""
;!define TOOLCHAIN ""
# Optional defines
;!define OUTDIR ""
@ -21,6 +22,9 @@
!ifndef ARCHITECTURE
!error "ARCHITECTURE is not defined"
!endif
!ifndef TOOLCHAIN
!error "TOOLCHAIN is not defined"
!endif
# Check optional defines
!ifdef OUTDIR
@ -72,7 +76,7 @@ ${!defineifexist} TOR_EXISTS "${DEPLOYDIR}\tor.exe"
# Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-${ARCHITECTURE}${RSTYPE}${INSTALLERADD}-setup.exe"
OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-${TOOLCHAIN}-msys2${RSTYPE}${INSTALLERADD}-setup.exe"
BrandingText "${APPNAMEANDVERSION}"
RequestExecutionlevel highest
# Use compression

View file

@ -55,7 +55,6 @@ Run the scripts in this order:
* "CONFIG+=..." enable other extra compile time features, you can find the almost complete list in file *&lt;sourcefolder&gt;\retroshare.pri*
* For fixing compile problems (optional)
* singlethread: use only 1 thread for building, slow but useful if you don't find the error message in the console
* clang: use clang compiler instead of GCC
* noupdate: skip the msys2 update step, sometimes some msys2 packages are broken, you can manually switch back to the older package, and this option will prevent updating to the broken version again
Example:

View file

@ -0,0 +1,32 @@
REM Usage:
REM call get-rs-date.bat SourcePath Variable
setlocal
set SourcePath=%~1
set Variable=%~2
if "%Variable%"=="" (
echo.
echo Parameter error
exit /B 1
)
:: Check git executable
set GitPath=
call "%~dp0find-in-path.bat" GitPath git.exe
if "%GitPath%"=="" (
echo.
echo Git executable not found in PATH.
exit /B 1
)
set Date=
pushd "%SourcePath%"
rem This doesn't work: git log -1 --date=format:"%Y%m%d" --format="%ad"
for /F "tokens=1,2,3* delims=-" %%A in ('git log -1 --date^=short --format^="%%ad"') do set Date=%%A%%B%%C
popd
:exit
endlocal & set %Variable%=%Date%
exit /B 0

View file

@ -0,0 +1,35 @@
## Build Retroshare with QtCreator & Qt 6.9 on Windows
### Qt 6.9 Installation
Download Qt 6.9 from: https://www.qt.io/download-dev
Run the installer and install Qt 6.9
Add GCC.exe to Path
C:\Qt\Tools\mingw1310_64\bin
Compile the external libs start build-libs.bat:
Open Qt Command Prompt:
cd C:\Users\User\Documents\GitHub\RetroShare\build_scripts\Windows\build-libs
Type (this will take some time to build all libs):
build-libs.bat
Open Qt Creator
Open project -> RetroShare.pro
After Project loaded, go to:
Projects->Build->Build Steps->Additional arguments:
Add EXTERNAL_LIB_DIR:
"EXTERNAL_LIB_DIR=%{sourceDir}\..\RetroShare-env\build-libs\gcc-13.1.0\x64\libs"
After done, Build Project

View file

@ -2,23 +2,31 @@ ZLIB_VERSION=1.2.11
BZIP2_VERSION=1.0.8
MINIUPNPC_VERSION=2.2.3
OPENSSL_VERSION=1.1.1w
SPEEX_VERSION=1.2.0
SPEEXDSP_VERSION=1.2.0
LIBXML2_VERSION=2.9.12
LIBXSLT_VERSION=1.1.34
CURL_VERSION=7.81.0
SPEEX_VERSION=1.2.1
SPEEXDSP_VERSION=1.2.1
LIBXML2_MAIN_VERSION=2.14
LIBXML2_VERSION=$(LIBXML2_MAIN_VERSION).5
LIBXSLT_MAIN_VERSION=1.1
LIBXSLT_VERSION=$(LIBXSLT_MAIN_VERSION).43
CURL_VERSION=8.9.1
TCL_VERSION=8.6.10
SQLCIPHER_VERSION=4.5.0
LIBMICROHTTPD_VERSION=0.9.75
FFMPEG_VERSION=4.4
FFMPEG_VERSION=4.4.6
RAPIDJSON_VERSION=1.1.0
XAPIAN_VERSION=1.4.19
XAPIAN_VERSION=1.4.29
ASIO_VERSION=1-34-2
#RNP_VERSION=0.17.1
# libaries for rnp
JSON_C_VERSION=0.18
BOTAN_VERSION=2.19.5
DOWNLOAD_PATH?=download
BUILD_PATH=build
LIBS_PATH?=libs
all: dirs zlib bzip2 miniupnpc openssl speex speexdsp libxml2 libxslt curl sqlcipher libmicrohttpd ffmpeg rapidjson xapian copylibs
all: dirs zlib bzip2 miniupnpc openssl speex speexdsp libxml curl sqlcipher ffmpeg rapidjson xapian jsonc botan asio copylibs
#rnp
download: \
$(DOWNLOAD_PATH)/zlib-$(ZLIB_VERSION).tar.gz \
@ -27,13 +35,12 @@ download: \
$(DOWNLOAD_PATH)/openssl-$(OPENSSL_VERSION).tar.gz \
$(DOWNLOAD_PATH)/speex-$(SPEEX_VERSION).tar.gz \
$(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tar.gz \
$(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz \
$(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz \
$(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.xz \
$(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.xz \
$(DOWNLOAD_PATH)/curl-$(CURL_VERSION).tar.gz \
$(DOWNLOAD_PATH)/tcl$(TCL_VERSION)-src.tar.gz \
$(DOWNLOAD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tar.gz \
$(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz \
$(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz \
$(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.xz \
$(DOWNLOAD_PATH)/rapidjson-$(RAPIDJSON_VERSION).tar.gz \
$(DOWNLOAD_PATH)/xapian-core-$(XAPIAN_VERSION).tar.xz
@ -56,8 +63,7 @@ $(BUILD_PATH)/zlib-$(ZLIB_VERSION): $(DOWNLOAD_PATH)/zlib-$(ZLIB_VERSION).tar.gz
rm -r -f $(BUILD_PATH)/zlib-*
tar xvf $(DOWNLOAD_PATH)/zlib-$(ZLIB_VERSION).tar.gz
# build
cd zlib-$(ZLIB_VERSION) && make -f win32/Makefile.gcc libz.a
cd zlib-$(ZLIB_VERSION) && make
cd zlib-$(ZLIB_VERSION) && make -j -f win32/Makefile.gcc libz.a
# copy files
mkdir -p $(BUILD_PATH)/zlib-$(ZLIB_VERSION).tmp/include
cp zlib-$(ZLIB_VERSION)/zlib.h $(BUILD_PATH)/zlib-$(ZLIB_VERSION).tmp/include/
@ -79,7 +85,7 @@ $(BUILD_PATH)/bzip2-$(BZIP2_VERSION): $(DOWNLOAD_PATH)/bzip2-$(BZIP2_VERSION).ta
tar xvf $(DOWNLOAD_PATH)/bzip2-$(BZIP2_VERSION).tar.gz
# build
#cd bzip2-$(BZIP2_VERSION) && make install PREFIX="`pwd`/../$(BUILD_PATH)"
cd bzip2-$(BZIP2_VERSION) && make
cd bzip2-$(BZIP2_VERSION) && make -j
# copy files
mkdir -p $(BUILD_PATH)/bzip2-$(BZIP2_VERSION).tmp/include
cp bzip2-$(BZIP2_VERSION)/bzlib.h $(BUILD_PATH)/bzip2-$(BZIP2_VERSION).tmp/include/
@ -99,7 +105,7 @@ $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION): $(DOWNLOAD_PATH)/miniupnpc-$(MINIU
rm -r -f $(BUILD_PATH)/miniupnpc-*
tar xvf $(DOWNLOAD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tar.gz
# build
cd miniupnpc-$(MINIUPNPC_VERSION) && export CC=gcc && export PATH=.:$$PATH && make -f Makefile.mingw libminiupnpc.a miniupnpc.dll
cd miniupnpc-$(MINIUPNPC_VERSION) && export CC=gcc && export PATH=.:$$PATH && make -j -f Makefile.mingw libminiupnpc.a miniupnpc.dll
# copy files
mkdir -p $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tmp/include/miniupnpc
cp miniupnpc-$(MINIUPNPC_VERSION)/include/*.h $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tmp/include/miniupnpc/
@ -124,7 +130,7 @@ $(BUILD_PATH)/openssl-$(OPENSSL_VERSION): $(DOWNLOAD_PATH)/openssl-$(OPENSSL_VER
#cd openssl-$(OPENSSL_VERSION) && ./config --prefix="`pwd`/../$(BUILD_PATH)"
#cd openssl-$(OPENSSL_VERSION) && make install
cd openssl-$(OPENSSL_VERSION) && ./config shared
cd openssl-$(OPENSSL_VERSION) && make
cd openssl-$(OPENSSL_VERSION) && make -j
# copy files
mkdir -p $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp/include/openssl
cp openssl-$(OPENSSL_VERSION)/include/openssl/*.h $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp/include/openssl/
@ -153,7 +159,7 @@ $(BUILD_PATH)/speex-$(SPEEX_VERSION): $(DOWNLOAD_PATH)/speex-$(SPEEX_VERSION).ta
# build
cd speex-$(SPEEX_VERSION) && ./configure
#cd speex-$(SPEEX_VERSION) && make install exec_prefix="`pwd`/../$(BUILD_PATH)"
cd speex-$(SPEEX_VERSION) && make
cd speex-$(SPEEX_VERSION) && make -j
# copy files
mkdir -p $(BUILD_PATH)/speex-$(SPEEX_VERSION).tmp/include/speex
cp speex-$(SPEEX_VERSION)/include/speex/*.h $(BUILD_PATH)/speex-$(SPEEX_VERSION).tmp/include/speex/
@ -174,7 +180,7 @@ $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION): $(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP
tar xvf $(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tar.gz
# build
cd speexdsp-$(SPEEXDSP_VERSION) && ./configure
cd speexdsp-$(SPEEXDSP_VERSION) && make
cd speexdsp-$(SPEEXDSP_VERSION) && make -j
# copy files
mkdir -p $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tmp/include/speex
cp speexdsp-$(SPEEXDSP_VERSION)/include/speex/*.h $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tmp/include/speex/
@ -184,50 +190,52 @@ $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION): $(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP
rm -r -f speexdsp-$(SPEEXDSP_VERSION)
mv $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tmp $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION)
libxml2: $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION)
libxml: \
$(BUILD_PATH)/libxml2-$(LIBXML2_VERSION) \
$(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION)
$(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz:
wget ftp://xmlsoft.org/libxml2/libxml2-$(LIBXML2_VERSION).tar.gz -O $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz
$(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.xz:
wget --no-check-certificate https://download.gnome.org/sources/libxml2/$(LIBXML2_MAIN_VERSION)/libxml2-$(LIBXML2_VERSION).tar.xz -O $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.xz
$(BUILD_PATH)/libxml2-$(LIBXML2_VERSION): $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz
# prepare
$(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.xz:
wget --no-check-certificate https://download.gnome.org/sources/libxslt/$(LIBXSLT_MAIN_VERSION)/libxslt-$(LIBXSLT_VERSION).tar.xz -O $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.xz
$(BUILD_PATH)/libxml2-$(LIBXML2_VERSION) $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION): \
$(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.xz \
$(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.xz
# libxml2: prepare
pacman --needed --noconfirm -S python3 pkg-config
rm -r -f $(BUILD_PATH)/libxml2-*
tar xvf $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz
# build
tar xvf $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.xz
# libxslt: prepare
rm -r -f $(BUILD_PATH)/libxslt-*
tar xvf $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.xz
tar xvf $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.xz
# libxml2: build
cd libxml2-$(LIBXML2_VERSION) && ./configure --without-iconv -enable-shared=no
#cd libxml2-$(LIBXML2_VERSION) && make install exec_prefix="`pwd`/../$(BUILD_PATH)"
cd libxml2-$(LIBXML2_VERSION) && make
# copy files
cd libxml2-$(LIBXML2_VERSION) && make -j libxml2.la
# libxslt: build
cd libxslt-$(LIBXSLT_VERSION) && ./configure --with-libxml-src=../libxml2-$(LIBXML2_VERSION) -enable-shared=no CFLAGS=-DLIBXML_STATIC
cd libxslt-$(LIBXSLT_VERSION)/libxslt && make -j
cd libxslt-$(LIBXSLT_VERSION)/libexslt && make -j
# libxml2: copy files
mkdir -p $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp/include/libxml
cp libxml2-$(LIBXML2_VERSION)/include/libxml/*.h $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp/include/libxml/
mkdir -p $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp/lib
cp libxml2-$(LIBXML2_VERSION)/.libs/libxml2.a $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp/lib/
# cleanup
#rm -r -f libxml2-$(LIBXML2_VERSION) # see libxslt
mv $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION)
libxslt: $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION)
$(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz:
wget ftp://xmlsoft.org/libxml2/libxslt-$(LIBXSLT_VERSION).tar.gz -O $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz
$(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION): $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz
# prepare
rm -r -f $(BUILD_PATH)/libxslt-*
tar xvf $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz
tar xvf $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz
# build
cd libxslt-$(LIBXSLT_VERSION) && ./configure --with-libxml-src=../libxml2-$(LIBXML2_VERSION) -enable-shared=no CFLAGS=-DLIBXML_STATIC
cd libxslt-$(LIBXSLT_VERSION) && make
# copy files
# libxslt: copy files
mkdir -p $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp/include/libxslt
cp libxslt-$(LIBXSLT_VERSION)/libxslt/*.h $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp/include/libxslt/
mkdir -p $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp/lib
cp libxslt-$(LIBXSLT_VERSION)/libxslt/.libs/libxslt.a $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp/lib/
cp libxslt-$(LIBXSLT_VERSION)/libexslt/.libs/libexslt.a $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp/lib/
# cleanup
# libxml2: cleanup
rm -r -f libxml2-$(LIBXML2_VERSION)
# libxslt: cleanup
rm -r -f libxslt-$(LIBXSLT_VERSION)
# finish
mv $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION)
mv $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION)
curl: $(BUILD_PATH)/curl-$(CURL_VERSION)
@ -242,7 +250,7 @@ $(BUILD_PATH)/curl-$(CURL_VERSION): $(DOWNLOAD_PATH)/curl-$(CURL_VERSION).tar.gz
# build
cd curl-$(CURL_VERSION) && ./configure --disable-shared --with-ssl="`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)"
#cd curl-$(CURL_VERSION) && make install exec_prefix="`pwd`/../$(BUILD_PATH)"
cd curl-$(CURL_VERSION) && make
cd curl-$(CURL_VERSION)/lib && make -j
# copy files
mkdir -p $(BUILD_PATH)/curl-$(CURL_VERSION).tmp/include/curl
cp curl-$(CURL_VERSION)/include/curl/*.h $(BUILD_PATH)/curl-$(CURL_VERSION).tmp/include/curl/
@ -267,14 +275,14 @@ $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION): $(DOWNLOAD_PATH)/tcl$(TCL_VERSION)
tar xvf $(DOWNLOAD_PATH)/tcl$(TCL_VERSION)-src.tar.gz
mkdir -p tcl$(TCL_VERSION)/build
cd tcl$(TCL_VERSION)/build && ../win/configure
cd tcl$(TCL_VERSION)/build && make
cd tcl$(TCL_VERSION)/build && make -j
#sqlcipher
tar xvf $(DOWNLOAD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tar.gz
cd sqlcipher-$(SQLCIPHER_VERSION) && ln -s ../tcl$(TCL_VERSION)/build/tclsh86.exe tclsh
mkdir -p tcl$(TCL_VERSION)/lib
ln -s `pwd`/tcl$(TCL_VERSION)/library `pwd`/tcl$(TCL_VERSION)/lib/tcl8.6
# build
cd sqlcipher-$(SQLCIPHER_VERSION) && PATH=.:$$PATH:`pwd`/../tcl$(TCL_VERSION)/build && export LIBS="-L`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)/lib -lgdi32 $$LIBS" && ./configure --disable-shared --enable-static --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -I`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)/include -I`pwd`/../tcl$(TCL_VERSION)/generic" LDFLAGS="-L`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)/lib -lcrypto -lgdi32" --with-tcl="`pwd`/../tcl$(TCL_VERSION)/build" && make install prefix="`pwd`/install"
cd sqlcipher-$(SQLCIPHER_VERSION) && PATH=.:$$PATH:`pwd`/../tcl$(TCL_VERSION)/build && export LIBS="-L`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)/lib -lgdi32 $$LIBS" && ./configure --disable-shared --enable-static --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -I`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)/include -I`pwd`/../tcl$(TCL_VERSION)/generic" LDFLAGS="-L`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)/lib -lcrypto -lgdi32" --with-tcl="`pwd`/../tcl$(TCL_VERSION)/build" && make -j install prefix="`pwd`/install"
# copy files
mkdir -p $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tmp/include
cp -r sqlcipher-$(SQLCIPHER_VERSION)/install/include/* $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tmp/include/
@ -287,34 +295,18 @@ $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION): $(DOWNLOAD_PATH)/tcl$(TCL_VERSION)
rm -r -f tcl$(TCL_VERSION)
mv $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tmp $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION)
libmicrohttpd: $(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION)
$(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz:
wget --no-check-certificate http://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz -O $(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz
$(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION): $(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz
# prepare
rm -r -f $(BUILD_PATH)/libmicrohttpd-*
tar xvf $(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz
# build
cd libmicrohttpd-$(LIBMICROHTTPD_VERSION) && ./configure --disable-shared --enable-static --prefix="`pwd`/../$(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tmp"
cd libmicrohttpd-$(LIBMICROHTTPD_VERSION) && make install
# cleanup
rm -r -f libmicrohttpd-$(LIBMICROHTTPD_VERSION)
mv $(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tmp $(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION)
ffmpeg: $(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION)
$(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz:
wget --no-check-certificate https://ffmpeg.org/releases/ffmpeg-$(FFMPEG_VERSION).tar.gz -O $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz
$(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.xz:
wget --no-check-certificate https://ffmpeg.org/releases/ffmpeg-$(FFMPEG_VERSION).tar.xz -O $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.xz
$(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION): $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz
$(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION): $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.xz
# prepare
rm -r -f $(BUILD_PATH)/ffmpeg-*
tar xvf $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz
tar xvf $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.xz
# build
cd ffmpeg-$(FFMPEG_VERSION) && ./configure --disable-shared --enable-static --disable-programs --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-yasm --disable-everything --enable-encoder=mpeg4 --enable-decoder=mpeg4 --prefix="`pwd`/../$(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION).tmp"
cd ffmpeg-$(FFMPEG_VERSION) && make install
cd ffmpeg-$(FFMPEG_VERSION) && make -j install
# cleanup
rm -r -f ffmpeg-$(FFMPEG_VERSION)
mv $(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION).tmp $(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION)
@ -352,7 +344,7 @@ $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION): $(DOWNLOAD_PATH)/xapian-core-$(XAPI
#cd xapian-core-$(XAPIAN_VERSION) && ./configure --disable-shared --enable-static --prefix="`pwd`/../$(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp"
#cd xapian-core-$(XAPIAN_VERSION) && make install
cd xapian-core-$(XAPIAN_VERSION) && ./configure --disable-shared --enable-static
cd xapian-core-$(XAPIAN_VERSION) && make
cd xapian-core-$(XAPIAN_VERSION) && make -j
# copy files
mkdir -p $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp/include
cp -r xapian-core-$(XAPIAN_VERSION)/include/* $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp/include/
@ -363,8 +355,73 @@ $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION): $(DOWNLOAD_PATH)/xapian-core-$(XAPI
rm -r -f xapian-core-$(XAPIAN_VERSION)
mv $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION)
jsonc: $(BUILD_PATH)/json-c-$(JSON_C_VERSION)
$(BUILD_PATH)/json-c-$(JSON_C_VERSION):
# prepare
rm -r -f $(BUILD_PATH)/json-c-*
[ -d "json-c-$(JSON_C_VERSION)" ] || git clone https://github.com/json-c/json-c.git --depth=1 --branch json-c-$(JSON_C_VERSION) "json-c-$(JSON_C_VERSION)"
# build
mkdir -p json-c-$(JSON_C_VERSION)/build
cd json-c-$(JSON_C_VERSION)/build && cmake .. -G"MSYS Makefiles" -Wno-dev -DCMAKE_BUILD_TYPE="release" -DBUILD_SHARED_LIBS=off -DBUILD_STATIC_LIBS=on -DBUILD_TESTING=off -DCMAKE_CXX_FLAGS="-D__MINGW_USE_VC2005_COMPAT" -DCMAKE_INSTALL_PREFIX="`pwd`/install" -DCMAKE_INSTALL_PREFIX="`pwd`/../../$(BUILD_PATH)/json-c-$(JSON_C_VERSION).tmp"
cd json-c-$(JSON_C_VERSION)/build && make -j install
# cleanup
rm -r -f json-c-$(JSON_C_VERSION)
mv $(BUILD_PATH)/json-c-$(JSON_C_VERSION).tmp $(BUILD_PATH)/json-c-$(JSON_C_VERSION)
botan: $(BUILD_PATH)/botan-$(BOTAN_VERSION)
$(BUILD_PATH)/botan-$(BOTAN_VERSION):
# prepare
pacman --needed --noconfirm -S python3
rm -r -f $(BUILD_PATH)/botan-*
[ -d "botan-$(BOTAN_VERSION)" ] || git clone https://github.com/randombit/botan.git --depth=1 --branch $(BOTAN_VERSION) "botan-$(BOTAN_VERSION)"
# build
if [ $(MSYSTEM) = "MINGW32" ] ; then cd botan-$(BOTAN_VERSION) && ./configure.py --os=mingw --cpu=x86_32 --disable-shared-library --enable-static-library --extra-cxxflags="-D__MINGW_USE_VC2005_COMPAT" --prefix="`pwd`/../$(BUILD_PATH)/botan-$(BOTAN_VERSION).tmp" ; fi
if [ $(MSYSTEM) = "MINGW64" ] ; then cd botan-$(BOTAN_VERSION) && ./configure.py --os=mingw --cpu=x86_64 --disable-shared-library --enable-static-library --prefix="`pwd`/../$(BUILD_PATH)/botan-$(BOTAN_VERSION).tmp" ; fi
cd botan-$(BOTAN_VERSION) && make -j install
# cleanup
rm -r -f botan-$(BOTAN_VERSION)
mv $(BUILD_PATH)/botan-$(BOTAN_VERSION).tmp $(BUILD_PATH)/botan-$(BOTAN_VERSION)
asio: $(BUILD_PATH)/asio-$(ASIO_VERSION)
$(BUILD_PATH)/asio-$(ASIO_VERSION):
# prepare
rm -r -f $(BUILD_PATH)/asio-*
[ -d "asio-$(ASIO_VERSION)" ] || git clone https://github.com/chriskohlhoff/asio.git --depth=1 --branch asio-$(ASIO_VERSION) "asio-$(ASIO_VERSION)"
# copy files
mkdir -p $(BUILD_PATH)/asio-$(ASIO_VERSION).tmp/include/asio
cp asio-$(ASIO_VERSION)/asio/include/*.hpp $(BUILD_PATH)/asio-$(ASIO_VERSION).tmp/include/
cp -r asio-$(ASIO_VERSION)/asio/include/asio/* $(BUILD_PATH)/asio-$(ASIO_VERSION).tmp/include/asio/
# cleanup
rm -r -f asio-$(ASIO_VERSION)
mv $(BUILD_PATH)/asio-$(ASIO_VERSION).tmp $(BUILD_PATH)/asio-$(ASIO_VERSION)
rnp: $(BUILD_PATH)/rnp-$(RNP_VERSION)
$(BUILD_PATH)/rnp-$(RNP_VERSION):
# prepare
rm -r -f $(BUILD_PATH)/rnp-*
[ -d "rnp-$(RNP_VERSION)" ] || git clone https://github.com/rnpgp/rnp.git --depth=1 --branch v$(RNP_VERSION) --recurse-submodules --shallow-submodules "rnp-$(RNP_VERSION)"
# build
mkdir -p rnp-$(RNP_VERSION)/build
cd rnp-$(RNP_VERSION)/build && cmake .. -G"MSYS Makefiles" -Wno-dev -DCMAKE_INSTALL_PREFIX="`pwd`/install" -DBUILD_SHARED_LIBS=yes -DBUILD_TESTING=off -DCMAKE_CXX_FLAGS="-D__MINGW_USE_VC2005_COMPAT -D__STDC_FORMAT_MACROS" -DBZIP2_INCLUDE_DIR="`pwd`/../../$(BUILD_PATH)/bzip2-$(BZIP2_VERSION)/include" -DBZIP2_LIBRARY_RELEASE="`pwd`/../../$(BUILD_PATH)/bzip2-$(BZIP2_VERSION)/lib/libbz2.a" -DBZIP2_LIBRARIES="`pwd`/../../$(BUILD_PATH)/bzip2-$(BZIP2_VERSION)/lib/libbz2.a" -DZLIB_INCLUDE_DIR="`pwd`/../../$(BUILD_PATH)/zlib-$(ZLIB_VERSION)/include" -DZLIB_LIBRARY="`pwd`/../../$(BUILD_PATH)/zlib-$(ZLIB_VERSION)/lib/libz.a" -DJSON-C_INCLUDE_DIR="`pwd`/../../$(BUILD_PATH)/json-c-$(JSON_C_VERSION)/include/json-c" -DJSON-C_LIBRARY="`pwd`/../../$(BUILD_PATH)/json-c-$(JSON_C_VERSION)/lib/libjson-c.a" -DBOTAN_INCLUDE_DIR="`pwd`/../../$(BUILD_PATH)/botan-$(BOTAN_VERSION)/include/botan-`echo $(BOTAN_VERSION) | cut -c1-1`" -DBOTAN_LIBRARY="`pwd`/../../$(BUILD_PATH)/botan-$(BOTAN_VERSION)/lib/libbotan-`echo $(BOTAN_VERSION) | cut -c1-1`.a"
cmake --build rnp-$(RNP_VERSION)/build
# copy files
mkdir -p $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/include/rnp
cp -r rnp-$(RNP_VERSION)/include/rnp/* $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/include/rnp/
cp -r rnp-$(RNP_VERSION)/build/src/lib/rnp/* $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/include/rnp/
mkdir -p $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/lib
cp -r rnp-$(RNP_VERSION)/build/src/lib/librnp.dll.a $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/lib/
mkdir -p $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/bin
cp -r rnp-$(RNP_VERSION)/build/src/lib/librnp.dll $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/bin/
# cleanup
rm -r -f rnp-$(RNP_VERSION)
mv $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp $(BUILD_PATH)/rnp-$(RNP_VERSION)
copylibs:
rm -r -f $(LIBS_PATH) ; \
mkdir -p $(LIBS_PATH) ; \
cp $(BUILD_PATH)/gcc-version $(LIBS_PATH) ; \
find $(BUILD_PATH) -mindepth 1 -maxdepth 1 -type d -not -name "*.tmp" -print -exec cp -r {}/. $(LIBS_PATH) \; ; \
cp -p $(BUILD_PATH)/gcc-version $(LIBS_PATH) ; \
find $(BUILD_PATH) -mindepth 1 -maxdepth 1 -type d -not -name "*.tmp" -print -exec cp -r -p {}/. $(LIBS_PATH) \; ; \

View file

@ -96,6 +96,7 @@ copy nul "%RsDeployPath%\portable" %Quite%
echo copy binaries
copy "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare*.exe" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" copy "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" copy "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" "%RsDeployPath%" %Quite%
if "%ParamService%"=="1" (
copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite%

View file

@ -16,13 +16,13 @@ if "%~1"=="clean" (
goto exit
)
set MSYS2Version=20231026
set MSYS2Version=20250622
set MSYS2Install=msys2-base-x86_64-%MSYS2Version%.sfx.exe
set MSYS2Url=https://github.com/msys2/msys2-installer/releases/download/%MSYS2Version:~0,4%-%MSYS2Version:~4,2%-%MSYS2Version:~6,2%/%MSYS2Install%
set MSYS2UnpackPath=%EnvMSYS2Path%\msys64
set CMakeInstall=cmake-3.19.0-win32-x86.zip
set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.19.0/%CMakeInstall%
set CMakeInstall=cmake-3.31.3-windows-i386.zip
set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.31.3/%CMakeInstall%
if exist "%MSYS2UnpackPath%\usr\bin\pacman.exe" (
if "%~1"=="reinstall" (

View file

@ -19,9 +19,9 @@ set MinGitInstallPath=%EnvToolsPath%\MinGit
set DoxygenInstall=doxygen-1.9.6.windows.x64.bin.zip
set DoxygenUrl=https://github.com/doxygen/doxygen/releases/download/Release_1_9_6/%DoxygenInstall%
set DoxygenInstallPath=%EnvToolsPath%\doxygen
set CMakeVersion=cmake-3.19.0-win32-x86
set CMakeVersion=cmake-3.31.3-windows-i386
set CMakeInstall=%CMakeVersion%.zip
set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.19.0/%CMakeInstall%
set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.31.3/%CMakeInstall%
set CMakeInstallPath=%EnvToolsPath%\cmake
set TorProjectUrl=https://www.torproject.org
set TorDownloadIndexUrl=%TorProjectUrl%/download/tor

View file

@ -247,6 +247,7 @@ Section $(Section_Main) Section_Main
; External binaries
File "${EXTERNAL_LIB_DIR}\bin\miniupnpc.dll"
File "${RELEASEDIR}\supportlibs\librnp\Build\src\lib\librnp.dll"
!if ${ARCHITECTURE} == "x86"
File "${EXTERNAL_LIB_DIR}\bin\libcrypto-1_1.dll"
File "${EXTERNAL_LIB_DIR}\bin\libssl-1_1.dll"

View file

@ -0,0 +1,20 @@
#!/bin/bash
function git_del_tag()
{
mTag=$1
for mRemote in $(git remote); do
echo "Attempting tag $mTag removal from remote $mRemote"
GIT_TERMINAL_PROMPT=0 git push $mRemote :$mTag || true
done
git tag --delete $mTag
}
for mModule in . build_scripts/OBS/ libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ ; do
pushd $mModule
git_del_tag v0.6.7a
git tag --list | grep untagged | while read mTag; do git_del_tag $mTag ; done
popd
done

View file

@ -7,5 +7,5 @@ Exec=/usr/bin/retroshare %U
Icon=/usr/share/pixmaps/retroshare.xpm
Terminal=false
Type=Application
Categories=Application;Network;P2P;Feed;Chat;InstantMessaging
Categories=Network;Email;InstantMessaging;Chat;Feed;FileTransfer;P2P
MimeType=x-scheme-handler/retroshare;

@ -1 +1 @@
Subproject commit de2b4bd80c57ca757b5f878130f98becf710236d
Subproject commit da6b849a41f3cf6e60f6f76e1f3c4463876a8741

@ -1 +1 @@
Subproject commit b41667912751a453e8e5d4733215a0609277a26f
Subproject commit 178aa8ebcef47e3271d5a5ca5c07e45d3b71c81d

View file

@ -45,6 +45,7 @@ SOURCES = FeedReaderPlugin.cpp \
gui/FeedReaderUserNotify.cpp \
gui/FeedReaderFeedItem.cpp \
gui/FeedTreeWidget.cpp \
gui/ProxyWidget.cpp \
util/CURLWrapper.cpp \
util/XMLWrapper.cpp \
util/HTMLWrapper.cpp \
@ -66,6 +67,7 @@ HEADERS = FeedReaderPlugin.h \
gui/FeedReaderUserNotify.h \
gui/FeedReaderFeedItem.h \
gui/FeedTreeWidget.h \
gui/ProxyWidget.h \
util/CURLWrapper.h \
util/XMLWrapper.h \
util/HTMLWrapper.h \
@ -76,7 +78,8 @@ FORMS = gui/FeedReaderDialog.ui \
gui/AddFeedDialog.ui \
gui/PreviewFeedDialog.ui \
gui/FeedReaderConfig.ui \
gui/FeedReaderFeedItem.ui
gui/FeedReaderFeedItem.ui \
gui/ProxyWidget.ui
TARGET = FeedReader
@ -125,7 +128,7 @@ win32 {
isEmpty(QMAKE_SH) {
# MinGW
LIBS += -lcrypt32
LIBS += -lcrypt32 -lbcrypt
}
# Check for msys2

View file

@ -28,6 +28,7 @@
#include "FeedReaderStringDefs.h"
#include "gui/settings/rsharesettings.h"
#include "gui/common/UIStateHelper.h"
#include "util/DateTime.h"
#include <retroshare/rsgxsforums.h>
#include <retroshare/rsposted.h>
@ -180,8 +181,7 @@ void AddFeedDialog::useStandardUpdateIntervalToggled()
void AddFeedDialog::useStandardProxyToggled()
{
bool checked = ui->useStandardProxyCheckBox->isChecked();
ui->proxyAddressLineEdit->setEnabled(!checked);
ui->proxyPortSpinBox->setEnabled(!checked);
ui->proxyWidget->setEnabled(!checked);
}
void AddFeedDialog::typeForumToggled()
@ -335,13 +335,12 @@ bool AddFeedDialog::fillFeed(uint32_t feedId)
ui->passwordLineEdit->setText(QString::fromUtf8(feedInfo.password.c_str()));
ui->useStandardProxyCheckBox->setChecked(feedInfo.flag.standardProxy);
ui->proxyAddressLineEdit->setText(QString::fromUtf8(feedInfo.proxyAddress.c_str()));
ui->proxyPortSpinBox->setValue(feedInfo.proxyPort);
ui->proxyWidget->setAddress(QString::fromUtf8(feedInfo.proxyAddress.c_str()));
ui->proxyWidget->setPort(feedInfo.proxyPort);
ui->useStandardUpdateInterval->setChecked(feedInfo.flag.standardUpdateInterval);
ui->updateIntervalSpinBox->setValue(feedInfo.updateInterval / 60);
QDateTime dateTime;
dateTime.setTime_t(feedInfo.lastUpdate);
QDateTime dateTime = DateTime::DateTimeFromTime_t(feedInfo.lastUpdate);
ui->lastUpdate->setText(dateTime.toString());
ui->useStandardStorageTimeCheckBox->setChecked(feedInfo.flag.standardStorageTime);
@ -425,8 +424,8 @@ void AddFeedDialog::getFeedInfo(FeedInfo &feedInfo)
feedInfo.password = ui->passwordLineEdit->text().toUtf8().constData();
feedInfo.flag.standardProxy = ui->useStandardProxyCheckBox->isChecked();
feedInfo.proxyAddress = ui->proxyAddressLineEdit->text().toUtf8().constData();
feedInfo.proxyPort = ui->proxyPortSpinBox->value();
feedInfo.proxyAddress = ui->proxyWidget->address().toUtf8().constData();
feedInfo.proxyPort = ui->proxyWidget->port();
feedInfo.flag.standardUpdateInterval = ui->useStandardUpdateInterval->isChecked();
feedInfo.updateInterval = ui->updateIntervalSpinBox->value() * 60;

View file

@ -133,37 +133,16 @@
<property name="title">
<string>Proxy</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0" colspan="2">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="useStandardProxyCheckBox">
<property name="text">
<string>Use standard proxy</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="serverLabel">
<property name="text">
<string>Server</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="proxyAddressLineEdit"/>
</item>
<item row="1" column="2">
<widget class="QLabel" name="portLabel">
<property name="text">
<string>:</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QSpinBox" name="proxyPortSpinBox">
<property name="maximum">
<number>65535</number>
</property>
</widget>
<item>
<widget class="ProxyWidget" name="proxyWidget" native="true"/>
</item>
</layout>
</widget>
@ -465,6 +444,12 @@
<extends>QComboBox</extends>
<header>gui/common/RSComboBox.h</header>
</customwidget>
<customwidget>
<class>ProxyWidget</class>
<extends>QWidget</extends>
<header>gui/ProxyWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>urlLineEdit</tabstop>
@ -494,8 +479,7 @@
<tabstop>useStandardUpdateInterval</tabstop>
<tabstop>updateIntervalSpinBox</tabstop>
<tabstop>useStandardProxyCheckBox</tabstop>
<tabstop>proxyAddressLineEdit</tabstop>
<tabstop>proxyPortSpinBox</tabstop>
<tabstop>proxyWidget</tabstop>
</tabstops>
<resources/>
<connections/>

View file

@ -31,8 +31,7 @@ FeedReaderConfig::FeedReaderConfig(QWidget *parent, Qt::WindowFlags flags)
/* Invoke the Qt Designer generated object setup routine */
ui->setupUi(this);
ui->proxyAddressLineEdit->setEnabled(false);
ui->proxyPortSpinBox->setEnabled(false);
ui->proxyWidget->setEnabled(false);
/* Connect signals */
connect(ui->updateIntervalSpinBox, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, [this]() {
@ -51,8 +50,7 @@ FeedReaderConfig::FeedReaderConfig(QWidget *parent, Qt::WindowFlags flags)
Settings->setValueToGroup("FeedReaderDialog", "OpenAllInNewTab", ui->openAllInNewTabCheckBox->isChecked());
});
connect(ui->useProxyCheckBox, &QCheckBox::toggled, this, &FeedReaderConfig::updateProxy);
connect(ui->proxyAddressLineEdit, &QLineEdit::textChanged, this, &FeedReaderConfig::updateProxy);
connect(ui->proxyPortSpinBox, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, &FeedReaderConfig::updateProxy);
connect(ui->proxyWidget, &ProxyWidget::changed, this, &FeedReaderConfig::updateProxy);
connect(ui->useProxyCheckBox, SIGNAL(toggled(bool)), this, SLOT(useProxyToggled()));
}
@ -75,8 +73,8 @@ void FeedReaderConfig::load()
std::string proxyAddress;
uint16_t proxyPort;
whileBlocking(ui->useProxyCheckBox)->setChecked(rsFeedReader->getStandardProxy(proxyAddress, proxyPort));
whileBlocking(ui->proxyAddressLineEdit)->setText(QString::fromUtf8(proxyAddress.c_str()));
whileBlocking(ui->proxyPortSpinBox)->setValue(proxyPort);
whileBlocking(ui->proxyWidget)->setAddress(QString::fromUtf8(proxyAddress.c_str()));
whileBlocking(ui->proxyWidget)->setPort(proxyPort);
loaded = true;
@ -87,11 +85,10 @@ void FeedReaderConfig::useProxyToggled()
{
bool enabled = ui->useProxyCheckBox->isChecked();
ui->proxyAddressLineEdit->setEnabled(enabled);
ui->proxyPortSpinBox->setEnabled(enabled);
ui->proxyWidget->setEnabled(enabled);
}
void FeedReaderConfig::updateProxy()
{
rsFeedReader->setStandardProxy(ui->useProxyCheckBox->isChecked(), ui->proxyAddressLineEdit->text().toUtf8().constData(), ui->proxyPortSpinBox->value());
rsFeedReader->setStandardProxy(ui->useProxyCheckBox->isChecked(), ui->proxyWidget->address().toUtf8().constData(), ui->proxyWidget->port());
}

View file

@ -36,7 +36,7 @@ class FeedReaderConfig : public ConfigPage
public:
/** Default Constructor */
FeedReaderConfig(QWidget *parent = 0, Qt::WindowFlags flags = 0);
FeedReaderConfig(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags());
/** Default Destructor */
virtual ~FeedReaderConfig();

View file

@ -77,37 +77,16 @@
<property name="title">
<string>Proxy</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="4">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="useProxyCheckBox">
<property name="text">
<string>Use proxy</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="serverLabel">
<property name="text">
<string>Server</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="proxyAddressLineEdit"/>
</item>
<item row="1" column="3">
<widget class="QSpinBox" name="proxyPortSpinBox">
<property name="maximum">
<number>65535</number>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="potLabel">
<property name="text">
<string>:</string>
</property>
</widget>
<item>
<widget class="ProxyWidget" name="proxyWidget" native="true"/>
</item>
</layout>
</widget>
@ -157,12 +136,19 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ProxyWidget</class>
<extends>QWidget</extends>
<header>gui/ProxyWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>updateIntervalSpinBox</tabstop>
<tabstop>storageTimeSpinBox</tabstop>
<tabstop>useProxyCheckBox</tabstop>
<tabstop>proxyAddressLineEdit</tabstop>
<tabstop>proxyPortSpinBox</tabstop>
<tabstop>proxyWidget</tabstop>
<tabstop>saveInBackgroundCheckBox</tabstop>
<tabstop>setMsgToReadOnActivate</tabstop>
<tabstop>openAllInNewTabCheckBox</tabstop>

View file

@ -129,6 +129,8 @@ FeedReaderDialog::FeedReaderDialog(RsFeedReader *feedReader, FeedReaderNotify *n
settingsChanged();
feedTreeItemActivated(NULL);
mFontSizeHandler.registerFontSize(ui->feedTreeWidget);
}
FeedReaderDialog::~FeedReaderDialog()

View file

@ -23,6 +23,7 @@
#include <retroshare-gui/mainpage.h>
#include "interface/rsFeedReader.h"
#include "util/FontSizeHandler.h"
namespace Ui {
class FeedReaderDialog;
@ -98,6 +99,8 @@ private:
RsFeedReader *mFeedReader;
FeedReaderNotify *mNotify;
FontSizeHandler mFontSizeHandler;
/** Qt Designer generated object */
Ui::FeedReaderDialog *ui;
};

View file

@ -57,10 +57,10 @@
<item row="0" column="0">
<widget class="QFrame" name="toolBarFrame">
<property name="frameShape">
<enum>QFrame::Box</enum>
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="leftMargin">

View file

@ -36,11 +36,12 @@
#include "gui/common/RSTreeWidgetItem.h"
#include "gui/settings/rsharesettings.h"
#include "util/HandleRichText.h"
#include "util/QtVersion.h"
#include "util/RsQtVersion.h"
#include "gui/Posted/PostedCreatePostDialog.h"
#include "gui/gxsforums/CreateGxsForumMsg.h"
#include "gui/common/FilesDefs.h"
#include "util/imageutil.h"
#include "util/DateTime.h"
#include "retroshare/rsiface.h"
#include "retroshare/rsgxsforums.h"
@ -154,6 +155,8 @@ FeedReaderMessageWidget::FeedReaderMessageWidget(uint32_t feedId, RsFeedReader *
ui->msgTreeWidget->installEventFilter(this);
setFeedId(feedId);
mFontSizeHandler.registerFontSize(ui->msgTreeWidget);
}
FeedReaderMessageWidget::~FeedReaderMessageWidget()
@ -474,8 +477,7 @@ void FeedReaderMessageWidget::calculateMsgIconsAndFonts(QTreeWidgetItem *item)
void FeedReaderMessageWidget::updateMsgItem(QTreeWidgetItem *item, FeedMsgInfo &info)
{
QString title = QString::fromUtf8(info.title.c_str());
QDateTime qdatetime;
qdatetime.setTime_t(info.pubDate);
QDateTime qdatetime = DateTime::DateTimeFromTime_t(info.pubDate);
/* add string to all data */
QString sort = QString("%1_%2_%3").arg(title, qdatetime.toString("yyyyMMdd_hhmmss")).arg(info.feedId);

View file

@ -24,6 +24,7 @@
#include <QWidget>
#include "interface/rsFeedReader.h"
#include "util/FontSizeHandler.h"
namespace Ui {
class FeedReaderMessageWidget;
@ -107,6 +108,8 @@ private:
RsFeedReader *mFeedReader;
FeedReaderNotify *mNotify;
FontSizeHandler mFontSizeHandler;
Ui::FeedReaderMessageWidget *ui;
};

View file

@ -0,0 +1,142 @@
#include "ProxyWidget.h"
#include "ui_ProxyWidget.h"
ProxyWidget::ProxyWidget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::ProxyWidget)
{
ui->setupUi(this);
/* Connect signals */
connectUi(true);
connect(ui->portSpinBox, (void(QSpinBox::*)(int))&QSpinBox::valueChanged, this, &ProxyWidget::changed);
/* Initialize types */
ui->schemeComboBox->addItem("", "");
ui->schemeComboBox->addItem("HTTP", "http://");
ui->schemeComboBox->setItemData(ui->schemeComboBox->count() - 1, tr("HTTP Proxy."), Qt::ToolTipRole);
ui->schemeComboBox->addItem("HTTPS", "https://");
ui->schemeComboBox->setItemData(ui->schemeComboBox->count() - 1, tr("HTTPS Proxy."), Qt::ToolTipRole);
ui->schemeComboBox->addItem("SOCKS4", "socks4://");
ui->schemeComboBox->setItemData(ui->schemeComboBox->count() - 1, tr("SOCKS4 Proxy."), Qt::ToolTipRole);
ui->schemeComboBox->addItem("SOCKS4a", "socks4a://");
ui->schemeComboBox->setItemData(ui->schemeComboBox->count() - 1, tr("SOCKS4a Proxy. Proxy resolves URL hostname."), Qt::ToolTipRole);
ui->schemeComboBox->addItem("SOCKS5", "socks5://");
ui->schemeComboBox->setItemData(ui->schemeComboBox->count() - 1, tr("SOCKS5 Proxy."), Qt::ToolTipRole);
ui->schemeComboBox->addItem("SOCKS5h", "socks5h://");
ui->schemeComboBox->setItemData(ui->schemeComboBox->count() - 1, tr("SOCKS5 Proxy. Proxy resolves URL hostname."), Qt::ToolTipRole);
}
ProxyWidget::~ProxyWidget()
{
delete ui;
}
void ProxyWidget::connectUi(bool doConnect)
{
if (doConnect) {
if (!mAddressConnection) {
mAddressConnection = connect(ui->addressLineEdit, &QLineEdit::textChanged, this, &ProxyWidget::addressChanged);
}
if (!mSchemeConnection) {
mSchemeConnection = connect(ui->schemeComboBox, (void(QComboBox::*)(int))&QComboBox::currentIndexChanged, this, &ProxyWidget::changed);
}
} else {
if (mAddressConnection) {
disconnect(mAddressConnection);
}
if (mSchemeConnection) {
disconnect(mSchemeConnection);
}
}
}
QString ProxyWidget::address()
{
QString host = ui->addressLineEdit->text();
if (host.isEmpty()) {
return "";
}
QString value;
QString scheme = ui->schemeComboBox->currentData().toString();
if (!scheme.isEmpty()) {
value = scheme;
}
value += ui->addressLineEdit->text();
return value;
}
void ProxyWidget::setAddress(const QString &value)
{
int schemeIndex;
QString host;
splitAddress(value, schemeIndex, host);
connectUi(false);
ui->schemeComboBox->setCurrentIndex(schemeIndex);
ui->addressLineEdit->setText(host);
connectUi(true);
}
int ProxyWidget::port()
{
return ui->portSpinBox->value();
}
void ProxyWidget::setPort(int value)
{
ui->portSpinBox->setValue(value);
}
void ProxyWidget::addressChanged(const QString &value)
{
int schemeIndex;
QString host;
splitAddress(value, schemeIndex, host);
connectUi(false);
ui->schemeComboBox->setCurrentIndex(schemeIndex);
if (host != ui->addressLineEdit->text()) {
ui->addressLineEdit->setText(host);
}
connectUi(true);
emit changed();
}
void ProxyWidget::splitAddress(const QString &value, int &schemeIndex, QString &host)
{
if (value.isEmpty()) {
schemeIndex = ui->schemeComboBox->currentIndex();
host = value;
return;
}
QString scheme;
int index = value.indexOf("://");
if (index >= 0) {
scheme = value.left(index + 3);
host = value.mid(index + 3);
} else {
if (ui->schemeComboBox->currentIndex() == 0) {
// Default to HTTP
scheme = "http://";
} else {
scheme = ui->schemeComboBox->currentData().toString();
}
host = value;
}
schemeIndex = ui->schemeComboBox->findData(scheme);
if (schemeIndex < 0) {
/* Unknown scheme */
schemeIndex = 0;
host = value;
}
}

View file

@ -0,0 +1,40 @@
#ifndef PROXYWIDGET_H
#define PROXYWIDGET_H
#include <QWidget>
namespace Ui {
class ProxyWidget;
}
class ProxyWidget : public QWidget
{
Q_OBJECT
public:
explicit ProxyWidget(QWidget *parent = nullptr);
~ProxyWidget();
QString address();
void setAddress(const QString &value);
int port();
void setPort(int value);
Q_SIGNALS:
void changed();
private Q_SLOTS:
void addressChanged(const QString &value);
private:
void connectUi(bool doConnect);
void splitAddress(const QString &value, int &schemeIndex, QString &host);
private:
Ui::ProxyWidget *ui;
QMetaObject::Connection mAddressConnection;
QMetaObject::Connection mSchemeConnection;
};
#endif // PROXYWIDGET_H

View file

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ProxyWidget</class>
<widget class="QWidget" name="ProxyWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>22</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true"/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="schemeComboBox"/>
</item>
<item>
<widget class="QLineEdit" name="addressLineEdit"/>
</item>
<item>
<widget class="QLabel" name="portLabel">
<property name="text">
<string notr="true">:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="portSpinBox">
<property name="maximum">
<number>65535</number>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View file

@ -9,7 +9,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+398"/>
<location line="+377"/>
<source>Board</source>
<translation type="unfinished"></translation>
</message>
@ -34,7 +34,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-391"/>
<location line="-370"/>
<source>Authentication (not yet supported)</source>
<translation type="unfinished"></translation>
</message>
@ -59,7 +59,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+50"/>
<location line="+29"/>
<source>Update interval</source>
<translation type="unfinished"></translation>
</message>
@ -89,7 +89,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="-216"/>
<location line="-195"/>
<source>Storage time</source>
<translation type="unfinished"></translation>
</message>
@ -114,17 +114,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Server</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+200"/>
<location line="+196"/>
<source>Type</source>
<translation type="unfinished"></translation>
</message>
@ -199,7 +189,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+211"/>
<location line="+208"/>
<location line="+152"/>
<location line="+15"/>
<source>Edit feed</source>
@ -264,17 +254,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Server</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<location line="+13"/>
<source>Misc</source>
<translation type="unfinished"></translation>
</message>
@ -317,12 +297,12 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/FeedReaderDialog.cpp" line="+101"/>
<location filename="../gui/FeedReaderDialog.cpp" line="+105"/>
<source>Message Folders</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+197"/>
<location line="+199"/>
<source>New</source>
<translation type="unfinished"></translation>
</message>
@ -372,7 +352,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+241"/>
<location line="+259"/>
<source>Add new folder</source>
<translation type="unfinished"></translation>
</message>
@ -535,7 +515,7 @@
</message>
<message>
<location line="+26"/>
<location filename="../gui/FeedReaderMessageWidget.cpp" line="+117"/>
<location filename="../gui/FeedReaderMessageWidget.cpp" line="+126"/>
<source>Title</source>
<translation type="unfinished"></translation>
</message>
@ -551,6 +531,11 @@
<source>Author</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+121"/>
<source>Copy Link Location</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/FeedReaderMessageWidget.cpp" line="-2"/>
<source>Search Title</source>
@ -567,7 +552,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<location line="+16"/>
<source>Open link in browser</source>
<translation type="unfinished"></translation>
</message>
@ -577,7 +562,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+127"/>
<location line="+131"/>
<source>The messages will be added to the forum</source>
<translation type="unfinished"></translation>
</message>
@ -637,7 +622,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location line="+374"/>
<location line="+412"/>
<source>Hide</source>
<translation type="unfinished"></translation>
</message>
@ -957,4 +942,37 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProxyWidget</name>
<message>
<location filename="../gui/ProxyWidget.cpp" line="+17"/>
<source>HTTP Proxy.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>HTTPS Proxy.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>SOCKS4 Proxy.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>SOCKS4a Proxy. Proxy resolves URL hostname.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>SOCKS5 Proxy.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>SOCKS5 Proxy. Proxy resolves URL hostname.</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View file

@ -848,6 +848,22 @@ RsFeedReaderErrorState p3FeedReaderThread::process(const RsFeedReaderFeed &feed,
RsFeedReaderErrorState result = RS_FEED_ERRORSTATE_OK;
time_t minimumPubDate = 0;
if (feed.lastUpdate == 0) {
// Get all items on first scan
} else {
// Get storage time
uint32_t storageTime = 0;
if (feed.flag & RS_FEED_FLAG_STANDARD_STORAGE_TIME) {
storageTime = mFeedReader->getStandardStorageTime();
} else {
storageTime = feed.storageTime;
}
if (storageTime > 0) {
minimumPubDate = time(NULL) - storageTime;
}
}
XMLWrapper xml;
if (xml.readXML(feed.content.c_str())) {
xmlNodePtr root = xml.getRootElement();
@ -1006,6 +1022,13 @@ RsFeedReaderErrorState p3FeedReaderThread::process(const RsFeedReaderFeed &feed,
}
}
if (minimumPubDate) {
if (item->pubDate < minimumPubDate) {
// pubDate is less than storage time, don't add as new item
continue;
}
}
entries.push_back(item);
}
} else {
@ -1097,7 +1120,7 @@ RsFeedReaderErrorState p3FeedReaderThread::processMsg(const RsFeedReaderFeed &fe
std::string url;
if (feed.flag & RS_FEED_FLAG_SAVE_COMPLETE_PAGE) {
#ifdef FEEDREADER_DEBUG
std::cerr << "p3FeedReaderThread::processHTML - feed " << feed.feedId << " (" << feed.name << ") download page " << msg->link << std::endl;
std::cerr << "p3FeedReaderThread::processMsg - feed " << feed.feedId << " (" << feed.name << ") download page " << msg->link << std::endl;
#endif
std::string content;
CURLWrapper CURL(proxy);
@ -1134,7 +1157,7 @@ RsFeedReaderErrorState p3FeedReaderThread::processMsg(const RsFeedReaderFeed &fe
if (result != RS_FEED_ERRORSTATE_OK) {
#ifdef FEEDREADER_DEBUG
std::cerr << "p3FeedReaderThread::processHTML - feed " << feed.feedId << " (" << feed.name << ") cannot download page, CURLCode = " << code << ", error = " << errorString << std::endl;
std::cerr << "p3FeedReaderThread::processMsg - feed " << feed.feedId << " (" << feed.name << ") cannot download page, CURLCode = " << code << ", error = " << errorString << std::endl;
#endif
return result;
}
@ -1280,7 +1303,7 @@ RsFeedReaderErrorState p3FeedReaderThread::processMsg(const RsFeedReaderFeed &fe
if (!src.empty()) {
/* download image */
#ifdef FEEDREADER_DEBUG
std::cerr << "p3FeedReaderThread::processHTML - feed " << feed.feedId << " (" << feed.name << ") download image " << src << std::endl;
std::cerr << "p3FeedReaderThread::processMsg - feed " << feed.feedId << " (" << feed.name << ") download image " << src << std::endl;
#endif
std::vector<unsigned char> data;
CURLWrapper CURL(proxy);
@ -1348,7 +1371,7 @@ RsFeedReaderErrorState p3FeedReaderThread::processMsg(const RsFeedReaderFeed &fe
if (!html.saveHTML(msg->postedDescriptionWithoutFirstImage)) {
errorString = html.lastError();
#ifdef FEEDREADER_DEBUG
std::cerr << "p3FeedReaderThread::processHTML - feed " << feed.feedId << " (" << feed.name << ") cannot dump html" << std::endl;
std::cerr << "p3FeedReaderThread::processMsg - feed " << feed.feedId << " (" << feed.name << ") cannot dump html" << std::endl;
std::cerr << " Error: " << errorString << std::endl;
#endif
result = RS_FEED_ERRORSTATE_PROCESS_INTERNAL_ERROR;
@ -1357,7 +1380,7 @@ RsFeedReaderErrorState p3FeedReaderThread::processMsg(const RsFeedReaderFeed &fe
} else {
errorString = html.lastError();
#ifdef FEEDREADER_DEBUG
std::cerr << "p3FeedReaderThread::processHTML - feed " << feed.feedId << " (" << feed.name << ") cannot dump html" << std::endl;
std::cerr << "p3FeedReaderThread::processMsg - feed " << feed.feedId << " (" << feed.name << ") cannot dump html" << std::endl;
std::cerr << " Error: " << errorString << std::endl;
#endif
result = RS_FEED_ERRORSTATE_PROCESS_INTERNAL_ERROR;
@ -1366,14 +1389,14 @@ RsFeedReaderErrorState p3FeedReaderThread::processMsg(const RsFeedReaderFeed &fe
}
} else {
#ifdef FEEDREADER_DEBUG
std::cerr << "p3FeedReaderThread::processHTML - feed " << feed.feedId << " (" << feed.name << ") no root element" << std::endl;
std::cerr << "p3FeedReaderThread::processMsg - feed " << feed.feedId << " (" << feed.name << ") no root element" << std::endl;
#endif
result = RS_FEED_ERRORSTATE_PROCESS_HTML_ERROR;
}
} else {
errorString = html.lastError();
#ifdef FEEDREADER_DEBUG
std::cerr << "p3FeedReaderThread::processHTML - feed " << feed.feedId << " (" << feed.name << ") cannot read html" << std::endl;
std::cerr << "p3FeedReaderThread::processMsg - feed " << feed.feedId << " (" << feed.name << ") cannot read html" << std::endl;
std::cerr << " Error: " << errorString << std::endl;
#endif
result = RS_FEED_ERRORSTATE_PROCESS_HTML_ERROR;

View file

@ -37,6 +37,7 @@ QVideoInputDevice::QVideoInputDevice(QWidget *parent)
_capture_device = NULL ;
_video_processor = NULL ;
_echo_output_device = NULL ;
_image_capture = NULL;
}
QVideoInputDevice::~QVideoInputDevice()

View file

@ -8,7 +8,11 @@
#include "pgp/pgpkeyutil.h"
#include "pgp/rscertificate.h"
#ifdef USE_OPENPGPSDK
#include "pgp/openpgpsdkhandler.h"
#else
#include "pgp/rnppgphandler.h"
#endif
#include "friendserver.h"
#include "friend_server/fsitem.h"
@ -393,7 +397,11 @@ FriendServer::FriendServer(const std::string& base_dir,const std::string& listen
std::string pgp_private_keyring_path = RsDirUtil::makePath(base_dir,"pgp_private_keyring") ; // not used.
std::string pgp_trustdb_path = RsDirUtil::makePath(base_dir,"pgp_trustdb") ; // not used.
#ifdef USE_OPENPGPSDK
mPgpHandler = new OpenPGPSDKHandler(pgp_public_keyring_path,pgp_private_keyring_path,pgp_trustdb_path,pgp_lock_path);
#else
mPgpHandler = new RNPPGPHandler(pgp_public_keyring_path,pgp_private_keyring_path,pgp_trustdb_path,pgp_lock_path);
#endif
// Random bias. Should be cryptographically safe.

View file

@ -512,7 +512,7 @@ list(
src/util/misc.h
src/util/HandleRichText.h
src/util/ObjectPainter.h
src/util/QtVersion.h
src/util/RsQtVersion.h
src/util/RsFile.h
src/util/qtthreadsutils.h
src/util/ClickableLabel.h

View file

@ -2,17 +2,14 @@
README for RetroShare
=======================================================================================
RetroShare web site . . . . http://retroshare.net/index.html
RetroShare web site . . . . https://retroshare.cc/
Developer's blog . . . . . https://retroshareteam.wordpress.com
Documentation . . . . . . . https://retroshare.readthedocs.io/en/latest/
Support . . . . . . . . . . http://retroshare.net/support.html
Forums . . . . . . . . . . http://retroshare.sourceforge.net/forum/
Documentation . . . . . . . https://retrosharedocs.readthedocs.io/en/latest/
Wiki . . . . . . . . . . . https://github.com/RetroShare/documentation/wiki
Old developers site . . . . http://retroshare.sourceforge.net/wiki/index.php/Developers_Corner
Project site . . . . . . . https://github.com/RetroShare/RetroShare
Relted projects/plugins . . https://github.com/RetroShare
Related projects/plugins . .https://github.com/RetroShare
Contact: . . . . . . . . . retroshare@lunamutt.com ,defnax@users.sourceforge.net
Contact: . . . . . . . . . retroshare.project@gmail.com
=========================================================================================
Compiling RetroShare
@ -22,9 +19,9 @@ Build Scripts are avaible on GIT:
https://github.com/RetroShare/RetroShare/tree/master/build_scripts
You can find here instructions howto compile RetroShare:
https://retroshare.readthedocs.io/en/latest/developer/compilation/
https://retrosharedocs.readthedocs.io/en/latest/developer/compilation/
You can go on over to our forum or chat lobby when you have trouble with compiling:
You can go on over to our forum or chat room when you have trouble with compiling:
retroshare://forum?name=Developers%20Discussions&id=8fd22bd8f99754461e7ba1ca8a727995
retroshare://chat_room?name=Retroshare%20Devel%20%28signed%29&id=L68DB0A1E09BDA3A5
http://retroshare.sourceforge.net/forum/

View file

@ -49,7 +49,7 @@ AboutWidget::AboutWidget(QWidget* parent)
setupUi(this);
QHBoxLayout* l = new QHBoxLayout();
l->setMargin(0);
l->setContentsMargins(0, 0, 0, 0);
l->addStretch(1);
l->addStretch(1);
specialFrame->setContentsMargins(0, 0, 0, 0);
@ -142,7 +142,7 @@ void AboutWidget::updateTitle()
{
if (tWidget == NULL)
{
setWindowTitle(QString("%1 %2").arg(tr("About RetroShare"), Rshare::retroshareVersion(true)));
setWindowTitle(QString("%1 %2").arg(tr("About RetroShare"), RsApplication::retroshareVersion(true)));
}
else
{
@ -228,7 +228,7 @@ void AWidget::initImages()
#ifdef RS_ONLYHIDDENNODE
p.drawText(QPointF(10, 50), QString("%1 : %2 (With embedded Tor)").arg(tr("Retroshare version"), Rshare::retroshareVersion(true)));
#else
p.drawText(QPointF(10, 50), QString("%1 : %2").arg(tr("Retroshare version"), Rshare::retroshareVersion(true)));
p.drawText(QPointF(10, 50), QString("%1 : %2").arg(tr("Retroshare version"), RsApplication::retroshareVersion(true)));
#endif
/* Draw Qt's version number */
@ -936,7 +936,7 @@ void AboutWidget::on_copy_button_clicked()
{
QString verInfo;
QString rsVerString = "RetroShare Version: ";
rsVerString+=Rshare::retroshareVersion(true);
rsVerString+=RsApplication::retroshareVersion(true);
verInfo+=rsVerString;
#ifdef RS_ONLYHIDDENNODE
verInfo+=" " + tr("Only Hidden Node");

View file

@ -35,7 +35,7 @@
#include "settings/rsharesettings.h"
#include "util/HandleRichText.h"
#include "util/misc.h"
#include "util/QtVersion.h"
#include "util/RsQtVersion.h"
#include "retroshare/rsmsgs.h"
#include "retroshare/rspeers.h"
@ -143,28 +143,28 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
QHeaderView_setSectionResizeModeColumn(header, COLUMN_TOPIC, QHeaderView::Interactive);
privateSubLobbyItem = new RSTreeWidgetItem(compareRole, TYPE_FOLDER);
privateSubLobbyItem->setText(COLUMN_NAME, tr("Private Subscribed chat rooms"));
privateSubLobbyItem->setText(COLUMN_NAME, tr("Private Subscribed"));
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 chat rooms"));
publicSubLobbyItem->setText(COLUMN_NAME, tr("Public Subscribed"));
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 chat rooms"));
privateLobbyItem->setText(COLUMN_NAME, tr("Private"));
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 chat rooms"));
publicLobbyItem->setText(COLUMN_NAME, tr("Public"));
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);
@ -230,6 +230,8 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
int ltwH = misc::getFontSizeFactor("LobbyTreeWidget", 1.5).height();
ui.lobbyTreeWidget->setIconSize(QSize(ltwH,ltwH));
mFontSizeHandler.registerFontSize(ui.lobbyTreeWidget);
}
ChatLobbyWidget::~ChatLobbyWidget()
@ -420,7 +422,7 @@ static void updateItem(QTreeWidget *treeWidget, QTreeWidgetItem *item, ChatLobby
if(lobby_flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED)
{
tooltipstr += QObject::tr("\nSecurity: no anonymous IDs") ;
QColor foreground = QColor(0, 128, 0); // green
QColor foreground = QColor(16, 157, 0); // green
for (int column = 0; column < COLUMN_COUNT; ++column)
item->setData(column, Qt::ForegroundRole, foreground);
}
@ -721,9 +723,9 @@ void ChatLobbyWidget::updateDisplay()
}
}
publicSubLobbyItem->setHidden(publicSubLobbyItem->childCount()==0);
publicSubLobbyItem->setText(COLUMN_NAME, tr("Public Subscribed chat rooms")+ QString(" (") + QString::number(publicSubLobbyItem->childCount())+QString(")"));
publicSubLobbyItem->setText(COLUMN_NAME, tr("Public Subscribed")+ QString(" (") + QString::number(publicSubLobbyItem->childCount())+QString(")"));
privateSubLobbyItem->setHidden(privateSubLobbyItem->childCount()==0);
publicLobbyItem->setText(COLUMN_NAME, tr("Public chat rooms")+ " (" + QString::number(publicLobbyItem->childCount())+QString(")"));
publicLobbyItem->setText(COLUMN_NAME, tr("Public")+ " (" + QString::number(publicLobbyItem->childCount())+QString(")"));
}
void ChatLobbyWidget::createChatLobby()

View file

@ -25,6 +25,7 @@
#include "chat/ChatLobbyUserNotify.h"
#include "gui/gxs/GxsIdChooser.h"
#include "util/FontSizeHandler.h"
#include <retroshare/rsmsgs.h>
@ -146,6 +147,8 @@ private:
QAbstractButton* myInviteYesButton;
GxsIdChooser* myInviteIdChooser;
FontSizeHandler mFontSizeHandler;
/* UI - from Designer */
Ui::ChatLobbyWidget ui;
};

View file

@ -73,7 +73,7 @@
<widget class="QLabel" name="titleBarLabel">
<property name="font">
<font>
<pointsize>12</pointsize>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
@ -191,11 +191,6 @@
</item>
<item>
<widget class="RSTreeWidget" name="lobbyTreeWidget">
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="iconSize">
<size>
<width>16</width>
@ -464,7 +459,7 @@
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header location="global">gui/common/LineEditClear.h</header>
<header>gui/common/LineEditClear.h</header>
</customwidget>
<customwidget>
<class>RSTreeWidget</class>

View file

@ -24,6 +24,7 @@
#include "retroshare/rsfiles.h"
#include "BannedFilesDialog.h"
#include "util/DateTime.h"
#define COLUMN_FILE_NAME 0
#define COLUMN_FILE_HASH 1
@ -80,7 +81,7 @@ void BannedFilesDialog::fillFilesList()
ui.bannedFiles_TW->setItem(row, COLUMN_FILE_NAME, new QTableWidgetItem(QIcon(),QString::fromUtf8(it->second.mFilename.c_str()),0));
ui.bannedFiles_TW->setItem(row, COLUMN_FILE_HASH, new QTableWidgetItem(QIcon(),QString::fromStdString(it->first.toStdString()),0));
ui.bannedFiles_TW->setItem(row, COLUMN_FILE_SIZE, new QTableWidgetItem(QIcon(),QString::number(it->second.mSize),0));
ui.bannedFiles_TW->setItem(row, COLUMN_FILE_TIME, new QTableWidgetItem(QIcon(),QDateTime::fromTime_t(it->second.mBanTimeStamp).toString(),0));
ui.bannedFiles_TW->setItem(row, COLUMN_FILE_TIME, new QTableWidgetItem(QIcon(),DateTime::DateTimeFromTime_t(it->second.mBanTimeStamp).toString(),0));
ui.bannedFiles_TW->item(row, COLUMN_FILE_HASH)->setData(Qt::UserRole, QString::fromStdString(it->first.toStdString()));

27
retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp Normal file → Executable file
View file

@ -29,6 +29,7 @@
#include <math.h>
#include "DLListDelegate.h"
#include "util/DateTime.h"
Q_DECLARE_METATYPE(FileProgressInfo)
@ -94,7 +95,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
for(int i = 0; i < 4; ++i) {
if (fileSize < 1024) {
fileSize = index.data().toLongLong();
temp.sprintf("%.2f ", fileSize / multi);
temp = QString::asprintf("%.2f ", fileSize / multi);
temp += byteUnits[i];
break;
}
@ -102,7 +103,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
multi *= 1024.0;
}
}
painter->drawText(option.rect, Qt::AlignRight, temp);
painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp);
break;
case COLUMN_REMAINING:
remaining = index.data().toLongLong();
@ -113,7 +114,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
for(int i = 0; i < 4; ++i) {
if (remaining < 1024) {
remaining = index.data().toLongLong();
temp.sprintf("%.2f ", remaining / multi);
temp = QString::asprintf("%.2f ", remaining / multi);
temp += byteUnits[i];
break;
}
@ -121,7 +122,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
multi *= 1024.0;
}
}
painter->drawText(option.rect, Qt::AlignRight, temp);
painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp);
break;
case COLUMN_COMPLETED:
completed = index.data().toLongLong();
@ -132,7 +133,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
for(int i = 0; i < 4; ++i) {
if (completed < 1024) {
completed = index.data().toLongLong();
temp.sprintf("%.2f ", completed / multi);
temp = QString::asprintf("%.2f ", completed / multi);
temp += byteUnits[i];
break;
}
@ -140,7 +141,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
multi *= 1024.0;
}
}
painter->drawText(option.rect, Qt::AlignRight, temp);
painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp);
break;
case COLUMN_DLSPEED:
dlspeed = index.data().toDouble();
@ -148,10 +149,10 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
temp = "";
} else {
temp.clear();
temp.sprintf("%.2f", dlspeed/1024.);
temp = QString::asprintf("%.2f", dlspeed/1024.);
temp += " KB/s";
}
painter->drawText(option.rect, Qt::AlignRight, temp);
painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp);
break;
case COLUMN_PROGRESS:
{
@ -236,7 +237,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
pixmap = qvariant_cast<QIcon>(value).pixmap(option.decorationSize, option.state & QStyle::State_Enabled ? QIcon::Normal : QIcon::Disabled, option.state & QStyle::State_Open ? QIcon::On : QIcon::Off);
pixmapRect = (pixmap.isNull() ? QRect(0, 0, 0, 0): QRect(QPoint(0, 0), option.decorationSize));
if (pixmapRect.isValid()){
QPoint p = QStyle::alignedRect(option.direction, Qt::AlignLeft, pixmap.size(), option.rect).topLeft();
QPoint p = QStyle::alignedRect(option.direction, Qt::AlignLeft | Qt::AlignVCenter, pixmap.size(), option.rect).topLeft();
p.setX( p.x() + pixOffset);
painter->drawPixmap(p, pixmap);
temp = " " + temp;
@ -247,13 +248,13 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
pixmap = qvariant_cast<QIcon>(value).pixmap(option.decorationSize, option.state & QStyle::State_Enabled ? QIcon::Normal : QIcon::Disabled, option.state & QStyle::State_Open ? QIcon::On : QIcon::Off);
pixmapRect = (pixmap.isNull() ? QRect(0, 0, 0, 0): QRect(QPoint(0, 0), option.decorationSize));
if (pixmapRect.isValid()){
QPoint p = QStyle::alignedRect(option.direction, Qt::AlignLeft, pixmap.size(), option.rect).topLeft();
QPoint p = QStyle::alignedRect(option.direction, Qt::AlignLeft | Qt::AlignVCenter, pixmap.size(), option.rect).topLeft();
p.setX( p.x() + pixOffset);
painter->drawPixmap(p, pixmap);
temp = " " + temp;
pixOffset += pixmap.size().width();
}
painter->drawText(option.rect.translated(pixOffset, 0), Qt::AlignLeft, temp);
painter->drawText(option.rect.translated(pixOffset, 0), Qt::AlignLeft | Qt::AlignVCenter, temp);
}
break;
case COLUMN_LASTDL:
@ -261,7 +262,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
break;
qi64Value = index.data().value<qint64>();
if (qi64Value < std::numeric_limits<qint64>::max()){
QDateTime qdtLastDL = QDateTime::fromTime_t(qi64Value);
QDateTime qdtLastDL = DateTime::DateTimeFromTime_t(qi64Value);
painter->drawText(option.rect, Qt::AlignCenter, qdtLastDL.toString("yyyy-MM-dd_hh:mm:ss"));
} else {
painter->drawText(option.rect, Qt::AlignCenter, tr("File Never Seen"));
@ -279,7 +280,7 @@ QSize DLListDelegate::sizeHint(const QStyleOptionViewItem & option, const QModel
{
float w = QFontMetricsF(option.font).width(index.data(Qt::DisplayRole).toString());
int S = QFontMetricsF(option.font).height() ;
int S = QFontMetricsF(option.font).height()*1.5 ;
return QSize(w,S);
}

View file

@ -29,6 +29,7 @@
#include "FileTransferInfoWidget.h"
#include "gui/RetroShareLink.h"
#include "gui/common/FilesDefs.h"
#include "gui/settings/rsharesettings.h"
// Variables to decide of display behaviour. All variables are expressed as a factor of font height
//
@ -132,7 +133,13 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
int ch_num_size = ch_num_size_factor*S ;
int tab_size = tab_size_factor*S ;
painter->setPen(QColor::fromRgb(0,0,0)) ;
if (Settings->getSheetName() == ":Standard_Dark"){
penColor = Qt::gray ;
} else {
penColor = Qt::black ;
}
painter->setPen(penColor) ;
y += text_height ;
painter->drawText(0,y,tr("Chunk map") + ":") ;
y += block_sep ;
@ -176,13 +183,13 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
uint32_t sizeY = 1*S ;
y += block_sep ;
y += text_height ;
painter->setPen(QColor::fromRgb(0,0,0)) ;
painter->setPen(penColor) ;
painter->drawText(0,y,tr("Active chunks") + ":") ;
y += block_sep ;
for(uint i=0;i<info.active_chunks.size();++i)
{
painter->setPen(QColor::fromRgb(0,0,0)) ;
painter->setPen(penColor) ;
painter->drawText(0.5*S,y+text_height*0.9,QString::number(info.active_chunks[i].first)) ;
int size_of_this_chunk = ( info.active_chunks[i].first == info.chunks.size()-1 && ((info.file_size % blockSize)>0) )?(info.file_size % blockSize):blockSize ;
@ -212,7 +219,7 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
}
painter->setPen(QColor::fromRgb(0,0,0)) ;
painter->setPen(penColor) ;
float percent = (size_of_this_chunk - info.active_chunks[i].second)*100.0/size_of_this_chunk ;
painter->drawText(sizeX+5.5*S,y+text_height*0.9,QString::number(percent,'f',2) + " %") ;
@ -227,7 +234,7 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
y += block_sep ;
y += text_height ;
painter->setPen(QColor::fromRgb(0,0,0)) ;
painter->setPen(penColor) ;
painter->drawText(0,y,(info.compressed_peer_availability_maps.size() == 1 ? tr("Availability map (%1 active source)") : tr("Availability map (%1 active sources)")).arg(info.compressed_peer_availability_maps.size())) ;
y += block_sep ;
@ -254,7 +261,8 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
// various info:
//
painter->setPen(QColor::fromRgb(0,0,0)) ;
painter->setPen(penColor) ;
y += text_height ; painter->drawText(0,y,tr("File info") + ":") ;
y += block_sep ;
y += text_height ; painter->drawText(2*S,y,tr("File name") + ":") ; painter->drawText(tab_size,y,QString::fromUtf8(nfo.fname.c_str())) ;

View file

@ -24,6 +24,7 @@
#include <QWidget>
#include <QPainter>
#include <QBitmap>
#include <QColor>
#include <retroshare-gui/RsAutoUpdatePage.h>
#include <retroshare/rstypes.h>
@ -36,7 +37,7 @@ class FileTransferInfoWidget : public RsAutoUpdatePage
Q_OBJECT
public:
FileTransferInfoWidget(QWidget * parent = 0, Qt::WindowFlags f = 0 );
FileTransferInfoWidget(QWidget * parent = 0, Qt::WindowFlags f = Qt::WindowFlags() );
void setFileHash(const RsFileHash& hash) { _file_hash = hash ; }
@ -58,6 +59,7 @@ private:
QPixmap downloadingPixmap;
QPixmap notDownloadPixmap;
QPixmap checkingPixmap;
QColor penColor;
RsFileHash _file_hash ;
};

View file

@ -30,14 +30,15 @@
#include "gui/RetroShareLink.h"
#include "retroshare-gui/RsAutoUpdatePage.h"
#include "gui/msgs/MessageComposer.h"
#include "gui/common/RsCollection.h"
#include "gui/common/RsCollectionDialog.h"
#include "gui/common/FilesDefs.h"
#include "gui/common/RsUrlHandler.h"
#include "gui/settings/rsharesettings.h"
#include "gui/advsearch/advancedsearchdialog.h"
#include "gui/common/RSTreeWidgetItem.h"
#include "util/QtVersion.h"
#include "util/RsQtVersion.h"
#include "util/qtthreadsutils.h"
#include "util/misc.h"
#include <retroshare/rsfiles.h>
#include <retroshare/rsturtle.h>
@ -201,10 +202,6 @@ SearchDialog::SearchDialog(QWidget *parent)
ui.searchResultWidget->sortItems(SR_NAME_COL, Qt::AscendingOrder);
QFontMetricsF fontMetrics(ui.searchResultWidget->font());
int iconHeight = fontMetrics.height() * 1.4;
ui.searchResultWidget->setIconSize(QSize(iconHeight, iconHeight));
/* Set initial size the splitter */
QList<int> sizes;
sizes << 250 << width(); // Qt calculates the right sizes
@ -239,6 +236,8 @@ SearchDialog::SearchDialog(QWidget *parent)
RsQThreadUtils::postToObject([=](){ handleEvent_main_thread(event); }, this );
}, mEventHandlerId, RsEventType::FILE_TRANSFER );
mFontSizeHandler.registerFontSize(ui.searchSummaryWidget);
mFontSizeHandler.registerFontSize(ui.searchResultWidget, 1.4f);
}
SearchDialog::~SearchDialog()
@ -325,7 +324,7 @@ void SearchDialog::checkText(const QString& txt)
ui.searchButton->setDisabled(txt.length() < 3);
ui.searchLineFrame->setProperty("valid", (txt.length() >= 3));
ui.searchLineFrame->style()->unpolish(ui.searchLineFrame);
Rshare::refreshStyleSheet(ui.searchLineFrame, false);
RsApplication::refreshStyleSheet(ui.searchLineFrame, false);
}
void SearchDialog::initialiseFileTypeMappings()
@ -497,25 +496,23 @@ void SearchDialog::collCreate()
int selectedCount = selectedItems.size() ;
QTreeWidgetItem * item ;
for (int i = 0; i < selectedCount; ++i) {
RsFileTree tree;
for (int i = 0; i < selectedCount; ++i)
{
item = selectedItems.at(i) ;
if (!item->text(SR_HASH_COL).isEmpty()) {
if (!item->text(SR_HASH_COL).isEmpty())
{
std::string name = item->text(SR_NAME_COL).toUtf8().constData();
RsFileHash hash( item->text(SR_HASH_COL).toStdString() );
uint64_t count = item->text(SR_SIZE_COL).toULongLong();
DirDetails details;
details.name = name;
details.hash = hash;
details.size = count;
details.type = DIR_TYPE_FILE;
dirVec.push_back(details);
tree.addFile(tree.root(),name,hash,count);
}
}
RsCollection(dirVec,RS_FILE_HINTS_LOCAL).openNewColl(this);
RsCollectionDialog::openNewCollection(tree);
}
void SearchDialog::collModif()
@ -542,12 +539,8 @@ void SearchDialog::collModif()
/* open file with a suitable application */
QFileInfo qinfo;
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
collection.openColl(qinfo.absoluteFilePath());
}//if (qinfo.absoluteFilePath().endsWith(RsCollectionFile::ExtensionString))
}//if (qinfo.exists())
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
RsCollectionDialog::openExistingCollection(qinfo.absoluteFilePath());
}
void SearchDialog::collView()
@ -574,12 +567,8 @@ void SearchDialog::collView()
/* open file with a suitable application */
QFileInfo qinfo;
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
collection.openColl(qinfo.absoluteFilePath(), true);
}//if (qinfo.absoluteFilePath().endsWith(RsCollectionFile::ExtensionString))
}//if (qinfo.exists())
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
RsCollectionDialog::openExistingCollection(qinfo.absoluteFilePath(), true);
}
void SearchDialog::collOpen()
@ -597,32 +586,35 @@ void SearchDialog::collOpen()
if (rsFiles->FileDetails(hash, RS_FILE_HINTS_EXTRA | RS_FILE_HINTS_LOCAL
| RS_FILE_HINTS_BROWSABLE | RS_FILE_HINTS_NETWORK_WIDE
| RS_FILE_HINTS_SPEC_ONLY, info)) {
| RS_FILE_HINTS_SPEC_ONLY, info))
{
/* make path for downloaded files */
std::string path;
path = info.path;
/* open file with a suitable application */
QFileInfo qinfo;
RsCollection::RsCollectionErrorCode err;
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
if (collection.load(qinfo.absoluteFilePath())) {
collection.downloadFiles();
return;
}
}
}
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
RsCollectionDialog::downloadFiles(RsCollection(qinfo.absoluteFilePath(),err));
}
}
}
RsCollection collection;
if (collection.load(this)) {
collection.downloadFiles();
}//if (collection.load(this))
QString fileName;
if (!misc::getOpenFileName(nullptr, RshareSettings::LASTDIR_EXTRAFILE, QApplication::translate("RsCollectionFile", "Open collection file"), QApplication::translate("RsCollectionFile", "Collection files") + " (*." + RsCollection::ExtensionString + ")", fileName))
return ;
std::cerr << "Got file name: " << fileName.toStdString() << std::endl;
RsCollection::RsCollectionErrorCode err;
RsCollection collection(fileName, err);
if(err == RsCollection::RsCollectionErrorCode::COLLECTION_NO_ERROR)
RsCollectionDialog::downloadFiles(collection);
else
QMessageBox::information(nullptr,tr("Error open RsCollection file"),RsCollection::errorString(err));
}
void SearchDialog::downloadDirectory(const QTreeWidgetItem *item, const QString &base)
@ -906,7 +898,7 @@ void SearchDialog::searchKeywords(const QString& keywords)
if (keywords.length() < 3)
return ;
QStringList qWords = keywords.split(" ", QString::SkipEmptyParts);
QStringList qWords = keywords.split(" ", QtSkipEmptyParts);
std::list<std::string> words;
QStringListIterator qWordsIter(qWords);
while (qWordsIter.hasNext())
@ -1048,7 +1040,7 @@ void SearchDialog::insertDirectory(const QString &txt, qulonglong searchId, cons
child->setText(SR_SOURCES_COL, QString::number(1));
child->setData(SR_SOURCES_COL, ROLE_SORT, 1);
child->setTextAlignment( SR_SOURCES_COL, Qt::AlignRight );
child->setTextAlignment( SR_SOURCES_COL, Qt::AlignRight | Qt::AlignVCenter );
child->setText(SR_SEARCH_ID_COL, sid_hexa);
setIconAndType(child, QString::fromUtf8(dir.name.c_str()));
@ -1073,7 +1065,7 @@ void SearchDialog::insertDirectory(const QString &txt, qulonglong searchId, cons
child->setTextAlignment( SR_SIZE_COL, Qt::AlignRight );
child->setText(SR_SOURCES_COL, QString::number(1));
child->setData(SR_SOURCES_COL, ROLE_SORT, 1);
child->setTextAlignment( SR_SOURCES_COL, Qt::AlignRight );
child->setTextAlignment( SR_SOURCES_COL, Qt::AlignRight | Qt::AlignVCenter );
child->setText(SR_SEARCH_ID_COL, sid_hexa);
child->setText(SR_TYPE_COL, tr("Folder"));
@ -1142,7 +1134,7 @@ void SearchDialog::insertDirectory(const QString &txt, qulonglong searchId, cons
child->setTextAlignment( SR_SIZE_COL, Qt::AlignRight );
child->setText(SR_SOURCES_COL, QString::number(1));
child->setData(SR_SOURCES_COL, ROLE_SORT, 1);
child->setTextAlignment( SR_SOURCES_COL, Qt::AlignRight );
child->setTextAlignment( SR_SOURCES_COL, Qt::AlignRight | Qt::AlignVCenter );
child->setText(SR_SEARCH_ID_COL, sid_hexa);
child->setText(SR_TYPE_COL, tr("Folder"));
@ -1244,7 +1236,7 @@ void SearchDialog::insertFile(qulonglong searchId, const FileDetail& file, int s
int friendSource = 0;
int anonymousSource = 0;
QString resultCount = it->text(SR_SOURCES_COL);
QStringList modifiedResultCount = resultCount.split("/", QString::SkipEmptyParts);
QStringList modifiedResultCount = resultCount.split("/", QtSkipEmptyParts);
if(searchType == FRIEND_SEARCH)
{
friendSource = modifiedResultCount.at(0).toInt() + 1;
@ -1334,9 +1326,11 @@ void SearchDialog::insertFile(qulonglong searchId, const FileDetail& file, int s
item->setText(SR_SIZE_COL, QString::number(file.size));
item->setData(SR_SIZE_COL, ROLE_SORT, (qulonglong) file.size);
item->setText(SR_AGE_COL, QString::number(file.mtime));
item->setData(SR_AGE_COL, ROLE_SORT, file.mtime);
item->setText(SR_AGE_COL, QString::number(file.mtime));
item->setData(SR_AGE_COL, ROLE_SORT, file.mtime);
item->setTextAlignment( SR_SIZE_COL, Qt::AlignRight );
item->setTextAlignment( SR_AGE_COL, Qt::AlignCenter );
int friendSource = 0;
int anonymousSource = 0;
if(searchType == FRIEND_SEARCH)
@ -1355,7 +1349,7 @@ void SearchDialog::insertFile(qulonglong searchId, const FileDetail& file, int s
item->setText(SR_SOURCES_COL,modifiedResult);
item->setToolTip(SR_SOURCES_COL, tr("Obtained via ")+QString::fromStdString(rsPeers->getPeerName(file.id)) );
item->setData(SR_SOURCES_COL, ROLE_SORT, fltRes);
item->setTextAlignment( SR_SOURCES_COL, Qt::AlignRight );
item->setTextAlignment( SR_SOURCES_COL, Qt::AlignRight | Qt::AlignVCenter );
item->setText(SR_SEARCH_ID_COL, sid_hexa);
QColor foreground;

View file

@ -25,6 +25,7 @@
#include "retroshare/rsevents.h"
#include "ui_SearchDialog.h"
#include "retroshare-gui/mainpage.h"
#include "util/FontSizeHandler.h"
class AdvancedSearchDialog;
class RSTreeWidgetItemCompareRole;
@ -173,6 +174,8 @@ private:
QAction *collViewAct;
QAction *collOpenAct;
FontSizeHandler mFontSizeHandler;
/** Qt Designer generated object */
Ui::SearchDialog ui;

View file

@ -27,13 +27,13 @@
#include "gui/RetroShareLink.h"
#include "gui/ShareManager.h"
#include "gui/common/PeerDefs.h"
#include "gui/common/RsCollection.h"
#include "gui/common/RsCollectionDialog.h"
#include "gui/msgs/MessageComposer.h"
#include "gui/gxschannels/GxsChannelDialog.h"
#include "gui/gxsforums/GxsForumsDialog.h"
#include "gui/settings/AddFileAssociationDialog.h"
#include "gui/settings/rsharesettings.h"
#include "util/QtVersion.h"
#include "util/RsQtVersion.h"
#include "util/RsAction.h"
#include "util/misc.h"
#include "util/rstime.h"
@ -652,7 +652,7 @@ void SharedFilesDialog::copyLinks(const QModelIndexList& lst, bool remote,QList<
QString dir_name = QDir(QString::fromUtf8(details.name.c_str())).dirName();
RetroShareLink link = RetroShareLink::createFileTree(dir_name,ft->mTotalSize,ft->mTotalFiles,QString::fromStdString(ft->toRadix64())) ;
RetroShareLink link = RetroShareLink::createFileTree(dir_name,ft->totalFileSize(),ft->numFiles(),QString::fromStdString(ft->toRadix64())) ;
if(link.valid())
urls.push_back(link) ;
@ -734,7 +734,32 @@ void SharedFilesDialog::sendLinkTo()
void SharedFilesDialog::collCreate()
{
QModelIndexList lst = getSelected();
model->createCollectionFile(this, lst);
std::vector <DirDetails> dirVec;
model->getDirDetailsFromSelect(lst, dirVec);
auto RemoteMode = isRemote();
FileSearchFlags f = RemoteMode?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL ;
QString dir_name;
if(!RemoteMode)
{
if(!dirVec.empty())
{
const DirDetails& details = dirVec[0];
dir_name = QDir(QString::fromUtf8(details.name.c_str())).dirName();
}
}
RsFileTree tree;
for(uint32_t i=0;i<dirVec.size();++i)
tree.addFileTree(tree.root(),*RsFileTree::fromDirDetails(dirVec[i],RemoteMode,true));
RsCollectionDialog::openNewCollection(tree);
//auto ft = RsFileTree::fromDirDetails(details,remote);
}
void SharedFilesDialog::collModif()
@ -759,12 +784,8 @@ void SharedFilesDialog::collModif()
/* open file with a suitable application */
QFileInfo qinfo;
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
collection.openColl(qinfo.absoluteFilePath());
}
}
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
RsCollectionDialog::editExistingCollection(qinfo.absoluteFilePath());
}
void SharedFilesDialog::collView()
@ -789,12 +810,8 @@ void SharedFilesDialog::collView()
/* open file with a suitable application */
QFileInfo qinfo;
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
collection.openColl(qinfo.absoluteFilePath(), true);
}
}
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
RsCollectionDialog::openExistingCollection(qinfo.absoluteFilePath(), true);
}
void SharedFilesDialog::collOpen()
@ -821,20 +838,24 @@ void SharedFilesDialog::collOpen()
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
if (collection.load(qinfo.absoluteFilePath())) {
collection.downloadFiles();
return;
}
RsCollectionDialog::openExistingCollection(qinfo.absoluteFilePath(),true);
}
}
}
}
RsCollection collection;
if (collection.load(this)) {
collection.downloadFiles();
}
QString fileName;
if (!misc::getOpenFileName(nullptr, RshareSettings::LASTDIR_EXTRAFILE, QApplication::translate("RsCollectionFile", "Open collection file"), QApplication::translate("RsCollectionFile", "Collection files") + " (*." + RsCollection::ExtensionString + ")", fileName))
return ;
std::cerr << "Got file name: " << fileName.toStdString() << std::endl;
RsCollection::RsCollectionErrorCode err;
RsCollection collection(fileName,err);
if(err == RsCollection::RsCollectionErrorCode::COLLECTION_NO_ERROR)
RsCollectionDialog::downloadFiles(collection);
}
void LocalSharedFilesDialog::playselectedfiles()
@ -1145,12 +1166,14 @@ void LocalSharedFilesDialog::spawnCustomPopupMenu( QPoint point )
collViewAct->setEnabled(bIsRsColl);
collOpenAct->setEnabled(true);
QMenu collectionMenu(tr("Collection"), this);
QMenu collectionMenu(tr("Retroshare Collection"), this);
collectionMenu.setIcon(QIcon(IMAGE_LIBRARY));
collectionMenu.addAction(collCreateAct);
collectionMenu.addAction(collModifAct);
collectionMenu.addAction(collViewAct);
collectionMenu.addAction(collOpenAct);
if(bIsRsColl)
collectionMenu.addAction(collModifAct);
//collectionMenu.addAction(collViewAct);
//collectionMenu.addAction(collOpenAct);
switch (type) {
case DIR_TYPE_DIR :
@ -1596,7 +1619,7 @@ void SharedFilesDialog::FilterItems()
return ;
//FileSearchFlags flags = isRemote()?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL;
QStringList lst = text.split(" ",QString::SkipEmptyParts) ;
QStringList lst = text.split(" ",QtSkipEmptyParts) ;
std::list<std::string> keywords ;
for(auto it(lst.begin());it!=lst.end();++it)
@ -1688,12 +1711,16 @@ bool SharedFilesDialog::tree_FilterItem(const QModelIndex &index, const QString
void SharedFilesDialog::updateFontSize()
{
#if defined(Q_OS_DARWIN)
int customFontSize = Settings->valueFromGroup("File", "MinimumFontSize", 13).toInt();
#else
int customFontSize = Settings->valueFromGroup("File", "MinimumFontSize", 11).toInt();
#endif
QFont newFont = ui.dirTreeView->font();
if (newFont.pointSize() != customFontSize) {
newFont.setPointSize(customFontSize);
QFontMetricsF fontMetrics(newFont);
int iconHeight = fontMetrics.height();
int iconHeight = fontMetrics.height()*1.5;
ui.dirTreeView->setFont(newFont);
ui.dirTreeView->setIconSize(QSize(iconHeight, iconHeight));
}

View file

@ -23,10 +23,10 @@
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
@ -399,8 +399,8 @@ border-image: url(:/images/closepressed.png)
</customwidget>
</customwidgets>
<resources>
<include location="../images.qrc"/>
<include location="../icons.qrc"/>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>

View file

@ -24,7 +24,7 @@
#include "gui/SoundManager.h"
#include "gui/RetroShareLink.h"
#include "gui/common/FilesDefs.h"
#include "gui/common/RsCollection.h"
#include "gui/common/RsCollectionDialog.h"
#include "gui/common/RSTreeView.h"
#include "gui/common/RsUrlHandler.h"
#include "gui/FileTransfer/DetailsDialog.h"
@ -37,7 +37,7 @@
#include "gui/FileTransfer/xprogressbar.h"
#include "gui/settings/rsharesettings.h"
#include "util/misc.h"
#include "util/QtVersion.h"
#include "util/RsQtVersion.h"
#include "util/RsFile.h"
#include "util/qtthreadsutils.h"
@ -1975,7 +1975,7 @@ void TransfersDialog::pasteLink()
for(auto &it : links)
col.merge_in(it.name(),it.size(),RsFileHash(it.hash().toStdString())) ;
col.downloadFiles();
RsCollectionDialog::downloadFiles(col);
}
void TransfersDialog::getDLSelectedItems(std::set<RsFileHash> *ids, std::set<int> *rows)
@ -2466,21 +2466,17 @@ void TransfersDialog::collCreate()
std::set<RsFileHash>::iterator it ;
getDLSelectedItems(&items, NULL);
RsFileTree tree;
for (it = items.begin(); it != items.end(); ++it)
{
FileInfo info;
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_DOWNLOAD, info)) continue;
DirDetails details;
details.name = info.fname;
details.hash = info.hash;
details.size = info.size;
details.type = DIR_TYPE_FILE;
dirVec.push_back(details);
tree.addFile(tree.root(),info.fname,info.hash,info.size);
}
RsCollection(dirVec,RS_FILE_HINTS_LOCAL).openNewColl(this);
RsCollectionDialog::openNewCollection(tree);
}
void TransfersDialog::collModif()
@ -2504,12 +2500,8 @@ void TransfersDialog::collModif()
/* open collection */
QFileInfo qinfo;
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
collection.openColl(qinfo.absoluteFilePath());
}
}
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
RsCollectionDialog::openExistingCollection(qinfo.absoluteFilePath());
}
}
@ -2534,12 +2526,8 @@ void TransfersDialog::collView()
/* open collection */
QFileInfo qinfo;
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
collection.openColl(qinfo.absoluteFilePath(), true);
}
}
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
RsCollectionDialog::openExistingCollection(qinfo.absoluteFilePath(), true);
}
}
@ -2564,23 +2552,29 @@ void TransfersDialog::collOpen()
/* open file with a suitable application */
QFileInfo qinfo;
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
if (collection.load(qinfo.absoluteFilePath())) {
collection.downloadFiles();
return;
}
}
}
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
{
RsCollection::RsCollectionErrorCode code;
RsCollectionDialog::downloadFiles(RsCollection(qinfo.absoluteFilePath(),code));
return;
}
}
}
}
RsCollection collection;
if (collection.load(this)) {
collection.downloadFiles();
}
QString fileName;
if (!misc::getOpenFileName(nullptr, RshareSettings::LASTDIR_EXTRAFILE, QApplication::translate("RsCollectionFile", "Open collection file"), QApplication::translate("RsCollectionFile", "Collection files") + " (*." + RsCollection::ExtensionString + ")", fileName))
return ;
std::cerr << "Got file name: " << fileName.toStdString() << std::endl;
RsCollection::RsCollectionErrorCode code;
RsCollection collection(fileName,code);
if(code == RsCollection::RsCollectionErrorCode::COLLECTION_NO_ERROR)
RsCollectionDialog::downloadFiles(collection);
else
QMessageBox::information(nullptr,tr("Error openning collection file"),RsCollection::errorString(code));
}
void TransfersDialog::collAutoOpen(const QString &fileHash)
@ -2592,21 +2586,18 @@ void TransfersDialog::collAutoOpen(const QString &fileHash)
if (rsFiles->FileDetails(hash, RS_FILE_HINTS_DOWNLOAD, info)) {
/* make path for downloaded files */
if (info.downloadStatus == FT_STATE_COMPLETE) {
if (info.downloadStatus == FT_STATE_COMPLETE)
{
std::string path;
path = info.path + "/" + info.fname;
/* open file with a suitable application */
QFileInfo qinfo;
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
if (collection.load(qinfo.absoluteFilePath(), false)) {
collection.autoDownloadFiles();
}
}
}
RsCollection::RsCollectionErrorCode err;
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
RsCollectionDialog::downloadFiles(RsCollection(qinfo.absoluteFilePath(),err));
}
}
}

18
retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp Normal file → Executable file
View file

@ -93,7 +93,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
for(int i = 0; i < 4; ++i) {
if (fileSize < 1024) {
fileSize = index.data().toLongLong();
temp.sprintf("%.2f ", fileSize / multi);
temp = QString::asprintf("%.2f ", fileSize / multi);
temp += byteUnits[i];
break;
}
@ -101,7 +101,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
multi *= 1024.0;
}
}
painter->drawText(option.rect, Qt::AlignRight, temp);
painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp);
break;
case COLUMN_UTRANSFERRED:
transferred = index.data().toLongLong();
@ -112,7 +112,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
for(int i = 0; i < 4; ++i) {
if (transferred < 1024) {
transferred = index.data().toLongLong();
temp.sprintf("%.2f ", transferred / multi);
temp = QString::asprintf("%.2f ", transferred / multi);
temp += byteUnits[i];
break;
}
@ -120,7 +120,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
multi *= 1024.0;
}
}
painter->drawText(option.rect, Qt::AlignRight, temp);
painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp);
break;
case COLUMN_ULSPEED:
ulspeed = index.data().toDouble();
@ -128,10 +128,10 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
temp = "";
} else {
temp.clear();
temp.sprintf("%.2f", ulspeed/1024.);
temp = QString::asprintf("%.2f", ulspeed/1024.);
temp += " KB/s";
}
painter->drawText(option.rect, Qt::AlignRight, temp);
painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp);
break;
case COLUMN_UPROGRESS:
{
@ -164,10 +164,10 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
pixmap = qvariant_cast<QIcon>(value).pixmap(option.decorationSize, option.state & QStyle::State_Enabled ? QIcon::Normal : QIcon::Disabled, option.state & QStyle::State_Open ? QIcon::On : QIcon::Off);
pixmapRect = (pixmap.isNull() ? QRect(0, 0, 0, 0): QRect(QPoint(0, 0), option.decorationSize));
if (pixmapRect.isValid()){
QPoint p = QStyle::alignedRect(option.direction, Qt::AlignLeft, pixmap.size(), option.rect).topLeft();
QPoint p = QStyle::alignedRect(option.direction, Qt::AlignLeft | Qt::AlignVCenter, pixmap.size(), option.rect).topLeft();
painter->drawPixmap(p, pixmap);
}
painter->drawText(option.rect.translated(pixmap.size().width(), 0), Qt::AlignLeft, index.data().toString());
painter->drawText(option.rect.translated(pixmap.size().width(), 0), Qt::AlignLeft | Qt::AlignVCenter, index.data().toString());
break;
default:
painter->drawText(option.rect, Qt::AlignCenter, index.data().toString());
@ -181,7 +181,7 @@ QSize ULListDelegate::sizeHint(const QStyleOptionViewItem & option, const QModel
{
float w = QFontMetricsF(option.font).width(index.data(Qt::DisplayRole).toString());
int S = QFontMetricsF(option.font).height() ;
int S = QFontMetricsF(option.font).height()*1.5 ;
return QSize(w,S);
}

View file

@ -202,8 +202,8 @@ void FriendsDialog::chatMessageReceived(const ChatMessage &msg)
{
if(msg.chat_id.isBroadcast())
{
QDateTime sendTime = QDateTime::fromTime_t(msg.sendTime);
QDateTime recvTime = QDateTime::fromTime_t(msg.recvTime);
QDateTime sendTime = DateTime::DateTimeFromTime_t(msg.sendTime);
QDateTime recvTime = DateTime::DateTimeFromTime_t(msg.recvTime);
QString message = QString::fromUtf8(msg.msg.c_str());
QString name = QString::fromUtf8(rsPeers->getPeerName(msg.broadcast_peer_id).c_str());

View file

@ -102,7 +102,7 @@
<enum>Qt::NoFocus</enum>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="icons.qrc">
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
</property>
<property name="checkable">
@ -132,10 +132,10 @@
<string notr="true"/>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="headerBFrame_GL">
<property name="leftMargin">
@ -401,8 +401,8 @@
</customwidget>
</customwidgets>
<resources>
<include location="images.qrc"/>
<include location="icons.qrc"/>
<include location="images.qrc"/>
</resources>
<connections/>
</ui>

View file

@ -251,7 +251,7 @@ void GenCertDialog::initKeyList()
void GenCertDialog::mouseMoveEvent(QMouseEvent *e)
{
std::cerr << "Mouse : " << e->x() << ", " << e->y() << std::endl;
//std::cerr << "Mouse : " << e->x() << ", " << e->y() << std::endl;
QDialog::mouseMoveEvent(e) ;
}
@ -649,7 +649,7 @@ void GenCertDialog::genPerson()
{
/* complete the process */
RsInit::LoadPassword(sslPasswd);
if (Rshare::loadCertificate(sslId, false)) {
if (RsApplication::loadCertificate(sslId, false)) {
// Normally we should clear the cached passphrase as soon as possible. However,some other GUI components may still need it at start.
// (csoler) This is really bad: we have to guess that 30 secs will be enough. I have no better way to do this.

View file

@ -421,7 +421,7 @@ void GetStartedDialog::emailSupport()
sysVersion = "Linux";
#endif
#endif
text += QString("My RetroShare Configuration is: (%1, %2, %3)").arg(Rshare::retroshareVersion(true)
text += QString("My RetroShare Configuration is: (%1, %2, %3)").arg(RsApplication::retroshareVersion(true)
, sysVersion
).arg(static_cast<typename std::underlying_type<RsConfigUserLvl>::type>(userLevel)) + "\n";
text += "\n";

View file

@ -80,7 +80,7 @@ HelpDialog::HelpDialog(QWidget *parent) :
ui->thanks->setHtml(in.readAll());
}
ui->version->setText(Rshare::retroshareVersion(true));
ui->version->setText(RsApplication::retroshareVersion(true));
/* Add version numbers of libretroshare */
std::list<RsLibraryInfo> libraries;

View file

@ -27,11 +27,13 @@
#include "util/misc.h"
#include "gui/notifyqt.h"
#include "gui/common/FilesDefs.h"
#include "gui/msgs/MessageComposer.h"
#include "gui/connect/ConnectFriendWizard.h"
#include "gui/connect/ConfCertDialog.h"
#include <gui/QuickStartWizard.h>
#include "gui/connect/FriendRecommendDialog.h"
#include "settings/rsharesettings.h"
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
#include <QUrlQuery>
@ -63,6 +65,9 @@ HomePage::HomePage(QWidget *parent) :
QAction *RecAction = new QAction(QIcon(),tr("Recommend friends to each others"), this);
connect(RecAction, SIGNAL(triggered()), this, SLOT(recommendFriends()));
QAction *SaveAction = new QAction(QIcon(),tr("Save to File"), this);
connect(SaveAction, SIGNAL(triggered()), this, SLOT(saveCert()));
QAction *SendAction = new QAction(QIcon(),tr("Send via Email"), this);
connect(SendAction, SIGNAL(triggered()), this, SLOT(runEmailClient()));
@ -73,6 +78,7 @@ HomePage::HomePage(QWidget *parent) :
menu->addAction(CopyIdAction);
menu->addSeparator();
menu->addAction(SaveAction);
menu->addAction(SendAction);
menu->addAction(WebMailAction);
menu->addAction(RecAction);
@ -135,6 +141,8 @@ HomePage::HomePage(QWidget *parent) :
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> event) { handleEvent(event); }, mEventHandlerId, RsEventType::NETWORK );
updateOwnCert();
updateHomeLogo();
}
void HomePage::handleEvent(std::shared_ptr<const RsEvent> e)
@ -377,3 +385,18 @@ void HomePage::openWebHelp()
{
QDesktopServices::openUrl(QUrl(QString("https://retrosharedocs.readthedocs.io/en/latest/")));
}
void HomePage::showEvent(QShowEvent *event)
{
if (!event->spontaneous()) {
updateHomeLogo();
}
}
void HomePage::updateHomeLogo()
{
if (Settings->getSheetName() == ":Standard_Dark")
ui->label->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":images/logo/logo_web_nobackground_black.png"));
else
ui->label->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":images/logo/logo_web_nobackground.png"));
}

View file

@ -51,6 +51,8 @@ public:
void getOwnCert(QString& invite,QString& description) const;
RetroshareInviteFlags currentInviteFlags() const ;
virtual void showEvent(QShowEvent *) override;
private slots:
#ifdef DEAD_CODE
void certContextMenu(QPoint);
@ -63,7 +65,8 @@ private slots:
void addFriend();
void webMail();
void openWebHelp() ;
void recommendFriends();
void recommendFriends();
void updateHomeLogo();
private:
Ui::HomePage *ui;

View file

@ -43,7 +43,6 @@
<property name="font">
<font>
<family>Courier New</family>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
@ -88,7 +87,6 @@
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
@ -107,7 +105,7 @@
<string>...</string>
</property>
<property name="icon">
<iconset resource="images.qrc">
<iconset resource="icons.qrc">
<normaloff>:/icons/help_64.png</normaloff>:/icons/help_64.png</iconset>
</property>
<property name="checkable">
@ -233,11 +231,6 @@
</item>
<item row="1" column="0" colspan="5">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Open Source cross-platform,
private and secure decentralized communication platform.
@ -317,11 +310,6 @@ private and secure decentralized communication platform.
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
@ -405,11 +393,6 @@ private and secure decentralized communication platform.
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="text">
<string>Do you need help with Retroshare?</string>
</property>
@ -424,8 +407,8 @@ private and secure decentralized communication platform.
</layout>
</widget>
<resources>
<include location="images.qrc"/>
<include location="icons.qrc"/>
<include location="images.qrc"/>
</resources>
<connections/>
</ui>

File diff suppressed because it is too large Load diff

View file

@ -22,8 +22,10 @@
#define IDENTITYDIALOG_H
#include "gui/gxs/RsGxsUpdateBroadcastPage.h"
#include "util/FontSizeHandler.h"
#include <retroshare/rsidentity.h>
#include "retroshare/rsidentity.h"
#include "IdentityListModel.h"
#include <QTimer>
@ -34,7 +36,11 @@ class IdDialog;
}
class UIStateHelper;
class QStyledItemDelegate;
class QTreeWidgetItem;
class RsIdentityListModel;
class IdListSortFilterProxyModel;
class QItemSelection;
class IdDialog : public MainPage
{
@ -58,6 +64,7 @@ protected:
void loadIdentity(RsGxsIdGroup id_data);
void loadCircles(const std::list<RsGroupMetaData>& circle_metas);
void updateIdListRequest();
//void requestCircleGroupData(const RsGxsCircleId& circle_id);
bool getItemCircleId(QTreeWidgetItem *item,RsGxsCircleId& id) ;
@ -66,13 +73,13 @@ protected:
private slots:
void updateIdList();
void updateCircles();
void createExternalCircle();
void updateIdList();
void updateCircles();
void createExternalCircle();
void showEditExistingCircle();
void updateCirclesDisplay();
void toggleAutoBanIdentities(bool b);
void sortColumn(int col,Qt::SortOrder so);
void acceptCircleSubscription() ;
void cancelCircleSubscription() ;
@ -86,17 +93,20 @@ private slots:
void removeIdentity();
void editIdentity();
void chatIdentity();
void chatIdentityItem(QTreeWidgetItem* item);
void sendMsg();
void chatIdentityItem(const QModelIndex &indx);
void chatIdentity(const RsGxsId& toGxsId);
void sendMsg();
void copyRetroshareLink();
void on_closeInfoFrameButton_Invite_clicked();
void updateSelection();
void updateSelection(const QItemSelection &new_sel, const QItemSelection &old_sel);
void modifyReputation();
/** Create the context popup menu and it's submenus */
void IdListCustomPopupMenu( QPoint point );
void headerContextMenuRequested(QPoint);
void toggleColumnVisible();
void CircleListCustomPopupMenu(QPoint point) ;
#ifdef SUSPENDED
@ -117,7 +127,12 @@ private:
void processSettings(bool load);
QString createUsageString(const RsIdentityUsage& u) const;
void requestIdData(std::list<RsGxsGroupId> &ids);
void saveExpandedPathsAndSelection_idTreeView(std::set<QStringList> &expanded, std::set<QStringList> &selected);
void restoreExpandedPathsAndSelection_idTreeView(const std::set<QStringList>& expanded, const std::set<QStringList>& selelected);
void recursSaveExpandedItems_idTreeView(const QModelIndex& index, const QStringList& parent_path, std::set<QStringList>& expanded, std::set<QStringList>& selected);
void recursRestoreExpandedItems_idTreeView(const QModelIndex& index,const QStringList& parent_path,const std::set<QStringList>& expanded,const std::set<QStringList>& selected);
void requestIdData(std::list<RsGxsGroupId> &ids);
bool fillIdListItem(const RsGxsIdGroup& data, QTreeWidgetItem *&item, const RsPgpId &ownPgpId, int accept);
void insertIdList(uint32_t token);
void filterIds();
@ -134,20 +149,32 @@ private:
private:
UIStateHelper *mStateHelper;
QTreeWidgetItem *contactsItem;
QTreeWidgetItem *allItem;
QTreeWidgetItem *ownItem;
QTreeWidgetItem *mExternalBelongingCircleItem;
QTreeWidgetItem *mExternalOtherCircleItem;
QTreeWidgetItem *mMyCircleItem;
RsGxsUpdateBroadcastBase *mCirclesBroadcastBase ;
void saveExpandedCircleItems(std::vector<bool> &expanded_root_items, std::set<RsGxsCircleId>& expanded_circle_items) const;
int mLastSortColumn;
Qt::SortOrder mLastSortOrder;
void saveExpandedCircleItems(std::vector<bool> &expanded_root_items, std::set<RsGxsCircleId>& expanded_circle_items) const;
void restoreExpandedCircleItems(const std::vector<bool>& expanded_root_items,const std::set<RsGxsCircleId>& expanded_circle_items);
RsGxsGroupId mId;
void applyWhileKeepingTree(std::function<void()> predicate);
RsGxsId getSelectedIdentity() const;
std::list<RsGxsId> getSelectedIdentities() const;
RsGxsGroupId mId;
RsGxsGroupId mIdToNavigate;
int filter;
bool mColumnSizeAlreadySet; // remembers if we already did some size set. If not, automatically stretch to content.
QStyledItemDelegate *mElidedLabelDelegate;
QStyledItemDelegate *mReputationDelegate;
RsIdentityListModel *mIdListModel;
IdListSortFilterProxyModel *mProxyModel;
void handleEvent_main_thread(std::shared_ptr<const RsEvent> event);
RsEventsHandlerId_t mEventHandlerId_identity;
@ -157,6 +184,8 @@ private:
bool needUpdateIdsOnNextShow;
bool needUpdateCirclesOnNextShow;
FontSizeHandler mFontSizeHandler;
/* UI - Designer */
Ui::IdDialog *ui;
};

File diff suppressed because it is too large Load diff

View file

@ -700,10 +700,10 @@ void IdEditDialog::removeAvatar()
void IdEditDialog::updateInterface()
{
const QPixmap *pixmap = ui->avatarLabel->pixmap();
if (pixmap && !pixmap->isNull()) {
QPixmap pixmap = ui->avatarLabel->pixmap(Qt::ReturnByValue);
if (!pixmap.isNull()) {
ui->removeButton->setEnabled(true);
} else if (mEditGroup.mImage.mSize != NULL) {
} else if (mEditGroup.mImage.mSize > 0) {
ui->removeButton->setEnabled(true);
} else {
ui->removeButton->setEnabled(false);

View file

@ -0,0 +1,968 @@
/*******************************************************************************
* retroshare-gui/src/gui/msgs/RsFriendListModel.cpp *
* *
* Copyright 2019 by Cyril Soler <csoler@users.sourceforge.net> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#include <list>
#include <QApplication>
#include <QDateTime>
#include <QFontMetrics>
#include <QModelIndex>
#include <QTreeView>
#include <QPainter>
#include <QIcon>
#include "gui/common/AvatarDefs.h"
#include "util/qtthreadsutils.h"
#include "util/HandleRichText.h"
#include "util/DateTime.h"
#include "gui/gxs/GxsIdDetails.h"
#include "retroshare/rsexpr.h"
#include "IdentityListModel.h"
//#define DEBUG_MODEL
//#define DEBUG_MODEL_INDEX
std::ostream& operator<<(std::ostream& o, const QModelIndex& i);// defined elsewhere
const QString RsIdentityListModel::FilterString("filtered");
const uint32_t MAX_INTERNAL_DATA_UPDATE_DELAY = 300 ; // re-update the internal data every 5 mins. Should properly cover sleep/wake-up changes.
const uint32_t MAX_NODE_UPDATE_DELAY = 10 ; // re-update the internal data every 5 mins. Should properly cover sleep/wake-up changes.
static const uint32_t ID_DETAILS_UPDATE_DELAY = 5; // update each node every 5 secs.
RsIdentityListModel::RsIdentityListModel(QObject *parent)
: QAbstractItemModel(parent)
, mLastInternalDataUpdate(0), mLastNodeUpdate(0)
{
mFontSize = QApplication::font().pointSize();
mFilterStrings.clear();
mIdentityUpdateTimer = new QTimer();
connect(mIdentityUpdateTimer,SIGNAL(timeout()),this,SLOT(timerUpdate()));
}
void RsIdentityListModel::timerUpdate()
{
emit dataChanged(index(0,0,QModelIndex()),index(2,0,QModelIndex()));
}
RsIdentityListModel::EntryIndex::EntryIndex()
: type(ENTRY_TYPE_INVALID),category_index(0),identity_index(0)
{
}
// The index encodes the whole hierarchy of parents. This allows to very efficiently compute indices of the parent of an index.
//
// On 32 bits and 64 bits architectures the format is the following:
//
// 0x [2 bits] 00000 [24 bits] [2 bits]
// | | |
// | | +-------------- type (0=top level, 1=category, 2=identity)
// | +----------------------- identity index
// +-------------------------------------- category index
//
bool RsIdentityListModel::convertIndexToInternalId(const EntryIndex& e,quintptr& id)
{
// the internal id is set to the place in the table of items. We simply shift to allow 0 to mean something special.
if(e.type == ENTRY_TYPE_INVALID)
{
RsErr() << "ERROR: asked for the internal id of an invalid EntryIndex" ;
id = 0;
return true;
}
if(bool(e.identity_index >> 24))
{
RsErr() << "Cannot encode more than 2^24 identities. Somthing's wrong. e.identity_index = " << std::hex << e.identity_index << std::dec ;
id = 0;
return false;
}
id = ((0x3 & (uint32_t)e.category_index) << 30) + ((uint32_t)e.identity_index << 2) + (0x3 & (uint32_t)e.type);
return true;
}
bool RsIdentityListModel::convertInternalIdToIndex(quintptr ref,EntryIndex& e)
{
// Compatible with ref=0 since it will cause type=TOP_LEVEL
e.type = static_cast<RsIdentityListModel::EntryType>((ref >> 0) & 0x3) ;// 2 bits
e.identity_index = (ref >> 2) & 0xffffff;// 24 bits
e.category_index = (ref >> 30) & 0x3 ;// 2 bits
return true;
}
static QIcon createAvatar(const QPixmap &avatar, const QPixmap &overlay)
{
int avatarWidth = avatar.width();
int avatarHeight = avatar.height();
QPixmap pixmap(avatar);
int overlaySize = (avatarWidth > avatarHeight) ? (avatarWidth/2.5) : (avatarHeight/2.5);
int overlayX = avatarWidth - overlaySize;
int overlayY = avatarHeight - overlaySize;
QPainter painter(&pixmap);
painter.drawPixmap(overlayX, overlayY, overlaySize, overlaySize, overlay);
QIcon icon;
icon.addPixmap(pixmap);
return icon;
}
void RsIdentityListModel::preMods()
{
emit layoutAboutToBeChanged();
}
void RsIdentityListModel::postMods()
{
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(rowCount()-1,columnCount()-1,(void*)NULL));
emit layoutChanged();
}
int RsIdentityListModel::rowCount(const QModelIndex& parent) const
{
if(parent.column() >= COLUMN_THREAD_NB_COLUMNS)
return 0;
EntryIndex index;
if(!parent.isValid() || !convertInternalIdToIndex(parent.internalId(),index))
return mCategories.size();
switch(index.type)
{
case ENTRY_TYPE_CATEGORY: return mCategories[index.category_index].child_identity_indices.size();
case ENTRY_TYPE_TOP_LEVEL: return mCategories.size();
default:
return 0;
}
}
int RsIdentityListModel::columnCount(const QModelIndex &/*parent*/) const
{
return COLUMN_THREAD_NB_COLUMNS ;
}
bool RsIdentityListModel::hasChildren(const QModelIndex &parent) const
{
if(!parent.isValid())
return true;
EntryIndex parent_index ;
convertInternalIdToIndex(parent.internalId(),parent_index);
if(parent_index.type == ENTRY_TYPE_TOP_LEVEL)
return true;
if(parent_index.type == ENTRY_TYPE_IDENTITY)
return false;
if(parent_index.type == ENTRY_TYPE_CATEGORY)
return !mCategories[parent_index.category_index].child_identity_indices.empty();
return false;
}
RsIdentityListModel::EntryIndex RsIdentityListModel::EntryIndex::parent() const
{
EntryIndex i(*this);
switch(type)
{
case ENTRY_TYPE_CATEGORY: i.type = ENTRY_TYPE_TOP_LEVEL;
i.category_index = 0;
i.identity_index = 0;
break;
case ENTRY_TYPE_IDENTITY: i.type = ENTRY_TYPE_CATEGORY;
i.identity_index = 0;
break;
case ENTRY_TYPE_TOP_LEVEL:
std::cerr << "ERROR: calling parent() on entryindex with no parent!" << std::endl;
default:
//Can be when request root index.
break;
}
return i;
}
RsIdentityListModel::EntryIndex RsIdentityListModel::EntryIndex::child(int row) const
{
EntryIndex i;
switch(type)
{
case ENTRY_TYPE_TOP_LEVEL:
i.type = ENTRY_TYPE_CATEGORY;
i.category_index = row;
i.identity_index = 0;
break;
case ENTRY_TYPE_CATEGORY: i.type = ENTRY_TYPE_IDENTITY;
i.category_index = category_index;
i.identity_index = row;
break;
case ENTRY_TYPE_IDENTITY: i = EntryIndex();
std::cerr << "ERROR: calling child() on entryindex with no children!" << std::endl;
default:
break;
}
return i;
}
uint32_t RsIdentityListModel::EntryIndex::parentRow() const
{
switch(type)
{
default:
case ENTRY_TYPE_TOP_LEVEL: return -1;
case ENTRY_TYPE_CATEGORY : return -1;
case ENTRY_TYPE_IDENTITY : return category_index;
}
}
QModelIndex RsIdentityListModel::index(int row, int column, const QModelIndex& parent) const
{
if(row < 0 || column < 0 || column >= columnCount(parent) || row >= rowCount(parent))
return QModelIndex();
EntryIndex parent_index ;
convertInternalIdToIndex(parent.internalId(),parent_index);
#ifdef DEBUG_MODEL_INDEX
RsDbg() << "Index row=" << row << " col=" << column << " parent=" << parent << std::endl;
#endif
quintptr ref;
EntryIndex new_index = parent_index.child(row);
convertIndexToInternalId(new_index,ref);
#ifdef DEBUG_MODEL_INDEX
RsDbg() << " returning " << createIndex(row,column,ref) << std::endl;
#endif
return createIndex(row,column,ref);
}
QModelIndex RsIdentityListModel::parent(const QModelIndex& index) const
{
if(!index.isValid())
return QModelIndex();
EntryIndex I ;
convertInternalIdToIndex(index.internalId(),I);
EntryIndex p = I.parent();
if(p.type == ENTRY_TYPE_TOP_LEVEL)
return QModelIndex();
quintptr i;
convertIndexToInternalId(p,i);
return createIndex(I.parentRow(),0,i);
}
Qt::ItemFlags RsIdentityListModel::flags(const QModelIndex& index) const
{
if (!index.isValid())
return Qt::ItemFlags();
return QAbstractItemModel::flags(index);
}
QVariant RsIdentityListModel::headerData(int section, Qt::Orientation /*orientation*/, int role) const
{
if(role == Qt::DisplayRole)
switch(section)
{
case COLUMN_THREAD_NAME: return tr("Name");
case COLUMN_THREAD_ID: return tr("Id");
case COLUMN_THREAD_REPUTATION: return QVariant();
case COLUMN_THREAD_OWNER_ID: return tr("Owner Id");
case COLUMN_THREAD_OWNER_NAME: return tr("Owner");
default:
return QVariant();
}
if(role == Qt::DecorationRole && section == COLUMN_THREAD_REPUTATION)
return QIcon(":/icons/flag-green.png");
return QVariant();
}
QVariant RsIdentityListModel::data(const QModelIndex &index, int role) const
{
#ifdef DEBUG_MESSAGE_MODEL
std::cerr << "calling data(" << index << ") role=" << role << std::endl;
#endif
if(!index.isValid())
return QVariant();
quintptr ref = (index.isValid())?index.internalId():0 ;
#ifdef DEBUG_MESSAGE_MODEL
std::cerr << "data(" << index << ")" ;
#endif
if(!ref)
{
#ifdef DEBUG_MESSAGE_MODEL
std::cerr << " [empty]" << std::endl;
#endif
return QVariant() ;
}
EntryIndex entry;
if(!convertInternalIdToIndex(ref,entry))
{
#ifdef DEBUG_MESSAGE_MODEL
std::cerr << "Bad pointer: " << (void*)ref << std::endl;
#endif
return QVariant() ;
}
switch(role)
{
case Qt::SizeHintRole: return sizeHintRole(entry,index.column()) ;
case Qt::DisplayRole: return displayRole(entry,index.column()) ;
case Qt::FontRole: return fontRole(entry,index.column()) ;
case Qt::ForegroundRole: return foregroundRole(entry,index.column()) ;
case Qt::DecorationRole: return decorationRole(entry,index.column()) ;
case FilterRole: return filterRole(entry,index.column()) ;
case SortRole: return sortRole(entry,index.column()) ;
case TreePathRole: return treePathRole(entry,index.column()) ;
default:
return QVariant();
}
}
bool RsIdentityListModel::passesFilter(const EntryIndex& e,int /*column*/) const
{
QString s ;
if(mFilterStrings.empty() || e.type != ENTRY_TYPE_IDENTITY)
return true;
auto passes_strings = [&](const QString& s) -> bool {
bool res = true;
for(auto iter(mFilterStrings.begin()); iter != mFilterStrings.end(); ++iter)
res = res && s.contains(*iter,Qt::CaseInsensitive);
return res;
};
if((mFilterType & FilterType::FILTER_TYPE_ID) && passes_strings(displayRole(e,COLUMN_THREAD_ID ).toString())) return true;
if((mFilterType & FilterType::FILTER_TYPE_NAME) && passes_strings(displayRole(e,COLUMN_THREAD_NAME ).toString())) return true;
if((mFilterType & FilterType::FILTER_TYPE_OWNER_ID) && passes_strings(displayRole(e,COLUMN_THREAD_OWNER_ID ).toString())) return true;
if((mFilterType & FilterType::FILTER_TYPE_OWNER_NAME) && passes_strings(displayRole(e,COLUMN_THREAD_OWNER_NAME).toString())) return true;
return false;
}
QVariant RsIdentityListModel::filterRole(const EntryIndex& e,int column) const
{
if(passesFilter(e,column))
return QVariant(FilterString);
return QVariant(QString());
}
uint32_t RsIdentityListModel::updateFilterStatus(ForumModelIndex /*i*/,int /*column*/,const QStringList& /*strings*/)
{
return 0;
}
void RsIdentityListModel::setFilter(uint8_t filter_type, const QStringList& strings)
{
#ifdef DEBUG_MODEL
std::cerr << "Setting filter to filter_type=" << int(filter_type) << " and strings to " ;
foreach(const QString& str,strings)
std::cerr << "\"" << str.toStdString() << "\" " ;
std::cerr << std::endl;
#endif
preMods();
mFilterType = filter_type;
mFilterStrings = strings;
postMods();
}
QVariant RsIdentityListModel::toolTipRole(const EntryIndex& fmpe,int /*column*/) const
{
switch(fmpe.type)
{
case ENTRY_TYPE_IDENTITY:
{
auto id_info = getIdentityInfo(fmpe);
if(!id_info)
return QVariant();
if(id_info->flags & RS_IDENTITY_FLAGS_IS_DEPRECATED)
return QVariant( tr("\nThis identity has a insecure fingerprint (It's probably quite old).\nYou should get rid of it now and use a new one.\nThese identities are not supported anymore.") ) ;
if(rsIdentity->isOwnId(id_info->id))
return QVariant(tr("This identity is owned by you"));
if(id_info->owner.isNull())
return QVariant("Anonymous identity");
else
{
RsPeerDetails dd;
if(rsPeers->getGPGDetails(id_info->owner,dd))
return QVariant(tr("Identity owned by profile")+" \""+ QString::fromUtf8(dd.name.c_str()) +"\" ("+QString::fromStdString(id_info->owner.toStdString()));
else
return QVariant(tr("Identity possibly owned by unknown profile")+" \""+ QString::fromUtf8(dd.name.c_str()) +"\" ("+QString::fromStdString(id_info->owner.toStdString()));
}
}
break;
case ENTRY_TYPE_CATEGORY: ; // fallthrough
default:
return QVariant();
}
}
QVariant RsIdentityListModel::sizeHintRole(const EntryIndex& e,int col) const
{
float x_factor = QFontMetricsF(QApplication::font()).height()/14.0f ;
float y_factor = QFontMetricsF(QApplication::font()).height()/14.0f ;
if(e.type == ENTRY_TYPE_IDENTITY)
y_factor *= 1.0;
if(e.type == ENTRY_TYPE_CATEGORY)
y_factor *= 1.5;
std::cerr << "sizeHintRole()" << std::endl;
switch(col)
{
default:
case COLUMN_THREAD_REPUTATION: return QVariant( QSize(x_factor * 14 , y_factor*14*1.1f ));
case COLUMN_THREAD_NAME:
case COLUMN_THREAD_ID:
case COLUMN_THREAD_OWNER_NAME:
case COLUMN_THREAD_OWNER_ID: return QFontMetricsF(QApplication::font()).boundingRect(displayRole(e,col).toString()).size();
}
}
QString RsIdentityListModel::indexIdentifier(QModelIndex index)
{
quintptr ref = (index.isValid())?index.internalId():0 ;
#ifdef DEBUG_MESSAGE_MODEL
std::cerr << "data(" << index << ")" ;
#endif
if(!ref)
{
#ifdef DEBUG_MESSAGE_MODEL
std::cerr << " [empty]" << std::endl;
#endif
return QString();
}
EntryIndex entry;
if(!convertInternalIdToIndex(ref,entry))
return QString();
return treePathRole(entry,0).toString();
}
QVariant RsIdentityListModel::treePathRole(const EntryIndex& entry,int /*column*/) const
{
if(entry.type == ENTRY_TYPE_CATEGORY)
return QString::number((int)entry.category_index);
else
return QString::fromStdString(mIdentities[mCategories[entry.category_index].child_identity_indices[entry.identity_index]].id.toStdString());
}
QVariant RsIdentityListModel::sortRole(const EntryIndex& entry,int column) const
{
switch(column)
{
case COLUMN_THREAD_REPUTATION: return decorationRole(entry,column);
case COLUMN_THREAD_ID:
case COLUMN_THREAD_OWNER_ID:
case COLUMN_THREAD_OWNER_NAME:
case COLUMN_THREAD_NAME: [[__fallthrough__]];
default:
return displayRole(entry,column);
}
}
QModelIndex RsIdentityListModel::getIndexOfIdentity(const RsGxsId& id) const
{
for(uint i=0;i<mCategories.size();++i)
for(uint j=0;j<mCategories[i].child_identity_indices.size();++j)
if(mIdentities[mCategories[i].child_identity_indices[j]].id == id)
{
EntryIndex e;
e.category_index = i;
e.identity_index = j;
e.type = ENTRY_TYPE_IDENTITY;
quintptr idx;
convertIndexToInternalId(e,idx);
return createIndex(j,0,idx);
}
return QModelIndex();
}
QModelIndex RsIdentityListModel::getIndexOfCategory(Category id) const
{
EntryIndex e;
e.category_index = id;
e.type = ENTRY_TYPE_CATEGORY;
quintptr idx;
convertIndexToInternalId(e,idx);
return createIndex((int)id,0,idx);
}
QVariant RsIdentityListModel::foregroundRole(const EntryIndex& e, int /*col*/) const
{
auto it = getIdentityInfo(e);
if(!it)
return QVariant();
if(it->flags & RS_IDENTITY_FLAGS_IS_DEPRECATED)
return QVariant(QColor(Qt::red));
return QVariant();
}
QVariant RsIdentityListModel::fontRole(const EntryIndex& e, int /*col*/) const
{
QFont f;
f.setPointSize(mFontSize);
auto it = getIdentityInfo(e);
if(it)
{
RsGxsId id(it->id);
if(rsIdentity->isOwnId(id))
f.setBold(true);
}
return QVariant(f);
}
void RsIdentityListModel::setFontSize(int s)
{
if(s != mFontSize)
{
mFontSize = s;
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(mCategories.size()-1,columnCount()-1,(void*)NULL));
}
}
#ifdef DEBUG_MODEL_INDEX
std::cerr << " font role " << e.type << ", (" << (int)e.group_index << ","<< (int)e.profile_index << ","<< (int)e.node_index << ") col="<< col<<": " << std::endl;
#endif
#ifdef TODO
int status = onlineRole(e,col).toInt();
switch (status)
{
case RS_STATUS_INACTIVE:
{
QFont font ;
QTreeView* myParent = dynamic_cast<QTreeView*>(QAbstractItemModel::parent());
if (myParent)
font = myParent->font();
font.setBold(true);
return QVariant(font);
}
default:
return QVariant();
}
#endif
QVariant RsIdentityListModel::displayRole(const EntryIndex& e, int col) const
{
#ifdef DEBUG_MODEL_INDEX
std::cerr << " Display role " << e.type << ", (" << (int)e.group_index << ","<< (int)e.profile_index << ","<< (int)e.node_index << ") col="<< col<<": ";
#endif
switch(e.type)
{
case ENTRY_TYPE_CATEGORY:
{
const HierarchicalCategoryInformation *cat = getCategoryInfo(e);
if(!cat)
return QVariant();
switch(col)
{
case COLUMN_THREAD_NAME:
#ifdef DEBUG_MODEL_INDEX
std::cerr << group->group_info.name.c_str() ;
#endif
if(!cat->child_identity_indices.empty())
return QVariant(cat->category_name+" (" + QString::number(cat->child_identity_indices.size()) + ")");
else
return QVariant(cat->category_name);
default:
return QVariant();
}
}
break;
case ENTRY_TYPE_IDENTITY:
{
const HierarchicalIdentityInformation *idinfo = getIdentityInfo(e);
const QString loading_string = "["+tr("Loading...")+"]";
#ifdef DEBUG_MODEL_INDEX
std::cerr << profile->profile_info.name.c_str() ;
#endif
if(col == COLUMN_THREAD_ID) return QVariant(QString::fromStdString(idinfo->id.toStdString()) );
if(col == COLUMN_THREAD_REPUTATION) return QVariant();
if(idinfo->nickname.empty())
return loading_string;
switch(col)
{
case COLUMN_THREAD_NAME: return QVariant(QString::fromUtf8(idinfo->nickname.c_str()));
case COLUMN_THREAD_OWNER_NAME: if(idinfo->owner.isNull())
return QVariant();
else
return QVariant(QString::fromStdString(rsPeers->getGPGName(idinfo->owner)) );
case COLUMN_THREAD_OWNER_ID: if(idinfo->owner.isNull())
return QVariant();
else
return QVariant(QString::fromStdString(idinfo->owner.toStdString()) );
default:
return QVariant();
}
}
break;
default: //ENTRY_TYPE
return QVariant();
}
}
// This function makes sure that the internal data gets updated. They are situations where the notification system cannot
// send the information about changes, such as when the computer is put on sleep.
void RsIdentityListModel::checkInternalData(bool force)
{
rstime_t now = time(NULL);
if( (mLastInternalDataUpdate + MAX_INTERNAL_DATA_UPDATE_DELAY < now) || force)
updateIdentityList();
}
const RsIdentityListModel::HierarchicalCategoryInformation *RsIdentityListModel::getCategoryInfo(const EntryIndex& e) const
{
if(e.category_index >= mCategories.size())
return NULL ;
else
return &mCategories[e.category_index];
}
const RsIdentityListModel::HierarchicalIdentityInformation *RsIdentityListModel::getIdentityInfo(const EntryIndex& e) const
{
// First look into the relevant group, then for the correct profile in this group.
if(e.type != ENTRY_TYPE_IDENTITY)
return nullptr ;
if(e.category_index >= mCategories.size())
return nullptr ;
if(e.identity_index < mCategories[e.category_index].child_identity_indices.size())
{
auto& it(mIdentities[mCategories[e.category_index].child_identity_indices[e.identity_index]]);
rstime_t now = time(nullptr);
if(now > it.last_update_TS + ID_DETAILS_UPDATE_DELAY)
{
RsIdentityDetails det;
if(rsIdentity->getIdDetails(it.id,det))
{
it.nickname = det.mNickname;
it.owner = det.mPgpId;
it.flags = det.mFlags;
it.last_update_TS = now;
}
}
return &it;
}
else
{
RsErr() << "Inconsistent identity index!" ;
return nullptr;
}
}
QVariant RsIdentityListModel::decorationRole(const EntryIndex& entry,int col) const
{
switch(entry.type)
{
case ENTRY_TYPE_CATEGORY:
return QVariant();
case ENTRY_TYPE_IDENTITY:
{
const HierarchicalIdentityInformation *hn = getIdentityInfo(entry);
if(!hn)
return QVariant();
if(col == COLUMN_THREAD_REPUTATION)
return QVariant( static_cast<uint8_t>(rsReputations->overallReputationLevel(hn->id)) );
else if(col == COLUMN_THREAD_NAME)
{
QPixmap sslAvatar;
RsIdentityDetails details ;
if(!rsIdentity->getIdDetails(hn->id, details))
{
mIdentityUpdateTimer->stop();
mIdentityUpdateTimer->setSingleShot(true);
mIdentityUpdateTimer->start(500);
return QVariant();
}
else if(details.mAvatar.mSize == 0 || !GxsIdDetails::loadPixmapFromData(details.mAvatar.mData, details.mAvatar.mSize, sslAvatar,GxsIdDetails::LARGE))
return QVariant(QIcon(GxsIdDetails::makeDefaultIcon(hn->id,GxsIdDetails::SMALL)));
else
return QVariant(QIcon(sslAvatar));
}
else
return QVariant();
}
break;
default:
return QVariant();
}
}
void RsIdentityListModel::clear()
{
preMods();
mIdentities.clear();
mCategories.clear();
mCategories.resize(3);
mCategories[0].category_name = tr("My own identities");
mCategories[1].category_name = tr("My contacts");
mCategories[2].category_name = tr("All");
postMods();
emit friendListChanged();
}
void RsIdentityListModel::debug_dump() const
{
std::cerr << "==== IdentityListModel Debug dump ====" << std::endl;
std::cerr << "Invalid index : " << QModelIndex() << std::endl;
EntryIndex top_level;
top_level.type = ENTRY_TYPE_TOP_LEVEL;
quintptr id;
convertIndexToInternalId(top_level,id);
std::cerr << "Top level index: " << createIndex(0,0,id) << std::endl;
EntryIndex tei;
convertInternalIdToIndex(0,tei);
std::cerr << "Top level entry index: " << tei << std::endl;
for(uint32_t j=0;j<mCategories.size();++j)
{
std::cerr << mCategories[j].category_name.toStdString() << " (" << mCategories[j].child_identity_indices.size() << ")" << std::endl;
const auto& hg(mCategories[j].child_identity_indices);
for(uint32_t i=0;i<hg.size();++i)
{
auto idx = getIndexOfIdentity(mIdentities[hg[i]].id);
auto parent = idx.parent();
EntryIndex index;
EntryIndex index_parent;
convertInternalIdToIndex(idx.internalId(),index);
convertInternalIdToIndex(parent.internalId(),index_parent);
std::cerr << " " << mIdentities[hg[i]].id << " index = " << idx << " parent = " << idx.parent() << " EntryIndex: " << index << " Parent index: " << index_parent << std::endl;
}
}
std::cerr << "====================================" << std::endl;
}
RsGxsId RsIdentityListModel::getIdentity(const QModelIndex& i) const
{
if(!i.isValid())
return RsGxsId();
EntryIndex e;
if(!convertInternalIdToIndex(i.internalId(),e) || e.type != ENTRY_TYPE_IDENTITY)
return RsGxsId();
const HierarchicalIdentityInformation *gnode = getIdentityInfo(e);
if(gnode)
return gnode->id;
else
return RsGxsId();
}
RsIdentityListModel::EntryType RsIdentityListModel::getType(const QModelIndex& i) const
{
if(!i.isValid())
return ENTRY_TYPE_TOP_LEVEL;
EntryIndex e;
if(!convertInternalIdToIndex(i.internalId(),e))
return ENTRY_TYPE_TOP_LEVEL;
return e.type;
}
int RsIdentityListModel::getCategory(const QModelIndex& i) const
{
if(!i.isValid())
return CATEGORY_ALL;
EntryIndex e;
if(!convertInternalIdToIndex(i.internalId(),e))
return CATEGORY_ALL;
return e.category_index;
}
void RsIdentityListModel::setIdentities(const std::list<RsGroupMetaData>& identities_meta)
{
preMods();
beginResetModel();
clear();
for(auto id:identities_meta)
{
HierarchicalIdentityInformation idinfo;
idinfo.id = RsGxsId(id.mGroupId);
idinfo.last_update_TS = 0;// forces update
if(rsIdentity->isOwnId(idinfo.id))
mCategories[CATEGORY_OWN].child_identity_indices.push_back(mIdentities.size());
else if(rsIdentity->isARegularContact(RsGxsId(id.mGroupId)))
mCategories[CATEGORY_CTS].child_identity_indices.push_back(mIdentities.size());
else
mCategories[CATEGORY_ALL].child_identity_indices.push_back(mIdentities.size());
mIdentities.push_back(idinfo);
}
if (mCategories.size()>0)
{
beginInsertRows(QModelIndex(),0,mCategories.size()-1);
endInsertRows();
}
endResetModel();
postMods();
mLastInternalDataUpdate = time(NULL);
}
void RsIdentityListModel::updateIdentityList()
{
std::cerr << "Updating identity list" << std::endl;
std::list<RsGroupMetaData> ids ;
if(!rsIdentity->getIdentitiesSummaries(ids))
{
std::cerr << __PRETTY_FUNCTION__ << " failed to retrieve identity metadata." << std::endl;
return;
}
setIdentities(ids) ;
debug_dump();
}
void RsIdentityListModel::collapseItem(const QModelIndex& index)
{
if(getType(index) != ENTRY_TYPE_CATEGORY)
return;
EntryIndex entry;
if(!convertInternalIdToIndex(index.internalId(),entry))
return;
mExpandedCategories[entry.category_index] = false;
// apparently we cannot be subtle here.
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(mCategories.size()-1,columnCount()-1,(void*)NULL));
}
void RsIdentityListModel::expandItem(const QModelIndex& index)
{
if(getType(index) != ENTRY_TYPE_CATEGORY)
return;
EntryIndex entry;
if(!convertInternalIdToIndex(index.internalId(),entry))
return;
mExpandedCategories[entry.category_index] = true;
// apparently we cannot be subtle here.
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(mCategories.size()-1,columnCount()-1,(void*)NULL));
}

View file

@ -0,0 +1,252 @@
/*******************************************************************************
* retroshare-gui/src/gui/msgs/RsFriendListModel.h *
* *
* Copyright 2019 by Cyril Soler <csoler@users.sourceforge.net> *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
* *
*******************************************************************************/
#pragma once
#include <QModelIndex>
#include <QColor>
#include "retroshare/rsstatus.h"
#include "retroshare/rsmsgs.h"
#include "retroshare/rspeers.h"
#include "retroshare/rsidentity.h"
typedef uint32_t ForumModelIndex;
// This class is the item model used by Qt to display the information
class QTimer;
class RsIdentityListModel : public QAbstractItemModel
{
Q_OBJECT
public:
explicit RsIdentityListModel(QObject *parent = NULL);
~RsIdentityListModel(){}
enum Columns {
COLUMN_THREAD_NAME = 0x00,
COLUMN_THREAD_ID = 0x01,
COLUMN_THREAD_OWNER_NAME = 0x02,
COLUMN_THREAD_OWNER_ID = 0x03,
COLUMN_THREAD_REPUTATION = 0x04,
COLUMN_THREAD_NB_COLUMNS = 0x05
};
enum Roles{ SortRole = Qt::UserRole+1,
StatusRole = Qt::UserRole+2,
UnreadRole = Qt::UserRole+3,
FilterRole = Qt::UserRole+4,
TreePathRole = Qt::UserRole+5,
};
enum FilterType{ FILTER_TYPE_NONE = 0x00,
FILTER_TYPE_ID = 0x01,
FILTER_TYPE_NAME = 0x02,
FILTER_TYPE_OWNER_NAME = 0x04,
FILTER_TYPE_OWNER_ID = 0x08
};
enum EntryType{ ENTRY_TYPE_TOP_LEVEL = 0x00,
ENTRY_TYPE_CATEGORY = 0x01,
ENTRY_TYPE_IDENTITY = 0x02,
ENTRY_TYPE_INVALID = 0x03
};
enum Category{ CATEGORY_OWN = 0x00,
CATEGORY_CTS = 0x01,
CATEGORY_ALL = 0x02
};
struct HierarchicalCategoryInformation
{
QString category_name;
std::vector<uint32_t> child_identity_indices; // index in the array of hierarchical profiles
};
// This stores all the info that is useful avoiding a call to the more expensive getIdDetails()
//
struct HierarchicalIdentityInformation
{
rstime_t last_update_TS;
RsGxsId id;
RsPgpId owner;
uint32_t flags;
std::string nickname;
};
// This structure encodes the position of a node in the hierarchy. The type tells which of the index fields are valid.
struct EntryIndex
{
public:
EntryIndex();
EntryType type; // type of the entry (group,profile,location)
friend std::ostream& operator<<(std::ostream& o, const EntryIndex& e)
{
o << "[" ;
switch(e.type)
{
case RsIdentityListModel::ENTRY_TYPE_INVALID: o << "Invalid," ; break;
case RsIdentityListModel::ENTRY_TYPE_CATEGORY: o << "Category," ; break;
case RsIdentityListModel::ENTRY_TYPE_IDENTITY: o << "Identity," ; break;
case RsIdentityListModel::ENTRY_TYPE_TOP_LEVEL: o << "Toplevel," ; break;
}
o << " CI: " << e.category_index << ", ";
o << " II: " << e.identity_index << "]";
return o;
}
// Indices w.r.t. parent. The set of indices entirely determines the position of the entry in the hierarchy.
// An index of 0xff means "undefined"
uint16_t category_index; // index of the category in the mCategory array
uint16_t identity_index; // index of the identity in its own category
EntryIndex parent() const;
EntryIndex child(int row) const;
uint32_t parentRow() const;
};
QModelIndex root() const{ return createIndex(0,0,(void*)NULL) ;}
QModelIndex getIndexOfIdentity(const RsGxsId& id) const;
QModelIndex getIndexOfCategory(Category id) const;
void updateIdentityList();
int count() const { return mIdentities.size() ; } // total number of identities
static const QString FilterString ;
// This method will asynchroneously update the data
EntryType getType(const QModelIndex&) const;
RsGxsId getIdentity(const QModelIndex&) const;
int getCategory(const QModelIndex&) const;
void setFontSize(int s);
void setFilter(uint8_t filter_type, const QStringList& strings) ;
void expandItem(const QModelIndex&) ;
void collapseItem(const QModelIndex&) ;
// Overloaded methods from QAbstractItemModel
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
bool hasChildren(const QModelIndex &parent = QModelIndex()) const override;
QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex& child) const override;
Qt::ItemFlags flags(const QModelIndex& index) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
void clear() ;
QString indexIdentifier(QModelIndex i);
/* Color definitions (for standard see default.qss) */
QColor mTextColorGroup;
QColor mTextColorStatus[RS_STATUS_COUNT];
void setIdentities(const std::list<RsGroupMetaData>& identities_meta);
private:
const HierarchicalCategoryInformation *getCategoryInfo (const EntryIndex&) const;
const HierarchicalIdentityInformation *getIdentityInfo(const EntryIndex&) const;
void checkIdentity(HierarchicalIdentityInformation& node);
QVariant sizeHintRole (const EntryIndex& e, int col) const;
QVariant displayRole (const EntryIndex& e, int col) const;
QVariant decorationRole(const EntryIndex& e, int col) const;
QVariant toolTipRole (const EntryIndex& e, int col) const;
QVariant statusRole (const EntryIndex& e, int col) const;
QVariant sortRole (const EntryIndex& e, int col) const;
QVariant fontRole (const EntryIndex& e, int col) const;
QVariant foregroundRole(const EntryIndex& e, int col) const;
QVariant textColorRole (const EntryIndex& e, int col) const;
QVariant filterRole (const EntryIndex& e, int col) const;
QVariant treePathRole (const EntryIndex& entry,int column) const;
/*!
* \brief debug_dump
* Dumps the hierarchy of posts in the terminal, to allow checking whether the internal representation is correct.
*/
public slots:
void checkInternalData(bool force);
void debug_dump() const;
void timerUpdate();
signals:
void dataLoaded(); // emitted after the messages have been set. Can be used to updated the UI.
void friendListChanged(); // emitted after the messages have been set. Can be used to updated the UI.
void dataAboutToLoad();
private:
bool passesFilter(const EntryIndex &e, int column) const;
void preMods() ;
void postMods() ;
void *getParentRef(void *ref,int& row) const;
void *getChildRef(void *ref,int row) const;
int getChildrenCount(void *ref) const;
static bool convertIndexToInternalId(const EntryIndex& e,quintptr& ref);
static bool convertInternalIdToIndex(quintptr ref, EntryIndex& e);
uint32_t updateFilterStatus(ForumModelIndex i,int column,const QStringList& strings);
QStringList mFilterStrings;
uint8_t mFilterType;
int mFontSize;
rstime_t mLastInternalDataUpdate;
rstime_t mLastNodeUpdate;;
// The 3 vectors below store thehierarchical information for groups, profiles and locations,
// meaning which is the child/parent of which. The actual group/profile/node data are also stored in the
// structure.
mutable std::vector<HierarchicalCategoryInformation> mCategories;
mutable std::vector<HierarchicalIdentityInformation> mIdentities;
// The top level list contains all nodes to display, which type depends on the option to display groups or not.
// Idices in the list may be profile indices or group indices. In the former case the profile child index refers to
// the inde in the mProfiles tab, whereas in the the later case, the child index refers to the index of the profile in the
// group it belows to.
std::vector<EntryIndex> mTopLevel;
// keeps track of expanded/collapsed items, so as to only show icon for collapsed profiles
std::vector<bool> mExpandedCategories;
// List of identities for which getIdDetails() failed, to be requested again.
mutable QTimer *mIdentityUpdateTimer;
};

View file

@ -80,7 +80,7 @@ void LogoBar::init() {
);
QGridLayout * layout = new QGridLayout(this);
layout->setMargin(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(FillLabel1, 0, 0);

View file

@ -28,9 +28,16 @@
#include <QString>
#include <QUrl>
#include <QtDebug>
#include <QMenuBar>
#include <QActionGroup>
#include <retroshare/rsplugin.h>
#include <retroshare/rsconfig.h>
#include <util/argstream.h>
#if defined(Q_OS_DARWIN)
#include "gui/common/MacDockIconHandler.h"
#endif
#ifdef MESSENGER_WINDOW
#include "MessengerWindow.h"
@ -114,7 +121,7 @@
#include "gui/statistics/StatisticsWindow.h"
#include "gui/connect/ConnectFriendWizard.h"
#include "gui/common/RsCollection.h"
#include "gui/common/RsCollectionDialog.h"
#include "settings/rsettingswin.h"
#include "settings/rsharesettings.h"
#include "common/StatusDefs.h"
@ -206,7 +213,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
hiddenmode = true;
}
setWindowTitle(tr("RetroShare %1 a secure decentralized communication platform").arg(Rshare::retroshareVersion(true)) + " - " + nameAndLocation);
setWindowTitle(tr("RetroShare %1 a secure decentralized communication platform").arg(RsApplication::retroshareVersion(true)) + " - " + nameAndLocation);
connect(rApp, SIGNAL(newArgsReceived(QStringList)), this, SLOT(receiveNewArgs(QStringList)));
/* add url handler for RetroShare links */
@ -254,7 +261,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
QWidget *widget = new QWidget();
widget->setObjectName("trans_statusComboBoxFrame");
QHBoxLayout *hbox = new QHBoxLayout();
hbox->setMargin(0);
hbox->setContentsMargins(0, 0, 0, 0);
hbox->setSpacing(6);
hbox->addWidget(statusComboBox);
widget->setLayout(hbox);
@ -354,6 +361,8 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags)
connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
settingsChanged();
mFontSizeHandler.registerFontSize(ui->listWidget, 1.5f);
}
/** Destructor. */
@ -377,6 +386,11 @@ MainWindow::~MainWindow()
delete sysTrayStatus;
delete trayIcon;
delete trayMenu;
#if defined(Q_OS_DARWIN)
delete menuBar;
delete dockMenu;
MacDockIconHandler::cleanup();
#endif
// delete notifyMenu; // already deleted by the deletion of trayMenu
StatisticsWindow::releaseInstance();
@ -553,6 +567,11 @@ void MainWindow::addPage(MainPage *page, QActionGroup *grp, QList<QPair<MainPage
QListWidgetItem *item = new QListWidgetItem(QIcon(page->iconPixmap()),page->pageName()) ;
ui->listWidget->addItem(item) ;
#if defined(Q_OS_DARWIN)
QFont f = ui->toolBarPage->font();
action->setFont(f);
#endif
if (notify)
{
QPair<QAction*, QListWidgetItem*> pair = QPair<QAction*, QListWidgetItem*>( action, item);
@ -651,10 +670,75 @@ void MainWindow::createTrayIcon()
trayIcon->setContextMenu(trayMenu);
trayIcon->setIcon(QIcon(IMAGE_NOONLINE));
#if defined(Q_OS_DARWIN)
// Note: On macOS, the Dock icon is used to provide the tray's functionality.
MacDockIconHandler* dockIconHandler = MacDockIconHandler::instance();
connect(dockIconHandler, &MacDockIconHandler::dockIconClicked, [this] {
show();
activateWindow();
});
#endif
#if defined(Q_OS_DARWIN)
createMenuBar();
#endif
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(toggleVisibility(QSystemTrayIcon::ActivationReason)));
trayIcon->show();
}
#if defined(Q_OS_DARWIN)
/** Creates a new menubar for macOS */
void MainWindow::createMenuBar()
{
/* Mac users sure like their shortcuts. */
actionMinimize = new QAction(tr("Minimize"),this);
actionMinimize->setShortcutContext(Qt::ApplicationShortcut);
actionMinimize->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));
actionMinimize->setShortcutVisibleInContextMenu(true);
connect(actionMinimize,SIGNAL(triggered()),this,SLOT(minimizeWindow())) ;
actionCloseWindow = new QAction(tr("Close window"),this);
actionCloseWindow->setShortcutContext(Qt::ApplicationShortcut);
actionCloseWindow->setShortcut(QKeySequence::Close);
actionCloseWindow->setShortcutVisibleInContextMenu(true);
connect(actionCloseWindow,SIGNAL(triggered()),this,SLOT(closeWindow())) ;
menuBar = new QMenuBar(this);
QMenu *fileMenu = menuBar->addMenu("");
fileMenu->addAction(actionMinimize);
fileMenu->addAction(actionCloseWindow);
dockMenu = new QMenu(this);
dockMenu->setAsDockMenu();
dockMenu->addAction(tr("Open Messages"), this, SLOT(showMess()));
dockMenu->addAction(tr("Bandwidth Graph"), this, SLOT(showBandwidthGraph()));
dockMenu->addAction(tr("Statistics"), this, SLOT(showStatisticsWindow()));
dockMenu->addAction(tr("Options"), this, SLOT(showSettings()));
dockMenu->addAction(tr("Help"), this, SLOT(showHelpDialog()));
dockMenu->addSeparator();
QMenu *statusMenu = dockMenu->addMenu(tr("Status"));
initializeStatusObject(statusMenu, true);
}
#endif
#if defined(Q_OS_DARWIN)
void MainWindow::minimizeWindow()
{
setWindowState(windowState() | Qt::WindowMinimized);
}
#endif
#if defined(Q_OS_DARWIN)
void MainWindow::closeWindow()
{
// On macOS window close is basically equivalent to window hide.
close();
}
#endif
void MainWindow::showBandwidthGraph()
{
if(_bandwidthGraph == NULL)
@ -946,6 +1030,7 @@ void SetForegroundWindowInternal(HWND hWnd)
/* Show the dialog. */
raiseWindow();
/* Set the focus to the specified page. */
_instance->ui->stackPages->setCurrentPage(page);
}
@ -1178,10 +1263,91 @@ void MainWindow::doQuit()
rApp->quit();
}
// This method parses arguments passed by the operating system. All arguments
// except -r, -f, -o and lists of rscollection files and rslinks are discarded.
//
void MainWindow::receiveNewArgs(QStringList args)
{
Rshare::parseArguments(args, false);
processLastArgs();
RsInfo() << "Received new arguments from operating system call.";
std::string argstring = RsApplication::applicationFilePath().toStdString() ;
for(auto l:args)
argstring += " " + l.toStdString();
// This class does all the job at once: validate arguments, and parses them.
std::vector<std::string> links_and_files;
argstream as(argstring.c_str());
QString omValues = QString(";full;noturtle;gaming;minimal;");
std::string opModeStr;
std::string retroshare_link_url;
std::string rscollection_file;
as >> parameter('r',"rslink",retroshare_link_url,"Retroshare:// link","Retroshare link to open in Downloads " ,false)
>> parameter('f',"rsfile",rscollection_file,"file","File to open " ,false)
>> parameter('o',"opmode",opModeStr,"opmode","Set mode (Full, NoTurtle, Gaming, Minimal) " ,false)
>> values<std::string>(back_inserter(links_and_files),"links and files");
if(!as.isOk())
{
RsErr() << "Error while parsing arguments:" ;
RsErr() << as.errorLog() ;
return;
}
if(!opModeStr.empty() && omValues.contains(";"+QString::fromStdString(opModeStr).toLower()+";"))
{
QString opmode = QString::fromStdString(opModeStr).toLower();
//RsApplication::setOpMode(opModeStr.toLower()); // Do we need this??
RsInfo() << "Setting new operating mode to \"" << opmode.toStdString() << "\"";
if (opmode == "noturtle")
opModeStatus->setCurrentIndex(static_cast<typename std::underlying_type<RsOpMode>::type>(RsOpMode::NOTURTLE) - 1);
else if (opmode == "gaming")
opModeStatus->setCurrentIndex(static_cast<typename std::underlying_type<RsOpMode>::type>(RsOpMode::GAMING) - 1);
else if (opmode == "minimal")
opModeStatus->setCurrentIndex(static_cast<typename std::underlying_type<RsOpMode>::type>(RsOpMode::MINIMAL) - 1);
else if (opmode != "")
opModeStatus->setCurrentIndex(static_cast<typename std::underlying_type<RsOpMode>::type>(RsOpMode::FULL) - 1);
opModeStatus->setOpMode();
}
// Sort all collected arguments into rscollection files and retroshare links, accordingly
QStringList rscollection_files;
QList<RetroShareLink> rslinks;
auto sort = [&](const QString s) {
if(QFile(s).exists() && s.endsWith(".rscollection"))
rscollection_files.append(QString::fromUtf8(rscollection_file.c_str()));
else if(s.startsWith("retroshare://"))
{
RetroShareLink link(s);
if(link.valid())
rslinks.push_back(link);
}
};
sort(QString::fromUtf8(rscollection_file.c_str()));
sort(QString::fromUtf8(retroshare_link_url.c_str()));
for(auto s:links_and_files)
sort(QString::fromUtf8(s.c_str()));
// Now handle links and rscollection files.
for(auto file:rscollection_files)
if(file.endsWith(".rscollection"))
openRsCollection(file);
for(auto link:rslinks)
retroshareLinkActivated(link.toUrl());
}
void MainWindow::displayErrorMessage(int /*a*/,int /*b*/,const QString& error_msg)
@ -1220,7 +1386,11 @@ void MainWindow::updateMenu()
void MainWindow::toggleVisibility(QSystemTrayIcon::ActivationReason e)
{
#if defined(Q_OS_DARWIN)
if (e == QSystemTrayIcon::DoubleClick) {
#else
if (e == QSystemTrayIcon::Trigger || e == QSystemTrayIcon::DoubleClick) {
#endif
if (isHidden() || isMinimized()) {
show();
if (isMinimized()) {
@ -1544,45 +1714,9 @@ void MainWindow::retroshareLinkActivated(const QUrl &url)
void MainWindow::openRsCollection(const QString &filename)
{
QFileInfo qinfo(filename);
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
collection.openColl(qinfo.absoluteFilePath());
}
}
}
void MainWindow::processLastArgs()
{
while (!Rshare::links()->isEmpty()) {
std::cerr << "MainWindow::processLastArgs() : " << Rshare::links()->count() << std::endl;
/* Now use links from the command line, because no RetroShare was running */
RetroShareLink link(Rshare::links()->takeFirst());
if (link.valid()) {
retroshareLinkActivated(link.toUrl());
}
}
while (!Rshare::files()->isEmpty()) {
/* Now use files from the command line, because no RetroShare was running */
openRsCollection(Rshare::files()->takeFirst());
}
/* Handle the -opmode options. */
if (opModeStatus) {
QString opmode = Rshare::opmode().toLower();
if (opmode == "noturtle") {
opModeStatus->setCurrentIndex(static_cast<typename std::underlying_type<RsOpMode>::type>(RsOpMode::NOTURTLE) - 1);
} else if (opmode == "gaming") {
opModeStatus->setCurrentIndex(static_cast<typename std::underlying_type<RsOpMode>::type>(RsOpMode::GAMING) - 1);
} else if (opmode == "minimal") {
opModeStatus->setCurrentIndex(static_cast<typename std::underlying_type<RsOpMode>::type>(RsOpMode::MINIMAL) - 1);
} else if (opmode != "") {
opModeStatus->setCurrentIndex(static_cast<typename std::underlying_type<RsOpMode>::type>(RsOpMode::FULL) - 1);
}
opModeStatus->setOpMode();
} else {
std::cerr << "ERR: MainWindow::processLastArgs opModeStatus is not initialized.";
}
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
RsCollectionDialog::openExistingCollection(qinfo.absoluteFilePath());
}
void MainWindow::switchVisibilityStatus(StatusElement e,bool b)

View file

@ -27,6 +27,7 @@
#include "gui/common/rwindow.h"
#include "gui/common/RSComboBox.h"
#include "util/FontSizeHandler.h"
namespace Ui {
class MainWindow;
@ -214,7 +215,6 @@ public slots:
void externalLinkActivated(const QUrl &url);
void retroshareLinkActivated(const QUrl &url);
void openRsCollection(const QString &filename);
void processLastArgs();
//! Go to a specific part of the control panel.
void setNewPage(int page);
void setCompactStatusMode(bool compact);
@ -265,6 +265,11 @@ private slots:
void toggleVisibility(QSystemTrayIcon::ActivationReason e);
void toggleVisibilitycontextmenu();
#if defined(Q_OS_DARWIN)
void minimizeWindow();
void closeWindow();
#endif
/** Toolbar fns. */
void addFriend();
//void newRsCollection();
@ -308,6 +313,10 @@ private:
void initStackedPage();
void addPage(MainPage *page, QActionGroup *grp, QList<QPair<MainPage *, QPair<QAction *, QListWidgetItem *> > > *notify);
void createTrayIcon();
#if defined(Q_OS_DARWIN)
/** Creates a default menubar on Mac */
void createMenuBar();
#endif
void createNotifyIcons();
static MainWindow *_instance;
@ -324,6 +333,14 @@ private:
QString nameAndLocation;
#if defined(Q_OS_DARWIN)
/** The menubar (Mac OS X only). */
QMenuBar *menuBar;
QMenu *dockMenu;
QAction* actionMinimize;
QAction* actionCloseWindow;
#endif
QSystemTrayIcon *trayIcon;
QMenu *notifyMenu;
QMenu *trayMenu;
@ -355,6 +372,8 @@ private:
void setIdle(bool Idle);
bool isIdle;
FontSizeHandler mFontSizeHandler;
Ui::MainWindow *ui ;
};

View file

@ -33,11 +33,6 @@
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
@ -157,7 +152,7 @@
</action>
<action name="actionOptions">
<property name="icon">
<iconset resource="images.qrc">
<iconset>
<normaloff>:/images/kcmsystem24.png</normaloff>:/images/kcmsystem24.png</iconset>
</property>
<property name="text">

View file

@ -39,7 +39,7 @@ public slots:
protected:
/** Default Constructor */
MessengerWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0);
MessengerWindow(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags());
/** Default Destructor */
~MessengerWindow();

View file

@ -42,7 +42,7 @@
#include "connect/PGPKeyDialog.h"
#include "settings/rsharesettings.h"
#include "RetroShareLink.h"
#include "util/QtVersion.h"
#include "util/RsQtVersion.h"
#include <time.h>

View file

@ -299,7 +299,7 @@ void NewsFeed::handleChannelEvent(std::shared_ptr<const RsEvent> event)
addFeedItem(new GxsChannelPostItem(this, NEWSFEED_CHANNELNEWLIST, pe->mChannelGroupId, pe->mChannelMsgId, false, true));
break;
case RsChannelEventCode::NEW_COMMENT:
addFeedItem(new ChannelsCommentsItem(this, NEWSFEED_CHANNELNEWLIST, pe->mChannelGroupId, pe->mChannelMsgId, false, true));
addFeedItem(new ChannelsCommentsItem(this, NEWSFEED_CHANNELNEWLIST, pe->mChannelGroupId, pe->mChannelMsgId,pe->mChannelThreadId, false, true));
break;
case RsChannelEventCode::RECEIVED_PUBLISH_KEY:
addFeedItem(new GxsChannelGroupItem(this, NEWSFEED_CHANNELPUBKEYLIST, pe->mChannelGroupId, false, true));

View file

@ -70,8 +70,8 @@
<widget class="QLabel" name="titleBarLabel">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>

View file

@ -41,7 +41,7 @@
PluginManager::PluginManager()
{
baseFolder = //qApp->applicationDirPath()+"///plugins" ;
Rshare::dataDirectory() + "/plugins" ;
RsApplication::dataDirectory() + "/plugins" ;
lastError = "No error.";
viewWidget = 0;

View file

@ -22,7 +22,6 @@
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>11</pointsize>
<weight>75</weight>
<italic>true</italic>
<bold>true</bold>
@ -103,7 +102,6 @@
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>9</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
@ -114,7 +112,7 @@
</widget>
</item>
<item>
<widget class="AvatarWidget" name="avatarWidget" native="true">
<widget class="AvatarWidget" name="avatarWidget">
<property name="minimumSize">
<size>
<width>24</width>
@ -134,7 +132,6 @@
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>11</pointsize>
<weight>75</weight>
<italic>true</italic>
<bold>true</bold>
@ -150,7 +147,6 @@
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
@ -163,7 +159,6 @@
<property name="font">
<font>
<family>MS Sans Serif</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
@ -209,17 +204,17 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>AvatarWidget</class>
<extends>QLabel</extends>
<header>gui/common/AvatarWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>GxsIdLabel</class>
<extends>QLabel</extends>
<header>gui/gxs/GxsIdLabel.h</header>
</customwidget>
<customwidget>
<class>AvatarWidget</class>
<extends>QWidget</extends>
<header>gui/common/AvatarWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>AspectRatioPixmapLabel</class>
<extends>QLabel</extends>

View file

@ -44,10 +44,10 @@
<bool>false</bool>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="feedFrame_GL">
<property name="leftMargin">
@ -262,7 +262,6 @@
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
<weight>75</weight>
<italic>true</italic>
<bold>true</bold>

View file

@ -45,6 +45,7 @@
#include "util/DateTime.h"
#include "util/qtthreadsutils.h"
#include "gui/common/FilesDefs.h"
#include "util/RsQtVersion.h"
#include "gui/MainWindow.h"
@ -417,7 +418,7 @@ void PostedListWidgetWithModel::updateShowLabel()
void PostedListWidgetWithModel::filterItems(QString text)
{
QStringList lst = text.split(" ",QString::SkipEmptyParts) ;
QStringList lst = text.split(" ",QtSkipEmptyParts) ;
uint32_t count;
mPostedPostsModel->setFilter(lst,count) ;
@ -619,12 +620,13 @@ void PostedListWidgetWithModel::updateGroupData()
void PostedListWidgetWithModel::postPostLoad()
{
#ifdef DEBUG_POSTED
std::cerr << "Post channel load..." << std::endl;
#endif
whileBlocking(ui->filter_LE)->setText(QString()); //Clear it before navigate, as it will update it.
if (!mNavigatePendingMsgId.isNull())
navigate(mNavigatePendingMsgId);
#ifdef TO_REMOVE
else if( (mLastSelectedPosts.count(groupId()) > 0)
&& !mLastSelectedPosts[groupId()].isNull())
@ -639,8 +641,10 @@ void PostedListWidgetWithModel::postPostLoad()
ui->postsTree->setFocus();
}
#endif
#ifdef DEBUG_POSTED
else
std::cerr << "No pre-selected channel post." << std::endl;
#endif
updateShowLabel();
}
@ -1019,7 +1023,7 @@ void PostedListWidget::createPostItemFromMetaData(const RsGxsMsgMetaData& meta,b
post.mOlderVersions.insert(post.mMeta.mMsgId);
GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, post, true, false,post.mOlderVersions);
ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, QDateTime::fromTime_t(post.mMeta.mPublishTs));
ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(post.mMeta.mPublishTs));
return ;
}
@ -1033,12 +1037,12 @@ void PostedListWidget::createPostItemFromMetaData(const RsGxsMsgMetaData& meta,b
if (item)
{
item->setPost(post);
ui->feedWidget->setSort(item, ROLE_PUBLISH, QDateTime::fromTime_t(meta.mPublishTs));
ui->feedWidget->setSort(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(meta.mPublishTs));
}
else
{
GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, meta.mGroupId,meta.mMsgId, true, true);
ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, QDateTime::fromTime_t(post.mMeta.mPublishTs));
ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(post.mMeta.mPublishTs));
}
#ifdef TODO
ui->fileWidget->addFiles(post, related);
@ -1064,7 +1068,7 @@ void PostedListWidget::createPostItem(const RsGxsChannelPost& post, bool related
older_versions.insert(meta.mMsgId);
GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, mGroup.mMeta,meta.mMsgId, true, false,older_versions);
ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, QDateTime::fromTime_t(meta.mPublishTs));
ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(meta.mPublishTs));
return ;
}
@ -1078,12 +1082,12 @@ void PostedListWidget::createPostItem(const RsGxsChannelPost& post, bool related
if (item)
{
item->setPost(post);
ui->feedWidget->setSort(item, ROLE_PUBLISH, QDateTime::fromTime_t(meta.mPublishTs));
ui->feedWidget->setSort(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(meta.mPublishTs));
}
else
{
GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, mGroup.mMeta,meta.mMsgId, true, true);
ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, QDateTime::fromTime_t(meta.mPublishTs));
ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(meta.mPublishTs));
}
ui->fileWidget->addFiles(post, related);

View file

@ -54,7 +54,7 @@
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'.AppleSystemUIFont'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Description&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textInteractionFlags">
@ -355,10 +355,10 @@ p, li { white-space: pre-wrap; }
<item>
<widget class="QFrame" name="toolBarFrame">
<property name="frameShape">
<enum>QFrame::Box</enum>
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
@ -576,37 +576,10 @@ p, li { white-space: pre-wrap; }
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ElidedLabel</class>
<extends>QLabel</extends>
<header>gui/common/ElidedLabel.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>GxsIdChooser</class>
<extends>QComboBox</extends>
<header>gui/gxs/GxsIdChooser.h</header>
</customwidget>
<customwidget>
<class>GxsIdLabel</class>
<extends>QLabel</extends>
<header>gui/gxs/GxsIdLabel.h</header>
</customwidget>
<customwidget>
<class>LineEditClear</class>
<extends>QLineEdit</extends>
<header>gui/common/LineEditClear.h</header>
</customwidget>
<customwidget>
<class>RSComboBox</class>
<extends>QComboBox</extends>
<header>gui/common/RSComboBox.h</header>
</customwidget>
<customwidget>
<class>RSTabWidget</class>
<extends>QTabWidget</extends>
<header>gui/common/RSTabWidget.h</header>
<container>1</container>
<header location="global">gui/common/LineEditClear.h</header>
</customwidget>
<customwidget>
<class>RSTreeView</class>
@ -614,15 +587,42 @@ p, li { white-space: pre-wrap; }
<header>gui/common/RSTreeView.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>GxsIdLabel</class>
<extends>QLabel</extends>
<header>gui/gxs/GxsIdLabel.h</header>
</customwidget>
<customwidget>
<class>ElidedLabel</class>
<extends>QLabel</extends>
<header>gui/common/ElidedLabel.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>SubscribeToolButton</class>
<extends>QToolButton</extends>
<header>gui/common/SubscribeToolButton.h</header>
</customwidget>
<customwidget>
<class>RSComboBox</class>
<extends>QComboBox</extends>
<header>gui/common/RSComboBox.h</header>
</customwidget>
<customwidget>
<class>GxsIdChooser</class>
<extends>QComboBox</extends>
<header>gui/gxs/GxsIdChooser.h</header>
</customwidget>
<customwidget>
<class>RSTabWidget</class>
<extends>QTabWidget</extends>
<header>gui/common/RSTabWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="Posted_images.qrc"/>
<include location="../icons.qrc"/>
<include location="Posted_images.qrc"/>
</resources>
<connections/>
</ui>

View file

@ -25,7 +25,7 @@
#include "gui/common/RSComboBox.h"
#endif
#include "settings/rsharesettings.h"
#include "util/QtVersion.h"
#include "util/RsQtVersion.h"
#include "retroshare/rsfiles.h"
#include "retroshare/rsconfig.h"

View file

@ -88,11 +88,16 @@ class RSHumanReadableAgeDelegate: public RSHumanReadableDelegate
public:
virtual void paint(QPainter *painter,const QStyleOptionViewItem & option, const QModelIndex & index) const
{
painter->save();
QStyleOptionViewItem opt(option) ;
setPainterOptions(painter,opt,index) ;
if(index.data().toLongLong() > 0) // no date is present.
painter->drawText(opt.rect, Qt::AlignCenter, misc::timeRelativeToNow(index.data().toLongLong())) ;
if(index.data().toLongLong() > 0) { // no date is present.
painter->setFont(opt.font);
painter->drawText(opt.rect, opt.displayAlignment, misc::timeRelativeToNow(index.data().toLongLong())) ;
}
painter->restore();
}
};
@ -101,10 +106,14 @@ class RSHumanReadableSizeDelegate: public RSHumanReadableDelegate
public:
virtual void paint(QPainter *painter,const QStyleOptionViewItem & option, const QModelIndex & index) const
{
painter->save();
QStyleOptionViewItem opt(option) ;
setPainterOptions(painter,opt,index) ;
painter->drawText(opt.rect, Qt::AlignRight, misc::friendlyUnit(index.data().toULongLong()));
painter->setFont(opt.font);
painter->drawText(opt.rect, opt.displayAlignment, misc::friendlyUnit(index.data().toULongLong()));
painter->restore();
}
};

View file

@ -24,7 +24,7 @@
#include "gui/common/FilesDefs.h"
#include "gui/common/GroupDefs.h"
#include "gui/common/RsCollection.h"
#include "gui/common/RsCollectionDialog.h"
#include "gui/common/RsUrlHandler.h"
#include "gui/gxs/GxsIdDetails.h"
#include "retroshare/rsfiles.h"
@ -1233,31 +1233,6 @@ bool RetroshareDirModel::requestDirDetails(void *ref, bool remote,DirDetails& d)
return false ;
}
void RetroshareDirModel::createCollectionFile(QWidget *parent, const QModelIndexList &list)
{
/* if(RemoteMode)
{
std::cerr << "Cannot create a collection file from remote" << std::endl;
return ;
}*/
std::vector <DirDetails> dirVec;
getDirDetailsFromSelect(list, dirVec);
FileSearchFlags f = RemoteMode?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL ;
QString dir_name;
if(!RemoteMode)
{
if(!dirVec.empty())
{
const DirDetails& details = dirVec[0];
dir_name = QDir(QString::fromUtf8(details.name.c_str())).dirName();
}
}
RsCollection(dirVec,f).openNewColl(parent,dir_name);
}
void RetroshareDirModel::downloadSelected(const QModelIndexList &list,bool interactive)
{
if (!RemoteMode)
@ -1278,7 +1253,7 @@ void RetroshareDirModel::downloadSelected(const QModelIndexList &list,bool inter
FileSearchFlags f = RemoteMode?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL ;
if(interactive)
RsCollection(dirVec,f).downloadFiles() ;
RsCollectionDialog::downloadFiles(RsCollection(dirVec,f)) ;
else /* Fire off requests */
for (int i = 0, n = dirVec.size(); i < n; ++i)
{

View file

@ -68,8 +68,6 @@ class RetroshareDirModel : public QAbstractItemModel
/* Callback from GUI */
void downloadSelected(const QModelIndexList &list, bool interactive);
void createCollectionFile(QWidget *parent, const QModelIndexList &list);
void getDirDetailsFromSelect (const QModelIndexList &list, std::vector <DirDetails>& dirVec);
int getType ( const QModelIndex & index ) const ;

Some files were not shown because too many files have changed in this diff Show more