Compare commits

...

21 Commits

Author SHA1 Message Date
tastytea 733aad9903
Remove xdgcfg dependency by copying it into this repo.
continuous-integration/drone/push Build is failing Details
2021-12-24 16:10:15 +01:00
tastytea 3a8b8c715a
Fix translation loading.
continuous-integration/drone/push Build is passing Details
https://www.kdab.com/fixing-a-common-antipattern-when-loading-translations-in-qt/
2020-07-09 13:22:17 +02:00
tastytea b19e8b233a
Fixed this and that in the readme. 2019-06-12 01:35:52 +02:00
tastytea bc6444747d
CI: Don't let rm fail if lockfile isn't there.
continuous-integration/drone/push Build is passing Details
2019-06-12 00:26:48 +02:00
tastytea ea9755bf9a
Updated readme.
continuous-integration/drone/push Build is failing Details
2019-06-12 00:22:38 +02:00
tastytea 774c1685af
Modified drone config to work with versions > 1.
continuous-integration/drone/push Build is failing Details
2019-06-12 00:14:33 +02:00
tastytea 9067b9dc91
Small cosmetic change to manpage.
the build was successful Details
2019-04-12 19:54:53 +02:00
tastytea 11b88aaf3d
Added files section to manpage.
the build was successful Details
2019-01-21 01:07:04 +01:00
tastytea 231f8ee1bb
fixed readme.
the build was successful Details
2019-01-21 00:30:58 +01:00
tastytea 788d56f98e
Rearranged stuff 2019-01-21 00:29:29 +01:00
tastytea bd33509e7a
Set default variables in build recipe correctly.
the build failed Details
2019-01-21 00:27:38 +01:00
tastytea 3711f30f3b
Fixed manpage version and email 2019-01-21 00:09:24 +01:00
tastytea 69177d5dda
Fixed translation compilation recipe.
the build was successful Details
2019-01-21 00:03:14 +01:00
tastytea dc33ae0a54
Fixed manpage script
the build failed Details
2019-01-21 00:01:29 +01:00
tastytea 032dc9f644
Enhanced manpage 2019-01-21 00:00:38 +01:00
tastytea 1bb26d9c33
Fixed version
the build failed Details
2019-01-20 23:48:47 +01:00
tastytea 3ab52e1b9e
CI: Added asciidoc as dependency
the build failed Details
2019-01-20 23:48:20 +01:00
tastytea 58a79b0681
Renamed whyblocked-gui -> whyblocked 2019-01-20 23:46:41 +01:00
tastytea fac5bd700a
Added manpage. 2019-01-20 23:31:58 +01:00
tastytea 3ed5d3ce0d
Set to blocked by default if account is added via drag & drop.
the build was successful Details
2019-01-16 15:49:36 +01:00
tastytea 449651e94f
Remove mentions of text interface from readme.
the build was successful Details
2019-01-15 01:46:11 +01:00
14 changed files with 563 additions and 250 deletions

View File

