Compare commits

..

No commits in common. "master" and "v0.6.7" have entirely different histories.

470 changed files with 74397 additions and 66494 deletions

View file

@ -1,83 +0,0 @@
name: macOS 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: macos-14
permissions:
actions: write
defaults:
run:
shell: bash
steps:
- name: Setup XCode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.0.1
- name: Show current version of Xcode
run: xcodebuild -version
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@main
- name: Show OpenSSL version
run: pkg-config --cflags libcrypto
- name: Install Packages
run: brew install openssl
miniupnpc
rapidjson
sqlcipher
bzip2
zlib
botan@2
libxslt
libxml2
qt
- name: Checkout submodules
run: |
env
git submodule update --init --remote libbitdht/ libretroshare/ retroshare-webui/
git submodule update --init supportlibs/librnp supportlibs/rapidjson supportlibs/restbed openpgpsdk/
- name: CI-Build
run: |
qmake6 . -r "CONFIG+=rs_macos14.0" "CONFIG+=release" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" "CONFIG+=rs_no_rnplib" \
INCLUDEPATH+="/opt/homebrew/opt/openssl@3/include" \
INCLUDEPATH+="/opt/homebrew/opt/rapidjson/include" \
INCLUDEPATH+="/opt/homebrew/opt/sqlcipher/include" \
INCLUDEPATH+="/opt/homebrew/opt/miniupnpc/include" \
INCLUDEPATH+="/opt/homebrew/opt/libxslt/include" \
INCLUDEPATH+="/opt/homebrew/opt/libxml2/include" \
QMAKE_LIBDIR+="/opt/homebrew/opt/openssl@3/lib" \
QMAKE_LIBDIR+="/opt/homebrew/opt/rapidjson/lib" \
QMAKE_LIBDIR+="/opt/homebrew/opt/sqlcipher/lib" \
QMAKE_LIBDIR+="/opt/homebrew/opt/miniupnpc/lib" \
QMAKE_LIBDIR+="/opt/homebrew/opt/libxslt/lib" \
QMAKE_LIBDIR+="/opt/homebrew/opt/libxml2/lib" \
CONFIG+=no_retroshare_service \
CONFIG+=no_retroshare_friendserver
make

View file

@ -1,71 +0,0 @@
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

View file

@ -1,70 +0,0 @@
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

View file

@ -1,70 +0,0 @@
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,40 +0,0 @@
name: Ubuntu Qt 5 C/C++ CI
on:
push:
paths-ignore:
- '**/*.md'
pull_request:
paths-ignore:
- '**/*.md'
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: git init
run: git submodule update --init --remote libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ && git --no-pager log --max-count 1
- name: git submodule supportlibs
run: git submodule update --init supportlibs/librnp supportlibs/restbed #supportlibs/rapidjson
- name: run apt update
run: sudo apt-get update
- name: apt install
run: sudo apt-get install g++ cmake qt5-qmake qtmultimedia5-dev libqt5x11extras5-dev libasio-dev libbz2-dev libjson-c-dev libssl-dev libsqlcipher-dev libupnp-dev libxss-dev rapidjson-dev libbotan-2-dev doxygen libsecret-1-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev
- name: print working directory
run: pwd && ls -la
- name: qmake
run: |
qmake CONFIG+=debug \
CONFIG+=rs_autologin \
CONFIG+=rs_webui \
CONFIG+=rs_jsonapi \
CONFIG+=wikipoos \
CONFIG+=gxsthewire \
CONFIG+=retroshare_plugins
- name: make
run: make
- name: make check
run: make check

View file

@ -1,40 +0,0 @@
name: Ubuntu Qt 6 C/C++ CI
on:
push:
paths-ignore:
- '**/*.md'
pull_request:
paths-ignore:
- '**/*.md'
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: git init
run: git submodule update --init --remote libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ && git --no-pager log --max-count 1
- name: git submodule supportlibs
run: git submodule update --init supportlibs/librnp supportlibs/restbed #supportlibs/rapidjson
- name: run apt update
run: sudo apt-get update
- name: apt install
run: sudo apt-get install g++ cmake qt6-base-dev qt6-multimedia-dev libasio-dev libbz2-dev libjson-c-dev libssl-dev libsqlcipher-dev libupnp-dev libxss-dev rapidjson-dev libbotan-2-dev doxygen qt6-5compat-dev libqt6core5compat6-dev libsecret-1-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev
- name: print working directory
run: pwd && ls -la
- name: qmake
run: |
qmake6 CONFIG+=debug \
CONFIG+=rs_autologin \
CONFIG+=rs_webui \
CONFIG+=rs_jsonapi \
CONFIG+=wikipoos \
CONFIG+=gxsthewire \
CONFIG+=retroshare_plugins
- name: make
run: make
- name: make check
run: make check

2
.gitignore vendored
View file

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

View file

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

5
.gitmodules vendored
View file

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

67
README.asciidoc Normal file
View file

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

View file

