Merge branch 'RetroShare:master' into cmake-fix-qt

This commit is contained in:
defnax 2025-08-10 22:19:17 +02:00 committed by GitHub
commit b489f7cbb3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
124 changed files with 1961 additions and 848 deletions

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

@ -0,0 +1,71 @@
name: MINGW64 Qt6 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-qt6-base
mingw-w64-x86_64-qt6-multimedia
mingw-w64-x86_64-qt6
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: Build
run: |
qmake6 . -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-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

View file

@ -1,70 +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.
|===============================================================================
| Developer Documentation | image:https://deepwiki.com/badge.svg[link="https://deepwiki.com/RetroShare/RetroShare",title="Ask DeepWiki"]
|===============================================================================
.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.)

53
README.md Normal file
View file

@ -0,0 +1,53 @@
## 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)
[![MINGW64 Qt5 Build](https://github.com/RetroShare/RetroShare/actions/workflows/ci-mingw64.yml/badge.svg)](https://github.com/RetroShare/RetroShare/actions/workflows/ci-mingw64.yml)
[![UCRT64 Qt5 Build](https://github.com/RetroShare/RetroShare/actions/workflows/ci-ucrt64.yml/badge.svg)](https://github.com/RetroShare/RetroShare/actions/workflows/ci-ucrt64.yml)
[![MINGW64 Qt6 Build](https://github.com/RetroShare/RetroShare/actions/workflows/ci-mingw64-Qt6.yml/badge.svg)](https://github.com/RetroShare/RetroShare/actions/workflows/ci-mingw64-Qt6.yml)
[![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)
## Compilation on Linux
Follow this file : [Linux_InstallGuide](https://github.com/RetroShare/RetroShare/blob/master/build_scripts/Debian+Ubuntu/Linux_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

@ -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

@ -0,0 +1,171 @@
## Compilation on Linux
### Install package dependencies:
#### Debian/Ubuntu
```bash
sudo apt-get install g++ cmake libbz2-dev libjson-c-dev libssl-dev libsqlcipher-dev \
libupnp-dev libxss-dev rapidjson-dev libbotan-2-dev libasio-dev
```
To compile with Qt5:
```bash
sudo apt-get install qt5-qmake qtmultimedia5-dev qt6-5compat-dev libqt5x11extras5-dev
```
To compile with Qt6:
```bash
sudo apt-get install qt6-base-dev qt6-multimedia-dev qt6-5compat-dev
```
Additional dependencies for Feedreader plugin:
```bash
sudo apt-get install libxml2-dev libxslt1-dev libcurl4-openssl-dev
```
Additional dependencies for Voip plugin:
```bash
sudo apt-get install libavcodec-dev libcurl4-openssl-dev \
libqt5multimedia5-plugins libspeexdsp-dev
```
Autologin:
```bash
sudo apt install libsecret-1-dev
```
#### openSUSE
```bash
sudo zypper install git gcc-c++ cmake libqt5-qtbase-devel \
libqt5-qtmultimedia-devel libqt5-qtx11extras-devel libbz2-devel \
libopenssl-devel libupnp-devel libXss-devel sqlcipher-devel rapidjson-devel \
json-c botan bzip2
```
Additional packages to compile with Qt6:
```bash
sudo zypper install qt6-base-devel qt6-multimedia-devel qt6-qt5compat-devel
```
Additional dependencies for plugins:
```bash
sudo zypper install ffmpeg-4-libavcodec-devel libcurl-devel libxml2-devel \
libxslt-devel speex-devel speexdsp-devel
```
#### Linux Mint
```bash
sudo apt-get install git g++ cmake qt5-qmake qtmultimedia5-dev \
libqt5x11extras5-dev libupnp-dev libxss-dev libssl-dev libsqlcipher-dev \
rapidjson-dev doxygen libbz2-dev libjson-c-dev libbotan-2-dev libasio-dev
```
#### Arch Linux
```bash
pacman -S base-devel libgnome-keyring cmake qt5-tools qt5-multimedia qt5-x11extras \
rapidjson libupnp libxslt libxss sqlcipher botan2 bzip2 json-c
```
### Checkout the source code
```bash
cd ~
git clone https://github.com/RetroShare/RetroShare.git retroshare
```
### Checkout the submodules
```bash
cd retroshare
git submodule update --init --remote libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/
git submodule update --init --remote supportlibs/librnp supportlibs/restbed supportlibs/rapidjson
```
### Compile
```bash
qmake CONFIG+=release CONFIG+=rs_jsonapi CONFIG+=rs_webui
make
```
The executable produced will be:
```bash
./retroshare-gui/src/retroshare
```
### Install
```bash
sudo make install
```
The executable produced will be:
```bash
~/usr/bin/RetroShare
```
### For packagers
Packagers can use PREFIX and LIB\_DIR to customize the installation paths:
```bash
qmake PREFIX=/usr LIB_DIR=/usr/lib64 "CONFIG-=debug" "CONFIG+=release"
make
make INSTALL_ROOT=${PKGDIR} install
```
### libsqlcipher
If libsqlcipher is not available as a package
You need to place sqlcipher so that the hierarchy is:
~Home
|
+--- retroshare
|
+--- lib
|
+---- sqlcipher
```bash
mkdir lib
cd lib
git clone https://github.com/sqlcipher/sqlcipher.git --depth=1 --branch v3.4.1
cd sqlcipher
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
make
cd ..
```
### Build infos
For the `FeedReader` it is required to append the config option `CONFIG+=retroshare_plugins`.
Make sure `plugins/plugins.pro` contains `FeedReader` in the list of plugins to compile.
Do not mix plugins compiled with Qt5 with those compiled with Qt6. They work only if they are compiled
with the same Qt version as RetroShare.
Voip is outdated and is not compileable on the latest Debian.
For `Autologin` it is required to append the config option `CONFIG+=rs_autologin`.
### Build options
* Mandatory
* release or debug: normally you would like to use the release option
* Extra features (optional)
* rs_autologin: enable autologin
* retroshare_plugins: build plugins
* rs_webui: enable Web interface
* rs_jsonapi: enable json api interface, required by rs_webui
* gxsthewire: enable Wire service (experimental)
* wikipoos: enable Wiki service (experimental)
* rs_use_native_dialogs: enable native dialogs (may cause crashes with some versions of Gtk)
* rs_deep_channels_index: build with deep channel indexing support
* rs_deep_files_index: build with deep file indexing support
* "CONFIG+=..." enable other extra compile time features, you can find the almost complete list in file *&lt;sourcefolder&gt;\retroshare.pri*
Example:
```batch
qmake CONFIG-=debug CONFIG+=release CONFIG+=rs_use_native_dialog CONFIG+=rs_gui_cmark
qmake CONFIG+=rs_jsonapi CONFIG+=rs_webui CONFIG+=rs_autologin
qmake CONFIG+=rs_deep_channels_index CONFIG += gxsthewire CONFIG += wikipoos
```

View file

@ -0,0 +1,128 @@
## Compilation on Red Hat-based Linux
### Install package dependencies:
#### RedHat/Fedora
```bash
sudo dnf install mesa-libGL-devel gcc cmake rapidjson-devel \
libupnp openssl sqlcipher sqlcipher-devel \
botan2 botan2-devel json-c-devel bzip2-devel asio-devel libsecret libXScrnSaver-devel
```
To compile with Qt5:
```bash
sudo dnf install qt5-qtbase-devel qt5-qtmultimedia qt5-qtx11extras
```
To compile with Qt6:
```bash
sudo dnf install qt6-qtbase-devel qt6-qtmultimedia-devel qt6-qt5compat-devel
```
Additional dependencies for Feedreader plugin:
```bash
sudo dnf install libxml2-devel libxslt-devel libcurl-devel
```
### Checkout the source code
```bash
cd ~
git clone https://github.com/RetroShare/RetroShare.git retroshare
```
### Checkout the submodules
```bash
cd retroshare
git submodule update --init --remote libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/
git submodule update --init --remote supportlibs/librnp supportlibs/restbed supportlibs/rapidjson
```
### Compile
```bash
qmake CONFIG+=release CONFIG+=rs_jsonapi CONFIG+=rs_webui
make
```
The executable produced will be:
```bash
./retroshare-gui/src/retroshare
```
### Install
```bash
sudo make install
```
The executable produced will be:
```bash
~/usr/bin/RetroShare
```
### For packagers
Packagers can use PREFIX and LIB\_DIR to customize the installation paths:
```bash
qmake PREFIX=/usr LIB_DIR=/usr/lib64 "CONFIG-=debug" "CONFIG+=release"
make
make INSTALL_ROOT=${PKGDIR} install
```
### SQLCipher
If libsqlcipher is not available as a package
You need to place sqlcipher so that the hierarchy is:
~Home
|
+--- retroshare
|
+--- lib
|
+---- sqlcipher
```bash
mkdir lib
cd lib
git clone https://github.com/sqlcipher/sqlcipher.git --depth=1 --branch v3.4.1
cd sqlcipher
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
make
cd ..
```
### Build infos
For the `FeedReader` it is required to append the config option `CONFIG+=retroshare_plugins`.
Make sure `plugins/plugins.pro` contains `FeedReader` in the list of plugins to compile.
Do not mix plugins compiled with Qt5 with those compiled with Qt6. They work only if they are compiled
with the same Qt version as RetroShare.
Voip is outdated and is not compileable on the latest Debian.
For `Autologin` it is required to append the config option `CONFIG+=rs_autologin`.
### Build options
* Mandatory
* release or debug: normally you would like to use the release option
* Extra features (optional)
* rs_autologin: enable autologin
* retroshare_plugins: build plugins
* rs_webui: enable Web interface
* rs_jsonapi: enable json api interface, required by rs_webui
* gxsthewire: enable Wire service (experimental)
* wikipoos: enable Wiki service (experimental)
* rs_use_native_dialogs: enable native dialogs (may cause crashes with some versions of Gtk)
* rs_deep_channels_index: build with deep channel indexing support
* rs_deep_files_index: build with deep file indexing support
* "CONFIG+=..." enable other extra compile time features, you can find the almost complete list in file *&lt;sourcefolder&gt;\retroshare.pri*
Example:
```batch
qmake CONFIG-=debug CONFIG+=release CONFIG+=rs_use_native_dialog CONFIG+=rs_gui_cmark
qmake CONFIG+=rs_jsonapi CONFIG+=rs_webui CONFIG+=rs_autologin
qmake CONFIG+=rs_deep_channels_index CONFIG += gxsthewire CONFIG += wikipoos
```

View file

@ -45,6 +45,7 @@ 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 NSIS_PARAM=%NSIS_PARAM% /DQTVERSION=%QtVersion%
set QtMainVersion=%QtVersion:~0,1%
@ -54,7 +55,10 @@ rem makensis %NSIS_PARAM% "%SourcePath%\build_scripts\Windows-msys2\installer\re
rem pushd "%SourcePath%\build_scripts\Windows-msys2\installer"
rem %EnvMSYS2Cmd% "makensis $0 retroshare-Qt%QtMainVersion%.nsi" "%NSIS_PARAM%"
rem popd
"%RsMinGWPath%\bin\makensis" %NSIS_PARAM% "%SourcePath%\build_scripts\Windows-msys2\installer\retroshare-Qt%QtMainVersion%.nsi"
rem Currently no need for separate nsi files
rem "%RsMinGWPath%\bin\makensis" %NSIS_PARAM% "%SourcePath%\build_scripts\Windows-msys2\installer\retroshare-Qt%QtMainVersion%.nsi"
"%RsMinGWPath%\bin\makensis" %NSIS_PARAM% "%SourcePath%\build_scripts\Windows-msys2\installer\retroshare.nsi"
exit /B %ERRORLEVEL%

View file

@ -15,9 +15,11 @@ call "%~dp0env-base.bat" %*
if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [Prerequisites]
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"
%EnvMSYS2Cmd% "pacman --noconfirm --needed -S make git mingw-w64-%RsMSYS2Architecture%-toolchain mingw-w64-%RsMSYS2Architecture%-qt%ParamQtVersion% 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"
@ -53,7 +55,7 @@ echo.
echo === Version
echo.
title Build - %SourceName%-%RsBuildConfig% [Version]
title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [Version]
pushd "%SourcePath%\retroshare-gui\src\gui\images"
:: Touch resource file
@ -67,7 +69,7 @@ echo.
echo === qmake
echo.
title Build - %SourceName%-%RsBuildConfig% [qmake]
title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [qmake]
set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=%RsBuildConfig%"
if "%ParamAutologin%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=rs_autologin"
@ -83,9 +85,9 @@ echo %RsToolchain% >> buildinfo.txt
call "%ToolsPath%\msys2-path.bat" "%SourcePath%" MSYS2SourcePath
call "%ToolsPath%\msys2-path.bat" "%EnvMSYS2Path%" MSYS2EnvMSYS2Path
if "%ClangCompiler%"=="1" (
%EnvMSYS2Cmd% "qmake "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-clang-g++ %RS_QMAKE_CONFIG%"
%EnvMSYS2Cmd% "%QMakeCmd% "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-clang-g++ %RS_QMAKE_CONFIG%"
) else (
%EnvMSYS2Cmd% "qmake "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-g++ %RS_QMAKE_CONFIG%"
%EnvMSYS2Cmd% "%QMakeCmd% "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-g++ %RS_QMAKE_CONFIG%"
)
if errorlevel 1 goto error
@ -93,7 +95,7 @@ echo.
echo === make
echo.
title Build - %SourceName%-%RsBuildConfig% [make]
title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [make]
%EnvMSYS2Cmd% "make -j %CoreCount%"
if errorlevel 1 goto error

View file

@ -12,7 +12,9 @@ set ParamNoupdate=0
set CoreCount=%NUMBER_OF_PROCESSORS%
set RS_QMAKE_CONFIG=
set RsToolchain=
set ParamQtVersion=5
set tcc=0
set QtVersionCount=0
:parameter_loop
if "%~1" NEQ "" (
@ -43,6 +45,12 @@ if "%~1" NEQ "" (
set /A tcc=tcc+1
) else if "%%~a"=="release" (
set ParamRelease=1
) else if "%%~a"=="qt5" (
set ParamQtVersion=5
set /A QtVersionCount+=1
) else if "%%~a"=="qt6" (
set ParamQtVersion=6
set /A QtVersionCount+=1
) else if "%%~a"=="debug" (
set ParamDebug=1
) else if "%%~a"=="autologin" (
@ -78,6 +86,16 @@ if %tcc% NEQ 1 (
goto :usage
)
if %QtVersionCount% GTR 1 (
echo Multiple Qt versions specified
goto :usage
)
if "%ParamQtVersion%" NEQ "5" if "%ParamQtVersion%" NEQ "6" (
echo Wrong Qt version specified
goto :usage
)
if "%RsToolchain%"=="mingw32" (
set RsArchitecture=x86
set RsMSYS2Architecture=i686
@ -140,7 +158,7 @@ exit /B 0
:usage
echo.
echo Usage: 32^|64^|other release^|debug [autologin plugins webui singlethread clang indexing friendserver noupdate] ["CONFIG+=..."]
echo Usage: 32^|64^|other release^|debug qt5^|qt6 [autologin plugins webui singlethread clang indexing friendserver noupdate] ["CONFIG+=..."]
echo.
echo Mandatory parameter
echo 32^|64 32-bit or 64-bit version (same as mingw32 or mingw64)
@ -148,6 +166,7 @@ echo Or you can specify any other toolchain supported by msys
echo mingw32^|mingw64^|clang32^|clang64^|ucrt64^|clangarm64
echo More info: https://www.msys2.org/docs/environments
echo release^|debug Build release or debug version
echo qt5^|qt6 Build with Qt 5 (default) or Qt 6
echo.
echo Optional parameter (need clean when changed)
echo autologin Build with autologin

View file

@ -1,6 +1,6 @@
call "%~dp0env-base.bat" %*
if errorlevel 2 exit /B 2
if errorlevel 1 goto error_env
if errorlevel 1 exit /B 1
set BuildPath=%EnvRootPath%\builds
set DeployPath=%EnvRootPath%\deploy
@ -8,8 +8,14 @@ set DeployPath=%EnvRootPath%\deploy
if not exist "%BuildPath%" mkdir "%BuildPath%"
if not exist "%DeployPath%" mkdir "%DeployPath%"
set QMakeCmd=
if "%ParamQtVersion%"=="5" set QMakeCmd=qmake
if "%ParamQtVersion%"=="6" set QMakeCmd=qmake6
if "%QMakeCmd%"=="" %cecho% error "Unknown Qt version %ParamQtVersion%." & exit /B 1
:: Get Qt version
call "%ToolsPath%\get-qt-version.bat" QtVersion
call "%ToolsPath%\get-qt-version.bat" QtVersion %QMakeCmd%
if errorlevel 1 %cecho% error "Cannot get Qt version." & exit /B 1
if "%QtVersion%"=="" %cecho% error "Cannot get Qt version." & exit /B 1
set RsMinGWPath=%EnvMSYS2BasePath%\%RsToolchain%

View file

@ -55,25 +55,28 @@ 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%\
rem Qt 4 = QtSvg4.dll
rem Qt 5 = Qt5Svg.dll
rem Qt 6 = Qt6Svg.dll
set QtMainVersion1=
set QtMainVersion2=
if "%QtMainVersion%"=="4" set QtMainVersion2=4
if "%QtMainVersion%"=="5" set QtMainVersion1=5
if "%QtMainVersion%"=="6" set QtMainVersion1=6
if "%RsBuildConfig%" NEQ "release" (
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsToolchain%-msys2%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-Qt-%QtVersion%-%RsToolchain%-msys2%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z
) else (
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsToolchain%-msys2%RsType%%RsArchiveAdd%.7z
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-Qt-%QtVersion%-%RsToolchain%-msys2%RsType%%RsArchiveAdd%.7z
)
if exist "%Archive%" del /Q "%Archive%"
@ -81,7 +84,7 @@ if exist "%Archive%" del /Q "%Archive%"
:: Create deploy path
mkdir "%RsDeployPath%"
title Pack - %SourceName%%RsType%-%RsBuildConfig% [copy files]
title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [copy files]
set ExtensionsFile=%SourcePath%\libretroshare\src\rsserver\rsinit.cc
set Extensions=
@ -118,18 +121,24 @@ for /D %%D in ("%RsBuildPath%\plugins\*") do (
echo copy Qt DLL's
copy "%RsMinGWPath%\bin\Qt%QtMainVersion1%Svg%QtMainVersion2%.dll" "%RsDeployPath%" %Quite%
if "%QtMainVersion%"=="5" (
if %QtMainVersion% GEQ 5 (
mkdir "%RsDeployPath%\platforms"
copy "%QtSharePath%\plugins\platforms\qwindows.dll" "%RsDeployPath%\platforms" %Quite%
)
if "%QtMainVersion%"=="5" (
mkdir "%RsDeployPath%\audio"
copy "%QtSharePath%\plugins\audio\qtaudio_windows.dll" "%RsDeployPath%\audio" %Quite%
)
if exist "%QtSharePath%\plugins\styles\qwindowsvistastyle.dll" (
echo copy styles
mkdir "%RsDeployPath%\styles" %Quite%
echo copy styles
mkdir "%RsDeployPath%\styles" %Quite%
if "%QtMainVersion%"=="5" (
copy "%QtSharePath%\plugins\styles\qwindowsvistastyle.dll" "%RsDeployPath%\styles" %Quite%
)
if "%QtMainVersion%"=="6" (
copy "%QtSharePath%\plugins\styles\qmodernwindowsstyle.dll" "%RsDeployPath%\styles" %Quite%
)
copy "%QtSharePath%\plugins\imageformats\*.dll" "%RsDeployPath%\imageformats" %Quite%
del /Q "%RsDeployPath%\imageformats\*d?.dll" %Quite%
@ -170,11 +179,13 @@ xcopy /S "%SourcePath%\retroshare-gui\src\license" "%RsDeployPath%\license" %Qui
echo copy translation
copy "%SourcePath%\retroshare-gui\src\translations\qt_tr.qm" "%RsDeployPath%\translations" %Quite%
copy "%QtSharePath%\translations\qt_*.qm" "%RsDeployPath%\translations" %Quite%
if "%QtMainVersion%"=="5" (
if "%QtMainVersion%"=="6" (
copy "%QtSharePath%\translations\qtbase_*.qm" "%RsDeployPath%\translations" %Quite%
copy "%QtSharePath%\translations\qtscript_*.qm" "%RsDeployPath%\translations" %Quite%
copy "%QtSharePath%\translations\qtquick1_*.qm" "%RsDeployPath%\translations" %Quite%
copy "%QtSharePath%\translations\qtmultimedia_*.qm" "%RsDeployPath%\translations" %Quite%
)
if "%QtMainVersion%"=="5" (
copy "%QtSharePath%\translations\qtscript_*.qm" "%RsDeployPath%\translations" %Quite%
copy "%QtSharePath%\translations\qtxmlpatterns_*.qm" "%RsDeployPath%\translations" %Quite%
)
@ -199,7 +210,7 @@ if "%ParamWebui%"=="1" (
)
rem pack files
title Pack - %SourceName%%RsType%-%RsBuildConfig% [pack files]
title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [pack files]
"%EnvSevenZipExe%" a -mx=9 -t7z "%Archive%" "%RsDeployPath%\*"

View file

@ -16,7 +16,7 @@ if "%~1"=="clean" (
goto exit
)
set MSYS2Version=20241208
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

@ -76,7 +76,7 @@ ${!defineifexist} TOR_EXISTS "${DEPLOYDIR}\tor.exe"
# Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-${TOOLCHAIN}-msys2${RSTYPE}${INSTALLERADD}-setup.exe"
OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-Qt-${QTVERSION}-${TOOLCHAIN}-msys2${RSTYPE}${INSTALLERADD}-setup.exe"
BrandingText "${APPNAMEANDVERSION}"
RequestExecutionlevel highest
# Use compression

View file

@ -44,8 +44,9 @@ Run the scripts in this order:
**Always delete the build artifacts folder if you enable or disable extra features after the build command: &lt;sourcefolder&gt;-msys2\deploy\builds**
* Mandatory
* 32 or 64: 32 or 64 bit version
* 32, 64, mingw32, mingw64, ucrt64, clang32, clang64 or clangarm64: It sets the msys2 build environment to the selected value. 32 is a shortcut for mingw32, 64 is a shortcut for mingw64. Default in build.bat and buil-tor.bat is 64.
* release or debug: normally you would like to use the release option
* qt5 or qt6: build with Qt 5 (default) or Qt 6
* Extra features (optional)
* autologin: enable autologin
* plugins: build plugins

View file

@ -1,5 +1,5 @@
:: Usage:
:: call get-qt-version.bat variable
:: call get-qt-version.bat variable qmake
setlocal
@ -10,9 +10,16 @@ if "%Var%"=="" (
exit /B 1
)
set QMakeCmd=%~2
if "%QMakeCmd%"=="" (
echo.
echo Parameter error.
exit /B 1
)
set QtVersion=
%EnvMSYS2Cmd% "qmake -version" >"%~dp0qtversion.tmp"
%EnvMSYS2Cmd% "%QMakeCmd% -version" >"%~dp0qtversion.tmp"
for /F "tokens=1,2,3,4" %%A in (%~sdp0qtversion.tmp) do (
if "%%A"=="Using" (
set QtVersion=%%D

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

@ -11,7 +11,6 @@ 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.6
RAPIDJSON_VERSION=1.1.0
XAPIAN_VERSION=1.4.29
@ -26,7 +25,7 @@ DOWNLOAD_PATH?=download
BUILD_PATH=build
LIBS_PATH?=libs
all: dirs zlib bzip2 miniupnpc openssl speex speexdsp libxml curl sqlcipher libmicrohttpd ffmpeg rapidjson xapian jsonc botan asio copylibs
all: dirs zlib bzip2 miniupnpc openssl speex speexdsp libxml curl sqlcipher ffmpeg rapidjson xapian jsonc botan asio copylibs
#rnp
download: \
@ -41,7 +40,6 @@ download: \
$(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.xz \
$(DOWNLOAD_PATH)/rapidjson-$(RAPIDJSON_VERSION).tar.gz \
$(DOWNLOAD_PATH)/xapian-core-$(XAPIAN_VERSION).tar.xz
@ -65,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/
@ -88,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/
@ -108,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/
@ -133,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/
@ -162,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/
@ -183,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/
@ -217,11 +214,11 @@ $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION) $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION
# 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 libxml2.la
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
cd libxslt-$(LIBXSLT_VERSION)/libexslt && make
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/
@ -253,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)/lib && 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/
@ -278,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/
@ -298,22 +295,6 @@ $(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.xz:
@ -325,7 +306,7 @@ $(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION): $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION
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)
@ -363,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/
@ -383,7 +364,7 @@ $(BUILD_PATH)/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 install
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)
@ -398,7 +379,7 @@ $(BUILD_PATH)/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 install
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)

View file

@ -33,7 +33,7 @@ echo.
echo === Version
echo.
title Build - %SourceName%-%RsBuildConfig% [Version]
title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion%-%GCCArchitecture% [Version]
pushd "%SourcePath%\retroshare-gui\src\gui\images"
:: Touch resource file
@ -47,7 +47,7 @@ echo.
echo === qmake
echo.
title Build - %SourceName%-%RsBuildConfig% [qmake]
title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion%-%GCCArchitecture% [qmake]
set RS_QMAKE_CONFIG=%RsBuildConfig%
if "%ParamAutologin%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% rs_autologin
@ -66,7 +66,7 @@ echo.
echo === make
echo.
title Build - %SourceName%-%RsBuildConfig% [make]
title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion%-%GCCArchitecture% [make]
mingw32-make -j %CoreCount%
if errorlevel 1 goto error
@ -75,7 +75,7 @@ echo.
echo === Changelog
echo.
title Build - %SourceName%-%RsBuildConfig% [changelog]
title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion%-%GCCArchitecture% [changelog]
call "%ToolsPath%\generate-changelog.bat" "%SourcePath%" "%RsBuildPath%\changelog.txt"
:error

View file

@ -59,10 +59,12 @@ set QtMainVersion=%QtVersion:~0,1%
rem Qt 4 = QtSvg4.dll
rem Qt 5 = Qt5Svg.dll
rem Qt 6 = Qt6Svg.dll
set QtMainVersion1=
set QtMainVersion2=
if "%QtMainVersion%"=="4" set QtMainVersion2=4
if "%QtMainVersion%"=="5" set QtMainVersion1=5
if "%QtMainVersion%"=="6" set QtMainVersion1=6
if "%RsBuildConfig%" NEQ "release" (
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-Qt-%QtVersion%-%GCCArchitecture%%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z
@ -75,7 +77,7 @@ if exist "%Archive%" del /Q "%Archive%"
:: Create deploy path
mkdir "%RsDeployPath%"
title Pack - %SourceName%%RsType%-%RsBuildConfig% [copy files]
title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion%-%GCCArchitecture% [copy files]
set ExtensionsFile=%SourcePath%\libretroshare\src\rsserver\rsinit.cc
set Extensions=
@ -131,18 +133,24 @@ if exist "%RsDeployPath%\retroshare.dll" call :copy_dependencies "%RsDeployPath%
echo copy Qt DLL's
copy "%QtPath%\Qt%QtMainVersion1%Svg%QtMainVersion2%.dll" "%RsDeployPath%" %Quite%
if "%QtMainVersion%"=="5" (
if %QtMainVersion% GEQ 5 (
mkdir "%RsDeployPath%\platforms"
copy "%QtPath%\..\plugins\platforms\qwindows.dll" "%RsDeployPath%\platforms" %Quite%
)
if "%QtMainVersion%"=="5" (
mkdir "%RsDeployPath%\audio"
copy "%QtPath%\..\plugins\audio\qtaudio_windows.dll" "%RsDeployPath%\audio" %Quite%
)
if exist "%QtPath%\..\plugins\styles\qwindowsvistastyle.dll" (
echo Copy styles
mkdir "%RsDeployPath%\styles" %Quite%
echo Copy styles
mkdir "%RsDeployPath%\styles" %Quite%
if "%QtMainVersion%"=="5" (
copy "%QtPath%\..\plugins\styles\qwindowsvistastyle.dll" "%RsDeployPath%\styles" %Quite%
)
if "%QtMainVersion%"=="6" (
copy "%QtPath%\..\plugins\styles\qmodernwindowsstyle.dll" "%RsDeployPath%\styles" %Quite%
)
copy "%QtPath%\..\plugins\imageformats\*.dll" "%RsDeployPath%\imageformats" %Quite%
del /Q "%RsDeployPath%\imageformats\*d?.dll" %Quite%
@ -169,10 +177,12 @@ xcopy /S "%SourcePath%\retroshare-gui\src\license" "%RsDeployPath%\license" %Qui
echo copy translation
copy "%SourcePath%\retroshare-gui\src\translations\qt_tr.qm" "%RsDeployPath%\translations" %Quite%
copy "%QtPath%\..\translations\qt_*.qm" "%RsDeployPath%\translations" %Quite%
if "%QtMainVersion%"=="5" (
if %QtMainVersion% GEQ 5 (
copy "%QtPath%\..\translations\qtbase_*.qm" "%RsDeployPath%\translations" %Quite%
copy "%QtPath%\..\translations\qtscript_*.qm" "%RsDeployPath%\translations" %Quite%
copy "%QtPath%\..\translations\qtmultimedia_*.qm" "%RsDeployPath%\translations" %Quite%
)
if "%QtMainVersion%"=="5" (
copy "%QtPath%\..\translations\qtscript_*.qm" "%RsDeployPath%\translations" %Quite%
copy "%QtPath%\..\translations\qtxmlpatterns_*.qm" "%RsDeployPath%\translations" %Quite%
)
@ -196,7 +206,7 @@ if "%ParamTor%"=="1" (
)
rem pack files
title Pack - %SourceName%%RsType%-%RsBuildConfig% [pack files]
title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion%-%GCCArchitecture% [pack files]
"%EnvSevenZipExe%" a -mx=9 -t7z "%Archive%" "%RsDeployPath%\*"

View file

@ -16,7 +16,7 @@ if "%~1"=="clean" (
goto exit
)
set MSYS2Version=20241208
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

@ -232,7 +232,7 @@ Section $(Section_Main) Section_Main
; Qt styles
SetOutPath "$INSTDIR\styles"
File /NONFATAL "${QTDIR}\plugins\styles\qwindowsvistastyle.dll"
File "${QTDIR}\plugins\styles\qwindowsvistastyle.dll"
; MinGW binaries
SetOutPath "$INSTDIR"

View file

@ -0,0 +1,622 @@
; Script generated with the Venis Install Wizard & modified by defnax
; Reworked by Thunder
!include ifexist.nsh
# Needed defines
;!define REVISION ""
;!define RELEASEDIR ""
;!define QTDIR ""
;!define MINGWDIR ""
# Optional defines
;!define OUTDIR ""
# Check needed defines
!ifndef RELEASEDIR
!error "RELEASEDIR is not defined"
!endif
!ifndef QTDIR
!error "QTDIR is not defined"
!endif
!ifndef MINGWDIR
!error "MINGWDIR is not defined"
!endif
!ifndef ARCHITECTURE
!error "Architecture is not defined"
!endif
# Check optional defines
!ifdef OUTDIR
!define OUTDIR_ "${OUTDIR}\"
!else
!define OUTDIR ""
!define OUTDIR_ ""
!endif
!ifndef INSTALLERADD
!define INSTALLERADD ""
!endif
# Source directory
!define SOURCEDIR "..\..\.."
# Get version from executable
!GetDllVersion "${RELEASEDIR}\retroshare-gui\src\release\retroshare.exe" VERSION_
!define VERSION ${VERSION_1}.${VERSION_2}.${VERSION_3}
;!define REVISION ${VERSION_4}
# Get version of Qt
!GetDllVersion "${QTDIR}\bin\Qt6Core.dll" QTVERSION_
!define QTVERSION ${QTVERSION_1}.${QTVERSION_2}.${QTVERSION_3}
# Check version
!ifndef REVISION
!error "REVISION is not defined"
!endif
# Date
!ifndef DATE
!define /date DATE "%Y%m%d"
!endif
# Service
${!defineifexist} SERVICE_EXISTS "${RELEASEDIR}\retroshare-service\src\release\retroshare-service.exe"
# Tor
!ifdef TORDIR
${!defineifexist} TOR_EXISTS "${TORDIR}\tor.exe"
!ifndef TOR_EXISTS
!error "tor.exe not found"
!endif
!endif
# WebUI
!ifdef WEBUIDIR
${!defineifexist} WEBUI_EXISTS "${WEBUIDIR}\index.html"
!ifndef WEBUI_EXISTS
!error "WebUI files not found"
!endif
!endif
# Friend Server
!ifdef TOR_EXISTS
# Add Friend Server with Tor only
#${!defineifexist} FRIENDSERVER_EXISTS "${RELEASEDIR}\retroshare-friendserver\src\release\retroshare-friendserver.exe"
!endif
# Application name and version
!define APPNAME "RetroShare"
!define APPNAMEANDVERSION "${APPNAME} ${VERSION}"
!define PUBLISHER "RetroShare Team"
# Install path
!if ${ARCHITECTURE} == "x86"
!define INSTDIR_NORMAL "$ProgramFiles32\${APPNAME}"
!endif
!if ${ARCHITECTURE} == "x64"
!define INSTDIR_NORMAL "$ProgramFiles64\${APPNAME}"
!endif
!define INSTDIR_PORTABLE "$Desktop\${APPNAME}"
!define DATADIR_NORMAL "$APPDATA\${APPNAME}"
!define DATADIR_PORTABLE "$INSTDIR\Data"
# Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDirRegKey HKLM "Software\${APPNAME}" ""
OutFile "${OUTDIR_}RetroShare-${VERSION}-${DATE}-${REVISION}-Qt-${QTVERSION}-${ARCHITECTURE}${INSTALLERADD}-setup.exe"
BrandingText "${APPNAMEANDVERSION}"
RequestExecutionlevel highest
# Use compression
SetCompressor /SOLID LZMA
# Global variables
Var PortableMode
Var InstDirNormal
Var InstDirPortable
Var DataDir
Var StyleSheetDir
# Modern interface settings
!include Sections.nsh
!include nsDialogs.nsh
!include "MUI.nsh"
# Interface Settings
!define MUI_ABORTWARNING
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${SOURCEDIR}\build_scripts\Windows\installer\HeaderImage.bmp"
;!define MUI_WELCOMEFINISHPAGE_BITMAP "...bmp"
# MUI defines
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_LICENSEPAGE_RADIOBUTTONS
!define MUI_COMPONENTSPAGE_SMALLDESC
!define MUI_FINISHPAGE_LINK "Visit the RetroShare forum for the latest news and support"
!define MUI_FINISHPAGE_LINK_LOCATION "http://retroshare.sourceforge.net/forum/"
!define MUI_FINISHPAGE_RUN "$INSTDIR\retroshare.exe"
!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\changelog.txt
!define MUI_FINISHPAGE_SHOWREADME_TEXT changelog.txt
;!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
;!define MUI_LANGDLL_REGISTRY_ROOT HKLM
;!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY}
;!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage
# Defines the un-/installer logo of RetroShare
!insertmacro MUI_DEFAULT MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
!insertmacro MUI_DEFAULT MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp"
# Installer pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "$(myLicenseData)"
Page Custom PortableModePageCreate PortableModePageLeave
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE dir_leave
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
# Set languages (first is default language)
!insertmacro MUI_RESERVEFILE_LANGDLL
# Installer languages
!define MUI_LANGDLL_ALLLANGUAGES
# Translations
!macro LANG_LOAD LANGUAGE LANGCODE LANGID LICENCEFILE
!insertmacro MUI_LANGUAGE "${LANGUAGE}"
; !verbose off
!define LANG "${LANGUAGE}"
!include "lang\${LANGCODE}.nsh"
LangString LANGUAGEID "${LANG_${LANG}}" "1031"
LicenseLangString myLicenseData ${LANGCODE} ${LICENCEFILE}
; !verbose on
!undef LANG
!macroend
!macro LANG_STRING NAME VALUE
LangString "${NAME}" "${LANG_${LANG}}" "${VALUE}"
!macroend
!insertmacro LANG_LOAD "English" "en" "1033" "${SOURCEDIR}\retroshare-gui\src\license\license.txt"
!insertmacro LANG_LOAD "French" "fr" "1036" "${SOURCEDIR}\retroshare-gui\src\license\license-FR.txt"
!insertmacro LANG_LOAD "German" "de" "1031" "${SOURCEDIR}\retroshare-gui\src\license\license-GER.txt"
!insertmacro LANG_LOAD "Turkish" "tr" "1055" "${SOURCEDIR}\retroshare-gui\src\license\license-TR.txt"
!insertmacro LANG_LOAD "SimpChinese" "zh_CN" "2052" "${SOURCEDIR}\retroshare-gui\src\license\license.txt"
!insertmacro LANG_LOAD "Polish" "pl" "1045" "${SOURCEDIR}\retroshare-gui\src\license\license.txt"
!insertmacro LANG_LOAD "Spanish" "es" "1034" "${SOURCEDIR}\retroshare-gui\src\license\license.txt"
!insertmacro LANG_LOAD "Russian" "ru" "1049" "${SOURCEDIR}\retroshare-gui\src\license\license.txt"
!insertmacro LANG_LOAD "Catalan" "ca_ES" "1027" "${SOURCEDIR}\retroshare-gui\src\license\license.txt"
LicenseData $(myLicenseData)
# Main binaries
Section $(Section_Main) Section_Main
;Set Section required
SectionIn RO
; Set Section properties
SetOverwrite on
; Clears previous error logs
; Delete "$INSTDIR\*.log"
; Main binaries
SetOutPath "$INSTDIR"
File "${RELEASEDIR}\retroshare-gui\src\release\retroshare.exe"
File /nonfatal "${RELEASEDIR}\libretroshare\src\lib\retroshare.dll"
; Qt binaries
File "${QTDIR}\bin\Qt6Core.dll"
File "${QTDIR}\bin\Qt6Core5Compat.dll"
File "${QTDIR}\bin\Qt6Gui.dll"
File "${QTDIR}\bin\Qt6Multimedia.dll"
File "${QTDIR}\bin\Qt6Network.dll"
File "${QTDIR}\bin\Qt6PrintSupport.dll"
File "${QTDIR}\bin\Qt6Svg.dll"
File "${QTDIR}\bin\Qt6Widgets.dll"
File "${QTDIR}\bin\Qt6Xml.dll"
; Qt platforms
SetOutPath "$INSTDIR\platforms"
File "${QTDIR}\plugins\platforms\qwindows.dll"
; Qt styles
SetOutPath "$INSTDIR\styles"
File "${QTDIR}\plugins\styles\qmodernwindowsstyle.dll"
; MinGW binaries
SetOutPath "$INSTDIR"
File "${MINGWDIR}\bin\libstdc++-6.dll"
!if ${ARCHITECTURE} == "x86"
File "${MINGWDIR}\bin\libgcc_s_dw2-1.dll"
!endif
!if ${ARCHITECTURE} == "x64"
File "${MINGWDIR}\bin\libgcc_s_seh-1.dll"
!endif
File "${MINGWDIR}\bin\libwinpthread-1.dll"
; 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"
!endif
!if ${ARCHITECTURE} == "x64"
File "${EXTERNAL_LIB_DIR}\bin\libcrypto-1_1-x64.dll"
File "${EXTERNAL_LIB_DIR}\bin\libssl-1_1-x64.dll"
!endif
; Other files
File "${RELEASEDIR}\changelog.txt"
File "${SOURCEDIR}\libbitdht\src\bitdht\bdboot.txt"
; License
SetOutPath "$INSTDIR\license"
File "${SOURCEDIR}\retroshare-gui\src\license\*.*"
; Image formats
SetOutPath "$INSTDIR\imageformats"
File /r "${QTDIR}\plugins\imageformats\qgif.dll"
File /r "${QTDIR}\plugins\imageformats\qicns.dll"
File /r "${QTDIR}\plugins\imageformats\qico.dll"
File /r "${QTDIR}\plugins\imageformats\qjpeg.dll"
File /r "${QTDIR}\plugins\imageformats\qsvg.dll"
File /r "${QTDIR}\plugins\imageformats\qtga.dll"
File /r "${QTDIR}\plugins\imageformats\qtiff.dll"
File /r "${QTDIR}\plugins\imageformats\qwbmp.dll"
File /r "${QTDIR}\plugins\imageformats\qwebp.dll"
; Sounds
SetOutPath "$INSTDIR\sounds"
File /r "${SOURCEDIR}\retroshare-gui\src\sounds\*.*"
; Translations
SetOutPath "$INSTDIR\translations"
File /r "${SOURCEDIR}\retroshare-gui\src\translations\*.qm"
File /r "${QTDIR}\translations\qt_*.qm"
File /r "${QTDIR}\translations\qtbase_*.qm"
File /r "${QTDIR}\translations\qtmultimedia_*.qm"
; WebUI
; SetOutPath "$INSTDIR\webui"
; File /r "${SOURCEDIR}\libresapi\src\webui\*.*"
; License
SetOutPath "$INSTDIR\license"
File /r "${SOURCEDIR}\retroshare-gui\src\license\*.*"
SectionEnd
# Service
!ifdef SERVICE_EXISTS
Section /o $(Section_Service) Section_Service
SetOutPath "$INSTDIR"
File "${RELEASEDIR}\retroshare-service\src\release\retroshare-service.exe"
SectionEnd
!endif
# Friend Server
!ifdef FRIENDSERVER_EXISTS
Section /o $(Section_FriendServer) Section_FriendServer
SetOutPath "$INSTDIR"
File "${RELEASEDIR}\retroshare-friendserver\src\release\retroshare-friendserver.exe"
SectionEnd
!endif
# Tor
!ifdef TOR_EXISTS
Section /o $(Section_Tor) Section_Tor
SetOutPath "$INSTDIR\tor"
File "${TORDIR}\*"
SectionEnd
!endif
# WebUI
!ifdef WEBUI_EXISTS
Section /o $(Section_WebUI) Section_WebUI
SetOutPath "$INSTDIR\webui"
File /r "${WEBUIDIR}\*"
SectionEnd
!endif
# Plugins
${!defineifexist} PLUGIN_FEEDREADER_EXISTS "${RELEASEDIR}\plugins\FeedReader\lib\FeedReader.dll"
${!defineifexist} PLUGIN_VOIP_EXISTS "${RELEASEDIR}\plugins\VOIP\lib\VOIP.dll"
!ifdef PLUGIN_FEEDREADER_EXISTS
!define /ifndef PLUGIN_EXISTS
!endif
!ifdef PLUGIN_VOIP_EXISTS
!define /ifndef PLUGIN_EXISTS
!endif
!ifdef PLUGIN_EXISTS
SectionGroup $(Section_Plugins) Section_Plugins
!ifdef PLUGIN_FEEDREADER_EXISTS
Section $(Section_Plugin_FeedReader) Section_Plugin_FeedReader
SetOutPath "$DataDir\extensions6"
File "${RELEASEDIR}\plugins\FeedReader\lib\FeedReader.dll"
SectionEnd
!endif
!ifdef PLUGIN_VOIP_EXISTS
Section $(Section_Plugin_VOIP) Section_Plugin_VOIP
SetOutPath "$DataDir\extensions6"
File "${RELEASEDIR}\plugins\VOIP\lib\VOIP.dll"
SetOutPath "$INSTDIR\sounds"
File /r "${SOURCEDIR}\plugins\VOIP\gui\sounds\*.*"
SectionEnd
!endif
SectionGroupEnd
!endif
# Data (Styles)
Section $(Section_Data) Section_Data
; Set Section properties
SetOverwrite on
; Chat style
SetOutPath "$StyleSheetDir\stylesheets\Bubble"
File /r "${SOURCEDIR}\retroshare-gui\src\gui\qss\chat\Bubble\*.*"
SetOutPath "$StyleSheetDir\stylesheets\Bubble_Compact"
File /r "${SOURCEDIR}\retroshare-gui\src\gui\qss\chat\Bubble_Compact\*.*"
; Stylesheets
SetOutPath "$INSTDIR\qss"
File /nonfatal /r "${SOURCEDIR}\retroshare-gui\src\qss\*.*"
SectionEnd
;Section $(Section_Link) Section_Link
; Delete any existing keys
; Write the file association
; WriteRegStr HKCR .pqi "" retroshare
; WriteRegStr HKCR retroshare "" "PQI File"
; WriteRegBin HKCR retroshare EditFlags 00000100
; WriteRegStr HKCR "retroshare\shell" "" open
; WriteRegStr HKCR "retroshare\shell\open\command" "" `"$INSTDIR\retroshare.exe" "%1"`
;SectionEnd
# Shortcuts
SectionGroup $(Section_Shortcuts) Section_Shortcuts
Section $(Section_StartMenu) Section_StartMenu
SetOutPath "$INSTDIR"
CreateDirectory "$SMPROGRAMS\${APPNAME}"
CreateShortCut "$SMPROGRAMS\${APPNAME}\$(Link_Uninstall).lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe" 0
!ifdef SERVICE_EXISTS
SectionGetFlags ${Section_Service} $0
IntOp $0 $0 & ${SF_SELECTED}
${If} $0 == ${SF_SELECTED}
CreateShortCut "$SMPROGRAMS\${APPNAME}\${APPNAME} Service.lnk" "$INSTDIR\retroshare-service.exe" "" "$INSTDIR\retroshare-service.exe" 0
${EndIf}
!endif
!ifdef FRIENDSERVER_EXISTS
SectionGetFlags ${Section_FriendServer} $0
IntOp $0 $0 & ${SF_SELECTED}
${If} $0 == ${SF_SELECTED}
CreateShortCut "$SMPROGRAMS\${APPNAME}\${APPNAME} Friend Server.lnk" "$INSTDIR\retroshare-friendserver.exe" "" "$INSTDIR\retroshare-friendserver.exe" 0
${EndIf}
!endif
SectionEnd
Section $(Section_Desktop) Section_Desktop
CreateShortCut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe" 0
SectionEnd
Section $(Section_QuickLaunch) Section_QuickLaunch
CreateShortCut "$QUICKLAUNCH\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe" 0
SectionEnd
SectionGroupEnd
Section $(Section_AutoStart) Section_AutoStart
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "RetroShare" "$INSTDIR\retroshare.exe -m"
SectionEnd
;Section $(Section_AutoStart) Section_AutoStart
; CreateShortCut "$SMSTARTUP\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe -m" 0
;SectionEnd
Section -FinishSection
${If} $PortableMode = 0
WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR"
WriteRegStr HKLM "Software\${APPNAME}" "Version" "${VERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayVersion" "${VERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$INSTDIR\retroshare.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "${PUBLISHER}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoModify" "1"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoRepair" "1"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe"
WriteUninstaller "$INSTDIR\uninstall.exe"
${Else}
; Create the file the application uses to detect portable mode
FileOpen $0 "$INSTDIR\portable" w
FileClose $0
${EndIf}
SectionEnd
# Descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Main} $(Section_Main_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Data} $(Section_Data_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Shortcuts} $(Section_Shortcuts_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_StartMenu} $(Section_StartMenu_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Desktop} $(Section_Desktop_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_QuickLaunch} $(Section_QuickLaunch_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugins} $(Section_Plugins_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugin_FeedReader} $(Section_Plugin_FeedReader_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugin_VOIP} $(Section_Plugin_VOIP_Desc)
; !insertmacro MUI_DESCRIPTION_TEXT ${Section_Link} $(Section_Link_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_AutoStart} $(Section_AutoStart_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Tor} $(Section_Tor_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_WebUI} $(Section_WebUI_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Service} $(Section_Service_Desc)
!insertmacro MUI_DESCRIPTION_TEXT ${Section_FriendServer} $(Section_FriendServer_Desc)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
# Uninstall
Section "Uninstall"
; Remove file association registry keys
; DeleteRegKey HKCR .pqi
DeleteRegKey HKCR RetroShare
; Remove program/uninstall regsitry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
DeleteRegKey HKLM SOFTWARE\${APPNAME}
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "RetroShare"
; Remove shortcuts, if any
Delete "$SMPROGRAMS\${APPNAME}\*.*"
; Remove desktop shortcut
Delete "$DESKTOP\${APPNAME}.lnk"
; Remove Quicklaunch shortcut
Delete "$QUICKLAUNCH\${APPNAME}.lnk"
; Remove Autstart
Delete "$SMSTARTUP\${APPNAME}.lnk"
; Remove directories used
RMDir "$SMPROGRAMS\${APPNAME}"
RMDir /r "$INSTDIR"
; Don't remove the directory, otherwise
; we lose the XPGP keys.
; Should make this an option though...
RMDir /r "${DATADIR_NORMAL}\extensions6"
RMDir /r "${DATADIR_NORMAL}\stylesheets"
SectionEnd
Function .onInit
StrCpy $InstDirNormal "${INSTDIR_NORMAL}"
StrCpy $InstDirPortable "${INSTDIR_PORTABLE}"
StrCpy $PortableMode 0
StrCpy $INSTDIR "$InstDirNormal"
StrCpy $DataDir "${DATADIR_NORMAL}"
InitPluginsDir
Push $R1
File /oname=$PLUGINSDIR\spltmp.bmp "${SOURCEDIR}\retroshare-gui\src\gui\images\logo\logo_splash.png"
advsplash::show 1200 1000 1000 -1 $PLUGINSDIR\spltmp
Pop $R1
Pop $R1
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
!ifdef FRIENDSERVER_EXISTS
Function .onSelChange
SectionGetFlags ${Section_FriendServer} $0
IntOp $0 $0 & ${SF_SELECTED}
${If} $0 == ${SF_SELECTED}
# Activate Tor and set readonly
SectionGetFlags ${Section_Tor} $1
IntOp $1 $1 | ${SF_SELECTED}
IntOp $1 $1 | ${SF_RO}
SectionSetFlags ${Section_Tor} $1
${Else}
# Remove readonly from Tor
SectionGetFlags ${Section_Tor} $1
IntOp $2 ${SF_RO} ~
IntOp $1 $1 & $2
SectionSetFlags ${Section_Tor} $1
${EndIf}
FunctionEnd
!endif
# Installation mode
Function RequireAdmin
UserInfo::GetAccountType
Pop $8
${If} $8 != "admin"
MessageBox MB_ICONSTOP "You need administrator rights to install ${APPNAME}"
SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
Abort
${EndIf}
FunctionEnd
Function SetModeDestinationFromInstdir
${If} $PortableMode = 0
StrCpy $InstDirNormal $INSTDIR
${Else}
StrCpy $InstDirPortable $INSTDIR
${EndIf}
FunctionEnd
Function PortableModePageCreate
Call SetModeDestinationFromInstdir ; If the user clicks BACK on the directory page we will remember their mode specific directory
!insertmacro MUI_HEADER_TEXT $(Page_InstallMode) $(Page_InstallMode_Desc)
nsDialogs::Create 1018
Pop $0
${NSD_CreateRadioButton} 5u 25u -10u 8u $(Page_InstallMode_Standard)
Pop $1
${NSD_CreateLabel} 18u 40u -10u 24u $(Page_InstallMode_Standard_Desc)
Pop $0
${NSD_CreateRadioButton} 5u 75u -10u 8u $(Page_InstallMode_Portable)
Pop $2
${NSD_CreateLabel} 18u 90u -10u 24u $(Page_InstallMode_Portable_Desc)
Pop $0
${If} $PortableMode = 0
SendMessage $1 ${BM_SETCHECK} ${BST_CHECKED} 0
${Else}
SendMessage $2 ${BM_SETCHECK} ${BST_CHECKED} 0
${EndIf}
nsDialogs::Show
FunctionEnd
Function PortableModePageLeave
${NSD_GetState} $1 $0
${If} $0 <> ${BST_UNCHECKED}
StrCpy $PortableMode 0
StrCpy $INSTDIR $InstDirNormal
Call RequireAdmin
; Enable sections
SectionSetText ${Section_Shortcuts} $(Section_Shortcuts)
SectionSetText ${Section_StartMenu} $(Section_StartMenu)
SectionSetText ${Section_Desktop} $(Section_Desktop)
SectionSetText ${Section_QuickLaunch} $(Section_QuickLaunch)
SectionSetText ${Section_AutoStart} $(Section_AutoStart)
!insertmacro SelectSection ${Section_Shortcuts}
!insertmacro SelectSection ${Section_AutoStart}
!insertmacro SelectSection ${Section_StartMenu}
!insertmacro SelectSection ${Section_Desktop}
!insertmacro SelectSection ${Section_QuickLaunch}
${Else}
StrCpy $PortableMode 1
StrCpy $INSTDIR $InstDirPortable
; Disable sections
!insertmacro UnselectSection ${Section_Shortcuts}
!insertmacro UnselectSection ${Section_AutoStart}
!insertmacro UnselectSection ${Section_StartMenu}
!insertmacro UnselectSection ${Section_Desktop}
!insertmacro UnselectSection ${Section_QuickLaunch}
SectionSetText ${Section_Shortcuts} ""
SectionSetText ${Section_StartMenu} ""
SectionSetText ${Section_Desktop} ""
SectionSetText ${Section_QuickLaunch} ""
SectionSetText ${Section_AutoStart} ""
${EndIf}
FunctionEnd
Function dir_leave
${If} $PortableMode = 0
StrCpy $DataDir "${DATADIR_NORMAL}"
StrCpy $StyleSheetDir $DataDir
${Else}
StrCpy $DataDir "${DATADIR_PORTABLE}"
StrCpy $StyleSheetDir $INSTDIR
${EndIf}
FunctionEnd

@ -1 +1 @@
Subproject commit ac83e00ea7a26cd6cf57cefef745d6dcfd07e5da
Subproject commit da6b849a41f3cf6e60f6f76e1f3c4463876a8741

View file

@ -28,6 +28,8 @@ greaterThan(QT_MAJOR_VERSION, 4) {
QT += widgets
}
greaterThan(QT_MAJOR_VERSION,5): QT += core5compat
target.files = lib/libFeedReader.so
SOURCES = FeedReaderPlugin.cpp \

View file

@ -27,6 +27,7 @@
#include "FeedReaderFeedItem.h"
#include "gui/settings/rsharesettings.h"
#include "retroshare/rsiface.h"
#include "util/DateTime.h"
FeedReaderFeedNotify::FeedReaderFeedNotify(RsFeedReader *feedReader, FeedReaderNotify *notify, QObject *parent) :
FeedNotify(parent), mFeedReader(feedReader), mNotify(notify)
@ -135,7 +136,7 @@ FeedItem *FeedReaderFeedNotify::testFeedItem(FeedHolder */*parent*/)
FeedMsgInfo msgInfo;
msgInfo.title = tr("Test message").toUtf8().constData();
msgInfo.description = tr("This is a test message.").toUtf8().constData();
msgInfo.pubDate = QDateTime::currentDateTime().toTime_t();
msgInfo.pubDate = DateTime::DateTimeToTime_t(QDateTime::currentDateTime());
//TODO: parent?
return new FeedReaderFeedItem(mFeedReader, mNotify, feedInfo, msgInfo);

View file

@ -33,6 +33,7 @@
#include <retroshare/rsdisc.h>
#include <retroshare/rspeers.h>
#include "settings/rsharesettings.h"
#include "util/RsQtVersion.h"
#include <QClipboard>
#include <QSysInfo>
@ -42,6 +43,9 @@
#include <QMessageBox>
#include <QStyle>
#include <assert.h>
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
#include <QRandomGenerator>
#endif
AboutWidget::AboutWidget(QWidget* parent)
: QWidget(parent)
@ -211,7 +215,7 @@ void AWidget::initImages()
if(height() == 0) return ;
image1 = QImage(width(),height(),QImage::Format_ARGB32);
image1.fill(palette().color(QPalette::Background));
image1.fill(palette().color(QPalette::Window));
//QImage image(":/images/logo/logo_info.png");
QPixmap image(":/images/logo/logo_splash.png");
@ -267,7 +271,7 @@ void AWidget::initGoL()
void AWidget::drawBitField()
{
image2.fill(palette().color(QPalette::Background));
image2.fill(palette().color(QPalette::Window));
QPainter p(&image2) ;
p.setPen(QColor(200,200,200));
@ -306,7 +310,7 @@ void AWidget::drawBitField()
AWidget::AWidget()
: page(0), density(5)
, mImagesReady(false), mState(0), mTimerId(0)
, mStep(1.0f), mMaxStep(QFontMetricsF(font()).width(' '))
, mStep(1.0f), mMaxStep(QFontMetrics_horizontalAdvance(QFontMetricsF(font()), ' '))
{
setMouseTracking(true);
//startTimer(15);
@ -774,7 +778,7 @@ void TBoard::showNextPiece() {
QPixmap pixmap(dx * squareWidth(), dy * squareHeight());
QPainter painter(&pixmap);
painter.fillRect(pixmap.rect(), nextPieceLabel->palette().background());
painter.fillRect(pixmap.rect(), nextPieceLabel->palette().window());
for (int i = 0; i < 4; ++i) {
int x = nextPiece.x(i) - nextPiece.minX();
@ -809,18 +813,23 @@ void TBoard::drawSquare(QPainter &painter, int x, int y, TPiece::Shape shape) {
QColor color = colorTable[int(shape)];
painter.fillRect(x + 1, y + 1, squareWidth() - 2, squareHeight() - 2, color);
painter.setPen(color.light());
painter.setPen(color.lighter());
painter.drawLine(x, y + squareHeight() - 1, x, y);
painter.drawLine(x, y, x + squareWidth() - 1, y);
painter.setPen(color.dark());
painter.setPen(color.darker());
painter.drawLine(x + 1, y + squareHeight() - 1, x + squareWidth() - 1, y + squareHeight() - 1);
painter.drawLine(x + squareWidth() - 1, y + squareHeight() - 1, x + squareWidth() - 1, y + 1);
}
void TPiece::setRandomShape() {
setShape(TPiece::Shape(qrand() % 7 + 1));
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
int rand = QRandomGenerator::global()->generate();
#else
int rand = qrand();
#endif
setShape(TPiece::Shape(rand % 7 + 1));
}
@ -905,7 +914,7 @@ TPiece TPiece::rotatedRight() const {
NextPieceLabel::NextPieceLabel( QWidget* parent /* = 0*/ ) : QLabel(parent)
{
QPalette p = palette();
p.setColor(QPalette::Background, Qt::white);
p.setColor(QPalette::Window, Qt::white);
setPalette(p);
setFrameShape(QFrame::Box);
setAlignment(Qt::AlignCenter);

View file

@ -38,6 +38,7 @@
#include "gui/gxs/GxsIdDetails.h"
#include "gui/Identity/IdDialog.h"
#include "gui/Identity/IdEditDialog.h"
#include "util/RsQtVersion.h"
//#define DEBUG_CREATE_CIRCLE_DIALOG 1
@ -74,7 +75,7 @@ CreateCircleDialog::CreateCircleDialog()
ui.IdFilter->addFilter(QIcon(), headerText, RSCIRCLEID_COL_KEYID, QString("%1 %2").arg(tr("Search"), headerText));
/* Set initial column width */
int fontWidth = QFontMetricsF(ui.treeWidget_IdList->font()).width("W");
int fontWidth = QFontMetrics_horizontalAdvance(QFontMetricsF(ui.treeWidget_IdList->font()), "W");
ui.treeWidget_IdList->setColumnWidth(RSCIRCLEID_COL_NICKNAME, 17 * fontWidth);
ui.treeWidget_membership->setColumnWidth(RSCIRCLEID_COL_NICKNAME, 17 * fontWidth);

View file

@ -21,7 +21,7 @@
#include <retroshare/rstypes.h>
#include <QModelIndex>
#include <QPainter>
#include <QStyleOptionProgressBarV2>
#include <QStyleOptionProgressBar>
#include <QProgressBar>
#include <QApplication>
#include <QDateTime>
@ -30,6 +30,7 @@
#include "DLListDelegate.h"
#include "util/DateTime.h"
#include "util/RsQtVersion.h"
Q_DECLARE_METATYPE(FileProgressInfo)
@ -43,7 +44,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
{
QString byteUnits[4] = {tr("B"), tr("KB"), tr("MB"), tr("GB")};
QStyleOptionViewItem opt = option;
QStyleOptionProgressBarV2 newopt;
QStyleOptionProgressBar newopt;
QRect pixmapRect;
QPixmap pixmap;
qlonglong fileSize;
@ -60,7 +61,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
painter->setClipRect(opt.rect);
//set text color
QVariant value = index.data(Qt::TextColorRole);
QVariant value = index.data(Qt::ForegroundRole);
if(value.isValid() && qvariant_cast<QColor>(value).isValid()) {
opt.palette.setColor(QPalette::Text, qvariant_cast<QColor>(value));
}
@ -278,7 +279,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
QSize DLListDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
{
float w = QFontMetricsF(option.font).width(index.data(Qt::DisplayRole).toString());
float w = QFontMetrics_horizontalAdvance(QFontMetricsF(option.font), index.data(Qt::DisplayRole).toString());
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
//
@ -84,7 +85,7 @@ void FileTransferInfoWidget::updateDisplay()
setFixedHeight(maxHeight);
QPainter painter(&pixmap);
painter.initFrom(this);
painter.begin(this);
float S = QFontMetricsF(font()).height();
int chunk_square_size = S*chunk_square_size_factor;
@ -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>
@ -58,6 +59,7 @@ private:
QPixmap downloadingPixmap;
QPixmap notDownloadPixmap;
QPixmap checkingPixmap;
QColor penColor;
RsFileHash _file_hash ;
};

View file

@ -145,7 +145,7 @@ public:
{
Q_ASSERT(index.isValid());
QStyleOptionViewItemV4 opt = option;
QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
// disable default icon
opt.icon = QIcon();
@ -199,7 +199,7 @@ SharedFilesDialog::SharedFilesDialog(bool remote_mode, QWidget *parent)
tree_proxyModel->setSortRole(RetroshareDirModel::SortRole);
tree_proxyModel->sort(SHARED_FILES_DIALOG_COLUMN_NAME);
tree_proxyModel->setFilterRole(RetroshareDirModel::FilterRole);
tree_proxyModel->setFilterRegExp(QRegExp(QString(SHARED_FILES_DIALOG_FILTER_STRING))) ;
QSortFilterProxyModel_setFilterRegularExpression(tree_proxyModel, QString(SHARED_FILES_DIALOG_FILTER_STRING)) ;
flat_proxyModel = new SFDSortFilterProxyModel(flat_model, this);
flat_proxyModel->setSourceModel(flat_model);
@ -207,7 +207,7 @@ SharedFilesDialog::SharedFilesDialog(bool remote_mode, QWidget *parent)
flat_proxyModel->setSortRole(RetroshareDirModel::SortRole);
flat_proxyModel->sort(SHARED_FILES_DIALOG_COLUMN_NAME);
flat_proxyModel->setFilterRole(RetroshareDirModel::FilterRole);
flat_proxyModel->setFilterRegExp(QRegExp(QString(SHARED_FILES_DIALOG_FILTER_STRING))) ;
QSortFilterProxyModel_setFilterRegularExpression(flat_proxyModel, QString(SHARED_FILES_DIALOG_FILTER_STRING)) ;
connect(ui.filterClearButton, SIGNAL(clicked()), this, SLOT(clearFilter()));
connect(ui.filterStartButton, SIGNAL(clicked()), this, SLOT(startFilter()));
@ -1018,7 +1018,7 @@ void SharedFilesDialog::recursExpandAll(const QModelIndex& index)
for(int row=0;row<ui.dirTreeView->model()->rowCount(index);++row)
{
QModelIndex idx(index.child(row,0)) ;
QModelIndex idx(ui.dirTreeView->model()->index(row,0,index)) ;
if(ui.dirTreeView->model()->rowCount(idx) > 0)
recursExpandAll(idx) ;
@ -1131,7 +1131,10 @@ void SharedFilesDialog::postModDirectories(bool local)
#ifdef DEBUG_SHARED_FILES_DIALOG
std::cerr << "****** updated directories! Re-enabling sorting ******" << std::endl;
#endif
#if QT_VERSION < QT_VERSION_CHECK (6, 0, 0)
QCoreApplication::flush();
#endif
}
class ChannelCompare

View file

@ -40,6 +40,7 @@
#include "util/RsQtVersion.h"
#include "util/RsFile.h"
#include "util/qtthreadsutils.h"
#include "util/DateTime.h"
#include "retroshare/rsdisc.h"
#include "retroshare/rsfiles.h"
@ -286,7 +287,7 @@ public:
{
case Qt::SizeHintRole: return sizeHintRole(index.column()) ;
case Qt::TextAlignmentRole:
case Qt::TextColorRole:
case Qt::ForegroundRole:
case Qt::WhatsThisRole:
case Qt::EditRole:
case Qt::ToolTipRole:
@ -434,7 +435,7 @@ public:
//Get Last Access on File
if (file.exists())
qi64LastDL = file.lastModified().toTime_t();
qi64LastDL = DateTime::DateTimeToTime_t(file.lastModified());
}
return QVariant(qi64LastDL) ;
}
@ -2646,5 +2647,5 @@ void TransfersDialog::filterChanged(const QString& /*text*/)
int filterColumn = ui.filterLineEdit->currentFilter();
QString text = ui.filterLineEdit->text();
DLLFilterModel->setFilterKeyColumn(filterColumn);
DLLFilterModel->setFilterRegExp(text);
QSortFilterProxyModel_setFilterRegularExpression(DLLFilterModel, text);
}

View file

@ -22,6 +22,7 @@
#include "ULListDelegate.h"
#include "xprogressbar.h"
#include "util/RsQtVersion.h"
Q_DECLARE_METATYPE(FileProgressInfo)
@ -39,7 +40,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
{
QString byteUnits[4] = {tr("B"), tr("KB"), tr("MB"), tr("GB")};
QStyleOptionViewItem opt = option;
QStyleOptionProgressBarV2 newopt;
QStyleOptionProgressBar newopt;
QRect pixmapRect;
QPixmap pixmap;
qlonglong fileSize;
@ -52,7 +53,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
painter->setClipRect(opt.rect);
//set text color
QVariant value = index.data(Qt::TextColorRole);
QVariant value = index.data(Qt::ForegroundRole);
if(value.isValid() && qvariant_cast<QColor>(value).isValid()) {
opt.palette.setColor(QPalette::Text, qvariant_cast<QColor>(value));
}
@ -179,7 +180,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
QSize ULListDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
{
float w = QFontMetricsF(option.font).width(index.data(Qt::DisplayRole).toString());
float w = QFontMetrics_horizontalAdvance(QFontMetricsF(option.font), index.data(Qt::DisplayRole).toString());
int S = QFontMetricsF(option.font).height()*1.5 ;
return QSize(w,S);

View file

@ -613,7 +613,9 @@ void GenCertDialog::genPerson()
std::cout << "Waiting ed->processEvents()" << std::endl;
#endif
time_t waitEnd = time(NULL) + 10;//Wait no more than 10 sec to processEvents
#if QT_VERSION < QT_VERSION_CHECK (6, 0, 0)
if (ed->hasPendingEvents())
#endif
while(ed->processEvents(QEventLoop::AllEvents) && (time(NULL) < waitEnd));
std::string email_str = "" ;

View file

@ -332,95 +332,8 @@ void GetStartedDialog::emailSupport()
QString text = QString("Hello") + "\n";
text += "\n";
QString sysVersion;
QString sysVersion = QSysInfo::prettyProductName();
#ifdef __APPLE__
#ifdef Q_OS_MAC
switch(QSysInfo::MacintoshVersion)
{
case QSysInfo::MV_9:
sysVersion = "Mac OS 9";
break;
case QSysInfo::MV_10_0:
sysVersion = "Mac OSX 10.0";
break;
case QSysInfo::MV_10_1:
sysVersion = "Mac OSX 10.1";
break;
case QSysInfo::MV_10_2:
sysVersion = "Mac OSX 10.2";
break;
case QSysInfo::MV_10_3:
sysVersion = "Mac OSX 10.3";
break;
case QSysInfo::MV_10_4:
sysVersion = "Mac OSX 10.4";
break;
case QSysInfo::MV_10_5:
sysVersion = "Mac OSX 10.5";
break;
case QSysInfo::MV_10_6:
sysVersion = "Mac OSX 10.6";
break;
// case QSysInfo::MV_10_7:
// sysVersion = "Mac OSX 10.7";
// break;
default:
sysVersion = "Mac Unknown";
break;
}
#else
sysVersion = "OSX Unknown";
#endif
#else
#if defined(_WIN32) || defined(__MINGW32__)
// Windows
#ifdef Q_OS_WIN
switch(QSysInfo::windowsVersion())
{
case QSysInfo::WV_32s:
sysVersion = "Windows 2.1";
break;
case QSysInfo::WV_95:
sysVersion = "Windows 95";
break;
case QSysInfo::WV_98:
sysVersion = "Windows 98";
break;
case QSysInfo::WV_Me:
sysVersion = "Windows Me";
break;
case QSysInfo::WV_NT:
sysVersion = "Windows NT";
break;
case QSysInfo::WV_2000:
sysVersion = "Windows 2000";
break;
case QSysInfo::WV_XP:
sysVersion = "Windows XP";
break;
case QSysInfo::WV_2003:
sysVersion = "Windows 2003";
break;
case QSysInfo::WV_VISTA:
sysVersion = "Windows Vista";
break;
case QSysInfo::WV_WINDOWS7:
sysVersion = "Windows 7";
break;
default:
sysVersion = "Windows";
break;
}
#else
sysVersion = "Windows Unknown";
#endif
#else
// Linux
sysVersion = "Linux";
#endif
#endif
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";

View file

@ -352,7 +352,11 @@ void HomePage::saveCert()
//Todo: move save to file to p3Peers::SaveCertificateToFile
QTextStream ts(&file);
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
ts.setEncoding(QStringConverter::Utf8);
#else
ts.setCodec(QTextCodec::codecForName("UTF-8"));
#endif
ts << ui->retroshareid->text();
}

View file

@ -28,6 +28,7 @@
#include "gui/common/FilesDefs.h"
#include "gui/msgs/MessageComposer.h"
#include "gui/RetroShareLink.h"
#include "util/DateTime.h"
#include <retroshare/rspeers.h>
@ -148,7 +149,7 @@ void IdDetailsDialog::loadIdentity(RsGxsIdGroup data)
ui->autoBanIdentities_CB->setVisible(!data.mPgpId.isNull()) ;
ui->banoption_label->setVisible(!data.mPgpId.isNull()) ;
ui->lineEdit_Created->setText(QDateTime::fromMSecsSinceEpoch(qint64(1000)*data.mMeta.mPublishTs).toString(Qt::SystemLocaleShortDate));
ui->lineEdit_Created->setText(QLocale::system().toString(DateTime::DateTimeFromTime_t(data.mMeta.mPublishTs), QLocale::ShortFormat));
time_t now = time(NULL) ;
ui->lineEdit_LastUsed->setText(getHumanReadableDuration(now - data.mLastUsageTS)) ;

View file

@ -50,6 +50,7 @@
#include "util/RsQtVersion.h"
#include "util/rstime.h"
#include "util/rsdebug.h"
#include "util/DateTime.h"
#include "retroshare/rsgxsflags.h"
#include "retroshare/rsmsgs.h"
@ -230,7 +231,7 @@ IdDialog::IdDialog(QWidget *parent)
mProxyModel->setSortRole(RsIdentityListModel::SortRole);
mProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
mProxyModel->setFilterRole(RsIdentityListModel::FilterRole);
mProxyModel->setFilterRegExp(QRegExp(RsIdentityListModel::FilterString));
QSortFilterProxyModel_setFilterRegularExpression(mProxyModel, RsIdentityListModel::FilterString);
ui->idTreeWidget->setModel(mProxyModel);
//ui->idTreeWidget->setSelectionModel(new QItemSelectionModel(mProxyModel));// useless in Qt5.
@ -393,7 +394,7 @@ IdDialog::IdDialog(QWidget *parent)
/* Set initial section sizes */
QHeaderView * circlesheader = ui->treeWidget_membership->header () ;
circlesheader->resizeSection (CIRCLEGROUP_CIRCLE_COL_GROUPNAME, fm.width("Circle name")*1.5) ;
circlesheader->resizeSection (CIRCLEGROUP_CIRCLE_COL_GROUPNAME, QFontMetrics_horizontalAdvance(fm, "Circle name")*1.5) ;
ui->treeWidget_membership->setColumnWidth(CIRCLEGROUP_CIRCLE_COL_GROUPNAME, 270);
/* Setup tree */
@ -1653,7 +1654,7 @@ void IdDialog::loadIdentity(RsGxsIdGroup data)
/* get GPG Details from rsPeers */
RsPgpId ownPgpId = rsPeers->getGPGOwnId();
ui->lineEdit_PublishTS->setText(QDateTime::fromMSecsSinceEpoch(qint64(1000)*data.mMeta.mPublishTs).toString(Qt::SystemLocaleShortDate));
ui->lineEdit_PublishTS->setText(QLocale::system().toString(DateTime::DateTimeFromTime_t(data.mMeta.mPublishTs), QLocale::ShortFormat));
//ui->lineEdit_Nickname->setText(QString::fromUtf8(data.mMeta.mGroupName.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE));
ui->lineEdit_KeyId->setText(QString::fromStdString(data.mMeta.mGroupId.toStdString()));
//ui->lineEdit_GpgHash->setText(QString::fromStdString(data.mPgpIdHash.toStdString()));
@ -2719,7 +2720,7 @@ void IdDialog::recursSaveExpandedItems_idTreeView(const QModelIndex& proxy_index
expanded.insert(local_path) ;
for(int row=0;row<mProxyModel->rowCount(proxy_index);++row)
recursSaveExpandedItems_idTreeView(proxy_index.child(row,0),local_path,expanded,selected) ;
recursSaveExpandedItems_idTreeView(mProxyModel->index(row,0,proxy_index),local_path,expanded,selected) ;
}
if(ui->idTreeWidget->selectionModel()->isSelected(proxy_index))
@ -2751,7 +2752,7 @@ void IdDialog::recursRestoreExpandedItems_idTreeView(const QModelIndex& proxy_in
ui->idTreeWidget->setExpanded(proxy_index,true) ;
for(int row=0;row<mProxyModel->rowCount(proxy_index);++row)
recursRestoreExpandedItems_idTreeView(proxy_index.child(row,0),local_path,expanded,selected) ;
recursRestoreExpandedItems_idTreeView(mProxyModel->index(row,0,proxy_index),local_path,expanded,selected) ;
}
if(selected.find(local_path) != selected.end())

View file

@ -35,6 +35,7 @@
#include "retroshare/rspeers.h"
#include "gui/common/FilesDefs.h"
#include "util/imageutil.h"
#include "util/RsQtVersion.h"
#include <iostream>
@ -700,7 +701,7 @@ void IdEditDialog::removeAvatar()
void IdEditDialog::updateInterface()
{
QPixmap pixmap = ui->avatarLabel->pixmap(Qt::ReturnByValue);
QPixmap pixmap = QLabel_pixmap(ui->avatarLabel);
if (!pixmap.isNull()) {
ui->removeButton->setEnabled(true);
} else if (mEditGroup.mImage.mSize > 0) {

View file

@ -939,7 +939,9 @@ void MainWindow::postModDirectories(bool /*update_local*/)
{
//RSettingsPage::postModDirectories(update_local);
#if QT_VERSION < QT_VERSION_CHECK (6, 0, 0)
QCoreApplication::flush();
#endif
}
#ifdef WINDOWS_SYS

View file

@ -44,7 +44,7 @@ pgpid_item_proxy::pgpid_item_proxy(QObject *parent) :
void pgpid_item_proxy::use_only_trusted_keys(bool val)
{
only_trusted_keys = val;
filterChanged();
invalidateFilter();
}
bool pgpid_item_proxy::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const

View file

@ -35,6 +35,7 @@
#include "util/HandleRichText.h"
#include "gui/Identity/IdDialog.h"
#include "gui/MainWindow.h"
#include "util/DateTime.h"
#include "ui_BoardPostDisplayWidget_compact.h"
#include "ui_BoardPostDisplayWidget_card.h"
@ -194,16 +195,14 @@ void BoardPostDisplayWidgetBase::baseSetup()
voteDownButton()->setDisabled(true);
fromLabel()->setId(mPost.mMeta.mAuthorId);
titleLabel()->setText(tr( "<p><font color=\"#ff0000\"><b>The author of this message (with ID %1) is banned.</b>").arg(QString::fromStdString(mPost.mMeta.mAuthorId.toStdString()))) ;
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QDateTime qtime = DateTime::DateTimeFromTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
dateLabel()->setText(timestamp);
pictureLabel()->setDisabled(true);
}
else
{
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QDateTime qtime = DateTime::DateTimeFromTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
QString timestamp2 = misc::timeRelativeToNow(mPost.mMeta.mPublishTs) + " " + tr("ago");
dateLabel()->setText(timestamp);

View file

@ -31,6 +31,7 @@
#include "gui/common/FilesDefs.h"
#include "util/qtthreadsutils.h"
#include "util/HandleRichText.h"
#include "util/DateTime.h"
#include "ui_PostedCardView.h"
@ -186,8 +187,7 @@ void PostedCardView::fill()
ui->picture_frame->hide();
ui->fromLabel->setId(mPost.mMeta.mAuthorId);
ui->titleLabel->setText(tr( "<p><font color=\"#ff0000\"><b>The author of this message (with ID %1) is banned.</b>").arg(QString::fromStdString(mPost.mMeta.mAuthorId.toStdString()))) ;
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QDateTime qtime = DateTime::DateTimeFromTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
ui->dateLabel->setText(timestamp);
} else {
@ -198,8 +198,7 @@ void PostedCardView::fill()
//int desired_height = 1.5*(ui->voteDownButton->height() + ui->voteUpButton->height() + ui->scoreLabel->height());
//int desired_width = sqpixmap2.width()*desired_height/(float)sqpixmap2.height();
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QDateTime qtime = DateTime::DateTimeFromTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
QString timestamp2 = misc::timeRelativeToNow(mPost.mMeta.mPublishTs);
ui->dateLabel->setText(timestamp2);

View file

@ -37,6 +37,7 @@
#include "PhotoView.h"
#include "gui/Posted/PostedDialog.h"
#include "ui_PostedItem.h"
#include "util/DateTime.h"
#include <retroshare/rsposted.h>
@ -498,8 +499,7 @@ void PostedItem::fill()
ui->thumbnailLabel->setPicture( FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default.png"));
ui->fromLabel->setId(mPost.mMeta.mAuthorId);
ui->titleLabel->setText(tr( "<p><font color=\"#ff0000\"><b>The author of this message (with ID %1) is banned.</b>").arg(QString::fromStdString(mPost.mMeta.mAuthorId.toStdString()))) ;
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QDateTime qtime = DateTime::DateTimeFromTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
ui->dateLabel->setText(timestamp);
} else {
@ -514,8 +514,7 @@ void PostedItem::fill()
ui->thumbnailLabel->setFixedSize(desired_width,desired_height);
QDateTime qtime;
qtime.setTime_t(mPost.mMeta.mPublishTs);
QDateTime qtime = DateTime::DateTimeFromTime_t(mPost.mMeta.mPublishTs);
QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy");
QString timestamp2 = misc::timeRelativeToNow(mPost.mMeta.mPublishTs);
ui->dateLabel->setText(timestamp2);

View file

@ -54,7 +54,7 @@ class RSHumanReadableDelegate: public QAbstractItemDelegate
// This part of the code is copied from DLListDelegate.cpp
//
QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;
QVariant value = index.data(Qt::TextColorRole);
QVariant value = index.data(Qt::ForegroundRole);
if(value.isValid() && qvariant_cast<QColor>(value).isValid())
option.palette.setColor(QPalette::Text, qvariant_cast<QColor>(value));
@ -75,7 +75,7 @@ class RSHumanReadableDelegate: public QAbstractItemDelegate
}
else
{
value = index.data(Qt::BackgroundColorRole);
value = index.data(Qt::BackgroundRole);
if(value.isValid() && qvariant_cast<QColor>(value).isValid())
painter->fillRect(option.rect, qvariant_cast<QColor>(value));

View file

@ -825,7 +825,7 @@ QVariant RetroshareDirModel::data(const QModelIndex &index, int role) const
if (role == RetroshareDirModel::FileNameRole) /* end of FileNameRole */
return QString::fromUtf8(details.name.c_str()) ;
if (role == Qt::TextColorRole)
if (role == Qt::ForegroundRole)
{
if((details.type == DIR_TYPE_FILE || details.type == DIR_TYPE_EXTRA_FILE) && details.hash.isNull())
return QVariant(QColor(Qt::green)) ;

View file

@ -242,7 +242,7 @@ void ShareManager::load()
listWidget->setCellWidget(row, COLUMN_SHARE_FLAGS, widget);
listWidget->setItem(row, COLUMN_GROUPS, new QTableWidgetItem()) ;
listWidget->item(row,COLUMN_GROUPS)->setBackgroundColor(QColor(183,236,181)) ;
listWidget->item(row,COLUMN_GROUPS)->setBackground(QColor(183,236,181)) ;
connect(widget,SIGNAL(flagsChanged(FileStorageFlags)),this,SLOT(updateFlags())) ;

View file

@ -21,12 +21,22 @@
#include <QApplication>
#include <QFile>
#include <QProcess>
#include <QSound>
#include <QDir>
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
#include <QAudioDevice>
#include <QMediaDevices>
#include <QUrl>
#elif QT_VERSION >= QT_VERSION_CHECK (5, 0, 0)
#include <QAudioDeviceInfo>
#endif
#if QT_VERSION < QT_VERSION_CHECK (6, 0, 0)
#include <QSound>
#endif
#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0)
#include <QAudio>
#include <QAudioDeviceInfo>
#endif
// #ifdef QMEDIAPLAYER
@ -241,15 +251,25 @@ void SoundManager::playFile(const QString &filename)
QString playFilename = realFilename(filename);
bool played = false ;
#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0)
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
if (!QMediaDevices::audioOutputs().isEmpty())
#elif QT_VERSION >= QT_VERSION_CHECK (5, 0, 0)
if (!QAudioDeviceInfo::availableDevices(QAudio::AudioOutput).isEmpty())
#else
if (QSound::isAvailable())
#endif
{
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
if (soundManager) {
soundManager->mSoundEffect.setSource(QUrl::fromLocalFile(playFilename));
soundManager->mSoundEffect.play();
played = true;
}
#else
QSound::play(playFilename);
played = true ;
#endif
}
if(!played) // let's go for the hard core stuff

View file

@ -24,6 +24,10 @@
#include <QObject>
#include <QMap>
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
#include <QSoundEffect>
#endif
#define SOUND_NEW_CHAT_MESSAGE "NewChatMessage"
#define SOUND_USER_ONLINE "User_go_Online"
#define SOUND_MESSAGE_ARRIVED "MessageArrived"
@ -91,6 +95,10 @@ public:
private:
SoundManager();
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
QSoundEffect mSoundEffect;
#endif
};
extern SoundManager *soundManager;

View file

@ -22,6 +22,7 @@
#include "gui/gxs/GxsIdTreeWidgetItem.h"
#include "gui/WikiPoos/WikiEditDialog.h"
#include "util/DateTime.h"
#include <iostream>
@ -727,10 +728,9 @@ void WikiEditDialog::loadBaseHistory(const uint32_t &token)
{
// From Forum stuff.
QDateTime qtime;
QDateTime qtime = DateTime::DateTimeFromTime_t(page.mMeta.mPublishTs);
QString text;
QString sort;
qtime.setTime_t(page.mMeta.mPublishTs);
sort = qtime.toString("yyyyMMdd_hhmmss");
text = qtime.toString("dd/MM/yy hh:mm");
@ -841,10 +841,9 @@ void WikiEditDialog::loadEditTreeData(const uint32_t &token)
{
// From Forum stuff.
QDateTime qtime;
QDateTime qtime = DateTime::DateTimeFromTime_t(snapshot.mMeta.mPublishTs);
QString text;
QString sort;
qtime.setTime_t(snapshot.mMeta.mPublishTs);
sort = qtime.toString("yyyyMMdd_hhmmss");
text = qtime.toString("dd/MM/yy hh:mm");

View file

@ -20,7 +20,11 @@
* *
*******************************************************************************/
#include <QRegularExpression>
#include "guiexprelement.h"
#include "util/DateTime.h"
#define STR_FIELDS_MIN_WFACTOR 20.0
#define SIZE_FIELDS_MIN_WFACTOR 8.0
#define DATE_FIELDS_MIN_WFACTOR 10.0
@ -398,10 +402,10 @@ void ExprParamElement::adjustForSearchType(ExprSearchType type)
{
// record which search type is active
searchType = type;
QRegExp regExp("0|[1-9][0-9]*");
numValidator = new QRegExpValidator(regExp, this);
QRegExp hexRegExp("[A-Fa-f0-9]*");
hexValidator = new QRegExpValidator(hexRegExp, this);
QRegularExpression regExp("0|[1-9][0-9]*");
numValidator = new QRegularExpressionValidator(regExp, this);
QRegularExpression hexRegExp("[A-Fa-f0-9]*");
hexValidator = new QRegularExpressionValidator(hexRegExp, this);
QHBoxLayout* hbox = static_cast<QHBoxLayout*>(layout());
clearLayout(hbox);
@ -607,7 +611,7 @@ uint64_t ExprParamElement::getIntValueFromField(QString fieldName, bool isToFiel
#else
QDateTime time = dateEdit->date().startOfDay();
#endif
val = (uint64_t)time.toTime_t();
val = (uint64_t) DateTime::DateTimeToTime_t(time);
break;
}
case SizeSearch:

View file

@ -34,6 +34,8 @@
#include <iostream>
class QRegularExpressionValidator;
enum ExprSearchType
{
NameSearch,
@ -191,8 +193,8 @@ public:
virtual QString toString();
private:
QRegExpValidator * numValidator;
QRegExpValidator * hexValidator;
QRegularExpressionValidator * numValidator;
QRegularExpressionValidator * hexValidator;
QFrame * rangeParamsFrame;
bool inRangedConfig;
uint64_t getIntValueFromField(QString fieldName, bool isToField=false,bool *ok = NULL);

View file

@ -229,7 +229,7 @@ void ChatLobbyUserNotify::iconClicked()
QString strName=tr("Remove All");
QAction *pAction = new QAction( QIcon(), strName, trayMenu);
ActionTag actionTag={0x0, "", true};
pAction->setData(qVariantFromValue(actionTag));
pAction->setData(QVariant::fromValue(actionTag));
trayMenu->addAction(pAction);
trayMenu->exec(QCursor::pos());
@ -268,14 +268,14 @@ void ChatLobbyUserNotify::makeSubMenu(QMenu* parentMenu, QIcon icoLobby, QString
QAction *pAction = new QAction( icoLobby, strName, lobbyMenu);
pAction->setToolTip(doc.toPlainText());
ActionTag actionTag={itCL->first, itMsg->first, false};
pAction->setData(qVariantFromValue(actionTag));
pAction->setData(QVariant::fromValue(actionTag));
lobbyMenu->addAction(pAction);
}
QString strName=tr("Remove All");
QAction *pAction = new QAction( icoLobby, strName, lobbyMenu);
ActionTag actionTag={itCL->first, "", true};
pAction->setData(qVariantFromValue(actionTag));
pAction->setData(QVariant::fromValue(actionTag));
lobbyMenu->addAction(pAction);
}

View file

@ -103,6 +103,7 @@
#include <QXmlStreamReader>
#include <QDomDocument>
#include <QTextStream>
#include <QRegularExpression>
#include "ChatStyle.h"
#include "gui/settings/rsharesettings.h"
@ -376,7 +377,7 @@ QString ChatStyle::formatMessage(enumFormatMessage type
QString strDate = DateTime::formatDate(timestamp.date()).prepend(QString("<a name=\"date\">")).append(QString("</a>"));
QString strTime = DateTime::formatTime(timestamp.time()).prepend(QString("<a name=\"time\">")).append(QString("</a>"));
int bi = name.lastIndexOf(QRegExp(" \\(.*\\)")); //trim location from the end
int bi = name.lastIndexOf(QRegularExpression(" \\(.*\\)")); //trim location from the end
QString strShortName = RsHtml::plainText(name.left(bi)).prepend(QString("<a name=\"name\">")).append(QString("</a>"));
//handle /me
@ -384,9 +385,9 @@ QString ChatStyle::formatMessage(enumFormatMessage type
//meName class for modifying the style of the name in the palce of /me
if(me){
messageBody = messageBody.replace(messageBody.indexOf("/me "), 3, strShortName.prepend(QString("<span class=\"meName\">")).append(QString("</span>"))); //replace only the first /me
style = style.remove(QRegExp("%nome%.*%/nome%")).remove("%me%").remove("%/me%");
style = style.remove(QRegularExpression("%nome%.*%/nome%")).remove("%me%").remove("%/me%");
} else {
style = style.remove(QRegExp("%me%.*%/me%")).remove("%nome%").remove("%/nome%");
style = style.remove(QRegularExpression("%me%.*%/me%")).remove("%nome%").remove("%/nome%");
}
QString formatMsg = style.replace("%name%", strName)
@ -425,8 +426,8 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle
while (reader.atEnd() == false) {
reader.readNext();
if (reader.isStartElement()) {
if (reader.name() == "RetroShare_Style") {
if (reader.attributes().value("version") == "1.0") {
if (reader.name() == QString("RetroShare_Style")) {
if (reader.attributes().value("version") == QString("1.0")) {
info.stylePath = stylePathRelative;
continue;
}
@ -438,22 +439,22 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle
continue;
}
if (reader.name() == "style") {
if (reader.name() == QString("style")) {
// read style information
while (reader.atEnd() == false) {
reader.readNext();
if (reader.isEndElement()) {
if (reader.name() == "style") {
if (reader.name() == QString("style")) {
break;
}
continue;
}
if (reader.isStartElement()) {
if (reader.name() == "name") {
if (reader.name() == QString("name")) {
info.styleName = reader.readElementText();
continue;
}
if (reader.name() == "description") {
if (reader.name() == QString("description")) {
info.styleDescription = reader.readElementText();
continue;
}
@ -463,22 +464,22 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle
continue;
}
if (reader.name() == "author") {
if (reader.name() == QString("author")) {
// read author information
while (reader.atEnd() == false) {
reader.readNext();
if (reader.isEndElement()) {
if (reader.name() == "author") {
if (reader.name() == QString("author")) {
break;
}
continue;
}
if (reader.isStartElement()) {
if (reader.name() == "name") {
if (reader.name() == QString("name")) {
info.authorName = reader.readElementText();
continue;
}
if (reader.name() == "email") {
if (reader.name() == QString("email")) {
info.authorEmail = reader.readElementText();
continue;
}

View file

@ -61,6 +61,7 @@
#include <QTimer>
#include <QToolTip>
#include <QInputDialog>
#include <QRegExp>
#include <time.h>
@ -1507,10 +1508,9 @@ void ChatWidget::on_markButton_clicked(bool bValue)
void ChatWidget::chooseColor()
{
bool ok;
QRgb color = QColorDialog::getRgba(currentColor.rgba(), &ok, window());
if (ok) {
currentColor = QColor(color);
QColor color = QColorDialog::getColor(currentColor, window(), "", QColorDialog::ShowAlphaChannel);
if (color.isValid()) {
currentColor = color;
PeerSettings->setPrivateChatColor(chatId, currentColor.name());
colorChanged();
setColorAndFont(false);
@ -1763,7 +1763,11 @@ bool ChatWidget::fileSave()
if (!file.open(QFile::WriteOnly))
return false;
QTextStream ts(&file);
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
ts.setEncoding(QStringConverter::Utf8);
#else
ts.setCodec(QTextCodec::codecForName("UTF-8"));
#endif
ts << ui->textBrowser->document()->toPlainText();
ui->textBrowser->document()->setModified(false);
return true;
@ -1930,7 +1934,7 @@ void ChatWidget::updatePeersCustomStateString(const QString& peer_id, const QStr
void ChatWidget::updateStatusString(const QString &statusMask, const QString &statusString, bool permanent)
{
ui->typingLabel->setText(QString(statusMask).arg(trUtf8(statusString.toUtf8()))); // displays info for 5 secs.
ui->typingLabel->setText(QString(statusMask).arg(tr(statusString.toUtf8()))); // displays info for 5 secs.
ui->typingPixmapLabel->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":icons/png/typing.png") );
if (statusString == "is typing...") {

View file

@ -23,6 +23,9 @@
#include <QPixmap>
#include <QCloseEvent>
#include <QMenu>
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
#include <QRandomGenerator>
#endif
#include "gui/common/FilesDefs.h"
#include "PopupChatWindow.h"
@ -205,7 +208,14 @@ void PopupChatWindow::showEvent(QShowEvent */*event*/)
if (tabbedWindow) {
Settings->loadWidgetInformation(this);
} else {
this->move(qrand()%100, qrand()%100); //avoid to stack multiple popup chat windows on the same position
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
int x = QRandomGenerator::global()->generate();
int y = QRandomGenerator::global()->generate();
#else
int x = qrand();
int y = qrand();
#endif
this->move(x % 100, y % 100); //avoid to stack multiple popup chat windows on the same position
PeerSettings->loadWidgetInformation(chatId, this);
}
}

View file

@ -42,6 +42,7 @@
#include "gui/common/FilesDefs.h"
#include "util/HandleRichText.h"
#include "util/imageutil.h"
#include "util/RsQtVersion.h"
#include "retroshare/rsinit.h"
#define ICONNAME "groupicon.png"
@ -107,7 +108,7 @@ void AvatarDialog::removeAvatar()
void AvatarDialog::updateInterface()
{
QPixmap pixmap = ui->avatarLabel->pixmap(Qt::ReturnByValue);
QPixmap pixmap = QLabel_pixmap(ui->avatarLabel);
if (!pixmap.isNull()) {
ui->removeButton->setEnabled(true);
} else {
@ -123,7 +124,7 @@ void AvatarDialog::setAvatar(const QPixmap &avatar)
void AvatarDialog::getAvatar(QPixmap &avatar)
{
avatar = ui->avatarLabel->pixmap(Qt::ReturnByValue);
avatar = QLabel_pixmap(ui->avatarLabel);
}
void AvatarDialog::getAvatar(QByteArray &avatar)

View file

@ -23,6 +23,7 @@
#include <QtGui>
#include <QScrollBar>
#include <QDebug>
#include <QMargins>
//*** FlowLayoutItem **********************************************************
@ -598,7 +599,8 @@ QSize FlowLayout::minimumSize() const
foreach (item, m_itemList)
size = size.expandedTo(item->minimumSize());
size += QSize(2*margin(), 2*margin());
QMargins margins = contentsMargins();
size += QSize(margins.left() + margins.right(), margins.top() + margins.bottom());
return size;
}
@ -645,7 +647,7 @@ void FlowLayout::performDrag()
if (curs==0) dragPixmap = itemPixmap;
QPixmap oldPixmap = dragPixmap;
if (curs!=0) dragPixmap = QPixmap(oldPixmap.width() + 20 , oldPixmap.height());
dragPixmap.fill(widget->palette().background().color());
dragPixmap.fill(widget->palette().window().color());
QPainter painter(&dragPixmap);
painter.drawPixmap(0, 0, oldPixmap);
if (curs!=0) painter.drawPixmap((20 * curs), 0, itemPixmap);

View file

@ -81,7 +81,7 @@ public:
void paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
opt.initFrom(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}

View file

@ -422,7 +422,7 @@ QVariant RsFriendListModel::data(const QModelIndex &index, int role) const
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::TextColorRole: return textColorRole(entry,index.column()) ;
case Qt::ForegroundRole: return textColorRole(entry,index.column()) ;
case Qt::DecorationRole: return decorationRole(entry,index.column()) ;
case FilterRole: return filterRole(entry,index.column()) ;

View file

@ -52,7 +52,7 @@ void GroupSelectionBox::fillGroups()
for (std::list<RsGroupInfo>::const_iterator it(groupIds.begin()); it != groupIds.end(); ++it) {
QListWidgetItem *item = new QListWidgetItem(GroupDefs::name(*it));
item->setData(ROLE_ID, QString::fromStdString(it->id.toStdString()));
item->setBackgroundColor(QColor(183,236,181));
item->setBackground(QColor(183,236,181));
addItem(item);
}

View file

@ -435,7 +435,7 @@ void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList<
else
{
item->setText(GTW_COLUMN_LAST_POST, itemInfo.lastpost.toString(Qt::ISODate).replace("T"," "));
item->setData(GTW_COLUMN_LAST_POST, ROLE_SORT, itemInfo.lastpost.toTime_t());
item->setData(GTW_COLUMN_LAST_POST, ROLE_SORT, (qint64) DateTime::DateTimeToTime_t(itemInfo.lastpost));
}

View file

@ -174,7 +174,7 @@ void HashBox::addAttachments(const QStringList& files,TransferRequestFlags tfl,
hashingInfo.item = file;
hashingInfo.flag = flag;
mHashingInfos.push_back(hashingInfo);
ui->verticalLayout->addWidget(file, 1, 0);
ui->verticalLayout->addWidget(file, 1);
}
QApplication::processEvents();

View file

@ -20,6 +20,7 @@
#include "gui/common/FilesDefs.h"
#include "LineEditClear.h"
#include "util/RsQtVersion.h"
#include <QToolButton>
#include <QStyle>
@ -237,7 +238,7 @@ void LineEditClear::setFilterButtonIcon(const QIcon &icon)
ensurePolished();
#if !defined(Q_OS_DARWIN)
QFontMetrics fm(this->font());
QSize size(fm.width("___"), fm.height());
QSize size(QFontMetrics_horizontalAdvance(fm, "___"), fm.height());
mFilterButton->setFixedSize(size);
mFilterButton->setIconSize(size);
#endif

View file

@ -213,7 +213,7 @@ NewFriendList::NewFriendList(QWidget */*parent*/) : /* RsAutoUpdatePage(5000,par
mProxyModel->setSortRole(RsFriendListModel::SortRole);
mProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
mProxyModel->setFilterRole(RsFriendListModel::FilterRole);
mProxyModel->setFilterRegExp(QRegExp(RsFriendListModel::FilterString));
QSortFilterProxyModel_setFilterRegularExpression(mProxyModel, RsFriendListModel::FilterString);
ui->peerTreeWidget->setModel(mProxyModel);
RSElidedItemDelegate *itemDelegate = new RSElidedItemDelegate(this);
@ -448,7 +448,7 @@ void NewFriendList::recursSaveExpandedItems(const QModelIndex& index,const QMode
exp.insert(local_path) ;
for(int row=0;row<mProxyModel->rowCount(index);++row)
recursSaveExpandedItems(index.child(row,0),current_index,local_path,exp,sel,indx+1) ;
recursSaveExpandedItems(mProxyModel->index(row,0,index),current_index,local_path,exp,sel,indx+1) ;
}
#ifdef DEBUG_NEW_FRIEND_LIST
else
@ -479,7 +479,7 @@ void NewFriendList::recursRestoreExpandedItems(const QModelIndex& index, const Q
ui->peerTreeWidget->setExpanded(index,true) ;
for(int row=0;row<mProxyModel->rowCount(index);++row)
recursRestoreExpandedItems(index.child(row,0),local_path,exp,sel,selected_index,indx+1) ;
recursRestoreExpandedItems(mProxyModel->index(row,0,index),local_path,exp,sel,selected_index,indx+1) ;
}
#ifdef DEBUG_NEW_FRIEND_LIST
else
@ -558,7 +558,7 @@ void NewFriendList::processSettings(bool load)
void NewFriendList::toggleSortByState(bool sort)
{
mProxyModel->setSortByState(sort);
mProxyModel->setFilterRegExp(QRegExp(QString(RsFriendListModel::FilterString))) ;// triggers a re-display.
QSortFilterProxyModel_setFilterRegularExpression(mProxyModel, QString(RsFriendListModel::FilterString)) ;// triggers a re-display.
processSettings(false);
}
@ -1419,7 +1419,11 @@ bool NewFriendList::exportFriendlist(QString &fileName)
root.appendChild(groups);
QTextStream ts(&file);
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
ts.setEncoding(QStringConverter::Utf8);
#else
ts.setCodec("UTF-8");
#endif
ts << doc.toString();
file.close();
@ -1468,7 +1472,7 @@ bool NewFriendList::importFriendlist(QString &fileName, bool &errorPeers, bool &
return false;
}
bool ok = doc.setContent(&file);
bool ok = (bool) doc.setContent(&file);
file.close();
if(!ok) {
@ -1623,7 +1627,7 @@ bool NewFriendList::getOrCreateGroup(const std::string& name, uint flag, RsNodeG
void NewFriendList::setShowUnconnected(bool show)
{
mProxyModel->setShowOfflineNodes(show);
mProxyModel->setFilterRegExp(QRegExp(QString(RsFriendListModel::FilterString))) ;// triggers a re-display.
QSortFilterProxyModel_setFilterRegularExpression(mProxyModel, QString(RsFriendListModel::FilterString)) ;// triggers a re-display.
}
bool NewFriendList::isColumnVisible(int col) const
@ -1682,7 +1686,7 @@ void NewFriendList::filterItems(const QString &text)
mModel->setFilter(RsFriendListModel::FILTER_TYPE_ID,lst);
// We do this in order to trigger a new filtering action in the proxy model.
mProxyModel->setFilterRegExp(QRegExp(QString(RsFriendListModel::FilterString))) ;
QSortFilterProxyModel_setFilterRegularExpression(mProxyModel, QString(RsFriendListModel::FilterString)) ;
if(!lst.empty())
ui->peerTreeWidget->expandAll();

View file

@ -35,6 +35,7 @@
#include <retroshare-gui/RsAutoUpdatePage.h>
#include "rshare.h"
#include "RSGraphWidget.h"
#include "util/RsQtVersion.h"
#if QT_VERSION < 0x040700
#include <sys/time.h>
@ -655,12 +656,12 @@ void RSGraphWidget::paintScale1()
if (_flags & RSGRAPH_FLAGS_DARK_STYLE){
_painter->setPen(SCALE_COLOR_DARK);
_painter->drawText(QPointF(SCALE_WIDTH*fact - QFontMetricsF(font()).width(text) - 4*fact, pos+0.4*FS), text);
_painter->drawText(QPointF(SCALE_WIDTH*fact - QFontMetrics_horizontalAdvance(QFontMetricsF(font()), text) - 4*fact, pos+0.4*FS), text);
_painter->setPen(GRID_COLOR_DARK);
_painter->drawLine(QPointF(SCALE_WIDTH*fact, pos), QPointF(_rec.width(), pos));
}else{
_painter->setPen(SCALE_COLOR);
_painter->drawText(QPointF(SCALE_WIDTH*fact - QFontMetricsF(font()).width(text) - 4*fact, pos+0.4*FS), text);
_painter->drawText(QPointF(SCALE_WIDTH*fact - QFontMetrics_horizontalAdvance(QFontMetricsF(font()), text) - 4*fact, pos+0.4*FS), text);
_painter->setPen(GRID_COLOR);
_painter->drawLine(QPointF(SCALE_WIDTH*fact, pos), QPointF(_rec.width(), pos));
}
@ -696,18 +697,24 @@ void RSGraphWidget::paintScale2()
void RSGraphWidget::wheelEvent(QWheelEvent *e)
{
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
int delta = e->angleDelta().y();
#else
int delta = e->delta();
#endif
if(e->modifiers() & Qt::ShiftModifier)
if(e->delta() > 0)
if(delta > 0)
_time_filter *= 1.1 ;
else
_time_filter /= 1.1 ;
else if(e->modifiers() & Qt::ControlModifier)
if(e->delta() > 0)
if(delta > 0)
_linewidthscale *= 1.2 ;
else
_linewidthscale /= 1.2 ;
else
if(e->delta() > 0)
if(delta > 0)
_time_scale *= 1.1 ;
else
_time_scale /= 1.1 ;

View file

@ -35,6 +35,7 @@
#include <QPlainTextEdit>
#include <QTextDocumentFragment>
#include <QScrollBar>
#include <QRegExp>
#include <iostream>
@ -284,10 +285,10 @@ void RSTextBrowser::contextMenuEvent(QContextMenuEvent *event)
QMenu *RSTextBrowser::createStandardContextMenuFromPoint(const QPoint &widgetPos)
{
QMatrix matrix;
matrix.translate(horizontalScrollBar()->value(), verticalScrollBar()->value());
QTransform transform;
transform.translate(horizontalScrollBar()->value(), verticalScrollBar()->value());
QMenu *menu = QTextBrowser::createStandardContextMenu(matrix.map(widgetPos));
QMenu *menu = QTextBrowser::createStandardContextMenu(transform.map(widgetPos));
menu->addSeparator();
QAction *a = menu->addAction(FilesDefs::getIconFromQtResourcePath("://icons/textedit/code.png"), tr("View &Source"), this, SLOT(viewSource()));

View file

@ -194,7 +194,7 @@ RsCollection::RsCollection(const QString& fileName, RsCollectionErrorCode& error
}
QDomDocument xml_doc;
bool ok = xml_doc.setContent(&file) ;
bool ok = (bool) xml_doc.setContent(&file);
if(!ok)
{
@ -311,7 +311,11 @@ bool RsCollection::save(const QString& fileName) const
xml_doc.appendChild(root);
QTextStream stream(&file) ;
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
stream.setEncoding(QStringConverter::Utf8);
#else
stream.setCodec("UTF-8") ;
#endif
stream << xml_doc.toString() ;
file.close();

View file

@ -239,7 +239,7 @@ QVariant RsCollectionModel::data(const QModelIndex& index, int role) const
case Qt::DisplayRole: return displayRole(i,index.column());
case Qt::DecorationRole: return decorationRole(i,index.column());
case Qt::CheckStateRole: return checkStateRole(i,index.column());
case Qt::TextColorRole: return textColorRole(i,index.column());
case Qt::ForegroundRole: return textColorRole(i,index.column());
default:
return QVariant();
}

View file

@ -21,6 +21,7 @@
// This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-diagramscene-arrow-cpp.html
#include <QPainter>
#include "gui/settings/rsharesettings.h"
#include "arrow.h"
#include "elnode.h"
@ -121,8 +122,11 @@ void Arrow::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *
cos(angle - Pi / 3) * arrowSize);
QPointF destArrowP2 = destPoint + QPointF(sin(angle - Pi + Pi / 3) * arrowSize,
cos(angle - Pi + Pi / 3) * arrowSize);
painter->setBrush(Qt::black);
if (Settings->getSheetName() == ":Standard_Dark"){
painter->setBrush(Qt::white);
} else {
painter->setBrush(Qt::black);
}
painter->drawPolygon(QPolygonF() << line.p1() << sourceArrowP1 << sourceArrowP2);
painter->drawPolygon(QPolygonF() << line.p2() << destArrowP1 << destArrowP2);
}

View file

@ -21,6 +21,7 @@
// This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-elasticnodes-edge-cpp.html
#include <QPainter>
#include "gui/settings/rsharesettings.h"
#include "edge.h"
#include "elnode.h"
@ -103,7 +104,11 @@ void Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
// Draw the line itself
QLineF line(sourcePoint, destPoint);
painter->setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
if (Settings->getSheetName() == ":Standard_Dark"){
painter->setPen(QPen(Qt::white, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
} else {
painter->setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
}
painter->drawLine(line);
return ;
@ -146,7 +151,11 @@ void Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
QPointF destArrowP1 = destPoint + QPointF( sin_theta_mins_pi_over_3 * arrowSize, cos_theta_mins_pi_over_3 * arrowSize);
QPointF destArrowP2 = destPoint + QPointF(sin_theta_mins_2_pi_over_3 * arrowSize, cos_theta_mins_2_pi_over_3 * arrowSize);
painter->setBrush(Qt::black);
if (Settings->getSheetName() == ":Standard_Dark"){
painter->setBrush(Qt::white);
}else {
painter->setBrush(Qt::black);
}
painter->drawConvexPolygon(QPolygonF() << line.p1() << sourceArrowP1 << sourceArrowP2);
painter->drawConvexPolygon(QPolygonF() << line.p2() << destArrowP1 << destArrowP2);
}

View file

@ -21,6 +21,7 @@
// This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-elasticnodes-node-cpp.html
#include "gui/common/FilesDefs.h"
#include "gui/settings/rsharesettings.h"
#include <math.h>
#include <QApplication>
@ -38,6 +39,7 @@
#include "edge.h"
#include "elnode.h"
#include "graphwidget.h"
#include "util/RsQtVersion.h"
#define IMAGE_AUTHED ":/images/accepted16.png"
#define IMAGE_DENIED ":/images/denied16.png"
@ -302,7 +304,11 @@ void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
#endif
}
painter->setBrush(gradient);
painter->setPen(QPen(Qt::black, 0));
if (Settings->getSheetName() == ":Standard_Dark"){
painter->setPen(QPen(Qt::white, 0));
} else {
painter->setPen(QPen(Qt::black, 0));
}
painter->drawEllipse(-mNodeDrawSize2, -mNodeDrawSize2, mNodeDrawSize, mNodeDrawSize);
QString txt = QString::fromUtf8(_desc_string.c_str());
@ -313,7 +319,7 @@ void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
if (!mDeterminedBB)
{
QRect textBox = painter->boundingRect(-10, 5*f, QFontMetricsF(graph->font()).width(txt), 1.5*m, Qt::AlignVCenter, QString::fromUtf8(_desc_string.c_str()));
QRect textBox = painter->boundingRect(-10, 5*f, QFontMetrics_horizontalAdvance(QFontMetricsF(graph->font()), txt), 1.5*m, Qt::AlignVCenter, QString::fromUtf8(_desc_string.c_str()));
mBBWidth = textBox.width()+40*f;
mDeterminedBB = true;
}

View file

@ -29,6 +29,9 @@
#include <QDebug>
#include <QGraphicsScene>
#include <QWheelEvent>
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
#include <QRandomGenerator>
#endif
#include <math.h>
@ -131,8 +134,16 @@ void GraphWidget::keyPressEvent(QKeyEvent *event)
case Qt::Key_Space:
case Qt::Key_Enter:
foreach (QGraphicsItem *item, scene()->items()) {
if (qgraphicsitem_cast<Node *>(item))
item->setPos(-150 + qrand() % 300, -150 + qrand() % 300);
if (qgraphicsitem_cast<Node *>(item)) {
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
int x = QRandomGenerator::global()->generate();
int y = QRandomGenerator::global()->generate();
#else
int x = qrand();
int y = qrand();
#endif
item->setPos(-150 + x % 300, -150 + y % 300);
}
}
break;
default:
@ -331,12 +342,18 @@ void GraphWidget::resizeEvent(QResizeEvent *event)
void GraphWidget::wheelEvent(QWheelEvent *event)
{
scaleView(pow((double)2, -event->delta() / 240.0));
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
int delta = event->angleDelta().y();
#else
int delta = event->delta();
#endif
scaleView(pow((double)2, -delta / 240.0));
}
void GraphWidget::scaleView(qreal scaleFactor)
{
qreal factor = matrix().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width();
qreal factor = transform().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width();
if (factor < 0.07 || factor > 100)
return;

View file

@ -110,7 +110,7 @@ void SecurityIpItem::updateItemStatic()
}
QDateTime currentTime = QDateTime::currentDateTime();
ui->timeLabel->setText(DateTime::formatLongDateTime(currentTime.toTime_t()));
ui->timeLabel->setText(DateTime::formatLongDateTime(currentTime));
}
void SecurityIpItem::updateItem()

View file

@ -153,7 +153,7 @@ void SecurityItem::updateItemStatic()
titleLabel->setText(title);
QDateTime currentTime = QDateTime::currentDateTime();
timeLabel->setText(DateTime::formatLongDateTime(currentTime.toTime_t()));
timeLabel->setText(DateTime::formatLongDateTime(currentTime));
if (mIsHome)
{

View file

@ -28,6 +28,7 @@
#include "gui/gxs/GxsCreateCommentDialog.h"
#include "gui/gxs/GxsIdTreeWidgetItem.h"
#include "util/qtthreadsutils.h"
#include "util/DateTime.h"
#include <QAbstractTextDocumentLayout>
#include <QApplication>
@ -798,8 +799,7 @@ void GxsCommentTreeWidget::insertComments(const std::vector<RsGxsComment>& comme
QString text;
{
QDateTime qtime ;
qtime.setTime_t(comment.mMeta.mPublishTs) ;
QDateTime qtime = DateTime::DateTimeFromTime_t(comment.mMeta.mPublishTs) ;
text = qtime.toString("yyyy-MM-dd hh:mm:ss") ;
item->setText(PCITEM_COLUMN_DATE, text) ;

View file

@ -36,6 +36,7 @@
#include "gui/common/GroupTreeWidget.h"
#include "util/qtthreadsutils.h"
#include "util/misc.h"
#include "util/RsQtVersion.h"
// class GxsChannelGroupInfoData : public RsUserdata
// {

View file

@ -283,7 +283,13 @@ void ZoomableLabel::wheelEvent(QWheelEvent *me)
if(!mZoomEnabled)
return;
float new_zoom_factor = (me->delta() > 0)?(mZoomFactor*1.05):(mZoomFactor/1.05);
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
int delta = me->angleDelta().y();
#else
int delta = me->delta();
#endif
float new_zoom_factor = (delta > 0)?(mZoomFactor*1.05):(mZoomFactor/1.05);
float new_center_x = mCenterX;
float new_center_y = mCenterY;

View file

@ -227,7 +227,7 @@ void ChannelPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem &
y += font_height;
y += font_height/2.0;
QString info_text = QDateTime::fromMSecsSinceEpoch(qint64(1000)*post.mMeta.mPublishTs).toString(Qt::DefaultLocaleShortDate);
QString info_text = QLocale::system().toString(DateTime::DateTimeFromTime_t(post.mMeta.mPublishTs), QLocale::ShortFormat);
if(post.mAttachmentCount > 0)
info_text += ", " + QString::number(post.mAttachmentCount)+ " " +((post.mAttachmentCount>1)?tr("files"):tr("file")) + " (" + misc::friendlyUnit(qulonglong(post.mSize)) + ")" ;
@ -355,9 +355,9 @@ QSize ChannelPostFilesDelegate::sizeHint(const QStyleOptionViewItem& option, con
switch(index.column())
{
case RsGxsChannelPostFilesModel::COLUMN_FILES_NAME: return QSize(1.1*fm.width(QString::fromUtf8(file.mName.c_str())),fm.height());
case RsGxsChannelPostFilesModel::COLUMN_FILES_SIZE: return QSize(1.1*fm.width(misc::friendlyUnit(qulonglong(file.mSize))),fm.height());
case RsGxsChannelPostFilesModel::COLUMN_FILES_DATE: return QSize(1.1*fm.width(QDateTime::fromMSecsSinceEpoch(file.mPublishTime*1000).toString("MM/dd/yyyy, hh:mm")),fm.height());
case RsGxsChannelPostFilesModel::COLUMN_FILES_NAME: return QSize(1.1*QFontMetrics_horizontalAdvance(fm, QString::fromUtf8(file.mName.c_str())),fm.height());
case RsGxsChannelPostFilesModel::COLUMN_FILES_SIZE: return QSize(1.1*QFontMetrics_horizontalAdvance(fm, misc::friendlyUnit(qulonglong(file.mSize))),fm.height());
case RsGxsChannelPostFilesModel::COLUMN_FILES_DATE: return QSize(1.1*QFontMetrics_horizontalAdvance(fm, QDateTime::fromMSecsSinceEpoch(file.mPublishTime*1000).toString("MM/dd/yyyy, hh:mm")),fm.height());
default:
case RsGxsChannelPostFilesModel::COLUMN_FILES_FILE: return QSize(option.rect.width(),GxsChannelFilesStatusWidget(file).height());
}
@ -463,8 +463,8 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI
QHeaderView * channelpostfilesheader = ui->channelPostFiles_TV->header () ;
QHeaderView * channelfilesheader = ui->channelFiles_TV->header () ;
channelpostfilesheader->resizeSection (RsGxsChannelPostFilesModel::COLUMN_FILES_NAME, fm.width("RetroShare-v0.6.5-1487-g6714648e5-Windows-x64-portable-20200518-Qt-5.14.2.7z"));
channelfilesheader->resizeSection (RsGxsChannelPostFilesModel::COLUMN_FILES_NAME, fm.width("RetroShare-v0.6.5-1487-g6714648e5-Windows-x64-portable-20200518-Qt-5.14.2.7z"));
channelpostfilesheader->resizeSection (RsGxsChannelPostFilesModel::COLUMN_FILES_NAME, QFontMetrics_horizontalAdvance(fm, "RetroShare-v0.6.5-1487-g6714648e5-Windows-x64-portable-20200518-Qt-5.14.2.7z"));
channelfilesheader->resizeSection (RsGxsChannelPostFilesModel::COLUMN_FILES_NAME, QFontMetrics_horizontalAdvance(fm, "RetroShare-v0.6.5-1487-g6714648e5-Windows-x64-portable-20200518-Qt-5.14.2.7z"));
/* Initialize feed widget */
//ui->feedWidget->setSortRole(ROLE_PUBLISH, Qt::DescendingOrder);

View file

@ -418,7 +418,7 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const
case Qt::DecorationRole: return decorationRole(fmpe,index.column()) ;
case Qt::ToolTipRole: return toolTipRole (fmpe,index.column()) ;
case Qt::UserRole: return userRole (fmpe,index.column()) ;
case Qt::TextColorRole: return textColorRole (fmpe,index.column()) ;
case Qt::ForegroundRole: return textColorRole (fmpe,index.column()) ;
case Qt::BackgroundRole: return backgroundRole(fmpe,index.column()) ;
case FilterRole: return filterRole (fmpe,index.column()) ;
@ -670,8 +670,7 @@ QVariant RsGxsForumModel::displayRole(const ForumModelPostEntry& fmpe,int col) c
if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_MISSING)
return QVariant(QString());
QDateTime qtime;
qtime.setTime_t(fmpe.mPublishTs);
QDateTime qtime = DateTime::DateTimeFromTime_t(fmpe.mPublishTs);
return QVariant(DateTime::formatDateTime(qtime));
}

View file

@ -219,7 +219,11 @@ public:
if(left_is_not_pinned ^ right_is_not_pinned)
return (m_header->sortIndicatorOrder()==Qt::AscendingOrder)?right_is_not_pinned:left_is_not_pinned ; // always put pinned posts on top
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
return QVariant::compare(left.data(RsGxsForumModel::SortRole), right.data(RsGxsForumModel::SortRole)) < 0;
#else
return left.data(RsGxsForumModel::SortRole) < right.data(RsGxsForumModel::SortRole) ;
#endif
}
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override
@ -264,7 +268,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
ui->threadTreeWidget->setModel(mThreadProxyModel);
mThreadProxyModel->setFilterRole(RsGxsForumModel::FilterRole);
mThreadProxyModel->setFilterRegExp(QRegExp(QString(RsGxsForumModel::FilterString))) ;
QSortFilterProxyModel_setFilterRegularExpression(mThreadProxyModel, QString(RsGxsForumModel::FilterString)) ;
ui->threadTreeWidget->setSortingEnabled(true);
@ -540,7 +544,7 @@ void GxsForumThreadWidget::recursSaveExpandedItems(const QModelIndex& index, QLi
if(ui->threadTreeWidget->isExpanded(index))
{
for(int row=0;row<mThreadProxyModel->rowCount(index);++row)
recursSaveExpandedItems(index.child(row,0),expanded_items) ;
recursSaveExpandedItems(mThreadProxyModel->index(row,0,index),expanded_items) ;
RsGxsMessageId message_id(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_MSGID).data(Qt::UserRole).toString().toStdString());
expanded_items.push_back(message_id);
@ -1854,7 +1858,7 @@ void GxsForumThreadWidget::filterItems(const QString& text)
mThreadModel->setFilter(filterColumn,lst,count) ;
// We do this in order to trigger a new filtering action in the proxy model.
mThreadProxyModel->setFilterRegExp(QRegExp(QString(RsGxsForumModel::FilterString))) ;
QSortFilterProxyModel_setFilterRegularExpression(mThreadProxyModel, QString(RsGxsForumModel::FilterString)) ;
if(!lst.empty())
ui->threadTreeWidget->expandAll();

View file

@ -104,7 +104,7 @@ HelpBrowser::HelpBrowser(QWidget *parent)
/* Show the first help topic in the tree */
ui.treeContents->setCurrentItem(ui.treeContents->topLevelItem(0));
ui.treeContents->setItemExpanded(ui.treeContents->topLevelItem(0), true);
ui.treeContents->topLevelItem(0)->setExpanded(true);
}
HelpBrowser::~HelpBrowser()
@ -231,7 +231,7 @@ HelpBrowser::contentsItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *prev
QList<QTreeWidgetItem *> selected = ui.treeSearch->selectedItems();
/* Deselect the selection in the search tree */
if (!selected.isEmpty()) {
ui.treeSearch->setItemSelected(selected[0], false);
selected[0]->setSelected(false);
}
currentItemChanged(current, prev);
}
@ -243,7 +243,7 @@ HelpBrowser::searchItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *prev)
QList<QTreeWidgetItem *> selected = ui.treeContents->selectedItems();
/* Deselect the selection in the contents tree */
if (!selected.isEmpty()) {
ui.treeContents->setItemSelected(selected[0], false);
selected[0]->setSelected(false);
}
/* Change to selected page */
@ -288,7 +288,7 @@ HelpBrowser::findTopicItem(QTreeWidgetItem *startItem, QString topic)
if (subtopic == item->data(0, ROLE_TOPIC_ID).toString().toLower()) {
/* Found a subtopic match, so expand this item */
ui.treeContents->setItemExpanded(item, true);
item->setSelected(true);
if (!topic.contains(".")) {
/* Found the exact topic */
return item;
@ -314,10 +314,10 @@ HelpBrowser::showTopic(QString topic)
* tree item. */
QTreeWidgetItem* selected = ui.treeContents->selectedItems()[0];
if (selected) {
ui.treeContents->setItemSelected(selected, false);
selected->setSelected(false);
}
ui.treeContents->setItemExpanded(ui.treeContents->topLevelItem(0), true);
ui.treeContents->setItemSelected(item, true);
ui.treeContents->topLevelItem(0)->setExpanded(true);
item->setSelected(true);
currentItemChanged(item, selected);
}
}

View file

@ -44,7 +44,7 @@ void IMHistoryItemPainter::paint(QPainter *painter, const QStyleOptionViewItem &
// if (mode == Editable) {
// painter->setBrush(option.palette.highlight());
// } else {
painter->setBrush(option.palette.foreground());
painter->setBrush(option.palette.windowText());
// }
if (option.state & QStyle::State_Selected) {
painter->fillRect(option.rect, option.palette.highlight());

View file

@ -295,7 +295,7 @@ void ImHistoryBrowser::fillItem(QListWidgetItem *itemWidget, HistoryMsg& msg)
QColor backgroundColor = ui.listWidget->palette().base().color();
QString formatMsg = style.formatMessage(type, name, DateTime::DateTimeFromTime_t(msg.sendTime), messageText, 0, backgroundColor);
itemWidget->setData(Qt::DisplayRole, qVariantFromValue(IMHistoryItemPainter(formatMsg)));
itemWidget->setData(Qt::DisplayRole, QVariant::fromValue(IMHistoryItemPainter(formatMsg)));
itemWidget->setData(ROLE_MSGID, msg.msgId);
/* calculate plain text */

View file

@ -2403,8 +2403,13 @@ bool MessageComposer::fileSave()
if (!file.open(QFile::WriteOnly))
return false;
QTextStream ts(&file);
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
ts.setEncoding(QStringConverter::Utf8);
ts << ui.msgText->document()->toHtml();
#else
ts.setCodec(QTextCodec::codecForName("UTF-8"));
ts << ui.msgText->document()->toHtml("UTF-8");
#endif
std::cerr << "Setting modified 002 = false" << std::endl;
ui.msgText->document()->setModified(false);
return true;
@ -2433,7 +2438,7 @@ void MessageComposer::filePrint()
printer.setFullPage(true);
QPrintDialog *dlg = new QPrintDialog(&printer, this);
if (ui.msgText->textCursor().hasSelection())
dlg->addEnabledOption(QAbstractPrintDialog::PrintSelection);
dlg->setOption(QPrintDialog::PrintSelection);
dlg->setWindowTitle(tr("Print Document"));
if (dlg->exec() == QDialog::Accepted) {
ui.msgText->print(&printer);

View file

@ -273,7 +273,7 @@ QVariant RsMessageModel::data(const QModelIndex &index, int role) const
case Qt::DecorationRole: return decorationRole(fmpe,index.column()) ;
case Qt::ToolTipRole: return toolTipRole (fmpe,index.column()) ;
case Qt::UserRole: return userRole (fmpe,index.column()) ;
case Qt::TextColorRole: return textColorRole (fmpe,index.column()) ;
case Qt::ForegroundRole: return textColorRole (fmpe,index.column()) ;
case Qt::BackgroundRole: return backgroundRole(fmpe,index.column()) ;
case FilterRole: return filterRole (fmpe,index.column()) ;
@ -504,8 +504,7 @@ QVariant RsMessageModel::displayRole(const Rs::Msgs::MsgInfoSummary& fmpe,int co
case COLUMN_THREAD_SPAM:
case COLUMN_THREAD_READ:return QVariant();
case COLUMN_THREAD_DATE:{
QDateTime qtime;
qtime.setTime_t(fmpe.ts);
QDateTime qtime = DateTime::DateTimeFromTime_t(fmpe.ts);
return QVariant(DateTime::formatDateTime(qtime));
}

View file

@ -640,7 +640,7 @@ void MessageWidget::fill(const std::string &msgId)
ui.trans_ToText->setText(to_text);
int recipientsCount = ui.trans_ToText->toPlainText().split(QRegExp("(\\s|\\n|\\r)+"), QtSkipEmptyParts).count();
int recipientsCount = ui.trans_ToText->toPlainText().split(QRegularExpression("(\\s|\\n|\\r)+"), QtSkipEmptyParts).count();
ui.expandButton->setText( QString::number(recipientsCount)+ " " + tr("more"));
if (recipientsCount >=20) {
@ -775,7 +775,7 @@ void MessageWidget::print()
printer.setFullPage(true);
QPrintDialog *dlg = new QPrintDialog(&printer, this);
if (ui.msgText->textCursor().hasSelection())
dlg->addEnabledOption(QAbstractPrintDialog::PrintSelection);
dlg->setOption(QPrintDialog::PrintSelection);
dlg->setWindowTitle(tr("Print Document"));
if (dlg->exec() == QDialog::Accepted) {
ui.msgText->print(&printer);
@ -802,8 +802,13 @@ void MessageWidget::saveAs()
if (!file.open(QFile::WriteOnly))
return;
QTextStream ts(&file);
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
ts.setEncoding(QStringConverter::Utf8);
ts << ui.msgText->document()->toHtml();
#else
ts.setCodec(QTextCodec::codecForName("UTF-8"));
ts << ui.msgText->document()->toHtml("UTF-8");
#endif
ui.msgText->document()->setModified(false);
}
}

View file

@ -117,7 +117,11 @@ public:
protected:
bool lessThan(const QModelIndex& left, const QModelIndex& right) const override
{
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
return QVariant::compare(sourceModel()->data(left, RsMessageModel::SortRole), sourceModel()->data(right, RsMessageModel::SortRole)) < 0;
#else
return sourceModel()->data(left, RsMessageModel::SortRole) < sourceModel()->data(right, RsMessageModel::SortRole) ;
#endif
}
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override
@ -157,7 +161,7 @@ MessagesDialog::MessagesDialog(QWidget *parent)
mMessageProxyModel->setSortRole(RsMessageModel::SortRole);
mMessageProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
mMessageProxyModel->setFilterRole(RsMessageModel::FilterRole);
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString));
QSortFilterProxyModel_setFilterRegularExpression(mMessageProxyModel, RsMessageModel::FilterString);
ui.messageTreeWidget->setModel(mMessageProxyModel);
@ -209,15 +213,15 @@ MessagesDialog::MessagesDialog(QWidget *parent)
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_CONTENT,true);
ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_MSGID,true);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_STAR, fm.width('0')*1.5);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_ATTACHMENT, fm.width('0')*1.5);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_READ, fm.width('0')*1.5);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_SPAM, fm.width('0')*1.5);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_STAR, QFontMetrics_horizontalAdvance(fm, '0')*1.5);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_ATTACHMENT, QFontMetrics_horizontalAdvance(fm, '0')*1.5);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_READ, QFontMetrics_horizontalAdvance(fm, '0')*1.5);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_SPAM, QFontMetrics_horizontalAdvance(fm, '0')*1.5);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_SUBJECT, fm.width("You have a message")*3.0);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_AUTHOR, fm.width("[Retroshare]")*1.1);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_TO, fm.width("[Retroshare]")*1.1);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_DATE, fm.width("01/01/1970")*1.1);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_SUBJECT, QFontMetrics_horizontalAdvance(fm, "You have a message")*3.0);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_AUTHOR, QFontMetrics_horizontalAdvance(fm, "[Retroshare]")*1.1);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_TO, QFontMetrics_horizontalAdvance(fm, "[Retroshare]")*1.1);
msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_DATE, QFontMetrics_horizontalAdvance(fm, "01/01/1970")*1.1);
msgwheader->setSectionResizeMode(RsMessageModel::COLUMN_THREAD_SUBJECT, QHeaderView::Interactive);
msgwheader->setSectionResizeMode(RsMessageModel::COLUMN_THREAD_AUTHOR, QHeaderView::Interactive);
@ -1016,7 +1020,7 @@ void MessagesDialog::changeQuickView(int newrow)
}
mMessageModel->setQuickViewFilter(f);
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); // this triggers the update of the proxy model
QSortFilterProxyModel_setFilterRegularExpression(mMessageProxyModel, RsMessageModel::FilterString); // this triggers the update of the proxy model
}
// click in messageTreeWidget
@ -1263,7 +1267,7 @@ void MessagesDialog::filterChanged(const QString& text)
}
mMessageModel->setFilter(f,items);
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); // this triggers the update of the proxy model
QSortFilterProxyModel_setFilterRegularExpression(mMessageProxyModel, RsMessageModel::FilterString); // this triggers the update of the proxy model
QCoreApplication::processEvents();
}
@ -1289,7 +1293,7 @@ void MessagesDialog::filterColumnChanged(int column)
QStringList items = ui.filterLineEdit->text().split(' ',QtSkipEmptyParts);
mMessageModel->setFilter(f,items);
mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); // this triggers the update of the proxy model
QSortFilterProxyModel_setFilterRegularExpression(mMessageProxyModel, RsMessageModel::FilterString); // this triggers the update of the proxy model
// save index
Settings->setValueToGroup("MessageDialog", "filterColumn", column);

View file

@ -1243,6 +1243,7 @@ QComboBox {
/* changed to 4px to fix #239 */
/* Fixes #103, #111 */
min-height: 1.5em;
min-width: 2em;
/* padding-top: 2px; removed to fix #132 */
/* padding-bottom: 2px; removed to fix #132 */
/* min-width: 75px; removed to fix #109 */

View file

@ -1243,6 +1243,7 @@ QComboBox {
/* changed to 4px to fix #239 */
/* Fixes #103, #111 */
min-height: 1.5em;
min-width: 2em;
/* padding-top: 2px; removed to fix #132 */
/* padding-bottom: 2px; removed to fix #132 */
/* min-width: 75px; removed to fix #109 */

View file

@ -78,7 +78,7 @@ QString ChatPage::loadStyleInfo(ChatStyle::enumStyleType type, QComboBox *style_
{
whileBlocking(style_CB)->insertItem(n,style->styleName);
style_CB->setItemData(n, qVariantFromValue(*style),Qt::UserRole);
style_CB->setItemData(n, QVariant::fromValue(*style),Qt::UserRole);
if (style->stylePath == stylePath) {
activeItem = n;
@ -686,10 +686,9 @@ void ChatPage::on_cbSearch_WithoutLimit_toggled(bool checked)
void ChatPage::on_btSearch_FoundColor_clicked()
{
bool ok;
QRgb color = QColorDialog::getRgba(rgbChatSearchFoundColor, &ok, window());
if (ok) {
rgbChatSearchFoundColor=color;
QColor color = QColorDialog::getColor(QColor::fromRgba(rgbChatSearchFoundColor), window(), "", QColorDialog::ShowAlphaChannel);
if (color.isValid()) {
rgbChatSearchFoundColor = color.rgba();
QPixmap pix(24, 24);
pix.fill(color);
ui.btSearch_FoundColor->setIcon(pix);

View file

@ -212,7 +212,11 @@ bool CryptoPage::fileSave()
if (!file.open(QFile::WriteOnly))
return false;
QTextStream ts(&file);
#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0)
ts.setEncoding(QStringConverter::Utf8);
#else
ts.setCodec(QTextCodec::codecForName("UTF-8"));
#endif
ts << ui.certplainTextEdit->document()->toPlainText();
return true;
}

View file

@ -28,6 +28,8 @@
#include <QTimer>
#include <QStringListModel>
#include <QProgressDialog>
#include <QRegularExpression>
#include <QRegularExpressionValidator>
#define IMAGE_LEDOFF ":/images/ledoff1.png"
#define IMAGE_LEDON ":/images/ledon1.png"
@ -47,8 +49,8 @@ JsonApiPage::JsonApiPage(QWidget */*parent*/, Qt::WindowFlags /*flags*/)
// This limits the possible tokens to alphanumeric
QString anRange = "[a-zA-Z0-9]+";
QRegExp anRegex ("^" + anRange + ":" + anRange + "$");
QRegExpValidator *anValidator = new QRegExpValidator(anRegex, this);
QRegularExpression anRegex ("^" + anRange + ":" + anRange + "$");
QRegularExpressionValidator *anValidator = new QRegularExpressionValidator(anRegex, this);
ui.tokenLineEdit->setValidator(anValidator);
@ -56,8 +58,8 @@ JsonApiPage::JsonApiPage(QWidget */*parent*/, Qt::WindowFlags /*flags*/)
QString ipRange = "(?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])";
// You may want to use QRegularExpression for new code with Qt 5 (not mandatory).
QRegExp ipRegex ("^" + ipRange + "\\." + ipRange + "\\." + ipRange + "\\." + ipRange + "$");
QRegExpValidator *ipValidator = new QRegExpValidator(ipRegex, this);
QRegularExpression ipRegex ("^" + ipRange + "\\." + ipRange + "\\." + ipRange + "\\." + ipRange + "$");
QRegularExpressionValidator *ipValidator = new QRegularExpressionValidator(ipRegex, this);
ui.listenAddressLineEdit->setValidator(ipValidator);
ui.providersListView->setSelectionMode(QAbstractItemView::NoSelection); // prevents edition.
@ -232,22 +234,22 @@ void JsonApiPage::addTokenClicked()
whileBlocking(ui.tokensListView)->setModel(new QStringListModel(newTk));
}
void JsonApiPage::removeTokenClicked()
{
QString token(ui.tokenLineEdit->text());
std::string tokenStr = token.toStdString();
rsJsonApi->revokeAuthToken(tokenStr.substr(0, tokenStr.find_first_of(":")));
QStringList newTk;
for(const auto& it : rsJsonApi->getAuthorizedTokens())
newTk.push_back(
QString::fromStdString(it.first) + ":" +
QString::fromStdString(it.second) );
whileBlocking(ui.tokensListView)->setModel(new QStringListModel(Settings->getJsonApiAuthTokens()) );
}
void JsonApiPage::removeTokenClicked()
{
QString token(ui.tokenLineEdit->text());
std::string tokenStr = token.toStdString();
rsJsonApi->revokeAuthToken(tokenStr.substr(0, tokenStr.find_first_of(":")));
QStringList newTk;
for(const auto& it : rsJsonApi->getAuthorizedTokens())
newTk.push_back(
QString::fromStdString(it.first) + ":" +
QString::fromStdString(it.second) );
whileBlocking(ui.tokensListView)->setModel(new QStringListModel(Settings->getJsonApiAuthTokens()) );
}
void JsonApiPage::tokenClicked(const QModelIndex& index)
{
ui.tokenLineEdit->setText(ui.tokensListView->model()->data(index).toString());

View file

@ -123,10 +123,9 @@ void NewTag::textChanged(const QString &text)
void NewTag::setTagColor()
{
bool ok;
QRgb color = QColorDialog::getRgba(m_Color, &ok, this);
if (ok) {
m_Color = color;
QColor color = QColorDialog::getColor(QColor::fromRgba(m_Color), this, "", QColorDialog::ShowAlphaChannel);
if (color.isValid()) {
m_Color = color.rgba();
showColor (m_Color);
}
}

View file

@ -129,7 +129,7 @@ NotifyPage::NotifyPage(QWidget * parent, Qt::WindowFlags flags)
QCheckBox *enabledCheckBox = new QCheckBox(name, this);
enabledCheckBox->setFont(font);
ui.notifyLayout->addWidget(enabledCheckBox, rowFeed, 0, 0);
ui.notifyLayout->addWidget(enabledCheckBox, rowFeed, 0);
connect(enabledCheckBox, SIGNAL(toggled(bool)), this, SLOT(notifyToggled()));
QCheckBox *combinedCheckBox = new QCheckBox(tr("Combined"), this);

View file

@ -32,11 +32,13 @@
#include "RSPermissionMatrixWidget.h"
#include "gui/settings/ServicePermissionsPage.h"
#include "gui/settings/rsharesettings.h"
#include <retroshare/rsstatus.h>
#include <retroshare/rspeers.h>
#include <retroshare/rsservicecontrol.h>
#include "rsitems/rsserviceids.h"
#include <QTextDocument>
#include "util/RsQtVersion.h"
#define NOT_IMPLEMENTED std::cerr << __PRETTY_FUNCTION__ << ": not yet implemented." << std::endl;
@ -246,8 +248,14 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *)
_painter->setRenderHint(QPainter::TextAntialiasing);
/* Fill in the background */
_painter->fillRect(_rec, QBrush(BACK_COLOR));
//_painter->fillRect(_rec, QBrush(BACK_COLOR));
_painter->drawRect(_rec);
if (Settings->getSheetName() == ":Standard_Dark"){
brushColor = Qt::gray ;
} else {
brushColor = Qt::black ;
}
// draw one line per friend.
std::list<RsPeerId> ssllist ;
@ -300,13 +308,13 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *)
if(name.length() > 20 + 3)
name = name.left(20)+"..." ;
peer_name_size = std::max(peer_name_size, fm.width(name)) ;
peer_name_size = std::max(peer_name_size, QFontMetrics_horizontalAdvance(fm, name)) ;
names.push_back(name) ;
}
QPen pen ;
pen.setWidth(2) ;
pen.setBrush(FOREGROUND_COLOR) ;
pen.setBrush(brushColor) ;
_painter->setPen(pen) ;
int i=0;
@ -315,13 +323,13 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *)
for(std::list<RsPeerId>::const_iterator it(ssllist.begin());it!=ssllist.end();++it,++i)
{
float X = S*fMATRIX_START_X + peer_name_size - fm.width(names[i]) ;
float X = S*fMATRIX_START_X + peer_name_size - QFontMetrics_horizontalAdvance(fm, names[i]) ;
float Y = S*fMATRIX_START_Y + (i+0.5)*S*fROW_SIZE + line_height/2.0f-2 ;
_painter->drawText(QPointF(X,Y),names[i]) ;
if(*it == _current_peer_id)
_painter->drawLine(QPointF(X,Y+3),QPointF(X+fm.width(names[i]),Y+3)) ;
_painter->drawLine(QPointF(X,Y+3),QPointF(X+QFontMetrics_horizontalAdvance(fm, names[i]),Y+3)) ;
y += line_height ;
}
@ -336,7 +344,7 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *)
for(std::map<uint32_t, RsServiceInfo>::const_iterator it(ownServices.mServiceList.begin());it!=ownServices.mServiceList.end();++it,++i)
{
QString name = QString::fromUtf8(it->second.mServiceName.c_str()) ;
int text_width = fm.width(name) ;
int text_width = QFontMetrics_horizontalAdvance(fm, name) ;
int X = matrix_start_x + S*fCOL_SIZE/2 - 2 + i*S*fCOL_SIZE - text_width/2;
@ -371,7 +379,7 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *)
_painter->drawLine(QPointF(X,Y+3),QPointF(X+text_width,Y+3)) ;
_painter->drawLine(QPointF(X+text_width/2, Y+3), QPointF(X+text_width/2,S*fMATRIX_START_Y+peer_ids.size()*S*fROW_SIZE - S*fROW_SIZE+5)) ;
pen.setBrush(FOREGROUND_COLOR) ;
pen.setBrush(brushColor) ;
_painter->setPen(pen) ;
_painter->drawText(QPointF(X,Y),name);
@ -490,11 +498,11 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *)
QFontMetrics fm(font);
int text_size_x = 0 ;
text_size_x = std::max(text_size_x,fm.width(service_name));
text_size_x = std::max(text_size_x,fm.width(peer_name));
text_size_x = std::max(text_size_x,fm.width(peer_id));
text_size_x = std::max(text_size_x,fm.width(local_status));
text_size_x = std::max(text_size_x,fm.width(remote_status));
text_size_x = std::max(text_size_x,QFontMetrics_horizontalAdvance(fm, service_name));
text_size_x = std::max(text_size_x,QFontMetrics_horizontalAdvance(fm, peer_name));
text_size_x = std::max(text_size_x,QFontMetrics_horizontalAdvance(fm, peer_id));
text_size_x = std::max(text_size_x,QFontMetrics_horizontalAdvance(fm, local_status));
text_size_x = std::max(text_size_x,QFontMetrics_horizontalAdvance(fm, remote_status));
// draw a half-transparent rectangle
@ -553,12 +561,12 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *)
brush.setStyle(Qt::SolidPattern) ;
QPen pen ;
pen.setWidth(1) ;
pen.setBrush(FOREGROUND_COLOR) ;
pen.setBrush(brushColor) ;
_painter->setPen(pen) ;
QRect position = computeNodePosition(0,i,false) ;
int popup_x = position.x() + (50 * S / 14.0);
int popup_y = position.y() - (10 * S / 14.0) + line_height;
int popup_width = std::max((int)td.size().width(), fm.width(service_name)) + S;
int popup_width = std::max((int)td.size().width(), QFontMetrics_horizontalAdvance(fm, service_name)) + S;
int popup_height = td.size().height() + line_height*2;
while (popup_x + popup_width > _max_width)
popup_x -= S;

View file

@ -25,6 +25,7 @@
#include <QApplication>
#include <QFrame>
#include <QColor>
#include <stdint.h>
#include <retroshare/rspeers.h>
@ -102,6 +103,7 @@ private:
/** The current dimensions of the graph. */
QRect _rec;
QColor brushColor;
bool mHideOffline;

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