@ -1,185 +1,223 @@
pipeline:
gcc6:
image: ubuntu:xenial
pull: true
environment:
- LANG=C.utf8
- CXX=g++-6
- CXXFLAGS=-pipe -O2
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main" >> /etc/apt/sources.list.d/ubuntu-toolchain-r.list
- gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 0x60c317803a41ba51845e371a1e9377a2ba9ef27f
- gpg --armor --export 0x60c317803a41ba51845e371a1e9377a2ba9ef27f | apt-key add -
- apt-get update -q
- apt-get install -qy g++-6 cmake pkg-config
- apt-get install -qy libvsqlitepp-dev libboost-dev libxdg-basedir-dev qt5-default qttools5-dev-tools qttools5-dev libconfig++-dev
- apt-get install -qy dpkg-dev rpm file wget
- gpg --import /var/autosign_gpg.key
- rm -rf build && mkdir -p build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr ..
- make VERBOSE=1
- make install DESTDIR=install
- make package
- cmake -DWITH_DEB=ON ..
- make package
- cmake -DWITH_DEB=OFF -DWITH_RPM=ON ..
- make package
- gpg --verbose --detach-sign *.tar.gz
- gpg --verbose --detach-sign *.deb
- gpg --verbose --detach-sign *.rpm
volumes:
- /var/cache/debian-package-cache:/var/cache/apt/archives
- /home/tastytea/misc/autosign_gpg.key:/var/autosign_gpg.key
kind: pipeline
name: build x86_64
gcc7:
image: debian:stretch-slim
pull: true
when:
event: [push, pull_request]
environment:
- LANG=C.utf8
- CXX=g++-7
- CXXFLAGS=-pipe -O2
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- apt-get update -q
- echo "APT::Default-Release \"stretch\";" >> /etc/apt/apt.conf.d/00default_release
- echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list.d/backports.list
- echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main" >> /etc/apt/sources.list.d/ubuntu-toolchain-r.list
- apt-get install -qy gnupg
- gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 0x60c317803a41ba51845e371a1e9377a2ba9ef27f
- gpg --armor --export 0x60c317803a41ba51845e371a1e9377a2ba9ef27f | apt-key add -
- apt-get update -q
- apt-get install -qy -t xenial g++-7
- apt-get install -qy cmake pkg-config
- apt-get install -qy libvsqlitepp-dev libboost-dev libxdg-basedir-dev qt5-default qttools5-dev-tools qttools5-dev libconfig++-dev
- rm -rf build && mkdir -p build && cd build
- cmake ..
- make VERBOSE=1
- make install DESTDIR=install
volumes:
- /var/cache/debian-package-cache:/var/cache/apt/archives
volumes:
- name: debian-package-cache
host:
path: /var/cache/debian-package-cache
gcc8:
image: debian:stretch-slim
pull: true
when:
event: [push, pull_request]
environment:
- LANG=C.utf8
- CXX=g++-8
- CXXFLAGS=-pipe -O2
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- apt-get update -q
- echo "APT::Default-Release \"stretch\";" >> /etc/apt/apt.conf.d/00default_release
- echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list.d/backports.list
- echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main" >> /etc/apt/sources.list.d/ubuntu-toolchain-r.list
- apt-get install -qy gnupg
- gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 0x60c317803a41ba51845e371a1e9377a2ba9ef27f
- gpg --armor --export 0x60c317803a41ba51845e371a1e9377a2ba9ef27f | apt-key add -
- apt-get update -q
- apt-get install -qy -t xenial g++-8
- apt-get install -qy cmake pkg-config
- apt-get install -qy libvsqlitepp-dev libboost-dev libxdg-basedir-dev qt5-default qttools5-dev-tools qttools5-dev libconfig++-dev
- rm -rf build && mkdir -p build && cd build
- cmake ..
- make VERBOSE=1
- make install DESTDIR=install
volumes:
- /var/cache/debian-package-cache:/var/cache/apt/archives
trigger:
event:
exclude:
- tag
clang3:
image: debian:stretch-slim
pull: true
when:
event: [push, pull_request]
environment:
- LANG=C.utf8
- CXX=clang++
- CXXFLAGS=-pipe -O2
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- echo "APT::Default-Release \"stretch\";" >> /etc/apt/apt.conf.d/00default_release
- echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list.d/backports.list
- apt-get update -q
- apt-get install -qy clang cmake pkg-config
- apt-get install -qy libvsqlitepp-dev libboost-dev libxdg-basedir-dev qt5-default qttools5-dev-tools qttools5-dev libconfig++-dev
- rm -rf build && mkdir -p build && cd build
- cmake ..
- make VERBOSE=1
- make install DESTDIR=install
volumes:
- /var/cache/debian-package-cache:/var/cache/apt/archives
steps:
- name: submodules
image: docker:git
commands:
- git submodule init
- git submodule update --recursive
clang5:
image: debian:stretch-slim
pull: true
when:
event: [push, pull_request]
environment:
- LANG=C.utf8
- CXX=clang++-5.0
- CXXFLAGS=-pipe -O2
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- echo "APT::Default-Release \"stretch\";" >> /etc/apt/apt.conf.d/00default_release
- echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list.d/stretch.list
- apt-get update -q
- apt-get install -qy -t stretch-backports clang-5.0
- apt-get install -qy cmake pkg-config
- apt-get install -qy libvsqlitepp-dev libboost-dev libxdg-basedir-dev qt5-default qttools5-dev-tools qttools5-dev libconfig++-dev
- rm -rf build && mkdir -p build && cd build
- cmake ..
- make VERBOSE=1
- make install DESTDIR=install
volumes:
- /var/cache/debian-package-cache:/var/cache/apt/archives
- name: gcc6
image: ubuntu:xenial
pull: always
environment:
CXX: g++-6
CXXFLAGS: -pipe -O2
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main" >> /etc/apt/sources.list.d/ubuntu-toolchain-r.list
- gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 0x60c317803a41ba51845e371a1e9377a2ba9ef27f
- gpg --armor --export 0x60c317803a41ba51845e371a1e9377a2ba9ef27f | apt-key add -
- rm -f /var/cache/apt/archives/lock
- apt-get update -q
- rm -f /var/cache/apt/archives/lock
- apt-get install -qy g++-6 cmake pkg-config
- rm -f /var/cache/apt/archives/lock
- apt-get install -qy libvsqlitepp-dev libboost-dev libxdg-basedir-dev qt5-default qttools5-dev-tools qttools5-dev libconfig++-dev asciidoc
- rm -rf build && mkdir -p build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr ..
- make VERBOSE=1
- make install DESTDIR=install
volumes:
- name: debian-package-cache
path: /var/cache/apt/archives
clang6:
image: debian:stretch-slim
pull: true
when:
event: [push, pull_request]
environment:
- LANG=C.utf8
- CXX=clang++-6.0
- CXXFLAGS=-pipe -O2
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- echo "APT::Default-Release \"stretch\";" >> /etc/apt/apt.conf.d/00default_release
- echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list.d/stretch.list
- apt-get update -q
- apt-get install -qy -t stretch-backports clang-6.0
- apt-get install -qy cmake pkg-config
- apt-get install -qy libvsqlitepp-dev libboost-dev libxdg-basedir-dev qt5-default qttools5-dev-tools qttools5-dev libconfig++-dev
- rm -rf build && mkdir -p build && cd build
- cmake ..
- make VERBOSE=1
- make install DESTDIR=install
volumes:
- /var/cache/debian-package-cache:/var/cache/apt/archives
- name: gcc9
image: debian:stretch-slim
pull: always
environment:
CXX: g++-9
CXXFLAGS: -pipe -O2
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- rm -f /var/cache/apt/archives/lock
- apt-get update -q
- echo "APT::Default-Release \"stretch\";" >> /etc/apt/apt.conf.d/00default_release
- echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list.d/backports.list
- echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main" >> /etc/apt/sources.list.d/ubuntu-toolchain-r.list
- rm -f /var/cache/apt/archives/lock
- apt-get install -qy gnupg
- gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 0x60c317803a41ba51845e371a1e9377a2ba9ef27f
- gpg --armor --export 0x60c317803a41ba51845e371a1e9377a2ba9ef27f | apt-key add -
- rm -f /var/cache/apt/archives/lock
- apt-get update -q
- rm -f /var/cache/apt/archives/lock
- apt-get install -qy -t xenial g++-9
- rm -f /var/cache/apt/archives/lock
- apt-get install -qy cmake pkg-config
- rm -f /var/cache/apt/archives/lock
- apt-get install -qy libvsqlitepp-dev libboost-dev libxdg-basedir-dev qt5-default qttools5-dev-tools qttools5-dev libconfig++-dev asciidoc
- rm -rf build && mkdir -p build && cd build
- cmake ..
- make VERBOSE=1
- make install DESTDIR=install
volumes:
- name: debian-package-cache
path: /var/cache/apt/archives
prepare_release:
image: ubuntu:xenial
pull: true
when:
event: tag
commands:
- cp -v build/whyblocked-${DRONE_TAG}_x86_64.tar.gz .
- cp -v build/whyblocked-${DRONE_TAG}_x86_64.tar.gz.sig .
- cp -v build/whyblocked_${DRONE_TAG}-0_amd64.deb .
- cp -v build/whyblocked_${DRONE_TAG}-0_amd64.deb.sig .
- cp -v build/whyblocked-${DRONE_TAG}-0.x86_64.rpm .
- cp -v build/whyblocked-${DRONE_TAG}-0.x86_64.rpm.sig .
gitea_release:
image: plugins/gitea-release
pull: true
when:
event: tag
- name: clang3
image: debian:stretch-slim
pull: always
environment:
CXX: clang++
CXXFLAGS: -pipe -O2
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- echo "APT::Default-Release \"stretch\";" >> /etc/apt/apt.conf.d/00default_release
- echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list.d/backports.list
- rm -f /var/cache/apt/archives/lock
- apt-get update -q
- rm -f /var/cache/apt/archives/lock
- apt-get install -qy clang cmake pkg-config
- rm -f /var/cache/apt/archives/lock
- apt-get install -qy libvsqlitepp-dev libboost-dev libxdg-basedir-dev qt5-default qttools5-dev-tools qttools5-dev libconfig++-dev asciidoc
- rm -rf build && mkdir -p build && cd build
- cmake ..
- make VERBOSE=1
- make install DESTDIR=install
volumes:
- name: debian-package-cache
path: /var/cache/apt/archives
- name: clang6
image: debian:stretch-slim
pull: always
environment:
CXX: clang++-6.0
CXXFLAGS: -pipe -O2
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- echo "APT::Default-Release \"stretch\";" >> /etc/apt/apt.conf.d/00default_release
- echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list.d/stretch.list
- rm -f /var/cache/apt/archives/lock
- apt-get update -q
- rm -f /var/cache/apt/archives/lock
- apt-get install -qy -t stretch-backports clang-6.0
- rm -f /var/cache/apt/archives/lock
- apt-get install -qy cmake pkg-config
- rm -f /var/cache/apt/archives/lock
- apt-get install -qy libvsqlitepp-dev libboost-dev libxdg-basedir-dev qt5-default qttools5-dev-tools qttools5-dev libconfig++-dev asciidoc
- rm -rf build && mkdir -p build && cd build
- cmake ..
- make VERBOSE=1
- make install DESTDIR=install
volumes:
- name: debian-package-cache
path: /var/cache/apt/archives
- name: notify
image: drillster/drone-email
pull: always
settings:
host: cryptoparty-celle.de
username:
from_secret: email_username
password:
from_secret: email_password
from: drone@tzend.de
when:
status: [ changed, failure ]
---
kind: pipeline
name: packages x86_64
volumes:
- name: debian-package-cache
host:
path: /var/cache/debian-package-cache
- name: gpg-key
host:
path: /var/autosign_gpg.key
trigger:
event:
- tag
steps:
- name: submodules
image: docker:git
commands:
- git submodule init
- git submodule update --recursive
- name: gcc6
image: ubuntu:xenial
pull: always
environment:
CXX: g++-6
CXXFLAGS: -pipe -O2
commands:
- rm /etc/apt/apt.conf.d/docker-clean
- echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main" >> /etc/apt/sources.list.d/ubuntu-toolchain-r.list
- gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 0x60c317803a41ba51845e371a1e9377a2ba9ef27f
- gpg --armor --export 0x60c317803a41ba51845e371a1e9377a2ba9ef27f | apt-key add -
- rm -f /var/cache/apt/archives/lock
- apt-get update -q
- rm -f /var/cache/apt/archives/lock
- apt-get install -qy g++-6 cmake pkg-config
- rm -f /var/cache/apt/archives/lock
- apt-get install -qy libvsqlitepp-dev libboost-dev libxdg-basedir-dev qt5-default qttools5-dev-tools qttools5-dev libconfig++-dev asciidoc
- rm -f /var/cache/apt/archives/lock
- apt-get install -qy dpkg-dev rpm file wget
- gpg --import /var/autosign_gpg.key
- rm -rf build && mkdir -p build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr ..
- make VERBOSE=1
- make install DESTDIR=install
- make package
- cmake -DWITH_DEB=ON ..
- make package
- cmake -DWITH_DEB=OFF -DWITH_RPM=ON ..
- make package
- gpg --verbose --detach-sign *.tar.gz
- gpg --verbose --detach-sign *.deb
- gpg --verbose --detach-sign *.rpm
volumes:
- name: debian-package-cache
path: /var/cache/apt/archives
- name: gpg-key
path: /var/autosign_gpg.key
- name: prepare_release
image: ubuntu:xenial
pull: always
commands:
- cp -v build/whyblocked-${DRONE_TAG}_x86_64.tar.gz .
- cp -v build/whyblocked-${DRONE_TAG}_x86_64.tar.gz.sig .
- cp -v build/whyblocked_${DRONE_TAG}-0_amd64.deb .
- cp -v build/whyblocked_${DRONE_TAG}-0_amd64.deb.sig .
- cp -v build/whyblocked-${DRONE_TAG}-0.x86_64.rpm .
- cp -v build/whyblocked-${DRONE_TAG}-0.x86_64.rpm.sig .
- name: release
image: plugins/gitea-release
pull: always
settings:
base_url: https://schlomp.space
secrets: [ gitea_token ]
api_key:
from_secret: gitea_token
title: ${DRONE_TAG}
prerelease: true
files:
@ -193,11 +231,15 @@ pipeline:
- sha256
- sha512
notify:
image: drillster/drone-email
pull: true
- name: notify
image: drillster/drone-email
pull: always
settings:
host: cryptoparty-celle.de
secrets: [ email_username, email_password ]
username:
from_secret: email_username
password:
from_secret: email_password
from: drone@tzend.de
when:
status: [ changed, failure ]
when:
status: [ changed, failure ]

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.2)
project (whyblocked
VERSION 0.14.5
VERSION 0.15.0
LANGUAGES CXX
)
@ -41,22 +41,46 @@ configure_file (
"${PROJECT_BINARY_DIR}/version.hpp"
)
add_executable(whyblocked-gui
add_executable(${CMAKE_PROJECT_NAME}
src/qt/main.cpp src/qt/mainwindow.cpp src/qt/dialog_add.cpp
src/whyblocked.cpp src/xdgcfg.cpp)
target_link_libraries(whyblocked-gui
target_link_libraries(${CMAKE_PROJECT_NAME}
${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp Qt5::Widgets
${LIBCONFIG_LIBRARIES} stdc++fs)
set(WITH_MAN "YES" CACHE STRING "WITH_MAN defaults to \"YES\"")
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_PROJECT_NAME} whyblocked-gui)
install(TARGETS whyblocked-gui DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES de.tastytea.Whyblocked.desktop DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/applications)
install(FILES de.tastytea.Whyblocked.appdata.xml DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
install(FILES de.tastytea.Whyblocked.svg DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps)
if(WITH_MAN)
add_custom_command(
OUTPUT "${PROJECT_BINARY_DIR}/whyblocked.1"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
DEPENDS "${CMAKE_SOURCE_DIR}/whyblocked.1.adoc"
COMMAND ${CMAKE_SOURCE_DIR}/build_manpage.sh
ARGS ${PROJECT_VERSION})
add_custom_target(run ALL
DEPENDS "${PROJECT_BINARY_DIR}/whyblocked.1"
)
endif()
if(NOT WITHOUT_TRANSLATIONS)
install(TARGETS ${CMAKE_PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES "${PROJECT_BINARY_DIR}/whyblocked-gui"
DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES de.tastytea.Whyblocked.desktop
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
install(FILES de.tastytea.Whyblocked.appdata.xml
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
install(FILES de.tastytea.Whyblocked.svg
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps)
if(WITH_MAN)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/whyblocked.1
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
endif()
set(WITH_TRANSLATIONS "YES" CACHE STRING "WITH_TRANSLATIONS defaults to \"YES\"")
if(WITH_TRANSLATIONS)
add_subdirectory(translations)
endif()

View File

@ -1,14 +1,13 @@
**Whyblocked** allows you to store the reason why you blocked someone, along with
"receipts", URLs to the posts that led you to block them.
**Whyblocked** allows you to store the reason why you blocked someone, along
with “receipts”, URLs to the posts that led you to block them.
It has a text- and a Qt-interface and uses an SQLite-database.
It has a Qt-interface and uses an SQLite-database.
![Screenshot Qt interface](https://doc.schlomp.space/whyblocked/whyblocked_screenshot.png)
![Screenshot](https://doc.schlomp.space/whyblocked/whyblocked_screenshot.png)
## Usage
For the text interface start `whyblocked`, for the Qt interface
`whyblocked-gui`. You can also start it from the menu of your desktop
Run `whyblocked`. You can also start it from the menu of your desktop
environment.
## Install
@ -17,9 +16,12 @@ environment.
Every [release](https://schlomp.space/tastytea/whyblocked/releases) includes
a .deb-package, an .rpm-package and a .tar.gz-package with precompiled binaries
for x86_64(amd64) ([more info](https://schlomp.space/tastytea/whyblocked/wiki/Binary-Packages)). These are automatically built and not tested. You can install
them with `dpkg -i` or `rpm -i`, respectively. The packages are signed with the
PGP key [242E5AC4DA587BF9](https://tastytea.de/tastytea_autosign.asc)
for x86_64(amd64)
([more info](https://schlomp.space/tastytea/whyblocked/wiki/Binary-Packages)).
These are automatically built and not tested. You can install them with
`apt install ./whyblocked*.deb` or `yum install ./whyblocked*.rpm`,
respectively. The packages are signed with the PGP key
[242E5AC4DA587BF9](https://tastytea.de/tastytea_autosign.asc)
(Fingerprint: `F730 1ADF C9ED 2624 48C4 2B64 242E 5AC4 DA58 7BF9`).
Gentoo ebuilds are available via my
@ -29,31 +31,26 @@ Gentoo ebuilds are available via my
#### Dependencies
* C++ compiler (tested: [gcc](https://gcc.gnu.org/) 6/7/8,
[clang](https://llvm.org/) 3/5/6)
* C++ compiler (tested: [gcc](https://gcc.gnu.org/) 6/8/9,
[clang](https://llvm.org/) 3/6)
* [cmake](https://cmake.org/) (at least 3.2)
* [vsqlite++](http://vsqlite.virtuosic-bytes.com/) (tested: 0.3)
* [libxdg-basedir](http://repo.or.cz/w/libxdg-basedir.git) (tested: 1.2)
* [qtcore](https://www.qt.io/) (tested: 5.11/5.5)
* [qtwidgets](https://www.qt.io/) (tested: 5.11/5.5)
* [qtcore](https://www.qt.io/) (tested: 5.12/5.5)
* [qtwidgets](https://www.qt.io/) (tested: 5.12/5.5)
* [libconfig++](https://github.com/hyperrealm/libconfig) (tested: 1.5)
* Optional
* Translations: [lupdate & lrelease](http://doc.qt.io/qt-5/linguist-manager.html) (tested: 5.11/5.5)
* Translations: [lupdate & lrelease](http://doc.qt.io/qt-5/linguist-manager.html) (tested: 5.12/5.5)
* Manpage: [asciidoc](http://asciidoc.org/) (tested: 8.6)
#### Get sourcecode
Download the current
[release](https://schlomp.space/tastytea/whyblocked/releases) and copy
[xdgcfg](https://schlomp.space/tastytea/xdgcfg) into `xdgcfg/`.
If you clone from git, be sure to `git submodule init` and
`git submodule update` afterwards. See the [submodules article in the git book]
(https://git-scm.com/book/en/v2/Git-Tools-Submodules#_cloning_submodules) for
further info.
[release](https://schlomp.space/tastytea/whyblocked/releases).
#### Compile
```SH
``` zsh
mkdir build
cd build
cmake ..
@ -63,7 +60,8 @@ make install
cmake options:
* `-DCMAKE_BUILD_TYPE=Debug` for a debug build
* `-DWITHOUT_TRANSLATIONS=YES` to not compile translations
* `-DWITH_TRANSLATIONS=NO` to not compile translations
* `-DWITH_MAN=NO` to not compile the manpage
* One of:
* `-DWITH_DEB=YES` if you want to be able to generate a deb-package
* `-DWITH_RPM=YES` if you want to be able to generate an rpm-package
@ -91,14 +89,14 @@ Please report them on the
## Licence & Copyright
```PLAIN
``` plain
Copyright © 2018 tastytea <tastytea@tastytea.de>.
License GPLv3: GNU GPL version 3 <https://www.gnu.org/licenses/gpl-3.0.html>.
This program comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
```
The icon is derived from the icons `messagebox critical` and `help` of the
The icon is derived from the icons *“messagebox critical”* and *“help”* of the
[Gartoon icon theme](https://commons.wikimedia.org/wiki/Gartoon_icons). The
original authors were Zeus, Patrick Yavitz and La Mula Francis, who released
them under the terms of the

10
build_manpage.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
if [ -n "${1}" ]; then
dir="$(dirname ${0})"
cp -vf ${dir}/whyblocked.1.adoc .
sed -Ei "s/(Revision: +)[0-9]+\.[0-9]\.[0-9]/\1${1}/" whyblocked.1.adoc
a2x --doctype manpage --format manpage --no-xmllint whyblocked.1.adoc
else
echo "usage: ${0} VERSION" >&2
fi

View File

@ -5,7 +5,7 @@ Name=Whyblocked
Comment=Reminds you why you blocked someone
Comment[de]=Erinnert dich, warum du jemanden blockiertest
Icon=de.tastytea.Whyblocked
Exec=whyblocked-gui
Exec=whyblocked
Terminal=false
Categories=Utility;
Keywords=blocklist;social-network;

View File

@ -1,5 +1,5 @@
/* This file is part of whyblocked.
* Copyright © 2019 tastytea <tastytea@tastytea.de>
* Copyright © 2019, 2020 tastytea <tastytea@tastytea.de>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -14,21 +14,24 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QTranslator>
#include <QLibraryInfo>
#include "mainwindow.hpp"
#include <QLibraryInfo>
#include <QLocale>
#include <QTranslator>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QCoreApplication::setApplicationName("Whyblocked");
QTranslator qtTranslator;
qtTranslator.load("qt_" + QLocale::system().name(),
qtTranslator.load(QLocale(), "qt", "_",
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&qtTranslator);
QTranslator appTranslator;
appTranslator.load("whyblocked_" + QLocale::system().name(),
appTranslator.load(QLocale(), "whyblocked", "_",
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&appTranslator);

View File

@ -255,6 +255,7 @@ void MainWindow::dropEvent(QDropEvent *event)
DialogAdd *dialog = new DialogAdd(_database, this);
Database::data data;
data.user = text;
data.blocked = true;
dialog->set_data(data);
dialog->show();
}

View File

@ -1 +0,0 @@
../xdgcfg/src/xdgcfg.cpp

95
src/xdgcfg.cpp Normal file
View File

@ -0,0 +1,95 @@
/* Copyright © 2019 tastytea <tastytea@tastytea.de>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the BSD-3-Clause license.
*/
#include <basedir.h>
#include "xdgcfg.hpp"
xdgcfg::xdgcfg(const string &filename, const string &subdir)
: _cfg()
, _verbose(false)
{
xdgHandle xdg;
xdgInitHandle(&xdg);
_filepath = xdgConfigHome(&xdg);
xdgWipeHandle(&xdg);
if (!subdir.empty())
{
_filepath /= subdir;
}
if (!fs::exists(_filepath))
{
fs::create_directories(_filepath);
}
_filepath /= filename;
}
uint8_t xdgcfg::read()
{
try
{
_cfg.readFile(_filepath.c_str());
}
catch (const libconfig::FileIOException &e)
{
if (_verbose)
{
cerr << "I/O error while reading " << _filepath
<< " - " << e.what() << endl;
}
return 1;
}
catch (const libconfig::ParseException &e)
{
if (_verbose)
{
cerr << "Parse error at " << e.getFile() << ":" << e.getLine()
<< " - " << e.getError() << endl;
}
return 2;
}
return 0;
}
bool xdgcfg::write()
{
try
{
_cfg.writeFile(_filepath.c_str());
}
catch (const libconfig::FileIOException &e)
{
if (_verbose)
{
cerr << "I/O error while writing " << _filepath
<< " - " << e.what() << endl;
}
return false;
}
return true;
}
libconfig::Config &xdgcfg::get_cfg()
{
return _cfg;
}
const fs::path xdgcfg::get_filepath() const
{
return _filepath;
}
void xdgcfg::set_verbose(bool verbose)
{
_verbose = verbose;
}
bool xdgcfg::get_verbose() const
{
return _verbose;
}

View File

@ -1 +0,0 @@
../xdgcfg/src/xdgcfg.hpp

106
src/xdgcfg.hpp Normal file
View File

@ -0,0 +1,106 @@
/* Copyright © 2019 tastytea <tastytea@tastytea.de>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the BSD-3-Clause license.
*/
#ifndef XDGCFG_HPP
#define XDGCFG_HPP
#if __cplusplus >= 201703L
#include <filesystem>
#else
#include <experimental/filesystem>
#endif
#include <string>
#include <iostream>
#include <cstdint>
#include <libconfig.h++>
#if __cplusplus >= 201703L
namespace fs = std::filesystem;
#else
namespace fs = std::experimental::filesystem;
#endif
using std::string;
using std::uint8_t;
using std::cerr;
using std::endl;
class xdgcfg
{
public:
/*!
* @brief Checks if subdir is present, creates it if necessary
*
* Example:
* @code
* xdgcfg config("test.cfg", "subdirectory");
* @endcode
*
* @param filename The name of the file, including extension
* @param subdir The subdir (optional)
*/
explicit xdgcfg(const string &filename, const string &subdir = "");
/*!
* @brief Read the file
*
* @return 0 on success, 1 on I/O error, 2 on parse error.
*/
uint8_t read();
/*!
* @brief Write the file
*
* @return `true` on success
*/
bool write();
/*!
* @brief Returns a reference to the config as libconfig::Config
*
* Example:
* @code
* libconfig::Config &cfg = config.get_cfg();
* @endcode
*/
libconfig::Config &get_cfg();
/*!
* @brief Returns the complete filepath
*/
const fs::path get_filepath() const;
/*!
* @brief Sets verbosity
*/
void set_verbose(bool verbose);
/*!
* @brief Returns verbosity
*/
bool get_verbose() const;
private:
/*!
* Holds the contents of the CFG file
*/
libconfig::Config _cfg;
/*!
* Complete filepath
*/
fs::path _filepath;
/*!
* Print out error messages if true
*/
bool _verbose;
};
/*!
* @example example.cpp
*/
#endif // XDGCFG_HPP

View File

@ -7,6 +7,6 @@ qt5_create_translation(QM_FILES ${TS_SRC_FILES} ${TS_FILES}
OPTIONS -no-obsolete)
# qt5_add_translation(QM_FILES ${TS_FILES})
add_custom_target(translations ALL DEPENDS ${QM_FILES})
add_dependencies(${CMAKE_PROJECT_NAME}-gui translations)
add_dependencies(${CMAKE_PROJECT_NAME} translations)
install(FILES ${QM_FILES} DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/qt5/translations)

View File

@ -198,7 +198,7 @@
</message>
<message>
<location filename="../src/qt/whyblocked.ui" line="285"/>
<location filename="../src/qt/mainwindow.cpp" line="277"/>
<location filename="../src/qt/mainwindow.cpp" line="279"/>
<source>Edit entry</source>
<translation>Eintrag bearbeiten</translation>
</message>
@ -219,18 +219,18 @@
</message>
<message>
<location filename="../src/qt/whyblocked.ui" line="59"/>
<location filename="../src/qt/mainwindow.cpp" line="327"/>
<location filename="../src/qt/mainwindow.cpp" line="329"/>
<source>User/Instance</source>
<translation>Benutzer/Instanz</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="328"/>
<location filename="../src/qt/mainwindow.cpp" line="330"/>
<source>Blocked/Silenced</source>
<translation>Blockiert/Gedämpft</translation>
</message>
<message>
<location filename="../src/qt/whyblocked.ui" line="72"/>
<location filename="../src/qt/mainwindow.cpp" line="329"/>
<location filename="../src/qt/mainwindow.cpp" line="331"/>
<source>Reason</source>
<translation>Begründung</translation>
</message>
@ -250,37 +250,37 @@
<translation>gedämpft</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="271"/>
<location filename="../src/qt/mainwindow.cpp" line="273"/>
<source>Invalid selection</source>
<translation>Ungültige Auswahl</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="272"/>
<location filename="../src/qt/mainwindow.cpp" line="274"/>
<source>Please select only 1 entry to edit.</source>
<translation>Bitte nur 1 Eintrag zum bearbeiten auswählen.</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="211"/>
<location filename="../src/qt/mainwindow.cpp" line="212"/>
<source>Nothing selected</source>
<translation>Nichts ausgewählt</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="212"/>
<location filename="../src/qt/mainwindow.cpp" line="213"/>
<source>Please select entries to remove.</source>
<translation>Bitte wähle Einträge aus, die gelöscht werden sollen.</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="290"/>
<location filename="../src/qt/mainwindow.cpp" line="292"/>
<source>About Whyblocked</source>
<translation>Über Whyblocked</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="291"/>
<location filename="../src/qt/mainwindow.cpp" line="293"/>
<source>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Reminds you why you blocked someone.&lt;/p&gt;&lt;p&gt;Sourcecode: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Licence GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.&lt;/small&gt;&lt;/p&gt;</source>
<translation>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Erinnert dich, warum du jemanden blockiertest.&lt;/p&gt;&lt;p&gt;Quelltext: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Lizenz GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;Für dieses Programm besteht KEINERLEI GARANTIE. Dies ist freie Software, die Sie unter bestimmten Bedingungen weitergeben dürfen.&lt;/small&gt;&lt;/p&gt;</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="312"/>
<location filename="../src/qt/mainwindow.cpp" line="314"/>
<source>Receipts:</source>
<translation>Belege:</translation>
</message>

View File

@ -198,7 +198,7 @@
</message>
<message>
<location filename="../src/qt/whyblocked.ui" line="285"/>
<location filename="../src/qt/mainwindow.cpp" line="277"/>
<location filename="../src/qt/mainwindow.cpp" line="279"/>
<source>Edit entry</source>
<translation type="unfinished"></translation>
</message>
@ -219,18 +219,18 @@
</message>
<message>
<location filename="../src/qt/whyblocked.ui" line="59"/>
<location filename="../src/qt/mainwindow.cpp" line="327"/>
<location filename="../src/qt/mainwindow.cpp" line="329"/>
<source>User/Instance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="328"/>
<location filename="../src/qt/mainwindow.cpp" line="330"/>
<source>Blocked/Silenced</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/whyblocked.ui" line="72"/>
<location filename="../src/qt/mainwindow.cpp" line="329"/>
<location filename="../src/qt/mainwindow.cpp" line="331"/>
<source>Reason</source>
<translation type="unfinished"></translation>
</message>
@ -250,37 +250,37 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="271"/>
<location filename="../src/qt/mainwindow.cpp" line="273"/>
<source>Invalid selection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="272"/>
<location filename="../src/qt/mainwindow.cpp" line="274"/>
<source>Please select only 1 entry to edit.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="211"/>
<location filename="../src/qt/mainwindow.cpp" line="212"/>
<source>Nothing selected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="212"/>
<location filename="../src/qt/mainwindow.cpp" line="213"/>
<source>Please select entries to remove.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="290"/>
<location filename="../src/qt/mainwindow.cpp" line="292"/>
<source>About Whyblocked</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="291"/>
<location filename="../src/qt/mainwindow.cpp" line="293"/>
<source>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Reminds you why you blocked someone.&lt;/p&gt;&lt;p&gt;Sourcecode: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Licence GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.&lt;/small&gt;&lt;/p&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="312"/>
<location filename="../src/qt/mainwindow.cpp" line="314"/>
<source>Receipts:</source>
<translation type="unfinished"></translation>
</message>

37
whyblocked.1.adoc Normal file
View File

@ -0,0 +1,37 @@
= whyblocked(1)
:Author: tastytea
:Email: tastytea@tastytea.de
:Date: 2019-04-12
:Revision: 0.0.0
:man source: Whyblocked
:man version: {revision}
:man manual: General Commands Manual
== NAME
whyblocked - reminds you why you blocked someone.
== SYNOPSIS
*whyblocked*
== DESCRIPTION
Whyblocked allows you to store the reason why you blocked someone, along with
"receipts", URLs to the posts that led you to block them.
Apart from the obvious method, you can add entries by dropping the link to a
profile into the main window. In the "Add entry" dialog, you can add receipts by
dropping links or text into the receipts list.
== FILES
- *Configuration file*: `${XDG_CONFIG_HOME}/whyblocked.cfg`
- *Database*: `${XDG_DATA_HOME}/whyblocked/database.sqlite`
`${XDG_CONFIG_HOME}` is usually `~/.config` and `${XDG_DATA_HOME}` is usually
`~/.local/share`
== REPORTING BUGS
Bugtracker: https://schlomp.space/tastytea/whyblocked/issues

1
xdgcfg

@ -1 +0,0 @@
Subproject commit e22f82fc6f1c40cda3d3ce5e671299f26f622528