@ -1,55 +0,0 @@
## 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](https://github.com/RetroShare/RetroShare/blob/master/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md)
With QtCreator : [Windows-QtCreator-InstallGuide](https://github.com/RetroShare/RetroShare/blob/master/build_scripts/Windows/Windows-QtCreator-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

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

312
appveyor.yml Normal file
View file

@ -0,0 +1,312 @@
# 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

@ -1,170 +0,0 @@
## Compilation on Linux
### Install package dependencies:
#### Debian / Ubuntu / Linux Mint
```bash
sudo apt-get install git g++ cmake libbz2-dev libjson-c-dev libssl-dev libsqlcipher-dev \
libupnp-dev doxygen libxss-dev rapidjson-dev libbotan-2-dev libasio-dev
```
To compile with Qt5:
```bash
sudo apt-get install qt5-qmake qtmultimedia5-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
```
#### Arch Linux / Manjaro / EndeavourOS
```bash
sudo pacman -S base-devel libgnome-keyring cmake qt5-tools qt5-multimedia qt5-x11extras \
rapidjson doxygen libupnp libxslt libxss sqlcipher botan2 bzip2 json-c
```
To compile with Qt6:
```bash
sudo pacman -S qt6-base qt6-multimedia qt6-5compat
```
### 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
Note: If you installed Qt6 you need to use `qmake6` on the command line.
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*
### Examples:
```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
```

View file

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

View file

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

@ -1 +1 @@
Subproject commit 9dd9d7f94a600e8c8478887a4f7784fdc3294034
Subproject commit 353596b0ee5ea76611eb663b90bf3ab1c9f34ad7

View file

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

View file

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

View file

@ -1,129 +0,0 @@
## 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
Note: If you installed Qt6 you need to use `qmake6` on the command line.
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
```

View file

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

View file

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

View file

@ -43,9 +43,7 @@ set NSIS_PARAM=%NSIS_PARAM% /DDEPLOYDIR="%RsDeployPath%"
set NSIS_PARAM=%NSIS_PARAM% /DOUTDIR="%RsPackPath%"
set NSIS_PARAM=%NSIS_PARAM% /DINSTALLERADD="%RsArchiveAdd%"
set NSIS_PARAM=%NSIS_PARAM% /DARCHITECTURE="%RsArchitecture%"
set NSIS_PARAM=%NSIS_PARAM% /DTOOLCHAIN="%RsToolchain%"
set NSIS_PARAM=%NSIS_PARAM% /DREVISION=%RsVersion.Extra%
set NSIS_PARAM=%NSIS_PARAM% /DQTVERSION=%QtVersion%
set QtMainVersion=%QtVersion:~0,1%
@ -55,10 +53,7 @@ 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
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"
"%RsMinGWPath%\bin\makensis" %NSIS_PARAM% "%SourcePath%\build_scripts\Windows-msys2\installer\retroshare-Qt%QtMainVersion%.nsi"
exit /B %ERRORLEVEL%

View file

@ -15,22 +15,18 @@ 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%-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"
%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"
:: Webui
if "%ParamWebui%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-doxygen mingw-w64-%RsMSYS2Architecture%-asio"
if "%ParamWebui%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-doxygen"
:: Plugins
if "%ParamPlugins%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-speex mingw-w64-%RsMSYS2Architecture%-speexdsp mingw-w64-%RsMSYS2Architecture%-curl mingw-w64-%RsMSYS2Architecture%-libxslt mingw-w64-%RsMSYS2Architecture%-opencv mingw-w64-%RsMSYS2Architecture%-ffmpeg"
:: Clang
if "%ClangCompiler%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-clang"
if "%ParamClang%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-clang"
:: Indexing
if "%ParamIndexing%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-xapian-core mingw-w64-%RsMSYS2Architecture%-libvorbis mingw-w64-%RsMSYS2Architecture%-flac mingw-w64-%RsMSYS2Architecture%-taglib"
@ -55,7 +51,7 @@ echo.
echo === Version
echo.
title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [Version]
title Build - %SourceName%-%RsBuildConfig% [Version]
pushd "%SourcePath%\retroshare-gui\src\gui\images"
:: Touch resource file
@ -69,7 +65,7 @@ echo.
echo === qmake
echo.
title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [qmake]
title Build - %SourceName%-%RsBuildConfig% [qmake]
set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=%RsBuildConfig%"
if "%ParamAutologin%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=rs_autologin"
@ -81,13 +77,14 @@ echo %RsBuildConfig% >> buildinfo.txt
echo %RsArchitecture% >> buildinfo.txt
echo Qt %QtVersion% >> buildinfo.txt
echo %RsToolchain% >> buildinfo.txt
echo %RsCompiler% >> buildinfo.txt
call "%ToolsPath%\msys2-path.bat" "%SourcePath%" MSYS2SourcePath
call "%ToolsPath%\msys2-path.bat" "%EnvMSYS2Path%" MSYS2EnvMSYS2Path
if "%ClangCompiler%"=="1" (
%EnvMSYS2Cmd% "%QMakeCmd% "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-clang-g++ %RS_QMAKE_CONFIG%"
if "%ParamClang%"=="1" (
%EnvMSYS2Cmd% "qmake "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-clang-g++ %RS_QMAKE_CONFIG%"
) else (
%EnvMSYS2Cmd% "%QMakeCmd% "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-g++ %RS_QMAKE_CONFIG%"
%EnvMSYS2Cmd% "qmake "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-g++ %RS_QMAKE_CONFIG%"
)
if errorlevel 1 goto error
@ -95,7 +92,7 @@ echo.
echo === make
echo.
title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [make]
title Build - %SourceName%-%RsBuildConfig% [make]
%EnvMSYS2Cmd% "make -j %CoreCount%"
if errorlevel 1 goto error

View file

@ -5,16 +5,14 @@ set ParamAutologin=0
set ParamPlugins=0
set ParamTor=0
set ParamWebui=0
set ClangCompiler=0
set ParamClang=0
set ParamIndexing=0
set ParamFriendserver=0
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 "" (
@ -45,12 +43,6 @@ 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" (
@ -63,6 +55,8 @@ if "%~1" NEQ "" (
set ParamWebui=1
) else if "%%~a"=="singlethread" (
set CoreCount=1
) else if "%%~a"=="clang" (
set ParamClang=1
) else if "%%~a"=="indexing" (
set ParamIndexing=1
) else if "%%~a"=="friendserver" (
@ -86,16 +80,6 @@ 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
@ -112,18 +96,24 @@ if "%RsToolchain%"=="mingw32" (
set RsArchitecture=x64
set RsMSYS2Architecture=clang-x86_64
set MSYSTEM=CLANG64
set ClangCompiler=1
set ParamClang=1
) else if "%RsToolchain%"=="clang32" (
set RsArchitecture=x86
set RsMSYS2Architecture=clang-i686
set MSYSTEM=CLANG32
set ClangCompiler=1
set ParamClang=1
) else if "%RsToolchain%"=="clangarm64" (
set RsArchitecture=arm64
set RsMSYS2Architecture=clang-aarch64
set MSYSTEM=CLANGARM64
)
if "%ParamClang%"=="1" (
set RsCompiler=Clang
) else (
set RsCompiler=GCC
)
if "%ParamRelease%"=="1" (
if "%ParamDebug%"=="1" (
echo.
@ -158,7 +148,7 @@ exit /B 0
:usage
echo.
echo Usage: 32^|64^|other release^|debug qt5^|qt6 [autologin plugins webui singlethread clang indexing friendserver noupdate] ["CONFIG+=..."]
echo Usage: 32^|64^|other release^|debug [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)
@ -166,13 +156,13 @@ 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
echo plugins Build plugins
echo webui Enable JsonAPI and pack webui files
echo singlethread Use only 1 thread for building
echo clang Use clang compiler instead of GCC
echo indexing Build with deep channel and file indexing support
echo friendserver Enable friendserver support
echo noupdate Skip updating the libraries

View file

@ -1,6 +1,6 @@
call "%~dp0env-base.bat" %*
if errorlevel 2 exit /B 2
if errorlevel 1 exit /B 1
if errorlevel 1 goto error_env
set BuildPath=%EnvRootPath%\builds
set DeployPath=%EnvRootPath%\deploy
@ -8,20 +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 %QMakeCmd%
if errorlevel 1 %cecho% error "Cannot get Qt version." & exit /B 1
call "%ToolsPath%\get-qt-version.bat" QtVersion
if "%QtVersion%"=="" %cecho% error "Cannot get Qt version." & exit /B 1
set RsMinGWPath=%EnvMSYS2BasePath%\%RsToolchain%
set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsToolchain%-%RsBuildConfig%
set RsDeployPath=%DeployPath%\Qt-%QtVersion%-%RsToolchain%%RsType%-%RsBuildConfig%
set RsBuildPath=%BuildPath%\Qt-%QtVersion%-%RsToolchain%-%RsCompiler%-%RsBuildConfig%
set RsDeployPath=%DeployPath%\Qt-%QtVersion%%RsType%-%RsToolchain%-%RsCompiler%-%RsBuildConfig%
set RsPackPath=%DeployPath%
set RsArchiveAdd=
set RsWebuiBuildPath=%RsBuildPath%\retroshare-webui\webui

View file

@ -55,28 +55,25 @@ 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
:: 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
:: 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%
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%-Qt-%QtVersion%-%RsToolchain%-msys2%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsArchitecture%-msys2%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z
) else (
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-Qt-%QtVersion%-%RsToolchain%-msys2%RsType%%RsArchiveAdd%.7z
set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsArchitecture%-msys2%RsType%%RsArchiveAdd%.7z
)
if exist "%Archive%" del /Q "%Archive%"
@ -84,7 +81,7 @@ if exist "%Archive%" del /Q "%Archive%"
:: Create deploy path
mkdir "%RsDeployPath%"
title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [copy files]
title Pack - %SourceName%%RsType%-%RsBuildConfig% [copy files]
set ExtensionsFile=%SourcePath%\libretroshare\src\rsserver\rsinit.cc
set Extensions=
@ -108,7 +105,6 @@ copy "%RsBuildPath%\retroshare-nogui\src\%RsBuildConfig%\retroshare*-nogui.exe"
copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite%
copy "%RsBuildPath%\supportlibs\cmark\build\src\libcmark.dll" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" copy "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" copy "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\retroshare-friendserver\src\%RsBuildConfig%\retroshare-friendserver.exe" (
copy "%RsBuildPath%\retroshare-friendserver\src\%RsBuildConfig%\retroshare-friendserver.exe" "%RsDeployPath%" %Quite%
)
@ -121,24 +117,18 @@ for /D %%D in ("%RsBuildPath%\plugins\*") do (
echo copy Qt DLL's
copy "%RsMinGWPath%\bin\Qt%QtMainVersion1%Svg%QtMainVersion2%.dll" "%RsDeployPath%" %Quite%
if %QtMainVersion% GEQ 5 (
if "%QtMainVersion%"=="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%
)
echo copy styles
mkdir "%RsDeployPath%\styles" %Quite%
if "%QtMainVersion%"=="5" (
if exist "%QtSharePath%\plugins\styles\qwindowsvistastyle.dll" (
echo copy styles
mkdir "%RsDeployPath%\styles" %Quite%
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%
@ -179,13 +169,11 @@ 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%"=="6" (
if "%QtMainVersion%"=="5" (
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%
)
@ -210,7 +198,7 @@ if "%ParamWebui%"=="1" (
)
rem pack files
title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [pack files]
title Pack - %SourceName%%RsType%-%RsBuildConfig% [pack files]
"%EnvSevenZipExe%" a -mx=9 -t7z "%Archive%" "%RsDeployPath%\*"

View file

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

View file

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

View file

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

View file

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

View file

@ -1,32 +0,0 @@
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

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

View file

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

View file

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

View file

@ -59,12 +59,10 @@ 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
@ -77,7 +75,7 @@ if exist "%Archive%" del /Q "%Archive%"
:: Create deploy path
mkdir "%RsDeployPath%"
title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion%-%GCCArchitecture% [copy files]
title Pack - %SourceName%%RsType%-%RsBuildConfig% [copy files]
set ExtensionsFile=%SourcePath%\libretroshare\src\rsserver\rsinit.cc
set Extensions=
@ -98,7 +96,6 @@ copy nul "%RsDeployPath%\portable" %Quite%
echo copy binaries
copy "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare*.exe" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" copy "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" "%RsDeployPath%" %Quite%
if exist "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" copy "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" "%RsDeployPath%" %Quite%
if "%ParamService%"=="1" (
copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite%
@ -133,24 +130,18 @@ 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% GEQ 5 (
if "%QtMainVersion%"=="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%
)
echo Copy styles
mkdir "%RsDeployPath%\styles" %Quite%
if "%QtMainVersion%"=="5" (
if exist "%QtPath%\..\plugins\styles\qwindowsvistastyle.dll" (
echo Copy styles
mkdir "%RsDeployPath%\styles" %Quite%
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%
@ -177,12 +168,10 @@ 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% GEQ 5 (
copy "%QtPath%\..\translations\qtbase_*.qm" "%RsDeployPath%\translations" %Quite%
copy "%QtPath%\..\translations\qtmultimedia_*.qm" "%RsDeployPath%\translations" %Quite%
)
if "%QtMainVersion%"=="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%
copy "%QtPath%\..\translations\qtxmlpatterns_*.qm" "%RsDeployPath%\translations" %Quite%
)
@ -206,7 +195,7 @@ if "%ParamTor%"=="1" (
)
rem pack files
title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion%-%GCCArchitecture% [pack files]
title Pack - %SourceName%%RsType%-%RsBuildConfig% [pack files]
"%EnvSevenZipExe%" a -mx=9 -t7z "%Archive%" "%RsDeployPath%\*"

View file

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

View file

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

View file

@ -232,7 +232,7 @@ Section $(Section_Main) Section_Main
; Qt styles
SetOutPath "$INSTDIR\styles"
File "${QTDIR}\plugins\styles\qwindowsvistastyle.dll"
File /NONFATAL "${QTDIR}\plugins\styles\qwindowsvistastyle.dll"
; MinGW binaries
SetOutPath "$INSTDIR"
@ -247,7 +247,6 @@ Section $(Section_Main) Section_Main
; External binaries
File "${EXTERNAL_LIB_DIR}\bin\miniupnpc.dll"
File "${RELEASEDIR}\supportlibs\librnp\Build\src\lib\librnp.dll"
!if ${ARCHITECTURE} == "x86"
File "${EXTERNAL_LIB_DIR}\bin\libcrypto-1_1.dll"
File "${EXTERNAL_LIB_DIR}\bin\libssl-1_1.dll"

View file

@ -1,622 +0,0 @@
; 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

View file

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

View file

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

@ -1 +1 @@
Subproject commit 96e249a06d8f30c2aace38beecc8fb7271159a88
Subproject commit de2b4bd80c57ca757b5f878130f98becf710236d

@ -1 +1 @@
Subproject commit 634f701d44585e4648b898be99d26e288db1881e
Subproject commit b41667912751a453e8e5d4733215a0609277a26f

View file

@ -28,8 +28,6 @@ greaterThan(QT_MAJOR_VERSION, 4) {
QT += widgets
}
greaterThan(QT_MAJOR_VERSION,5): QT += core5compat
target.files = lib/libFeedReader.so
SOURCES = FeedReaderPlugin.cpp \
@ -47,7 +45,6 @@ SOURCES = FeedReaderPlugin.cpp \
gui/FeedReaderUserNotify.cpp \
gui/FeedReaderFeedItem.cpp \
gui/FeedTreeWidget.cpp \
gui/ProxyWidget.cpp \
util/CURLWrapper.cpp \
util/XMLWrapper.cpp \
util/HTMLWrapper.cpp \
@ -69,7 +66,6 @@ HEADERS = FeedReaderPlugin.h \
gui/FeedReaderUserNotify.h \
gui/FeedReaderFeedItem.h \
gui/FeedTreeWidget.h \
gui/ProxyWidget.h \
util/CURLWrapper.h \
util/XMLWrapper.h \
util/HTMLWrapper.h \
@ -80,8 +76,7 @@ FORMS = gui/FeedReaderDialog.ui \
gui/AddFeedDialog.ui \
gui/PreviewFeedDialog.ui \
gui/FeedReaderConfig.ui \
gui/FeedReaderFeedItem.ui \
gui/ProxyWidget.ui
gui/FeedReaderFeedItem.ui
TARGET = FeedReader
@ -130,7 +125,7 @@ win32 {
isEmpty(QMAKE_SH) {
# MinGW
LIBS += -lcrypt32 -lbcrypt
LIBS += -lcrypt32
}
# Check for msys2

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -34,7 +34,7 @@
#include "FeedReaderStringDefs.h"
#include "gui/common/RSTreeWidgetItem.h"
#include "gui/settings/rsharesettings.h"
#include "gui/RsGUIEventManager.h"
#include "gui/notifyqt.h"
#include "FeedReaderUserNotify.h"
#include "gui/Posted/PostedCreatePostDialog.h"
#include "util/imageutil.h"
@ -73,7 +73,7 @@ FeedReaderDialog::FeedReaderDialog(RsFeedReader *feedReader, FeedReaderNotify *n
connect(mNotify, &FeedReaderNotify::feedChanged, this, &FeedReaderDialog::feedChanged, Qt::QueuedConnection);
connect(mNotify, &FeedReaderNotify::optimizeImage, this, &FeedReaderDialog::optimizeImage, Qt::QueuedConnection);
connect(RsGUIEventManager::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
/* connect signals */
connect(ui->feedTreeWidget, SIGNAL(itemActivated(QTreeWidgetItem*,int)), this, SLOT(feedTreeItemActivated(QTreeWidgetItem*)));
@ -129,8 +129,6 @@ FeedReaderDialog::FeedReaderDialog(RsFeedReader *feedReader, FeedReaderNotify *n
settingsChanged();
feedTreeItemActivated(NULL);
mFontSizeHandler.registerFontSize(ui->feedTreeWidget);
}
FeedReaderDialog::~FeedReaderDialog()
@ -570,7 +568,7 @@ void FeedReaderDialog::feedChanged(uint32_t feedId, int type)
}
FeedInfo feedInfo;
if (type != FeedReaderNotify::NOTIFY_TYPE_DEL) {
if (type != NOTIFY_TYPE_DEL) {
if (!mFeedReader->getFeedInfo(feedId, feedInfo)) {
return;
}
@ -580,12 +578,12 @@ void FeedReaderDialog::feedChanged(uint32_t feedId, int type)
}
}
if (type == FeedReaderNotify::NOTIFY_TYPE_MOD || type == FeedReaderNotify::NOTIFY_TYPE_DEL) {
if (type == NOTIFY_TYPE_MOD || type == NOTIFY_TYPE_DEL) {
QTreeWidgetItemIterator it(ui->feedTreeWidget);
QTreeWidgetItem *item;
while ((item = *it) != NULL) {
if (item->data(COLUMN_FEED_DATA, ROLE_FEED_ID).toUInt() == feedId) {
if (type == FeedReaderNotify::NOTIFY_TYPE_MOD) {
if (type == NOTIFY_TYPE_MOD) {
updateFeedItem(item, feedInfo);
} else {
delete(item);
@ -596,7 +594,7 @@ void FeedReaderDialog::feedChanged(uint32_t feedId, int type)
}
}
if (type == FeedReaderNotify::NOTIFY_TYPE_ADD) {
if (type == NOTIFY_TYPE_ADD) {
QTreeWidgetItemIterator it(ui->feedTreeWidget);
QTreeWidgetItem *itemParent;
while ((itemParent = *it) != NULL) {

View file

@ -23,7 +23,6 @@
#include <retroshare-gui/mainpage.h>
#include "interface/rsFeedReader.h"
#include "util/FontSizeHandler.h"
namespace Ui {
class FeedReaderDialog;
@ -40,15 +39,15 @@ class FeedReaderDialog : public MainPage
Q_OBJECT
public:
FeedReaderDialog(RsFeedReader *feedReader, FeedReaderNotify *notify, QWidget *parent = 0);
FeedReaderDialog(RsFeedReader *feedReader, FeedReaderNotify *notify, QWidget *parent = 0);
~FeedReaderDialog();
static QIcon iconFromFeed(const FeedInfo &feedInfo);
protected:
virtual UserNotify *createUserNotify(QObject *parent) override;
virtual void showEvent(QShowEvent *event) override;
bool eventFilter(QObject *obj, QEvent *ev) override;
virtual void showEvent(QShowEvent *event);
bool eventFilter(QObject *obj, QEvent *ev);
private slots:
void settingsChanged();
@ -99,8 +98,6 @@ private:
RsFeedReader *mFeedReader;
FeedReaderNotify *mNotify;
FontSizeHandler mFontSizeHandler;
/** Qt Designer generated object */
Ui::FeedReaderDialog *ui;
};

View file

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

View file

@ -27,7 +27,6 @@
#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)
@ -72,7 +71,7 @@ void FeedReaderFeedNotify::msgChanged(uint32_t feedId, const QString &msgId, int
return;
}
if (type != FeedReaderNotify::NOTIFY_TYPE_ADD) {
if (type != NOTIFY_TYPE_ADD) {
return;
}
@ -136,7 +135,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 = DateTime::DateTimeToTime_t(QDateTime::currentDateTime());
msgInfo.pubDate = QDateTime::currentDateTime().toTime_t();
//TODO: parent?
return new FeedReaderFeedItem(mFeedReader, mNotify, feedInfo, msgInfo);

View file

@ -36,12 +36,11 @@
#include "gui/common/RSTreeWidgetItem.h"
#include "gui/settings/rsharesettings.h"
#include "util/HandleRichText.h"
#include "util/RsQtVersion.h"
#include "util/QtVersion.h"
#include "gui/Posted/PostedCreatePostDialog.h"
#include "gui/gxsforums/CreateGxsForumMsg.h"
#include "gui/common/FilesDefs.h"
#include "util/imageutil.h"
#include "util/DateTime.h"
#include "retroshare/rsiface.h"
#include "retroshare/rsgxsforums.h"
@ -155,8 +154,6 @@ FeedReaderMessageWidget::FeedReaderMessageWidget(uint32_t feedId, RsFeedReader *
ui->msgTreeWidget->installEventFilter(this);
setFeedId(feedId);
mFontSizeHandler.registerFontSize(ui->msgTreeWidget);
}
FeedReaderMessageWidget::~FeedReaderMessageWidget()
@ -477,7 +474,8 @@ void FeedReaderMessageWidget::calculateMsgIconsAndFonts(QTreeWidgetItem *item)
void FeedReaderMessageWidget::updateMsgItem(QTreeWidgetItem *item, FeedMsgInfo &info)
{
QString title = QString::fromUtf8(info.title.c_str());
QDateTime qdatetime = DateTime::DateTimeFromTime_t(info.pubDate);
QDateTime qdatetime;
qdatetime.setTime_t(info.pubDate);
/* add string to all data */
QString sort = QString("%1_%2_%3").arg(title, qdatetime.toString("yyyyMMdd_hhmmss")).arg(info.feedId);
@ -515,12 +513,12 @@ void FeedReaderMessageWidget::feedChanged(uint32_t feedId, int type)
return;
}
if (type == FeedReaderNotify::NOTIFY_TYPE_DEL) {
if (type == NOTIFY_TYPE_DEL) {
setFeedId(0);
return;
}
if (type == FeedReaderNotify::NOTIFY_TYPE_MOD) {
if (type == NOTIFY_TYPE_MOD) {
if (!mFeedReader->getFeedInfo(mFeedId, mFeedInfo)) {
setFeedId(0);
return;
@ -555,18 +553,18 @@ void FeedReaderMessageWidget::msgChanged(uint32_t feedId, const QString &msgId,
}
FeedMsgInfo msgInfo;
if (type != FeedReaderNotify::NOTIFY_TYPE_DEL) {
if (type != NOTIFY_TYPE_DEL) {
if (!mFeedReader->getMsgInfo(feedId, msgId.toStdString(), msgInfo)) {
return;
}
}
if (type == FeedReaderNotify::NOTIFY_TYPE_MOD || type == FeedReaderNotify::NOTIFY_TYPE_DEL) {
if (type == NOTIFY_TYPE_MOD || type == NOTIFY_TYPE_DEL) {
QTreeWidgetItemIterator it(ui->msgTreeWidget);
QTreeWidgetItem *item;
while ((item = *it) != NULL) {
if (item->data(COLUMN_MSG_DATA, ROLE_MSG_ID).toString() == msgId) {
if (type == FeedReaderNotify::NOTIFY_TYPE_MOD) {
if (type == NOTIFY_TYPE_MOD) {
updateMsgItem(item, msgInfo);
filterItem(item);
} else {
@ -578,13 +576,13 @@ void FeedReaderMessageWidget::msgChanged(uint32_t feedId, const QString &msgId,
}
}
if (type == FeedReaderNotify::NOTIFY_TYPE_MOD) {
if (type == NOTIFY_TYPE_MOD) {
if (msgId.toStdString() == currentMsgId()) {
updateCurrentMessage();
}
}
if (type == FeedReaderNotify::NOTIFY_TYPE_ADD) {
if (type == NOTIFY_TYPE_ADD) {
QTreeWidgetItem *item = new RSTreeWidgetItem(mMsgCompareRole);
updateMsgItem(item, msgInfo);
ui->msgTreeWidget->addTopLevelItem(item);

View file

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

View file

@ -29,13 +29,6 @@ class FeedReaderNotify : public QObject, public RsFeedReaderNotify
Q_OBJECT
public:
// These replace the variables from the old notify system. It's simpler than switching the entire
// feedreader plugin to the new rsEvents system
static const int NOTIFY_TYPE_ADD = 0x01;
static const int NOTIFY_TYPE_DEL = 0x02;
static const int NOTIFY_TYPE_MOD = 0x03;
FeedReaderNotify();
/* RsFeedReaderNotify */

View file

@ -67,7 +67,7 @@ void FeedReaderUserNotify::iconClicked()
void FeedReaderUserNotify::feedChanged(uint32_t /*feedId*/, int type)
{
if (type == FeedReaderNotify::NOTIFY_TYPE_DEL) {
if (type == NOTIFY_TYPE_DEL) {
updateIcon();
}
}

View file

@ -294,13 +294,13 @@ void PreviewFeedDialog::feedChanged(uint32_t feedId, int type)
return;
}
if (type == FeedReaderNotify::NOTIFY_TYPE_DEL) {
if (type == NOTIFY_TYPE_DEL) {
/* feed deleted */
mFeedId = 0;
return;
}
if (type == FeedReaderNotify::NOTIFY_TYPE_ADD || type == FeedReaderNotify::NOTIFY_TYPE_MOD) {
if (type == NOTIFY_TYPE_ADD || type == NOTIFY_TYPE_MOD) {
FeedInfo feedInfo;
if (!mFeedReader->getFeedInfo(mFeedId, feedInfo)) {
return;
@ -320,18 +320,18 @@ void PreviewFeedDialog::msgChanged(uint32_t feedId, const QString &msgId, int ty
}
switch (type) {
case FeedReaderNotify::NOTIFY_TYPE_ADD:
case NOTIFY_TYPE_ADD:
if (mMsgId.empty()) {
mMsgId = msgId.toStdString();
updateMsg();
}
break;
case FeedReaderNotify::NOTIFY_TYPE_MOD:
case NOTIFY_TYPE_MOD:
if (mMsgId == msgId.toStdString()) {
updateMsg();
}
break;
case FeedReaderNotify::NOTIFY_TYPE_DEL:
case NOTIFY_TYPE_DEL:
if (mMsgId == msgId.toStdString()) {
std::list<std::string>::iterator it = std::find(mMsgIds.begin(), mMsgIds.end(), mMsgId);
if (it != mMsgIds.end()) {

View file

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

View file

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

View file

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

View file

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

View file

@ -20,7 +20,6 @@
#include "rsFeedReaderItems.h"
#include "p3FeedReader.h"
#include "gui/FeedReaderNotify.h"
#include "p3FeedReaderThread.h"
#include "rsitems/rsconfigitems.h"
#include "retroshare/rsiface.h"
@ -416,7 +415,7 @@ RsFeedResult p3FeedReader::addFolder(uint32_t parentId, const std::string &name,
IndicateConfigChanged(RsConfigMgr::CheckPriority::SAVE_NOW);
if (mNotify) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_ADD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_ADD);
}
return RS_FEED_RESULT_SUCCESS;
@ -456,7 +455,7 @@ RsFeedResult p3FeedReader::setFolder(uint32_t feedId, const std::string &name)
IndicateConfigChanged(RsConfigMgr::CheckPriority::SAVE_NOW);
if (mNotify) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD);
}
return RS_FEED_RESULT_SUCCESS;
@ -503,7 +502,7 @@ RsFeedResult p3FeedReader::addFeed(const FeedInfo &feedInfo, uint32_t &feedId)
IndicateConfigChanged(RsConfigMgr::CheckPriority::SAVE_NOW);
if (mNotify) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_ADD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_ADD);
}
return RS_FEED_RESULT_SUCCESS;
@ -588,7 +587,7 @@ RsFeedResult p3FeedReader::setFeed(uint32_t feedId, const FeedInfo &feedInfo)
IndicateConfigChanged(RsConfigMgr::CheckPriority::SAVE_NOW);
if (mNotify) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD);
}
if (!forumId.empty()) {
@ -659,7 +658,7 @@ RsFeedResult p3FeedReader::setParent(uint32_t feedId, uint32_t parentId)
IndicateConfigChanged(RsConfigMgr::CheckPriority::SAVE_NOW);
if (mNotify) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD);
}
}
@ -757,7 +756,7 @@ bool p3FeedReader::removeFeed(uint32_t feedId)
/* only notify remove of feed */
std::list<uint32_t>::iterator it;
for (it = removedFeedIds.begin(); it != removedFeedIds.end(); ++it) {
mNotify->notifyFeedChanged(*it, FeedReaderNotify::NOTIFY_TYPE_DEL);
mNotify->notifyFeedChanged(*it, NOTIFY_TYPE_DEL);
}
}
@ -804,7 +803,7 @@ bool p3FeedReader::addPreviewFeed(const FeedInfo &feedInfo, uint32_t &feedId)
}
if (mNotify) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_ADD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_ADD);
}
{
@ -926,8 +925,8 @@ bool p3FeedReader::removeMsg(uint32_t feedId, const std::string &msgId)
}
if (mNotify) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyMsgChanged(feedId, msgId, FeedReaderNotify::NOTIFY_TYPE_DEL);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD);
mNotify->notifyMsgChanged(feedId, msgId, NOTIFY_TYPE_DEL);
}
return true;
@ -978,11 +977,11 @@ bool p3FeedReader::removeMsgs(uint32_t feedId, const std::list<std::string> &msg
}
if (mNotify && !removedMsgs.empty()) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD);
std::list<std::string>::iterator it;
for (it = removedMsgs.begin(); it != removedMsgs.end(); ++it) {
mNotify->notifyMsgChanged(feedId, *it, FeedReaderNotify::NOTIFY_TYPE_DEL);
mNotify->notifyMsgChanged(feedId, *it, NOTIFY_TYPE_DEL);
}
}
@ -1225,7 +1224,7 @@ bool p3FeedReader::processFeed(uint32_t feedId)
if (mNotify) {
for (it = notifyIds.begin(); it != notifyIds.end(); ++it) {
mNotify->notifyFeedChanged(*it, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyFeedChanged(*it, NOTIFY_TYPE_MOD);
}
}
@ -1274,8 +1273,8 @@ bool p3FeedReader::setMessageRead(uint32_t feedId, const std::string &msgId, boo
if (changed) {
IndicateConfigChanged(RsConfigMgr::CheckPriority::SAVE_OFTEN);
if (mNotify) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyMsgChanged(feedId, msgId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD);
mNotify->notifyMsgChanged(feedId, msgId, NOTIFY_TYPE_MOD);
}
}
@ -1329,10 +1328,10 @@ bool p3FeedReader::retransformMsg(uint32_t feedId, const std::string &msgId)
IndicateConfigChanged(RsConfigMgr::CheckPriority::SAVE_NOW);
if (mNotify) {
if (feedChanged) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD);
}
if (msgChanged) {
mNotify->notifyMsgChanged(feedId, msgId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyMsgChanged(feedId, msgId, NOTIFY_TYPE_MOD);
}
}
}
@ -1467,7 +1466,7 @@ int p3FeedReader::tick()
if (mNotify) {
for (it = notifyIds.begin(); it != notifyIds.end(); ++it) {
mNotify->notifyFeedChanged(*it, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyFeedChanged(*it, NOTIFY_TYPE_MOD);
}
if (imageToOptimze) {
mNotify->notifyOptimizeImage();
@ -1527,7 +1526,7 @@ void p3FeedReader::cleanFeeds()
if (mNotify) {
std::list<std::pair<uint32_t, std::string> >::iterator it;
for (it = removedMsgIds.begin(); it != removedMsgIds.end(); ++it) {
mNotify->notifyMsgChanged(it->first, it->second, FeedReaderNotify::NOTIFY_TYPE_DEL);
mNotify->notifyMsgChanged(it->first, it->second, NOTIFY_TYPE_DEL);
}
}
}
@ -1802,7 +1801,7 @@ bool p3FeedReader::getFeedToDownload(RsFeedReaderFeed &feed, uint32_t neededFeed
}
if (mNotify) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD);
}
return true;
@ -1853,7 +1852,7 @@ void p3FeedReader::onDownloadSuccess(uint32_t feedId, const std::string &content
}
if (mNotify) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD);
}
}
@ -1890,7 +1889,7 @@ void p3FeedReader::onDownloadError(uint32_t feedId, RsFeedReaderErrorState resul
}
if (mNotify) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD);
}
}
@ -1945,7 +1944,7 @@ bool p3FeedReader::getFeedToProcess(RsFeedReaderFeed &feed, uint32_t neededFeedI
}
if (mNotify) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD);
}
return true;
@ -2324,11 +2323,11 @@ void p3FeedReader::onProcessSuccess_addMsgs(uint32_t feedId, std::list<RsFeedRea
}
if (mNotify) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD);
std::list<std::string>::iterator it;
for (it = addedMsgs.begin(); it != addedMsgs.end(); ++it) {
mNotify->notifyMsgChanged(feedId, *it, FeedReaderNotify::NOTIFY_TYPE_ADD);
mNotify->notifyMsgChanged(feedId, *it, NOTIFY_TYPE_ADD);
}
}
}
@ -2366,7 +2365,7 @@ void p3FeedReader::onProcessError(uint32_t feedId, RsFeedReaderErrorState result
}
if (mNotify) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD);
}
}
@ -2434,7 +2433,7 @@ void p3FeedReader::setFeedInfo(uint32_t feedId, const std::string &name, const s
}
if (mNotify) {
mNotify->notifyFeedChanged(feedId, FeedReaderNotify::NOTIFY_TYPE_MOD);
mNotify->notifyFeedChanged(feedId, NOTIFY_TYPE_MOD);
}
}

View file

@ -32,9 +32,9 @@ class RsFeedReaderMsg;
class p3FeedReaderThread;
class RsGxsForums;
class RsGxsForumGroup;
struct RsGxsForumGroup;
class RsPosted;
class RsPostedGroup;
struct RsPostedGroup;
class RsGxsIfaceHelper;
class p3FeedReader : public RsPQIService, public RsFeedReader

View file

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

View file

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

View file

@ -947,9 +947,9 @@ void VOIPChatWidgetHolder::sendAudioData()
}
}
void VOIPChatWidgetHolder::updateStatus(RsStatusValue status)
void VOIPChatWidgetHolder::updateStatus(int status)
{
bool enabled = (status != RsStatusValue::RS_STATUS_OFFLINE);
bool enabled = (status != RS_STATUS_OFFLINE);
audioListenToggleButton->setEnabled(audioCaptureToggleButton->isChecked() && enabled);
audioListenToggleButtonFS->setEnabled(audioCaptureToggleButton->isChecked() && enabled);

View file

@ -52,7 +52,7 @@ public:
VOIPChatWidgetHolder(ChatWidget *chatWidget, VOIPNotify *notify);
virtual ~VOIPChatWidgetHolder();
virtual void updateStatus(RsStatusValue status);
virtual void updateStatus(int status);
void addAudioData(const RsPeerId &peer_id, QByteArray* array) ;
void addVideoData(const RsPeerId &peer_id, QByteArray* array) ;

View file

@ -33,7 +33,7 @@ void VOIPGUIHandler::ReceivedInvitation(const RsPeerId &peer_id, int flags)
#ifdef VOIPGUIHANDLER_DEBUG
std::cerr << "****** VOIPGUIHandler: received Invitation from peer " << peer_id.toStdString() << " with flags==" << flags << std::endl;
#endif
ChatDialog *di = ChatDialog::getChat(ChatId(peer_id), (RsChatFlags) Settings->getChatFlags());
ChatDialog *di = ChatDialog::getChat(ChatId(peer_id), Settings->getChatFlags());
if (di) {
ChatWidget *cw = di->getChatWidget();
if(cw) {
@ -113,7 +113,7 @@ void VOIPGUIHandler::ReceivedVoipData(const RsPeerId &peer_id)
return ;
}
ChatDialog *di = ChatDialog::getChat(ChatId(peer_id), (RsChatFlags) Settings->getChatFlags());
ChatDialog *di = ChatDialog::getChat(ChatId(peer_id), Settings->getChatFlags());
if (di) {
ChatWidget *cw = di->getChatWidget();
if (cw) {

View file

@ -27,7 +27,7 @@
/*Retroshare-Gui*/
#include "gui/chat/ChatDialog.h"
#include "gui/RsGUIEventManager.h"
#include "gui/notifyqt.h"
#include "util/HandleRichText.h"
VOIPToasterItem::VOIPToasterItem(const RsPeerId &peer_id, const QString &msg, const voipToasterItem_Type type)

View file

@ -18,10 +18,6 @@
TEMPLATE = subdirs
win32-g++:isEmpty(QMAKE_SH):lessThan(QT_MAJOR_VERSION,6) {
# Qt 5 Windows native build
SUBDIRS += \
VOIP \
}
SUBDIRS += \
FeedReader

View file

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

View file

@ -77,24 +77,14 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package( Qt6 COMPONENTS Core REQUIRED)
find_package( Qt6 COMPONENTS Widgets REQUIRED)
find_package( Qt6 COMPONENTS Xml REQUIRED)
find_package( Qt6 COMPONENTS Network REQUIRED)
find_package( Qt6 COMPONENTS Multimedia REQUIRED)
find_package( Qt6 COMPONENTS PrintSupport REQUIRED)
find_package( Qt5 COMPONENTS Core REQUIRED)
find_package( Qt5 COMPONENTS Widgets REQUIRED)
find_package( Qt5 COMPONENTS Xml REQUIRED)
find_package( Qt5 COMPONENTS Network REQUIRED)
find_package( Qt5 COMPONENTS Multimedia REQUIRED)
find_package( Qt5 COMPONENTS PrintSupport REQUIRED)
list( APPEND RS_LINK_LIBRARIES Qt6::Multimedia Qt6::Widgets Qt6::Xml Qt6::Network Qt6::PrintSupport)
if (NOT Qt6_FOUND)
find_package( Qt5 COMPONENTS Core REQUIRED)
find_package( Qt5 COMPONENTS Widgets REQUIRED)
find_package( Qt5 COMPONENTS Xml REQUIRED)
find_package( Qt5 COMPONENTS Network REQUIRED)
find_package( Qt5 COMPONENTS Multimedia REQUIRED)
find_package( Qt5 COMPONENTS PrintSupport REQUIRED)
list( APPEND RS_LINK_LIBRARIES Qt5::Multimedia Qt5::Widgets Qt5::Xml Qt5::Network Qt5::PrintSupport)
endif()
list( APPEND RS_LINK_LIBRARIES Qt5::Multimedia Qt5::Widgets Qt5::Xml Qt5::Network Qt5::PrintSupport)
################################################################################
@ -114,10 +104,7 @@ endif(RS_DEVELOPMENT_BUILD)
include(src/CMakeLists.txt)
qt_wrap_ui(RS_UI_HEADERS ${RS_GUI_FORMS})
if (NOT Qt6_FOUND)
qt5_wrap_ui(RS_UI_HEADERS ${RS_GUI_FORMS})
endif()
qt5_wrap_ui(RS_UI_HEADERS ${RS_GUI_FORMS})
add_executable(${PROJECT_NAME} ${RS_GUI_SOURCES} ${RS_UI_HEADERS} ${RS_GUI_QTRESOURCES})
install(TARGETS ${PROJECT_NAME} DESTINATION ${RS_BIN_INSTALL_DIR})

View file

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

View file

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

View file

@ -33,7 +33,6 @@
#include <retroshare/rsdisc.h>
#include <retroshare/rspeers.h>
#include "settings/rsharesettings.h"
#include "util/RsQtVersion.h"
#include <QClipboard>
#include <QSysInfo>
@ -43,9 +42,6 @@
#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)
@ -53,7 +49,7 @@ AboutWidget::AboutWidget(QWidget* parent)
setupUi(this);
QHBoxLayout* l = new QHBoxLayout();
l->setContentsMargins(0, 0, 0, 0);
l->setMargin(0);
l->addStretch(1);
l->addStretch(1);
specialFrame->setContentsMargins(0, 0, 0, 0);
@ -146,7 +142,7 @@ void AboutWidget::updateTitle()
{
if (tWidget == NULL)
{
setWindowTitle(QString("%1 %2").arg(tr("About RetroShare"), RsApplication::retroshareVersion(true)));
setWindowTitle(QString("%1 %2").arg(tr("About RetroShare"), Rshare::retroshareVersion(true)));
}
else
{
@ -215,7 +211,7 @@ void AWidget::initImages()
if(height() == 0) return ;
image1 = QImage(width(),height(),QImage::Format_ARGB32);
image1.fill(palette().color(QPalette::Window));
image1.fill(palette().color(QPalette::Background));
//QImage image(":/images/logo/logo_info.png");
QPixmap image(":/images/logo/logo_splash.png");
@ -232,7 +228,7 @@ void AWidget::initImages()
#ifdef RS_ONLYHIDDENNODE
p.drawText(QPointF(10, 50), QString("%1 : %2 (With embedded Tor)").arg(tr("Retroshare version"), Rshare::retroshareVersion(true)));
#else
p.drawText(QPointF(10, 50), QString("%1 : %2").arg(tr("Retroshare version"), RsApplication::retroshareVersion(true)));
p.drawText(QPointF(10, 50), QString("%1 : %2").arg(tr("Retroshare version"), Rshare::retroshareVersion(true)));
#endif
/* Draw Qt's version number */
@ -271,7 +267,7 @@ void AWidget::initGoL()
void AWidget::drawBitField()
{
image2.fill(palette().color(QPalette::Window));
image2.fill(palette().color(QPalette::Background));
QPainter p(&image2) ;
p.setPen(QColor(200,200,200));
@ -310,7 +306,7 @@ void AWidget::drawBitField()
AWidget::AWidget()
: page(0), density(5)
, mImagesReady(false), mState(0), mTimerId(0)
, mStep(1.0f), mMaxStep(QFontMetrics_horizontalAdvance(QFontMetricsF(font()), ' '))
, mStep(1.0f), mMaxStep(QFontMetricsF(font()).width(' '))
{
setMouseTracking(true);
//startTimer(15);
@ -778,7 +774,7 @@ void TBoard::showNextPiece() {
QPixmap pixmap(dx * squareWidth(), dy * squareHeight());
QPainter painter(&pixmap);
painter.fillRect(pixmap.rect(), nextPieceLabel->palette().window());
painter.fillRect(pixmap.rect(), nextPieceLabel->palette().background());
for (int i = 0; i < 4; ++i) {
int x = nextPiece.x(i) - nextPiece.minX();
@ -813,23 +809,18 @@ 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.lighter());
painter.setPen(color.light());
painter.drawLine(x, y + squareHeight() - 1, x, y);
painter.drawLine(x, y, x + squareWidth() - 1, y);
painter.setPen(color.darker());
painter.setPen(color.dark());
painter.drawLine(x + 1, y + squareHeight() - 1, x + squareWidth() - 1, y + squareHeight() - 1);
painter.drawLine(x + squareWidth() - 1, y + squareHeight() - 1, x + squareWidth() - 1, y + 1);
}
void TPiece::setRandomShape() {
#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));
setShape(TPiece::Shape(qrand() % 7 + 1));
}
@ -914,7 +905,7 @@ TPiece TPiece::rotatedRight() const {
NextPieceLabel::NextPieceLabel( QWidget* parent /* = 0*/ ) : QLabel(parent)
{
QPalette p = palette();
p.setColor(QPalette::Window, Qt::white);
p.setColor(QPalette::Background, Qt::white);
setPalette(p);
setFrameShape(QFrame::Box);
setAlignment(Qt::AlignCenter);
@ -945,7 +936,7 @@ void AboutWidget::on_copy_button_clicked()
{
QString verInfo;
QString rsVerString = "RetroShare Version: ";
rsVerString+=RsApplication::retroshareVersion(true);
rsVerString+=Rshare::retroshareVersion(true);
verInfo+=rsVerString;
#ifdef RS_ONLYHIDDENNODE
verInfo+=" " + tr("Only Hidden Node");

View file

@ -21,6 +21,7 @@
#include "ChatLobbyWidget.h"
#include "notifyqt.h"
#include "RetroShareLink.h"
#include "chat/ChatLobbyDialog.h"
#include "chat/ChatLobbyUserNotify.h"
@ -34,11 +35,11 @@
#include "settings/rsharesettings.h"
#include "util/HandleRichText.h"
#include "util/misc.h"
#include "util/qtthreadsutils.h"
#include "util/RsQtVersion.h"
#include "util/QtVersion.h"
#include "retroshare/rsmsgs.h"
#include "retroshare/rspeers.h"
#include "retroshare/rsnotify.h"
#include "retroshare/rsidentity.h"
#include <QGridLayout>
@ -104,39 +105,9 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
myInviteYesButton = NULL;
myInviteIdChooser = NULL;
mEventHandlerId = 0;
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> event)
{
RsQThreadUtils::postToObject([=](){
auto ev = dynamic_cast<const RsChatLobbyEvent *>(event.get());
if(!ev) return;
switch(ev->mEventCode)
{
case RsChatLobbyEventCode::CHAT_LOBBY_INVITE_RECEIVED:
readChatLobbyInvites();
break;
case RsChatLobbyEventCode::CHAT_LOBBY_LIST_CHANGED:
lobbyChanged();
break;
case RsChatLobbyEventCode::CHAT_LOBBY_EVENT_PEER_LEFT:
case RsChatLobbyEventCode::CHAT_LOBBY_EVENT_PEER_STATUS:
case RsChatLobbyEventCode::CHAT_LOBBY_EVENT_PEER_JOINED:
case RsChatLobbyEventCode::CHAT_LOBBY_EVENT_PEER_CHANGE_NICKNAME:
case RsChatLobbyEventCode::CHAT_LOBBY_EVENT_KEEP_ALIVE:
handleChatLobbyEvent(ev->mLobbyId,ev->mEventCode,ev->mGxsId,QString::fromUtf8(ev->mStr.c_str()));
break;
default:
break;
}
}, this );
}, mEventHandlerId, RsEventType::CHAT_SERVICE );
QObject::connect( NotifyQt::getInstance(), SIGNAL(lobbyListChanged()), SLOT(lobbyChanged()));
QObject::connect( NotifyQt::getInstance(), SIGNAL(chatLobbyEvent(qulonglong,int,RsGxsId,QString)), this, SLOT(displayChatLobbyEvent(qulonglong,int,RsGxsId,QString)));
QObject::connect( NotifyQt::getInstance(), SIGNAL(chatLobbyInviteReceived()), this, SLOT(readChatLobbyInvites()));
QObject::connect( ui.lobbyTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(lobbyTreeWidgetCustomPopupMenu(QPoint)));
QObject::connect( ui.lobbyTreeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem*,int)));
@ -172,28 +143,28 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
QHeaderView_setSectionResizeModeColumn(header, COLUMN_TOPIC, QHeaderView::Interactive);
privateSubLobbyItem = new RSTreeWidgetItem(compareRole, TYPE_FOLDER);
privateSubLobbyItem->setText(COLUMN_NAME, tr("Private Subscribed"));
privateSubLobbyItem->setText(COLUMN_NAME, tr("Private Subscribed chat rooms"));
privateSubLobbyItem->setData(COLUMN_NAME, ROLE_SORT, "1");
// privateLobbyItem->setIcon(COLUMN_NAME, QIcon(IMAGE_PRIVATE));
privateSubLobbyItem->setData(COLUMN_DATA, ROLE_PRIVACYLEVEL, CHAT_LOBBY_PRIVACY_LEVEL_PRIVATE);
ui.lobbyTreeWidget->insertTopLevelItem(0, privateSubLobbyItem);
publicSubLobbyItem = new RSTreeWidgetItem(compareRole, TYPE_FOLDER);
publicSubLobbyItem->setText(COLUMN_NAME, tr("Public Subscribed"));
publicSubLobbyItem->setText(COLUMN_NAME, tr("Public Subscribed chat rooms"));
publicSubLobbyItem->setData(COLUMN_NAME, ROLE_SORT, "2");
// publicLobbyItem->setIcon(COLUMN_NAME, QIcon(IMAGE_PUBLIC));
publicSubLobbyItem->setData(COLUMN_DATA, ROLE_PRIVACYLEVEL, CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC);
ui.lobbyTreeWidget->insertTopLevelItem(1, publicSubLobbyItem);
privateLobbyItem = new RSTreeWidgetItem(compareRole, TYPE_FOLDER);
privateLobbyItem->setText(COLUMN_NAME, tr("Private"));
privateLobbyItem->setText(COLUMN_NAME, tr("Private chat rooms"));
privateLobbyItem->setData(COLUMN_NAME, ROLE_SORT, "3");
// privateLobbyItem->setIcon(COLUMN_NAME, QIcon(IMAGE_PRIVATE));
privateLobbyItem->setData(COLUMN_DATA, ROLE_PRIVACYLEVEL, CHAT_LOBBY_PRIVACY_LEVEL_PRIVATE);
ui.lobbyTreeWidget->insertTopLevelItem(2, privateLobbyItem);
publicLobbyItem = new RSTreeWidgetItem(compareRole, TYPE_FOLDER);
publicLobbyItem->setText(COLUMN_NAME, tr("Public"));
publicLobbyItem->setText(COLUMN_NAME, tr("Public chat rooms"));
publicLobbyItem->setData(COLUMN_NAME, ROLE_SORT, "4");
// publicLobbyItem->setIcon(COLUMN_NAME, QIcon(IMAGE_PUBLIC));
publicLobbyItem->setData(COLUMN_DATA, ROLE_PRIVACYLEVEL, CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC);
@ -259,13 +230,10 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags)
int ltwH = misc::getFontSizeFactor("LobbyTreeWidget", 1.5).height();
ui.lobbyTreeWidget->setIconSize(QSize(ltwH,ltwH));
mFontSizeHandler.registerFontSize(ui.lobbyTreeWidget);
}
ChatLobbyWidget::~ChatLobbyWidget()
{
rsEvents->unregisterEventsHandler(mEventHandlerId);
// save settings
processSettings(false);
@ -452,7 +420,7 @@ static void updateItem(QTreeWidget *treeWidget, QTreeWidgetItem *item, ChatLobby
if(lobby_flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED)
{
tooltipstr += QObject::tr("\nSecurity: no anonymous IDs") ;
QColor foreground = QColor(16, 157, 0); // green
QColor foreground = QColor(0, 128, 0); // green
for (int column = 0; column < COLUMN_COUNT; ++column)
item->setData(column, Qt::ForegroundRole, foreground);
}
@ -680,7 +648,7 @@ void ChatLobbyWidget::updateDisplay()
if (autoSubscribe && subscribed && _lobby_infos.find(lobby.lobby_id) == _lobby_infos.end())
{
ChatDialog *cd = ChatDialog::getChat(ChatId(lobby.lobby_id), RsChatFlags::RS_CHAT_OPEN);
ChatDialog *cd = ChatDialog::getChat(ChatId(lobby.lobby_id), RS_CHAT_OPEN);
addChatPage(dynamic_cast<ChatLobbyDialog*>(cd));
}
@ -753,9 +721,9 @@ void ChatLobbyWidget::updateDisplay()
}
}
publicSubLobbyItem->setHidden(publicSubLobbyItem->childCount()==0);
publicSubLobbyItem->setText(COLUMN_NAME, tr("Public Subscribed")+ QString(" (") + QString::number(publicSubLobbyItem->childCount())+QString(")"));
publicSubLobbyItem->setText(COLUMN_NAME, tr("Public Subscribed chat rooms")+ QString(" (") + QString::number(publicSubLobbyItem->childCount())+QString(")"));
privateSubLobbyItem->setHidden(privateSubLobbyItem->childCount()==0);
publicLobbyItem->setText(COLUMN_NAME, tr("Public")+ " (" + QString::number(publicLobbyItem->childCount())+QString(")"));
publicLobbyItem->setText(COLUMN_NAME, tr("Public chat rooms")+ " (" + QString::number(publicLobbyItem->childCount())+QString(")"));
}
void ChatLobbyWidget::createChatLobby()
@ -783,7 +751,7 @@ void ChatLobbyWidget::showLobby(QTreeWidgetItem *item)
showBlankPage(id) ;
else
{
_lobby_infos[id].dialog->showDialog(RsChatFlags::RS_CHAT_FOCUS);
_lobby_infos[id].dialog->showDialog(RS_CHAT_FOCUS);
if (_lobby_infos[id].dialog->isWindowed())
showBlankPage(id, true);
}
@ -846,7 +814,7 @@ bool ChatLobbyWidget::showLobbyAnchor(ChatLobbyId id, QString anchor)
if(_lobby_infos.find(id) == _lobby_infos.end()) {
showBlankPage(id) ;
} else {
_lobby_infos[id].dialog->showDialog(RsChatFlags::RS_CHAT_FOCUS);
_lobby_infos[id].dialog->showDialog(RS_CHAT_FOCUS);
if (_lobby_infos[id].dialog->isWindowed())
showBlankPage(id, true);
@ -1188,10 +1156,10 @@ void ChatLobbyWidget::itemDoubleClicked(QTreeWidgetItem *item, int /*column*/)
subscribeChatLobbyAtItem(item);
}
void ChatLobbyWidget::handleChatLobbyEvent(uint64_t lobby_id, RsChatLobbyEventCode event_type, const RsGxsId &gxs_id, const QString& str)
void ChatLobbyWidget::displayChatLobbyEvent(qulonglong lobby_id, int event_type, const RsGxsId &gxs_id, const QString& str)
{
if (ChatLobbyDialog *cld = dynamic_cast<ChatLobbyDialog*>(ChatDialog::getExistingChat(ChatId(lobby_id)))) {
cld->handleLobbyEvent(event_type, gxs_id, str);
cld->displayLobbyEvent(event_type, gxs_id, str);
}
}

View file

@ -25,7 +25,6 @@
#include "chat/ChatLobbyUserNotify.h"
#include "gui/gxs/GxsIdChooser.h"
#include "util/FontSizeHandler.h"
#include <retroshare/rsmsgs.h>
@ -89,8 +88,8 @@ protected slots:
void unsubscribeItem();
void itemDoubleClicked(QTreeWidgetItem *item, int column);
void updateCurrentLobby() ;
void handleChatLobbyEvent(uint64_t lobby_id, RsChatLobbyEventCode event_type, const RsGxsId &gxs_id, const QString& str);
void readChatLobbyInvites();
void displayChatLobbyEvent(qulonglong lobby_id, int event_type, const RsGxsId& gxs_id, const QString& str);
void readChatLobbyInvites();
void showLobby(QTreeWidgetItem *lobby_item) ;
void showBlankPage(ChatLobbyId id, bool subscribed = false) ;
void unsubscribeChatLobby(ChatLobbyId id) ;
@ -147,11 +146,7 @@ private:
QAbstractButton* myInviteYesButton;
GxsIdChooser* myInviteIdChooser;
FontSizeHandler mFontSizeHandler;
/* UI - from Designer */
Ui::ChatLobbyWidget ui;
RsEventsHandlerId_t mEventHandlerId;
};

View file

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

View file

@ -38,7 +38,6 @@
#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
@ -75,7 +74,7 @@ CreateCircleDialog::CreateCircleDialog()
ui.IdFilter->addFilter(QIcon(), headerText, RSCIRCLEID_COL_KEYID, QString("%1 %2").arg(tr("Search"), headerText));
/* Set initial column width */
int fontWidth = QFontMetrics_horizontalAdvance(QFontMetricsF(ui.treeWidget_IdList->font()), "W");
int fontWidth = QFontMetricsF(ui.treeWidget_IdList->font()).width("W");
ui.treeWidget_IdList->setColumnWidth(RSCIRCLEID_COL_NICKNAME, 17 * fontWidth);
ui.treeWidget_membership->setColumnWidth(RSCIRCLEID_COL_NICKNAME, 17 * fontWidth);

View file

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

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

@ -21,7 +21,7 @@
#include <retroshare/rstypes.h>
#include <QModelIndex>
#include <QPainter>
#include <QStyleOptionProgressBar>
#include <QStyleOptionProgressBarV2>
#include <QProgressBar>
#include <QApplication>
#include <QDateTime>
@ -29,8 +29,6 @@
#include <math.h>
#include "DLListDelegate.h"
#include "util/DateTime.h"
#include "util/RsQtVersion.h"
Q_DECLARE_METATYPE(FileProgressInfo)
@ -44,7 +42,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
{
QString byteUnits[4] = {tr("B"), tr("KB"), tr("MB"), tr("GB")};
QStyleOptionViewItem opt = option;
QStyleOptionProgressBar newopt;
QStyleOptionProgressBarV2 newopt;
QRect pixmapRect;
QPixmap pixmap;
qlonglong fileSize;
@ -61,7 +59,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
painter->setClipRect(opt.rect);
//set text color
QVariant value = index.data(Qt::ForegroundRole);
QVariant value = index.data(Qt::TextColorRole);
if(value.isValid() && qvariant_cast<QColor>(value).isValid()) {
opt.palette.setColor(QPalette::Text, qvariant_cast<QColor>(value));
}
@ -96,7 +94,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
for(int i = 0; i < 4; ++i) {
if (fileSize < 1024) {
fileSize = index.data().toLongLong();
temp = QString::asprintf("%.2f ", fileSize / multi);
temp.sprintf("%.2f ", fileSize / multi);
temp += byteUnits[i];
break;
}
@ -104,7 +102,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
multi *= 1024.0;
}
}
painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp);
painter->drawText(option.rect, Qt::AlignRight, temp);
break;
case COLUMN_REMAINING:
remaining = index.data().toLongLong();
@ -115,7 +113,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
for(int i = 0; i < 4; ++i) {
if (remaining < 1024) {
remaining = index.data().toLongLong();
temp = QString::asprintf("%.2f ", remaining / multi);
temp.sprintf("%.2f ", remaining / multi);
temp += byteUnits[i];
break;
}
@ -123,7 +121,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
multi *= 1024.0;
}
}
painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp);
painter->drawText(option.rect, Qt::AlignRight, temp);
break;
case COLUMN_COMPLETED:
completed = index.data().toLongLong();
@ -134,7 +132,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
for(int i = 0; i < 4; ++i) {
if (completed < 1024) {
completed = index.data().toLongLong();
temp = QString::asprintf("%.2f ", completed / multi);
temp.sprintf("%.2f ", completed / multi);
temp += byteUnits[i];
break;
}
@ -142,7 +140,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
multi *= 1024.0;
}
}
painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp);
painter->drawText(option.rect, Qt::AlignRight, temp);
break;
case COLUMN_DLSPEED:
dlspeed = index.data().toDouble();
@ -150,10 +148,10 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
temp = "";
} else {
temp.clear();
temp = QString::asprintf("%.2f", dlspeed/1024.);
temp.sprintf("%.2f", dlspeed/1024.);
temp += " KB/s";
}
painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp);
painter->drawText(option.rect, Qt::AlignRight, temp);
break;
case COLUMN_PROGRESS:
{
@ -238,7 +236,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
pixmap = qvariant_cast<QIcon>(value).pixmap(option.decorationSize, option.state & QStyle::State_Enabled ? QIcon::Normal : QIcon::Disabled, option.state & QStyle::State_Open ? QIcon::On : QIcon::Off);
pixmapRect = (pixmap.isNull() ? QRect(0, 0, 0, 0): QRect(QPoint(0, 0), option.decorationSize));
if (pixmapRect.isValid()){
QPoint p = QStyle::alignedRect(option.direction, Qt::AlignLeft | Qt::AlignVCenter, pixmap.size(), option.rect).topLeft();
QPoint p = QStyle::alignedRect(option.direction, Qt::AlignLeft, pixmap.size(), option.rect).topLeft();
p.setX( p.x() + pixOffset);
painter->drawPixmap(p, pixmap);
temp = " " + temp;
@ -249,13 +247,13 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
pixmap = qvariant_cast<QIcon>(value).pixmap(option.decorationSize, option.state & QStyle::State_Enabled ? QIcon::Normal : QIcon::Disabled, option.state & QStyle::State_Open ? QIcon::On : QIcon::Off);
pixmapRect = (pixmap.isNull() ? QRect(0, 0, 0, 0): QRect(QPoint(0, 0), option.decorationSize));
if (pixmapRect.isValid()){
QPoint p = QStyle::alignedRect(option.direction, Qt::AlignLeft | Qt::AlignVCenter, pixmap.size(), option.rect).topLeft();
QPoint p = QStyle::alignedRect(option.direction, Qt::AlignLeft, pixmap.size(), option.rect).topLeft();
p.setX( p.x() + pixOffset);
painter->drawPixmap(p, pixmap);
temp = " " + temp;
pixOffset += pixmap.size().width();
}
painter->drawText(option.rect.translated(pixOffset, 0), Qt::AlignLeft | Qt::AlignVCenter, temp);
painter->drawText(option.rect.translated(pixOffset, 0), Qt::AlignLeft, temp);
}
break;
case COLUMN_LASTDL:
@ -263,7 +261,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
break;
qi64Value = index.data().value<qint64>();
if (qi64Value < std::numeric_limits<qint64>::max()){
QDateTime qdtLastDL = DateTime::DateTimeFromTime_t(qi64Value);
QDateTime qdtLastDL = QDateTime::fromTime_t(qi64Value);
painter->drawText(option.rect, Qt::AlignCenter, qdtLastDL.toString("yyyy-MM-dd_hh:mm:ss"));
} else {
painter->drawText(option.rect, Qt::AlignCenter, tr("File Never Seen"));
@ -279,9 +277,9 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
QSize DLListDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
{
float w = QFontMetrics_horizontalAdvance(QFontMetricsF(option.font), index.data(Qt::DisplayRole).toString());
float w = QFontMetricsF(option.font).width(index.data(Qt::DisplayRole).toString());
int S = QFontMetricsF(option.font).height()*1.5 ;
int S = QFontMetricsF(option.font).height() ;
return QSize(w,S);
}

View file

@ -29,7 +29,6 @@
#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
//
@ -85,7 +84,7 @@ void FileTransferInfoWidget::updateDisplay()
setFixedHeight(maxHeight);
QPainter painter(&pixmap);
painter.begin(this);
painter.initFrom(this);
float S = QFontMetricsF(font()).height();
int chunk_square_size = S*chunk_square_size_factor;
@ -133,13 +132,7 @@ 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 ;
if (Settings->getSheetName() == ":Standard_Dark"){
penColor = Qt::gray ;
} else {
penColor = Qt::black ;
}
painter->setPen(penColor) ;
painter->setPen(QColor::fromRgb(0,0,0)) ;
y += text_height ;
painter->drawText(0,y,tr("Chunk map") + ":") ;
y += block_sep ;
@ -183,13 +176,13 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
uint32_t sizeY = 1*S ;
y += block_sep ;
y += text_height ;
painter->setPen(penColor) ;
painter->setPen(QColor::fromRgb(0,0,0)) ;
painter->drawText(0,y,tr("Active chunks") + ":") ;
y += block_sep ;
for(uint i=0;i<info.active_chunks.size();++i)
{
painter->setPen(penColor) ;
painter->setPen(QColor::fromRgb(0,0,0)) ;
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 ;
@ -219,7 +212,7 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
}
painter->setPen(penColor) ;
painter->setPen(QColor::fromRgb(0,0,0)) ;
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) + " %") ;
@ -234,7 +227,7 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
y += block_sep ;
y += text_height ;
painter->setPen(penColor) ;
painter->setPen(QColor::fromRgb(0,0,0)) ;
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 ;
@ -261,8 +254,7 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info
// various info:
//
painter->setPen(penColor) ;
painter->setPen(QColor::fromRgb(0,0,0)) ;
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,7 +24,6 @@
#include <QWidget>
#include <QPainter>
#include <QBitmap>
#include <QColor>
#include <retroshare-gui/RsAutoUpdatePage.h>
#include <retroshare/rstypes.h>
@ -37,7 +36,7 @@ class FileTransferInfoWidget : public RsAutoUpdatePage
Q_OBJECT
public:
FileTransferInfoWidget(QWidget * parent = 0, Qt::WindowFlags f = Qt::WindowFlags() );
FileTransferInfoWidget(QWidget * parent = 0, Qt::WindowFlags f = 0 );
void setFileHash(const RsFileHash& hash) { _file_hash = hash ; }
@ -59,7 +58,6 @@ private:
QPixmap downloadingPixmap;
QPixmap notDownloadPixmap;
QPixmap checkingPixmap;
QColor penColor;
RsFileHash _file_hash ;
};

View file

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

View file

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

View file

@ -22,19 +22,19 @@
#include "rshare.h"
#include "gui/MainWindow.h"
#include "gui/notifyqt.h"
#include "gui/RemoteDirModel.h"
#include "gui/RetroShareLink.h"
#include "gui/ShareManager.h"
#include "gui/common/PeerDefs.h"
#include "gui/common/RsCollectionDialog.h"
#include "gui/common/RsCollection.h"
#include "gui/msgs/MessageComposer.h"
#include "gui/gxschannels/GxsChannelDialog.h"
#include "gui/gxsforums/GxsForumsDialog.h"
#include "gui/settings/AddFileAssociationDialog.h"
#include "gui/settings/rsharesettings.h"
#include "util/RsQtVersion.h"
#include "util/QtVersion.h"
#include "util/RsAction.h"
#include "util/qtthreadsutils.h"
#include "util/misc.h"
#include "util/rstime.h"
#include "util/rsdir.h"
@ -145,7 +145,7 @@ public:
{
Q_ASSERT(index.isValid());
QStyleOptionViewItem opt = option;
QStyleOptionViewItemV4 opt = option;
initStyleOption(&opt, index);
// disable default icon
opt.icon = QIcon();
@ -166,7 +166,6 @@ public:
SharedFilesDialog::~SharedFilesDialog()
{
rsEvents->unregisterEventsHandler(mEventHandlerId);
delete tree_model;
delete flat_model;
delete tree_proxyModel;
@ -178,36 +177,9 @@ SharedFilesDialog::SharedFilesDialog(bool remote_mode, QWidget *parent)
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
//connect(notify, SIGNAL(filesPreModChanged(bool)), this, SLOT(preModDirectories(bool)));
//connect(notify, SIGNAL(filesPostModChanged(bool)), this, SLOT(postModDirectories(bool)));
mEventHandlerId = 0;
rsEvents->registerEventsHandler([this](std::shared_ptr<const RsEvent> event)
{
RsQThreadUtils::postToObject([=](){
auto e = dynamic_cast<const RsSharedDirectoriesEvent*>(event.get());
switch(e->mEventCode)
{
case RsSharedDirectoriesEventCode::OWN_DIR_LIST_PROCESSING:
preModDirectories(true);
break;
case RsSharedDirectoriesEventCode::OWN_DIR_LIST_UPDATED:
postModDirectories(true);
break;
case RsSharedDirectoriesEventCode::FRIEND_DIR_LIST_UPDATED:
preModDirectories(false);
postModDirectories(false);
break;
default:
break;
};}, this);
}, mEventHandlerId,RsEventType::SHARED_DIRECTORIES);
NotifyQt *notify = NotifyQt::getInstance();
connect(notify, SIGNAL(filesPreModChanged(bool)), this, SLOT(preModDirectories(bool)));
connect(notify, SIGNAL(filesPostModChanged(bool)), this, SLOT(postModDirectories(bool)));
connect(ui.viewType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changeCurrentViewModel(int)));
connect(ui.dirTreeView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT( spawnCustomPopupMenu( QPoint ) ) );
@ -227,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);
QSortFilterProxyModel_setFilterRegularExpression(tree_proxyModel, QString(SHARED_FILES_DIALOG_FILTER_STRING)) ;
tree_proxyModel->setFilterRegExp(QRegExp(QString(SHARED_FILES_DIALOG_FILTER_STRING))) ;
flat_proxyModel = new SFDSortFilterProxyModel(flat_model, this);
flat_proxyModel->setSourceModel(flat_model);
@ -235,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);
QSortFilterProxyModel_setFilterRegularExpression(flat_proxyModel, QString(SHARED_FILES_DIALOG_FILTER_STRING)) ;
flat_proxyModel->setFilterRegExp(QRegExp(QString(SHARED_FILES_DIALOG_FILTER_STRING))) ;
connect(ui.filterClearButton, SIGNAL(clicked()), this, SLOT(clearFilter()));
connect(ui.filterStartButton, SIGNAL(clicked()), this, SLOT(startFilter()));
@ -680,7 +652,7 @@ void SharedFilesDialog::copyLinks(const QModelIndexList& lst, bool remote,QList<
QString dir_name = QDir(QString::fromUtf8(details.name.c_str())).dirName();
RetroShareLink link = RetroShareLink::createFileTree(dir_name,ft->totalFileSize(),ft->numFiles(),QString::fromStdString(ft->toRadix64())) ;
RetroShareLink link = RetroShareLink::createFileTree(dir_name,ft->mTotalSize,ft->mTotalFiles,QString::fromStdString(ft->toRadix64())) ;
if(link.valid())
urls.push_back(link) ;
@ -762,31 +734,7 @@ void SharedFilesDialog::sendLinkTo()
void SharedFilesDialog::collCreate()
{
QModelIndexList lst = getSelected();
std::vector <DirDetails> dirVec;
model->getDirDetailsFromSelect(lst, dirVec);
auto RemoteMode = isRemote();
QString dir_name;
if(!RemoteMode)
{
if(!dirVec.empty())
{
const DirDetails& details = dirVec[0];
dir_name = QDir(QString::fromUtf8(details.name.c_str())).dirName();
}
}
RsFileTree tree;
for(uint32_t i=0;i<dirVec.size();++i)
tree.addFileTree(tree.root(),*RsFileTree::fromDirDetails(dirVec[i],RemoteMode,true));
RsCollectionDialog::openNewCollection(tree);
//auto ft = RsFileTree::fromDirDetails(details,remote);
model->createCollectionFile(this, lst);
}
void SharedFilesDialog::collModif()
@ -811,8 +759,12 @@ void SharedFilesDialog::collModif()
/* open file with a suitable application */
QFileInfo qinfo;
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
RsCollectionDialog::editExistingCollection(qinfo.absoluteFilePath());
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
collection.openColl(qinfo.absoluteFilePath());
}
}
}
void SharedFilesDialog::collView()
@ -837,8 +789,12 @@ void SharedFilesDialog::collView()
/* open file with a suitable application */
QFileInfo qinfo;
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
RsCollectionDialog::openExistingCollection(qinfo.absoluteFilePath(), true);
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
collection.openColl(qinfo.absoluteFilePath(), true);
}
}
}
void SharedFilesDialog::collOpen()
@ -865,24 +821,20 @@ void SharedFilesDialog::collOpen()
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollectionDialog::openExistingCollection(qinfo.absoluteFilePath(),true);
RsCollection collection;
if (collection.load(qinfo.absoluteFilePath())) {
collection.downloadFiles();
return;
}
}
}
}
}
QString fileName;
if (!misc::getOpenFileName(nullptr, RshareSettings::LASTDIR_EXTRAFILE, QApplication::translate("RsCollectionFile", "Open collection file"), QApplication::translate("RsCollectionFile", "Collection files") + " (*." + RsCollection::ExtensionString + ")", fileName))
return ;
std::cerr << "Got file name: " << fileName.toStdString() << std::endl;
RsCollection::RsCollectionErrorCode err;
RsCollection collection(fileName,err);
if(err == RsCollection::RsCollectionErrorCode::COLLECTION_NO_ERROR)
RsCollectionDialog::downloadFiles(collection);
RsCollection collection;
if (collection.load(this)) {
collection.downloadFiles();
}
}
void LocalSharedFilesDialog::playselectedfiles()
@ -1045,7 +997,7 @@ void SharedFilesDialog::recursExpandAll(const QModelIndex& index)
for(int row=0;row<ui.dirTreeView->model()->rowCount(index);++row)
{
QModelIndex idx(ui.dirTreeView->model()->index(row,0,index)) ;
QModelIndex idx(index.child(row,0)) ;
if(ui.dirTreeView->model()->rowCount(idx) > 0)
recursExpandAll(idx) ;
@ -1158,10 +1110,7 @@ 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
@ -1196,14 +1145,12 @@ void LocalSharedFilesDialog::spawnCustomPopupMenu( QPoint point )
collViewAct->setEnabled(bIsRsColl);
collOpenAct->setEnabled(true);
QMenu collectionMenu(tr("Retroshare Collection"), this);
QMenu collectionMenu(tr("Collection"), this);
collectionMenu.setIcon(QIcon(IMAGE_LIBRARY));
collectionMenu.addAction(collCreateAct);
if(bIsRsColl)
collectionMenu.addAction(collModifAct);
//collectionMenu.addAction(collViewAct);
//collectionMenu.addAction(collOpenAct);
collectionMenu.addAction(collModifAct);
collectionMenu.addAction(collViewAct);
collectionMenu.addAction(collOpenAct);
switch (type) {
case DIR_TYPE_DIR :
@ -1649,7 +1596,7 @@ void SharedFilesDialog::FilterItems()
return ;
//FileSearchFlags flags = isRemote()?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL;
QStringList lst = text.split(" ",QtSkipEmptyParts) ;
QStringList lst = text.split(" ",QString::SkipEmptyParts) ;
std::list<std::string> keywords ;
for(auto it(lst.begin());it!=lst.end();++it)
@ -1741,16 +1688,12 @@ bool SharedFilesDialog::tree_FilterItem(const QModelIndex &index, const QString
void SharedFilesDialog::updateFontSize()
{
#if defined(Q_OS_DARWIN)
int customFontSize = Settings->valueFromGroup("File", "MinimumFontSize", 13).toInt();
#else
int customFontSize = Settings->valueFromGroup("File", "MinimumFontSize", 11).toInt();
#endif
QFont newFont = ui.dirTreeView->font();
if (newFont.pointSize() != customFontSize) {
newFont.setPointSize(customFontSize);
QFontMetricsF fontMetrics(newFont);
int iconHeight = fontMetrics.height()*1.5;
int iconHeight = fontMetrics.height();
ui.dirTreeView->setFont(newFont);
ui.dirTreeView->setIconSize(QSize(iconHeight, iconHeight));
}

View file

@ -21,7 +21,6 @@
#ifndef _SHAREDFILESDIALOG_H
#define _SHAREDFILESDIALOG_H
#include <retroshare/rsevents.h>
#include "ui_SharedFilesDialog.h"
#include <retroshare-gui/RsAutoUpdatePage.h>
@ -146,8 +145,6 @@ protected:
QString lastFilterString;
QString mLastFilterText ;
RsProtectedTimer* mFilterTimer;
RsEventsHandlerId_t mEventHandlerId ;
};
class LocalSharedFilesDialog : public SharedFilesDialog

View file

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

View file

@ -20,6 +20,7 @@
#include "retroshare/rsfiles.h"
#include "TransferUserNotify.h"
#include "gui/notifyqt.h"
#include "gui/MainWindow.h"
TransferUserNotify::TransferUserNotify(QObject *parent) :

View file

@ -20,10 +20,11 @@
#include "TransfersDialog.h"
#include "gui/notifyqt.h"
#include "gui/SoundManager.h"
#include "gui/RetroShareLink.h"
#include "gui/common/FilesDefs.h"
#include "gui/common/RsCollectionDialog.h"
#include "gui/common/RsCollection.h"
#include "gui/common/RSTreeView.h"
#include "gui/common/RsUrlHandler.h"
#include "gui/FileTransfer/DetailsDialog.h"
@ -36,10 +37,9 @@
#include "gui/FileTransfer/xprogressbar.h"
#include "gui/settings/rsharesettings.h"
#include "util/misc.h"
#include "util/RsQtVersion.h"
#include "util/QtVersion.h"
#include "util/RsFile.h"
#include "util/qtthreadsutils.h"
#include "util/DateTime.h"
#include "retroshare/rsdisc.h"
#include "retroshare/rsfiles.h"
@ -286,7 +286,7 @@ public:
{
case Qt::SizeHintRole: return sizeHintRole(index.column()) ;
case Qt::TextAlignmentRole:
case Qt::ForegroundRole:
case Qt::TextColorRole:
case Qt::WhatsThisRole:
case Qt::EditRole:
case Qt::ToolTipRole:
@ -434,7 +434,7 @@ public:
//Get Last Access on File
if (file.exists())
qi64LastDL = DateTime::DateTimeToTime_t(file.lastModified());
qi64LastDL = file.lastModified().toTime_t();
}
return QVariant(qi64LastDL) ;
}
@ -1009,6 +1009,7 @@ TransfersDialog::TransfersDialog(QWidget *parent)
connect(collViewAct,SIGNAL(triggered()),this,SLOT(collView()));
collOpenAct = new QAction(FilesDefs::getIconFromQtResourcePath(IMAGE_COLLOPEN), tr( "Download from collection file..." ), this );
connect(collOpenAct, SIGNAL(triggered()), this, SLOT(collOpen()));
connect(NotifyQt::getInstance(), SIGNAL(downloadComplete(QString)), this, SLOT(collAutoOpen(QString)));
/** Setup the actions for the download header context menu */
showDLSizeAct= new QAction(tr("Size"),this);
@ -1113,8 +1114,14 @@ void TransfersDialog::handleEvent_main_thread(std::shared_ptr<const RsEvent> eve
switch (fe->mFileTransferEventCode)
{
case RsFileTransferEventCode::DOWNLOAD_COMPLETE:
collAutoOpen(fe->mHash);
{
FileInfo nfo ;
if(!rsFiles->FileDetails(fe->mHash, RS_FILE_HINTS_DOWNLOAD, nfo))
break;
SoundManager::play(SOUND_DOWNLOAD_COMPLETE);
NotifyQt::getInstance()->addToaster(RS_POPUP_DOWNLOAD, fe->mHash.toStdString(), nfo.fname.c_str(),"");
}
[[fallthrough]];
case RsFileTransferEventCode::COMPLETED_FILES_REMOVED:
@ -1968,7 +1975,7 @@ void TransfersDialog::pasteLink()
for(auto &it : links)
col.merge_in(it.name(),it.size(),RsFileHash(it.hash().toStdString())) ;
RsCollectionDialog::downloadFiles(col);
col.downloadFiles();
}
void TransfersDialog::getDLSelectedItems(std::set<RsFileHash> *ids, std::set<int> *rows)
@ -2459,17 +2466,21 @@ void TransfersDialog::collCreate()
std::set<RsFileHash>::iterator it ;
getDLSelectedItems(&items, NULL);
RsFileTree tree;
for (it = items.begin(); it != items.end(); ++it)
{
FileInfo info;
if (!rsFiles->FileDetails(*it, RS_FILE_HINTS_DOWNLOAD, info)) continue;
tree.addFile(tree.root(),info.fname,info.hash,info.size);
DirDetails details;
details.name = info.fname;
details.hash = info.hash;
details.size = info.size;
details.type = DIR_TYPE_FILE;
dirVec.push_back(details);
}
RsCollectionDialog::openNewCollection(tree);
RsCollection(dirVec,RS_FILE_HINTS_LOCAL).openNewColl(this);
}
void TransfersDialog::collModif()
@ -2493,8 +2504,12 @@ void TransfersDialog::collModif()
/* open collection */
QFileInfo qinfo;
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
RsCollectionDialog::openExistingCollection(qinfo.absoluteFilePath());
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
collection.openColl(qinfo.absoluteFilePath());
}
}
}
}
@ -2519,8 +2534,12 @@ void TransfersDialog::collView()
/* open collection */
QFileInfo qinfo;
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
RsCollectionDialog::openExistingCollection(qinfo.absoluteFilePath(), true);
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
collection.openColl(qinfo.absoluteFilePath(), true);
}
}
}
}
@ -2545,51 +2564,49 @@ void TransfersDialog::collOpen()
/* open file with a suitable application */
QFileInfo qinfo;
qinfo.setFile(QString::fromUtf8(path.c_str()));
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
{
RsCollection::RsCollectionErrorCode code;
RsCollectionDialog::downloadFiles(RsCollection(qinfo.absoluteFilePath(),code));
return;
}
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
if (collection.load(qinfo.absoluteFilePath())) {
collection.downloadFiles();
return;
}
}
}
}
}
}
QString fileName;
if (!misc::getOpenFileName(nullptr, RshareSettings::LASTDIR_EXTRAFILE, QApplication::translate("RsCollectionFile", "Open collection file"), QApplication::translate("RsCollectionFile", "Collection files") + " (*." + RsCollection::ExtensionString + ")", fileName))
return ;
std::cerr << "Got file name: " << fileName.toStdString() << std::endl;
RsCollection::RsCollectionErrorCode code;
RsCollection collection(fileName,code);
if(code == RsCollection::RsCollectionErrorCode::COLLECTION_NO_ERROR)
RsCollectionDialog::downloadFiles(collection);
else
QMessageBox::information(nullptr,tr("Error openning collection file"),RsCollection::errorString(code));
RsCollection collection;
if (collection.load(this)) {
collection.downloadFiles();
}
}
void TransfersDialog::collAutoOpen(const RsFileHash& hash)
void TransfersDialog::collAutoOpen(const QString &fileHash)
{
if (Settings->valueFromGroup("Transfer","AutoDLColl").toBool())
{
RsFileHash hash = RsFileHash(fileHash.toStdString());
FileInfo info;
if (rsFiles->FileDetails(hash, RS_FILE_HINTS_DOWNLOAD, info)) {
/* make path for downloaded files */
if (info.downloadStatus == FT_STATE_COMPLETE)
{
if (info.downloadStatus == FT_STATE_COMPLETE) {
std::string path;
path = info.path + "/" + info.fname;
/* open file with a suitable application */
QFileInfo qinfo;
qinfo.setFile(QString::fromUtf8(path.c_str()));
RsCollection::RsCollectionErrorCode err;
if (qinfo.exists() && qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString))
RsCollectionDialog::downloadFiles(RsCollection(qinfo.absoluteFilePath(),err));
if (qinfo.exists()) {
if (qinfo.absoluteFilePath().endsWith(RsCollection::ExtensionString)) {
RsCollection collection;
if (collection.load(qinfo.absoluteFilePath(), false)) {
collection.autoDownloadFiles();
}
}
}
}
}
}
@ -2638,5 +2655,5 @@ void TransfersDialog::filterChanged(const QString& /*text*/)
int filterColumn = ui.filterLineEdit->currentFilter();
QString text = ui.filterLineEdit->text();
DLLFilterModel->setFilterKeyColumn(filterColumn);
QSortFilterProxyModel_setFilterRegularExpression(DLLFilterModel, text);
DLLFilterModel->setFilterRegExp(text);
}

View file

@ -145,7 +145,7 @@ private slots:
void collModif();
void collView();
void collOpen();
void collAutoOpen(const RsFileHash &hash);
void collAutoOpen(const QString& fileHash);
void setShowDLSizeColumn(bool show);
void setShowDLCompleteColumn(bool show);

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

@ -22,7 +22,6 @@
#include "ULListDelegate.h"
#include "xprogressbar.h"
#include "util/RsQtVersion.h"
Q_DECLARE_METATYPE(FileProgressInfo)
@ -40,7 +39,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
{
QString byteUnits[4] = {tr("B"), tr("KB"), tr("MB"), tr("GB")};
QStyleOptionViewItem opt = option;
QStyleOptionProgressBar newopt;
QStyleOptionProgressBarV2 newopt;
QRect pixmapRect;
QPixmap pixmap;
qlonglong fileSize;
@ -53,7 +52,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
painter->setClipRect(opt.rect);
//set text color
QVariant value = index.data(Qt::ForegroundRole);
QVariant value = index.data(Qt::TextColorRole);
if(value.isValid() && qvariant_cast<QColor>(value).isValid()) {
opt.palette.setColor(QPalette::Text, qvariant_cast<QColor>(value));
}
@ -94,7 +93,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
for(int i = 0; i < 4; ++i) {
if (fileSize < 1024) {
fileSize = index.data().toLongLong();
temp = QString::asprintf("%.2f ", fileSize / multi);
temp.sprintf("%.2f ", fileSize / multi);
temp += byteUnits[i];
break;
}
@ -102,7 +101,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
multi *= 1024.0;
}
}
painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp);
painter->drawText(option.rect, Qt::AlignRight, temp);
break;
case COLUMN_UTRANSFERRED:
transferred = index.data().toLongLong();
@ -113,7 +112,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
for(int i = 0; i < 4; ++i) {
if (transferred < 1024) {
transferred = index.data().toLongLong();
temp = QString::asprintf("%.2f ", transferred / multi);
temp.sprintf("%.2f ", transferred / multi);
temp += byteUnits[i];
break;
}
@ -121,7 +120,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
multi *= 1024.0;
}
}
painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp);
painter->drawText(option.rect, Qt::AlignRight, temp);
break;
case COLUMN_ULSPEED:
ulspeed = index.data().toDouble();
@ -129,10 +128,10 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
temp = "";
} else {
temp.clear();
temp = QString::asprintf("%.2f", ulspeed/1024.);
temp.sprintf("%.2f", ulspeed/1024.);
temp += " KB/s";
}
painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp);
painter->drawText(option.rect, Qt::AlignRight, temp);
break;
case COLUMN_UPROGRESS:
{
@ -165,10 +164,10 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
pixmap = qvariant_cast<QIcon>(value).pixmap(option.decorationSize, option.state & QStyle::State_Enabled ? QIcon::Normal : QIcon::Disabled, option.state & QStyle::State_Open ? QIcon::On : QIcon::Off);
pixmapRect = (pixmap.isNull() ? QRect(0, 0, 0, 0): QRect(QPoint(0, 0), option.decorationSize));
if (pixmapRect.isValid()){
QPoint p = QStyle::alignedRect(option.direction, Qt::AlignLeft | Qt::AlignVCenter, pixmap.size(), option.rect).topLeft();
QPoint p = QStyle::alignedRect(option.direction, Qt::AlignLeft, pixmap.size(), option.rect).topLeft();
painter->drawPixmap(p, pixmap);
}
painter->drawText(option.rect.translated(pixmap.size().width(), 0), Qt::AlignLeft | Qt::AlignVCenter, index.data().toString());
painter->drawText(option.rect.translated(pixmap.size().width(), 0), Qt::AlignLeft, index.data().toString());
break;
default:
painter->drawText(option.rect, Qt::AlignCenter, index.data().toString());
@ -180,9 +179,9 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
QSize ULListDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
{
float w = QFontMetrics_horizontalAdvance(QFontMetricsF(option.font), index.data(Qt::DisplayRole).toString());
float w = QFontMetricsF(option.font).width(index.data(Qt::DisplayRole).toString());
int S = QFontMetricsF(option.font).height()*1.5 ;
int S = QFontMetricsF(option.font).height() ;
return QSize(w,S);
}

View file

@ -118,7 +118,7 @@ FriendServerControl::FriendServerControl(QWidget *parent)
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> event)
{
RsQThreadUtils::postToObject([=](){ handleEvent_main_thread(event); }, this );
}, mEventHandlerId_peer, RsEventType::FRIEND_LIST );
}, mEventHandlerId_peer, RsEventType::PEER_CONNECTION );
}
void FriendServerControl::onAutoAddFriends(bool b)
@ -145,14 +145,14 @@ void FriendServerControl::handleEvent_main_thread(std::shared_ptr<const RsEvent>
}
{
const RsFriendListEvent *pe = dynamic_cast<const RsFriendListEvent*>(event.get());
const RsConnectionEvent *pe = dynamic_cast<const RsConnectionEvent*>(event.get());
if(pe)
switch(pe->mEventCode)
switch(pe->mConnectionInfoCode)
{
case RsFriendListEventCode::NODE_ADDED:
case RsFriendListEventCode::NODE_REMOVED:
case RsFriendListEventCode::NODE_CONNECTED: updateContactsStatus();
case RsConnectionEventCode::PEER_ADDED:
case RsConnectionEventCode::PEER_REMOVED:
case RsConnectionEventCode::PEER_CONNECTED: updateContactsStatus();
break;
default: ;
@ -169,7 +169,7 @@ FriendServerControl::~FriendServerControl()
rsEvents->unregisterEventsHandler(mEventHandlerId_peer);
}
void FriendServerControl::launchStatusContextMenu(QPoint /* p */)
void FriendServerControl::launchStatusContextMenu(QPoint p)
{
RsPeerId peer_id = getCurrentPeer();

View file

@ -34,12 +34,12 @@
#include "groups/CreateGroup.h"
#include "MainWindow.h"
#include "NewsFeed.h"
#include "notifyqt.h"
#include "profile/ProfileWidget.h"
#include "profile/StatusMessage.h"
#include "RetroShareLink.h"
#include "settings/rsharesettings.h"
#include "util/misc.h"
#include "util/qtthreadsutils.h"
#include "util/DateTime.h"
#include "FriendsDialog.h"
#include "NetworkView.h"
@ -77,49 +77,12 @@ FriendsDialog::FriendsDialog(QWidget *parent) : MainPage(parent)
ui.chatWidget->setWelcomeMessage(msg);
ui.chatWidget->init(ChatId::makeBroadcastId(), tr("Broadcast"));
mEventHandlerId_chat = 0;
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e)
{
RsQThreadUtils::postToObject([=]()
{
auto fe = dynamic_cast<const RsChatServiceEvent*>(e.get()); if(!fe) return;
switch(fe->mEventCode)
{
case RsChatServiceEventCode::CHAT_MESSAGE_RECEIVED: chatMessageReceived(fe->mMsg); break;
case RsChatServiceEventCode::CHAT_STATUS_CHANGED: chatStatusReceived(fe->mCid,QString::fromUtf8(fe->mStr.c_str())); break;
default:
break;
}
}
, this );
}, mEventHandlerId_chat, RsEventType::CHAT_SERVICE );
connect(NotifyQt::getInstance(), SIGNAL(chatMessageReceived(ChatMessage)), this, SLOT(chatMessageReceived(ChatMessage)));
connect(NotifyQt::getInstance(), SIGNAL(chatStatusChanged(ChatId,QString)), this, SLOT(chatStatusReceived(ChatId,QString)));
#else // def RS_DIRECT_CHAT
ui.tabWidget->removeTab(ui.tabWidget->indexOf(ui.groupChatTab));
ui.tabWidget->removeTab(ui.tabWidget->indexOf(ui.groupChatTab));
#endif // def RS_DIRECT_CHAT
rsEvents->registerEventsHandler( [this](std::shared_ptr<const RsEvent> e)
{
RsQThreadUtils::postToObject([=]()
{
auto fe = dynamic_cast<const RsFriendListEvent*>(e.get()); if(!fe) return;
switch(fe->mEventCode)
{
case RsFriendListEventCode::OWN_STATUS_CHANGED: loadmypersonalstatus();
break;
default: // OWN_AVATAR_CHANGED is handled in AvatarWidget
break;
}
}
, this );
}, mEventHandlerId_friends, RsEventType::FRIEND_LIST );
mEventHandlerId_friends = 0;
connect( ui.mypersonalstatusLabel, SIGNAL(clicked()), SLOT(statusmessage()));
connect( ui.actionSet_your_Avatar, SIGNAL(triggered()), this, SLOT(getAvatar()));
@ -190,8 +153,6 @@ FriendsDialog::~FriendsDialog ()
if (this == instance) {
instance = NULL;
}
rsEvents->unregisterEventsHandler(mEventHandlerId_friends);
rsEvents->unregisterEventsHandler(mEventHandlerId_chat);
}
void FriendsDialog::activatePage(FriendsDialog::Page page)
@ -239,31 +200,31 @@ void FriendsDialog::processSettings(bool bLoad)
void FriendsDialog::chatMessageReceived(const ChatMessage &msg)
{
if(!msg.chat_id.isBroadcast())
return;
if(msg.chat_id.isBroadcast())
{
QDateTime sendTime = QDateTime::fromTime_t(msg.sendTime);
QDateTime recvTime = QDateTime::fromTime_t(msg.recvTime);
QString message = QString::fromUtf8(msg.msg.c_str());
QString name = QString::fromUtf8(rsPeers->getPeerName(msg.broadcast_peer_id).c_str());
QDateTime sendTime = DateTime::DateTimeFromTime_t(msg.sendTime);
QDateTime recvTime = DateTime::DateTimeFromTime_t(msg.recvTime);
QString message = QString::fromUtf8(msg.msg.c_str());
QString name = QString::fromUtf8(rsPeers->getPeerName(msg.broadcast_peer_id).c_str());
ui.chatWidget->addChatMsg(msg.incoming, name, sendTime, recvTime, message, ChatWidget::MSGTYPE_NORMAL);
ui.chatWidget->addChatMsg(msg.incoming, name, sendTime, recvTime, message, ChatWidget::MSGTYPE_NORMAL);
if(ui.chatWidget->isActive())
{
// clear the chat notify when control returns to the Qt event loop
// we have to do this later, because we don't know if we or the notify receives the chat message first
QMetaObject::invokeMethod(this, "clearChatNotify", Qt::QueuedConnection);
}
if(ui.chatWidget->isActive())
{
// clear the chat notify when control returns to the Qt event loop
// we have to do this later, because we don't know if we or the notify receives the chat message first
QMetaObject::invokeMethod(this, "clearChatNotify", Qt::QueuedConnection);
}
}
}
void FriendsDialog::chatStatusReceived(const ChatId &chat_id, const QString &status_string)
{
if(!chat_id.isBroadcast())
return;
QString name = QString::fromUtf8(rsPeers->getPeerName(chat_id.broadcast_status_peer_id).c_str());
ui.chatWidget->updateStatusString(name + " %1", status_string);
if(chat_id.isBroadcast())
{
QString name = QString::fromUtf8(rsPeers->getPeerName(chat_id.broadcast_status_peer_id).c_str());
ui.chatWidget->updateStatusString(name + " %1", status_string);
}
}
void FriendsDialog::addFriend()

View file

@ -70,6 +70,9 @@ public:
IdDialog *idDialog;
private slots:
void chatMessageReceived(const ChatMessage& msg);
void chatStatusReceived(const ChatId& chat_id, const QString& status_string);
void addFriend();
void statusmessage();
@ -86,17 +89,10 @@ signals:
void notifyGroupChat(const QString&,const QString&) ;
private:
void chatMessageReceived(const ChatMessage& msg);
void chatStatusReceived(const ChatId& chat_id, const QString& status_string);
void processSettings(bool bLoad);
/** Qt Designer generated object */
Ui::FriendsDialog ui;
RsEventsHandlerId_t mEventHandlerId_friends ;
#ifdef RS_DIRECT_CHAT
RsEventsHandlerId_t mEventHandlerId_chat ;
#endif
};
#endif

View file

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

View file

@ -39,6 +39,7 @@
#include "retroshare/rstor.h"
#include "retroshare/rsidentity.h"
#include "retroshare/rsinit.h"
#include "retroshare/rsnotify.h"
#include "rsserver/rsaccounts.h"
#include "util/rsrandom.h"
@ -250,7 +251,7 @@ void GenCertDialog::initKeyList()
void GenCertDialog::mouseMoveEvent(QMouseEvent *e)
{
//std::cerr << "Mouse : " << e->x() << ", " << e->y() << std::endl;
std::cerr << "Mouse : " << e->x() << ", " << e->y() << std::endl;
QDialog::mouseMoveEvent(e) ;
}
@ -612,9 +613,7 @@ 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 = "" ;
@ -642,7 +641,7 @@ void GenCertDialog::genPerson()
std::cout << "RsAccounts::GenerateSSLCertificate" << std::endl;
// now cache the PGP password so that it's not asked again for immediately signing the key
rsLoginHelper->cachePgpPassphrase(ui.password_input->text().toUtf8().constData()) ;
rsNotify->cachePgpPassphrase(ui.password_input->text().toUtf8().constData()) ;
bool okGen = RsAccounts::createNewAccount(PGPId, "", genLoc, "", isHiddenLoc, isAutoTor, sslPasswd, sslId, err);
@ -650,12 +649,12 @@ void GenCertDialog::genPerson()
{
/* complete the process */
RsInit::LoadPassword(sslPasswd);
if (RsApplication::loadCertificate(sslId, false)) {
if (Rshare::loadCertificate(sslId, false)) {
// Normally we should clear the cached passphrase as soon as possible. However,some other GUI components may still need it at start.
// (csoler) This is really bad: we have to guess that 30 secs will be enough. I have no better way to do this.
QTimer::singleShot(30000, []() { RsLoginHelper::clearPgpPassphrase(); } );
QTimer::singleShot(30000, []() { rsNotify->clearPgpPassphrase(); } );
accept();
}
@ -663,7 +662,7 @@ void GenCertDialog::genPerson()
else
{
// Now clear the cached passphrase
RsLoginHelper::clearPgpPassphrase();
rsNotify->clearPgpPassphrase();
/* Message Dialog */
QMessageBox::warning(this,

View file

@ -332,9 +332,96 @@ void GetStartedDialog::emailSupport()
QString text = QString("Hello") + "\n";
text += "\n";
QString sysVersion = QSysInfo::prettyProductName();
QString sysVersion;
text += QString("My RetroShare Configuration is: (%1, %2, %3)").arg(RsApplication::retroshareVersion(true)
#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(Rshare::retroshareVersion(true)
, sysVersion
).arg(static_cast<typename std::underlying_type<RsConfigUserLvl>::type>(userLevel)) + "\n";
text += "\n";

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