mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
Compare commits
177 Commits
zoitechat-
...
gtk3-themi
| Author | SHA1 | Date | |
|---|---|---|---|
| 69985913b8 | |||
| df45cc996d | |||
| 5763653672 | |||
| 2ece544792 | |||
| 8e0958fd19 | |||
| 324aeab8c9 | |||
| e8dbe06f01 | |||
| f3213c56eb | |||
| 9ef607f44a | |||
| a93bed2c41 | |||
| d10c9654fa | |||
| a823047104 | |||
| bf349a27b1 | |||
| 90ada474a0 | |||
| 4a996c9135 | |||
| c9682d98f3 | |||
| 8a4ecf8649 | |||
| 252f4a3c07 | |||
| d21a5c1b60 | |||
| a1ba30865a | |||
| 607faa80ca | |||
| 1c1110847c | |||
| a796f78884 | |||
| 4354aaa57a | |||
| 4aeb5b5697 | |||
| 30609ba6db | |||
| 6b8e41b4c6 | |||
| 0edab77fac | |||
| c8ae4f3b18 | |||
| 578a417804 | |||
| 440e9ecf5a | |||
| ac2ab1443c | |||
| ce5128e4fb | |||
| c37faa1492 | |||
| 685989fa25 | |||
| cbc474477b | |||
| 51f8795d1a | |||
| faacd95dfc | |||
| ed02b21228 | |||
| d321717da8 | |||
| 6310ab245c | |||
| 5952006662 | |||
| e4cb453915 | |||
| 361e35de7f | |||
| bbde2e5578 | |||
| 97c6f36b20 | |||
|
|
2bf32fc770 | ||
| 3e095c3c33 | |||
| 3445d946bc | |||
| 7578928199 | |||
|
|
428127ef40 | ||
| e3f932aa6b | |||
| 7cfa3b3513 | |||
| 81c691491c | |||
| c361602b1a | |||
| 99b969067e | |||
| 6e8b750c68 | |||
| df37b44cc8 | |||
| 9548be0cec | |||
|
|
588e27b456 | ||
|
|
7032d0c6b7 | ||
|
|
72e9a99315 | ||
| 3cff6742f5 | |||
| 6a02f578b6 | |||
| e62769b361 | |||
| 9df9776238 | |||
| 4beabb6bf5 | |||
| 10d5bb91ab | |||
| 7c9c615aed | |||
| fd48c97209 | |||
| e58bf2be22 | |||
| dc6453e230 | |||
| b3a0288fd9 | |||
| 9c86f18982 | |||
| 1bf0140652 | |||
| bb72f8afab | |||
| bb11c4676b | |||
| 32fe3e54f1 | |||
| 9d2187ca4d | |||
| 0e94432c24 | |||
| c4890d157a | |||
| ef2befa698 | |||
| 5f9ce549f8 | |||
| cb435f0d15 | |||
| 105e259f2c | |||
| 51bf0c3fe0 | |||
| e6311a5fe7 | |||
| 2c90c14d72 | |||
| 6c9aeac36f | |||
| 48f7693eac | |||
| 71d3ba576f | |||
| 067670bd01 | |||
| 610d6fa1c0 | |||
| 5d6fa503c9 | |||
| 375e747014 | |||
| 5cab7be8a9 | |||
| 4808d83b26 | |||
| c4951a06f3 | |||
| bd418160e1 | |||
| 90a3d6d839 | |||
|
|
e2511e8be1 | ||
|
|
33e1403b98 | ||
|
|
596a134ef3 | ||
|
|
1ae7e50c88 | ||
|
|
922595d68c | ||
| 618aecd349 | |||
| 3ed66f9945 | |||
| 4284cb76c1 | |||
| b7693e75ec | |||
| c15b352c4b | |||
|
|
cf8aeba53e | ||
|
|
ff75d73b92 | ||
|
|
d7986d603f | ||
|
|
672fe041cc | ||
| 91485465c9 | |||
| 1c39d7b9ad | |||
|
|
54105f3816 | ||
|
|
69b007f849 | ||
|
|
118ac25059 | ||
| 9ee8a53b9c | |||
|
|
e407ef6c47 | ||
| 0935799f7d | |||
|
|
fac15811c2 | ||
|
|
d89f632850 | ||
| b7804fd7eb | |||
| 95e40bbe5e | |||
| 3a680cf6b4 | |||
| 314dfbbd75 | |||
|
|
aed21ffcae | ||
| a79d34bcc0 | |||
| eebe11b95b | |||
| 42993c8c9b | |||
|
|
2598f3732c | ||
|
|
5204a6b672 | ||
|
|
155a20115c | ||
| ab0e84257a | |||
| b2fd66e4c4 | |||
| 66d0549938 | |||
| 498497171b | |||
| b731d3fb18 | |||
|
|
0081d5c492 | ||
|
|
ccdc9d4992 | ||
| 45105590fe | |||
| 149863fdca | |||
| be7b5e62be | |||
| 1b66b136dc | |||
| 4b188192f8 | |||
| 743bf334d4 | |||
| 1c5bf9d6b1 | |||
| 8b344e8bfe | |||
| 44019bcab2 | |||
| 52f547ae13 | |||
|
|
c7311009dc | ||
| 1b1855b14e | |||
| 6c699ac07b | |||
| d379bb138c | |||
| 76796f5f23 | |||
| 796c572292 | |||
| 931dddcf0e | |||
| 2713270e1f | |||
| 2705d21f6e | |||
| 6b6869e327 | |||
| 97fc9c7061 | |||
| c928568a92 | |||
|
|
78fe710b97 | ||
|
|
2ed22b3081 | ||
|
|
3ad30c4775 | ||
|
|
fe5033ea6d | ||
|
|
b6ec7d2981 | ||
| 42de1c8e60 | |||
| 5dcd4151db | |||
| 275e5504f8 | |||
|
|
f53e2a21ba | ||
|
|
e58d128c73 | ||
| 4b919721b1 | |||
| 391c4c1a24 | |||
| acb8d2f539 |
86
.github/workflows/appimage-build.yml
vendored
86
.github/workflows/appimage-build.yml
vendored
@@ -8,7 +8,7 @@ on:
|
||||
|
||||
jobs:
|
||||
appimage_build:
|
||||
runs-on: ubuntu-24.04
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
libxkbcommon0 \
|
||||
libgtk-3-bin libglib2.0-bin shared-mime-info gsettings-desktop-schemas \
|
||||
libluajit-5.1-dev libpci-dev libperl-dev libssl-dev libayatana-appindicator3-dev \
|
||||
python3-dev python3-cffi mono-devel desktop-file-utils \
|
||||
perl python3 python3-minimal python3-dev python3-cffi mono-devel desktop-file-utils \
|
||||
patchelf file curl
|
||||
|
||||
- name: Configure
|
||||
@@ -43,11 +43,11 @@ jobs:
|
||||
rm -rf build
|
||||
meson setup build \
|
||||
--prefix=/usr \
|
||||
-Dgtk3=true \
|
||||
-Dtext-frontend=true \
|
||||
-Dwith-perl=perl \
|
||||
-Dwith-python=python3 \
|
||||
-Dauto_features=enabled
|
||||
-Dauto_features=enabled \
|
||||
-Dappindicator=enabled
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
@@ -60,6 +60,60 @@ jobs:
|
||||
rm -rf AppDir
|
||||
DESTDIR="${PWD}/AppDir" ninja -C build install
|
||||
|
||||
- name: Bundle scripting runtimes in AppDir
|
||||
run: |
|
||||
set -eux
|
||||
|
||||
python3_version="$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')"
|
||||
|
||||
install -Dm755 "$(command -v python3)" "AppDir/usr/bin/python3"
|
||||
if [ -x "/usr/bin/perl" ]; then
|
||||
install -Dm755 /usr/bin/perl AppDir/usr/bin/perl
|
||||
fi
|
||||
|
||||
install -d AppDir/usr/lib
|
||||
cp -a "/usr/lib/python${python3_version}" "AppDir/usr/lib/"
|
||||
|
||||
if [ -d "/usr/lib/python3/dist-packages" ]; then
|
||||
install -d AppDir/usr/lib/python3
|
||||
cp -a /usr/lib/python3/dist-packages AppDir/usr/lib/python3/
|
||||
fi
|
||||
|
||||
if [ -d "/usr/lib/x86_64-linux-gnu/python3/dist-packages" ]; then
|
||||
install -d AppDir/usr/lib/x86_64-linux-gnu/python3
|
||||
cp -a /usr/lib/x86_64-linux-gnu/python3/dist-packages AppDir/usr/lib/x86_64-linux-gnu/python3/
|
||||
fi
|
||||
|
||||
if [ -d "/usr/lib/x86_64-linux-gnu/perl" ]; then
|
||||
install -d AppDir/usr/lib/x86_64-linux-gnu
|
||||
cp -a /usr/lib/x86_64-linux-gnu/perl AppDir/usr/lib/x86_64-linux-gnu/
|
||||
fi
|
||||
|
||||
if [ -d "/usr/share/perl" ]; then
|
||||
install -d AppDir/usr/share
|
||||
cp -a /usr/share/perl AppDir/usr/share/
|
||||
fi
|
||||
|
||||
if [ -d "/usr/share/perl5" ]; then
|
||||
install -d AppDir/usr/share
|
||||
cp -a /usr/share/perl5 AppDir/usr/share/
|
||||
fi
|
||||
if compgen -G '/usr/lib/x86_64-linux-gnu/libpython3*.so*' > /dev/null; then
|
||||
install -d AppDir/usr/lib/x86_64-linux-gnu
|
||||
cp -a /usr/lib/x86_64-linux-gnu/libpython3*.so* AppDir/usr/lib/x86_64-linux-gnu/
|
||||
fi
|
||||
|
||||
- name: Verify bundled plugins
|
||||
run: |
|
||||
set -eux
|
||||
|
||||
# Include every built-in plugin except the Windows-only update plugin.
|
||||
find AppDir/usr/lib -maxdepth 4 -type f -name '*.so' -path '*/zoitechat/plugins/*' -print | sort
|
||||
|
||||
for plugin in checksum fishlim lua perl python sysinfo; do
|
||||
find "AppDir/usr/lib" -maxdepth 4 -type f -name "${plugin}.so" -path '*/zoitechat/plugins/*' -print -quit | grep -q .
|
||||
done
|
||||
|
||||
- name: Build AppImage
|
||||
env:
|
||||
APPIMAGE_EXTRACT_AND_RUN: 1
|
||||
@@ -86,10 +140,16 @@ jobs:
|
||||
|
||||
APPDIR="${APPDIR:-$(dirname "$(readlink -f "$0")")}"
|
||||
|
||||
export PATH="$APPDIR/usr/bin:${PATH:-/usr/bin:/bin}"
|
||||
export PATH="${PATH:-/usr/bin:/bin}:$APPDIR/usr/bin"
|
||||
export LD_LIBRARY_PATH="$APPDIR/usr/lib:$APPDIR/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}"
|
||||
export XDG_DATA_DIRS="$APPDIR/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
|
||||
|
||||
if [ -d "$APPDIR/usr/lib/x86_64-linux-gnu/zoitechat/plugins" ]; then
|
||||
export ZOITECHAT_LIBDIR="$APPDIR/usr/lib/x86_64-linux-gnu/zoitechat/plugins"
|
||||
elif [ -d "$APPDIR/usr/lib/zoitechat/plugins" ]; then
|
||||
export ZOITECHAT_LIBDIR="$APPDIR/usr/lib/zoitechat/plugins"
|
||||
fi
|
||||
|
||||
if [ -d "$APPDIR/usr/share/glib-2.0/schemas" ]; then
|
||||
export GSETTINGS_SCHEMA_DIR="$APPDIR/usr/share/glib-2.0/schemas${GSETTINGS_SCHEMA_DIR:+:$GSETTINGS_SCHEMA_DIR}"
|
||||
fi
|
||||
@@ -100,6 +160,22 @@ jobs:
|
||||
export GIO_EXTRA_MODULES="$APPDIR/usr/lib/gio/modules${GIO_EXTRA_MODULES:+:$GIO_EXTRA_MODULES}"
|
||||
fi
|
||||
|
||||
export PYTHONHOME="$APPDIR/usr"
|
||||
python_stdlib_dir="$(find "$APPDIR/usr/lib" -maxdepth 1 -type d -name 'python3.*' | head -n 1 || true)"
|
||||
pythonpath_entries=""
|
||||
if [ -n "$python_stdlib_dir" ] && [ -d "$python_stdlib_dir/dist-packages" ]; then
|
||||
pythonpath_entries="$python_stdlib_dir/dist-packages"
|
||||
fi
|
||||
if [ -d "$APPDIR/usr/lib/python3/dist-packages" ]; then
|
||||
pythonpath_entries="${pythonpath_entries:+$pythonpath_entries:}$APPDIR/usr/lib/python3/dist-packages"
|
||||
fi
|
||||
if [ -d "$APPDIR/usr/lib/x86_64-linux-gnu/python3/dist-packages" ]; then
|
||||
pythonpath_entries="${pythonpath_entries:+$pythonpath_entries:}$APPDIR/usr/lib/x86_64-linux-gnu/python3/dist-packages"
|
||||
fi
|
||||
if [ -n "$pythonpath_entries" ]; then
|
||||
export PYTHONPATH="$pythonpath_entries${PYTHONPATH:+:$PYTHONPATH}"
|
||||
fi
|
||||
|
||||
# OpenSSL trust store override
|
||||
export SSL_CERT_FILE="${SSL_CERT_FILE:-$APPDIR/etc/ssl/certs/ca-certificates.crt}"
|
||||
export SSL_CERT_DIR="${SSL_CERT_DIR:-$APPDIR/etc/ssl/certs}"
|
||||
|
||||
48
.github/workflows/debian-build.yml
vendored
48
.github/workflows/debian-build.yml
vendored
@@ -1,48 +0,0 @@
|
||||
name: Debian Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
debian_build:
|
||||
runs-on: ubuntu-24.04
|
||||
container:
|
||||
image: debian:bookworm
|
||||
|
||||
steps:
|
||||
- name: Install packaging tooling and build dependencies
|
||||
run: |
|
||||
set -eux
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends \
|
||||
git ca-certificates \
|
||||
build-essential dpkg-dev debhelper fakeroot \
|
||||
pkg-config meson ninja-build \
|
||||
gettext iso-codes \
|
||||
libcanberra-dev libdbus-glib-1-dev libglib2.0-dev libgtk-3-dev libayatana-appindicator3-dev \
|
||||
liblua5.3-dev libpci-dev libperl-dev libssl-dev \
|
||||
python3-dev python3-cffi desktop-file-utils
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Build Debian packages
|
||||
run: |
|
||||
set -eux
|
||||
dpkg-buildpackage -us -uc -b
|
||||
|
||||
- name: Collect Debian artifacts
|
||||
run: |
|
||||
set -eux
|
||||
mkdir -p artifacts
|
||||
cp -v ../*.deb ../*.changes ../*.buildinfo artifacts/
|
||||
|
||||
- name: Upload Debian artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: zoitechat-debian-packages
|
||||
path: artifacts/*
|
||||
81
.github/workflows/manjaro-package-build.yml
vendored
Normal file
81
.github/workflows/manjaro-package-build.yml
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
name: Manjaro Package Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, main]
|
||||
pull_request:
|
||||
branches: [master, main]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
manjaro-package:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: manjarolinux/base:latest
|
||||
|
||||
steps:
|
||||
- name: Install packaging toolchain
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
pacman -Syu --noconfirm
|
||||
pacman -S --noconfirm --needed \
|
||||
base-devel \
|
||||
git \
|
||||
namcap \
|
||||
meson \
|
||||
ninja \
|
||||
pkgconf \
|
||||
glib2 \
|
||||
glib2-devel \
|
||||
gtk3 \
|
||||
openssl \
|
||||
dbus-glib \
|
||||
libcanberra \
|
||||
libayatana-appindicator \
|
||||
luajit \
|
||||
iso-codes \
|
||||
lua \
|
||||
perl \
|
||||
python \
|
||||
python-cffi \
|
||||
pciutils
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
|
||||
- name: Build package and generate .SRCINFO (non-root)
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
id -u builder >/dev/null 2>&1 || useradd -m builder
|
||||
chown -R builder:builder "$GITHUB_WORKSPACE"
|
||||
su builder -c "cd '$GITHUB_WORKSPACE/packaging/manjaro' && makepkg --noconfirm --syncdeps --cleanbuild"
|
||||
su builder -c "cd '$GITHUB_WORKSPACE/packaging/manjaro' && makepkg --printsrcinfo > .SRCINFO"
|
||||
|
||||
- name: Lint PKGBUILD and package with namcap
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
cd "$GITHUB_WORKSPACE/packaging/manjaro"
|
||||
namcap PKGBUILD
|
||||
pkg_file="$(find . -maxdepth 1 -type f -name '*.pkg.tar.*' | head -n1)"
|
||||
namcap "$pkg_file"
|
||||
|
||||
- name: Collect artifacts
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
mkdir -p artifacts
|
||||
cp -v "$GITHUB_WORKSPACE"/packaging/manjaro/*.pkg.tar.* artifacts/
|
||||
cp -v "$GITHUB_WORKSPACE"/packaging/manjaro/PKGBUILD artifacts/
|
||||
cp -v "$GITHUB_WORKSPACE"/packaging/manjaro/.SRCINFO artifacts/
|
||||
|
||||
- name: Upload package artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: zoitechat-manjaro-package
|
||||
path: artifacts/*
|
||||
if-no-files-found: error
|
||||
118
.github/workflows/openbsd-build.yml
vendored
118
.github/workflows/openbsd-build.yml
vendored
@@ -1,118 +0,0 @@
|
||||
name: OpenBSD Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
openbsd_package:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Build OpenBSD package
|
||||
uses: vmactions/openbsd-vm@v1
|
||||
with:
|
||||
release: '7.5'
|
||||
usesh: true
|
||||
sync: rsync
|
||||
run: |
|
||||
set -eux
|
||||
|
||||
rdate -n pool.ntp.org
|
||||
export PKG_PATH="https://ftp.openbsd.org/pub/OpenBSD/7.5/packages/$(uname -m)/"
|
||||
|
||||
pkg_add -U \
|
||||
git \
|
||||
meson ninja pkgconf gmake \
|
||||
gettext-tools \
|
||||
glib2 gtk+3 dbus-glib libcanberra \
|
||||
luajit mono libgdiplus openssl
|
||||
|
||||
work="$(mktemp -d /tmp/zoitechat.XXXXXX)"
|
||||
trap 'rm -rf "$work"' EXIT
|
||||
|
||||
rsync -a --delete "$GITHUB_WORKSPACE"/ "$work/src/"
|
||||
cd "$work/src"
|
||||
|
||||
rm -rf build
|
||||
meson setup build \
|
||||
--prefix=/usr/local \
|
||||
-Dtext-frontend=true \
|
||||
-Dgtk3=true \
|
||||
-Dplugin=false \
|
||||
-Dauto_features=enabled
|
||||
|
||||
ninja -C build
|
||||
|
||||
staging="$work/staging"
|
||||
rm -rf "$staging"
|
||||
mkdir -p "$staging"
|
||||
|
||||
# Staged install
|
||||
DESTDIR="$staging" meson install -C build --no-rebuild
|
||||
|
||||
# If these exist, something ignored DESTDIR (install scripts are leaking)
|
||||
ls -l /usr/local/bin/zoitechat /usr/local/bin/thememan 2>/dev/null || true
|
||||
|
||||
sync
|
||||
sleep 1
|
||||
sync
|
||||
|
||||
# Freeze staged tree so pkg_create doesn't see moving targets
|
||||
snap="$work/staging-snap"
|
||||
rm -rf "$snap"
|
||||
mkdir -p "$snap"
|
||||
(cd "$staging" && pax -rw -pe . "$snap")
|
||||
|
||||
version="$(meson introspect --projectinfo build | sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')"
|
||||
pkg_name="zoitechat-${version}"
|
||||
pkg_file="${pkg_name}.tgz"
|
||||
plist="$work/openbsd-plist"
|
||||
desc="$work/DESCR"
|
||||
|
||||
cat >"$desc" <<'EOF'
|
||||
ZoiteChat is an IRC client (HexChat-derived) with a GTK UI and optional tools.
|
||||
EOF
|
||||
|
||||
{
|
||||
echo "@cwd /usr/local"
|
||||
|
||||
# Files + symlinks
|
||||
find "$snap/usr/local" \( -type f -o -type l \) -print \
|
||||
| LC_ALL=C sort \
|
||||
| sed "s#^$snap/usr/local/##"
|
||||
|
||||
# Directories (reverse so children removed first)
|
||||
find "$snap/usr/local" -mindepth 1 -type d -print \
|
||||
| LC_ALL=C sort -r \
|
||||
| sed "s#^$snap/usr/local/##" \
|
||||
| sed 's#^#@dir #'
|
||||
} > "$plist"
|
||||
|
||||
# OpenBSD pkg_create: COMMENT is set via -D COMMENT=... (mandatory), no -c flag exists.
|
||||
# Create the .tgz in $work so we can copy it back out.
|
||||
cd "$work"
|
||||
pkg_create \
|
||||
-B "$snap" \
|
||||
-p /usr/local \
|
||||
-f "$plist" \
|
||||
-d "$desc" \
|
||||
-D "COMMENT=ZoiteChat IRC client" \
|
||||
-D "FULLPKGPATH=net/zoitechat" \
|
||||
"$pkg_file"
|
||||
|
||||
mkdir -p "$GITHUB_WORKSPACE/artifacts"
|
||||
cp "$work/$pkg_file" "$GITHUB_WORKSPACE/artifacts/"
|
||||
|
||||
- name: Upload OpenBSD package
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: openbsd-package
|
||||
path: artifacts/*.tgz
|
||||
13
.github/workflows/solus-eopkg-build.yml
vendored
13
.github/workflows/solus-eopkg-build.yml
vendored
@@ -62,17 +62,8 @@ jobs:
|
||||
sh -lc '
|
||||
set -euo pipefail
|
||||
eopkg update-repo -y
|
||||
# Do not remove openssl-11 here: it can trigger a very large
|
||||
# dependency cascade (including python3/eopkg itself), which
|
||||
# breaks the build environment before package build starts.
|
||||
# Some Solus base images still contain openssl-11 files that
|
||||
# conflict with openssl 3.x when the package set is refreshed.
|
||||
# Allowing file-conflict resolution keeps the CI image usable
|
||||
# long enough to install ypkg and complete the package build.
|
||||
# The base image does not guarantee Meson toolchain packages,
|
||||
# while our package.yml setup phase calls meson directly.
|
||||
# Install the essential build tools up front to avoid
|
||||
# `/tmp/ypkg-setup*: meson: command not found` failures.
|
||||
# Keep file-conflict handling on: some base images still carry
|
||||
# openssl-11 leftovers, and Meson tooling is not always preinstalled.
|
||||
eopkg install -y --ignore-file-conflicts \
|
||||
ypkg git meson ninja pkgconf gcc gettext
|
||||
ypkg build "$PACKAGE_YML"
|
||||
|
||||
2
.github/workflows/windows-build.yml
vendored
2
.github/workflows/windows-build.yml
vendored
@@ -54,11 +54,9 @@ jobs:
|
||||
Invoke-WebRequest https://github.com/zoitechat/gvsbuild/releases/download/zoitechat-2.17.0/perl-5.20.0-${{ matrix.arch }}.7z -OutFile deps\perl-${{ matrix.arch }}.7z
|
||||
& 7z.exe x deps\perl-${{ matrix.arch }}.7z -oC:\gtk-build\perl-5.20\${{ matrix.platform }}
|
||||
|
||||
# Resolve python root from setup-python
|
||||
$pyRoot = $env:pythonLocation
|
||||
if (-not $pyRoot) { $pyRoot = & python -c "import sys; print(sys.prefix)" }
|
||||
|
||||
# Create BOTH paths because the .vcxproj hard-codes python-3.14\...
|
||||
foreach ($pyDir in @("C:\gtk-build\python-3.14.2", "C:\gtk-build\python-3.14")) {
|
||||
New-Item -Path $pyDir -ItemType Directory -Force | Out-Null
|
||||
$target = Join-Path $pyDir "${{ matrix.platform }}"
|
||||
|
||||
1
Makefile
1
Makefile
@@ -14,7 +14,6 @@ CONFIG_STAMP := $(BUILD_DIR)/build.ninja
|
||||
|
||||
all: build
|
||||
|
||||
# Only run initial meson setup if we don't have a configured build dir yet.
|
||||
$(CONFIG_STAMP):
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
@env NINJA=$(NINJA) $(MESON) setup $(BUILD_DIR) --prefix=$(PREFIX) $(MESON_SETUP_ARGS)
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
ZoiteChat ChangeLog
|
||||
=================
|
||||
|
||||
2.18.0~pre2 (2026-02-25)
|
||||
------------------------
|
||||
|
||||
- Added HexChat plugin compatibility improvements.
|
||||
- Fixed the user info right-click menu so it updates properly.
|
||||
- Added support for emoji characters in alert highlights.
|
||||
- clicking links in chat window with appimage build now works.
|
||||
- Removed remaining unused GTK2 code paths.
|
||||
- Continued GTK3 cleanup and packaging alignment work.
|
||||
|
||||
2.18.0-pre1 (2026-02-16)
|
||||
------------------------
|
||||
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
<id>net.zoite.Zoitechat</id>
|
||||
<name>ZoiteChat</name>
|
||||
<launchable type="desktop-id">net.zoite.Zoitechat.desktop</launchable>
|
||||
<developer_name>ZoiteChat</developer_name>
|
||||
|
||||
<developer id="net.zoite">
|
||||
<name translate="no">ZoiteChat</name>
|
||||
</developer>
|
||||
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-2.0+</project_license>
|
||||
<translation type="gettext">zoitechat</translation>
|
||||
@@ -12,7 +16,7 @@
|
||||
<p>ZoiteChat is an easy to use yet extensible IRC Client based on Hexchat. It allows you to securely join multiple networks and talk to users privately or in channels using a customizable interface. You can even transfer files.</p>
|
||||
<p>ZoiteChat supports features such as: DCC, SASL, proxies, spellcheck, alerts, logging, custom themes, and Python/Perl scripts.</p>
|
||||
</description>
|
||||
<url type="homepage">http://zoitechat.zoite.net</url>
|
||||
<url type="homepage">https://zoitechat.zoite.net</url>
|
||||
<url type="bugtracker">https://github.com/zoitechat/zoitechat</url>
|
||||
<url type="help">https://docs.zoitechat.zoite.net/en/latest/</url>
|
||||
<screenshots>
|
||||
@@ -25,7 +29,18 @@
|
||||
<id>zoitechat.desktop</id>
|
||||
</provides>
|
||||
<releases>
|
||||
<release date="2026-02-16" version="2.18.0-pre1">
|
||||
<release date="2026-02-25" version="2.18.0~pre2">
|
||||
<description>
|
||||
<p>Compatibility and UI improvements:</p>
|
||||
<ul>
|
||||
<li>Added HexChat plugin compatibility improvements.</li>
|
||||
<li>Fixed the user info right-click menu so it updates properly.</li>
|
||||
<li>Added support for emoji characters in alert highlights.</li>
|
||||
<li>Removed remaining unused GTK2 code paths.</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release date="2026-02-16" version="2.18.0~pre1">
|
||||
<description>
|
||||
<p>Packaging and GTK3 improvements:</p>
|
||||
<ul>
|
||||
@@ -223,5 +238,5 @@
|
||||
<content_rating type="oars-1.1">
|
||||
<content_attribute id="social-chat">intense</content_attribute>
|
||||
</content_rating>
|
||||
<update_contact>tingping_at_fedoraproject.org</update_contact>
|
||||
<update_contact>deepend_at_zoite.net</update_contact>
|
||||
</component>
|
||||
|
||||
511
debian/changelog
vendored
511
debian/changelog
vendored
@@ -1,511 +0,0 @@
|
||||
zoitechat (2.18.0~pre1-1) unstable; urgency=medium
|
||||
|
||||
* New upstream pre-release 2.18.0~pre1.
|
||||
* Debian packaging updates in this branch:
|
||||
- switch package builds to GTK 3 and pass -Dgtk3=true to Meson.
|
||||
- add/install split-package manifests for generated binary packages.
|
||||
- include manpage and MIME package XML in package installs.
|
||||
- adjust CI artifact staging/upload paths for actions/upload-artifact@v4.
|
||||
|
||||
-- ZoiteChat Maintainers <zoitechat@users.noreply.github.com> Sun, 16 Feb 2026 00:00:00 +0000
|
||||
|
||||
zoitechat (2.17.0-1) unstable; urgency=medium
|
||||
|
||||
* Switch Debian build to GTK 3 packaging:
|
||||
- replace libgtk2.0-dev with libgtk-3-dev in Build-Depends.
|
||||
- pass -Dgtk3=true to Meson during package builds.
|
||||
- update package description to explicitly reference GTK 3.
|
||||
|
||||
-- ZoiteChat Maintainers <zoitechat@users.noreply.github.com> Sun, 16 Feb 2026 00:00:00 +0000
|
||||
|
||||
zoitechat (2.17.0-0) stable; urgency=medium
|
||||
|
||||
* Initial ZoiteChat packaging (forked from HexChat's Debian packaging).
|
||||
* Rename packages/binaries to zoitechat.
|
||||
* Move Python plugin package to Suggests (known to be unstable in Flatpak builds).
|
||||
|
||||
-- ZoiteChat Maintainers <zoitechat@users.noreply.github.com> Wed, 07 Jan 2026 00:00:00 +0000
|
||||
|
||||
hexchat (2.16.2-1) unstable; urgency=medium
|
||||
|
||||
* Update watch file for new github tarball location
|
||||
* New upstream version 2.16.2
|
||||
* Update copyright file
|
||||
* Update copyright years also for Debian packaging
|
||||
* Drop patch 0001-Be-even-more-picky-about-invalid-URLs.patch: upstream
|
||||
* Add three patches from <pabs>:
|
||||
- Add-channel-context-menu-item-to-close-the-channel,
|
||||
- Automatically-reconnect-when-there-is-a-TLS-error,
|
||||
- Do-not-insert-an-extra-space-on-all-lines-when-loading-scrollback-with-colours
|
||||
|
||||
-- Gianfranco Costamagna <locutusofborg@debian.org> Sat, 09 Mar 2024 11:51:16 +0100
|
||||
|
||||
hexchat (2.16.1-2) unstable; urgency=medium
|
||||
|
||||
[ Gianfranco Costamagna ]
|
||||
* Team upload
|
||||
|
||||
[ Debian Janitor ]
|
||||
* Drop versioned constraint on python3-dev.
|
||||
|
||||
[ Sudip Mukherjee ]
|
||||
* Fix hexchat crash for specific links. (LP: #2029314)
|
||||
+ This is an upstream cherry-pick
|
||||
|
||||
-- Gianfranco Costamagna <locutusofborg@debian.org> Wed, 06 Mar 2024 07:30:56 +0100
|
||||
|
||||
hexchat (2.16.1-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version 2.16.1.
|
||||
* Drop all patches, applied upstream.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Fri, 22 Apr 2022 21:52:27 +0200
|
||||
|
||||
hexchat (2.16.0-4) unstable; urgency=medium
|
||||
|
||||
* d/copyright: bump copyright year
|
||||
* Add some patches from upstream, while waiting for the new release:
|
||||
+ Fix build with OpenSSL 3.
|
||||
+ Improve the fishlim tests.
|
||||
+ Fix the URL opening to not double-encode already encoded URLs.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Mon, 17 Jan 2022 13:26:58 +0100
|
||||
|
||||
hexchat (2.16.0-3) unstable; urgency=medium
|
||||
|
||||
* Increase the tests timeout even more.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Sun, 31 Oct 2021 17:45:43 +0100
|
||||
|
||||
hexchat (2.16.0-2) unstable; urgency=medium
|
||||
|
||||
* Add patch to increase the tests timeout.
|
||||
* Update our copy of the upstream changelog.
|
||||
* Recommends:hexchat-lua from hexchat. Closes: #996172
|
||||
Thanks to Jesse Rhodes <jesse@sney.ca> for the patch!
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Fri, 15 Oct 2021 14:20:31 +0200
|
||||
|
||||
hexchat (2.16.0-1) unstable; urgency=medium
|
||||
|
||||
[ Mattia Rizzolo ]
|
||||
* New upstream version 2.16.0.
|
||||
+ Drop all patches applied upstream.
|
||||
+ Refresh the patches tweaking the default channels/networks.
|
||||
* Refresh the upstream signing key.
|
||||
* Update copyright.
|
||||
* Drop our patch renaming the Python plugin into Python3.
|
||||
There doesn't seem to be any transition needed.
|
||||
* d/control:
|
||||
+ Drop Build-Depends on libnotify-dev and libproxy-dev,
|
||||
not used anymore starting with v2.16.
|
||||
+ Have hexchat-python3 Depend on python3-cffi-backend;
|
||||
seems like I missed this dependency since v2.14.3-4.
|
||||
+ Bump Standards-Version to 4.6.0, no changes needed.
|
||||
|
||||
[ Debian Janitor ]
|
||||
* Remove constraints unnecessary since buster:
|
||||
* Build-Depends: Drop versioned constraint on meson.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Mon, 04 Oct 2021 17:12:52 +0200
|
||||
|
||||
hexchat (2.14.3-6) unstable; urgency=medium
|
||||
|
||||
* Add Recommends:ca-certificates.
|
||||
* Add patches from upstream to add Libera.Chat to the network list.
|
||||
* Adapt default servers patches for the upstream changes.
|
||||
* Ubuntu default server: LP: #1933681
|
||||
+ Change from Freenode to Libera.Chat.
|
||||
+ Pre-select the "join channel" button, like we do in Debian.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Wed, 26 May 2021 14:55:10 +0200
|
||||
|
||||
hexchat (2.14.3-5) unstable; urgency=medium
|
||||
|
||||
* Bump copyright for 2021.
|
||||
* Apply patch from upstream to fix font height calculation with Pango>=1.44.
|
||||
LP: #1920974
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Sat, 02 Jan 2021 16:31:39 +0100
|
||||
|
||||
hexchat (2.14.3-4) unstable; urgency=medium
|
||||
|
||||
[ Debian Janitor ]
|
||||
* Set upstream metadata fields: Bug-Submit.
|
||||
|
||||
[ Mattia Rizzolo ]
|
||||
* Bump Standards-Version to 4.5.1, no changes needed.
|
||||
* Bump debhelper compat version to 13.
|
||||
+ Drop dh_missing override, now that --fail-missing is the default.
|
||||
* Add a patch series from upstream to refactor the whole Python plugin,
|
||||
using CFFI. This fixes support for Python 3.9. Closes: #975393
|
||||
+ Replace my naive patch to fix the build with Python 3.8, using instead
|
||||
the fix that comes from upstream.
|
||||
+ Install the new files produced by cffi.
|
||||
+ Add new Build-Depends python3-cffi.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Wed, 16 Dec 2020 22:03:57 +0100
|
||||
|
||||
hexchat (2.14.3-3) unstable; urgency=medium
|
||||
|
||||
* Add patch to use the new -embed variant of python3.pc.
|
||||
Fix linking with Python 3.8. LP: #1866081
|
||||
* Swap the Recommends:hwdata with Recommends:pci.ids. Closes: #953300
|
||||
* Bump Standards-Version to 4.5.0, no changes needed.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Wed, 11 Mar 2020 17:08:25 +0100
|
||||
|
||||
hexchat (2.14.3-2) unstable; urgency=medium
|
||||
|
||||
[ Gianfranco Costamagna ]
|
||||
* Refresh the Ubuntu servlist patch.
|
||||
|
||||
[ Mattia Rizzolo ]
|
||||
* Import patch from upstream (from James Clarke) to properly prioritize
|
||||
MODE commands, that were delaying PINGs in some cases.
|
||||
|
||||
[ Debian Janitor ]
|
||||
* Set upstream metadata fields: Bug-Database, Repository,
|
||||
Repository-Browse.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Thu, 02 Jan 2020 09:46:24 +0100
|
||||
|
||||
hexchat (2.14.3-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version 2.14.3.
|
||||
+ Drop patches applied upstream.
|
||||
* d/control:
|
||||
+ Bump build-dependency on meson to >= 0.40.
|
||||
+ Bump Standards-Version to 4.4.1, no changes needed.
|
||||
* Update the boundled upstream docs.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Tue, 31 Dec 2019 15:24:45 +0100
|
||||
|
||||
hexchat (2.14.2-5) unstable; urgency=medium
|
||||
|
||||
* Stop building the Python2 plugin. Closes: #936697
|
||||
Simplify the patch used to build py2 and py3; we need to keep it because
|
||||
we used to rename the 'python' plugin to 'python3'. We should check if
|
||||
some kind of transition should be done to go back to the upstream
|
||||
defaults.
|
||||
* d/control:
|
||||
+ Drop a bunch of old Breaks/Replaces that shouldn't be needed anymore.
|
||||
+ Bump Standards-Version to 4.4.0, no changes needed.
|
||||
+ Bump debhelper compat level to 12, no changes needed.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Sat, 31 Aug 2019 11:57:51 +0200
|
||||
|
||||
hexchat (2.14.2-4) unstable; urgency=medium
|
||||
|
||||
* Add a patch to fix a probable crash while unloading the Python plugin
|
||||
when using Python 3.7. LP: #1830246; Closes: #921208
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Sat, 25 May 2019 11:48:26 +0200
|
||||
|
||||
hexchat (2.14.2-3) unstable; urgency=medium
|
||||
|
||||
[ Ondřej Nový ]
|
||||
* d/copyright: Change Format URL to correct one.
|
||||
|
||||
[ Mattia Rizzolo ]
|
||||
* Move the patches tweaking the default servers out of d/patches, and inject
|
||||
them through d/rules. The ctte decided that vendored series files are not
|
||||
allowed in the Debian archive, see #904302. Closes: #915350
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Mon, 03 Dec 2018 14:17:35 +0100
|
||||
|
||||
hexchat (2.14.2-2) unstable; urgency=medium
|
||||
|
||||
* Add patch to fix FTBFS on !linux.
|
||||
* d/control: Use the new debhelper-compat(=11) build-dep and drop d/compat.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Sun, 23 Sep 2018 20:38:39 +0200
|
||||
|
||||
hexchat (2.14.2-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version 2.14.2.
|
||||
* d/patches:
|
||||
+ Drop patches applied upstream.
|
||||
+ Refresh remaining patches.
|
||||
* d/control: Bump Standards-Version to 4.2.1, no changes needed.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Sat, 01 Sep 2018 22:28:20 +0200
|
||||
|
||||
hexchat (2.14.1-2) unstable; urgency=medium
|
||||
|
||||
* Add some patches from upstream:
|
||||
+ upstream/0003-Remove-shift-click-to-close-tab-binding.patch
|
||||
- LP: #1756402
|
||||
+ upstream/0004-build-Add-metainfo-files-for-addons.patch
|
||||
+ upstream/0005-build-Fix-id-in-plugin-metainfo-files.patch
|
||||
+ upstream/0006-build-Correctly-set-plugin-licenses.patch
|
||||
+ upstream/0007-build-Re-add-support-for-the-legacy-perl-api.patch
|
||||
+ upstream/0008-Deiconify-window-on-tray-click.-Closes-2136.patch
|
||||
* Fixup our py2+py3 patch after the above patches have been applied.
|
||||
* Install the new metainfo files representing the various plugins.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Tue, 20 Mar 2018 16:10:27 +0100
|
||||
|
||||
hexchat (2.14.1-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version 2.14.1.
|
||||
* Drop all patches applied upstream.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Wed, 14 Mar 2018 03:35:41 +0100
|
||||
|
||||
hexchat (2.14.0-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version 2.14.0. Closes: #892085
|
||||
* Refresh patches:
|
||||
+ drop 4c178782a779f013fafab476506f7d4dae372b8a.patch, applied upstream.
|
||||
+ Rewrite the local patch used to build for both python2 and python3 after
|
||||
the change of build system upstream.
|
||||
+ Add all the commits from upstream after the release:
|
||||
- 0003-build-Remove-pie-from-global-ldflags.patch
|
||||
- 0004-Fix-fscanf-usage-without-size-limit.patch
|
||||
- 0005-fix-typo-in-comment.patch
|
||||
- 0006-Revert-xtext-Always-use-Pango-to-get-correct-glyph-w.patch
|
||||
* d/control:
|
||||
+ Update build dependencies for the new upstream:
|
||||
- New build-deps: gettext, iso-codes, liblua5.3-dev, meson (>= 0.38).
|
||||
- Drop build-deps: dh-lua, intltool, libtool.
|
||||
- Drop version restriction from libgtk2.0-dev (>= 2.10.0).
|
||||
+ Set Rules-Requires-Root:no.
|
||||
* d/changelog.txt: Update from upstream.
|
||||
* d/hexchat.install: Slightly update the paths.
|
||||
* d/rules:
|
||||
+ Drop override_dh_install not needed anymore with meson.
|
||||
+ Explicitly build with lua 5.3. The new build system defaults on luajit
|
||||
only now.
|
||||
* d/copyright: Update.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Wed, 14 Mar 2018 02:36:37 +0100
|
||||
|
||||
hexchat (2.12.4-6) unstable; urgency=medium
|
||||
|
||||
* d/control:
|
||||
+ Move packaging to salsa.debian.org.
|
||||
+ Replace recomendency on gvfs-bin to libglib2.0-bin. Closes: #877746
|
||||
+ Bump Standards-Version to 4.1.3, no changes needed.
|
||||
* d/copyright: Bump copyright years for debian/*.
|
||||
* d/rules: Replace dh_install --fail-missing by dh_missing.
|
||||
* d/watch: Use HTTPS.
|
||||
* Bump debhelper compat level to 11.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Sat, 24 Feb 2018 18:26:41 +0100
|
||||
|
||||
hexchat (2.12.4-5) unstable; urgency=medium
|
||||
|
||||
* Add a short description to the previous changelog entry on how to manually
|
||||
preserve the scrollback that would otherwise get lost.
|
||||
* Remove the patch also for Ubuntu (fixing FTBFS there).
|
||||
* d/control:
|
||||
+ Add a bunch of Multi-Arch:same notation, suggested by the M-A hinter.
|
||||
+ Remove the transitional package hexchat-python.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Sat, 15 Jul 2017 18:34:27 +0200
|
||||
|
||||
hexchat (2.12.4-4) unstable; urgency=medium
|
||||
|
||||
* Stop reverting upstream commit 15600f405f2d5bda6ccf0dd73957395716e0d4d3.
|
||||
This means users will lose their scrollback right after updating, but
|
||||
that's what upstream did and we have no real reasons to undefinitely
|
||||
diverge from them just to wait for a nicer fix.
|
||||
Closes: #852275; CVE-2016-2087
|
||||
For users who care about their scrollback, it's enough to manually rename
|
||||
the directories in ~/.config/hexchat/scrollback to all-lowercase characters
|
||||
before restarting hexchat after the update.
|
||||
* d/control: Bump Standards-Version to 4.0.0, no changes needed
|
||||
* d/copyright: bump my copyright year for debian/ to cover 2017
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Fri, 14 Jul 2017 16:12:32 +0200
|
||||
|
||||
hexchat (2.12.4-3) unstable; urgency=medium
|
||||
|
||||
* Demote hexchat-otr from Recommends to Suggests.
|
||||
It reportely causes noise and problems for unexperienced users, and it's
|
||||
a mostly unmaintained plugin, so don't install it by default.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Tue, 30 May 2017 21:50:09 +0200
|
||||
|
||||
hexchat (2.12.4-2) unstable; urgency=medium
|
||||
|
||||
* Also apply patch 4c178782a779f013fafab476506f7d4dae372b8a.patch on ubuntu.
|
||||
* d/p/0001-Debian-server-defaults.patch: Add missing braces around the `if`.
|
||||
Thanks to Lauri Alanko <la@iki.fi> for the patch. Closes: #779892
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Thu, 26 Jan 2017 09:54:41 +0100
|
||||
|
||||
hexchat (2.12.4-1) unstable; urgency=medium
|
||||
|
||||
* New upstream version 2.12.4.
|
||||
* d/copyright: update (removal of the doat plugin).
|
||||
* d/watch: improve:
|
||||
+ Bump version to 4.
|
||||
+ Use substitution strings @ANY_VERSION@ and @ARCHIVE_EXT@.
|
||||
+ Ignore version 2.12.4-repack by mangling it into 2.12.4.
|
||||
* d/control: mark hexchat-dev and hexchat-lua as Multi-Arch:same.
|
||||
* d/patches/:
|
||||
+ openssl/*: drop, applied upstream.
|
||||
+ clean.patch: drop, applied upstream.
|
||||
+ 4c178782a779f013fafab476506f7d4dae372b8a.patch: include from upstream to
|
||||
work around a gdk-pixbuf bug which would prevent the hexchat icon from
|
||||
being displayed in panels/systrays. Closes: #848615
|
||||
* d/rules: add a 'udoc' target to update the bundled copy of upstream doc.
|
||||
* Update upstream documentation.
|
||||
* d/hexchat-plugins.install: upstream converted the 'doat' plugin into an
|
||||
internal command, so stop trying to install the plugin.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Mon, 26 Dec 2016 01:16:19 +0100
|
||||
|
||||
hexchat (2.12.3-4) unstable; urgency=medium
|
||||
|
||||
* Re-enable Lua support everywhere now that #845929 is fixed.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Mon, 19 Dec 2016 12:47:31 +0100
|
||||
|
||||
hexchat (2.12.3-3) unstable; urgency=medium
|
||||
|
||||
* Actually disable Lua support when building.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Mon, 05 Dec 2016 16:03:26 +0100
|
||||
|
||||
hexchat (2.12.3-2) unstable; urgency=medium
|
||||
|
||||
* Temporary restrict the build of hexchat-lua to the architectures where lua
|
||||
is usable right now (see #845929).
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Mon, 05 Dec 2016 14:02:40 +0100
|
||||
|
||||
hexchat (2.12.3-1) unstable; urgency=medium
|
||||
|
||||
[ Jesse Rhodes ]
|
||||
* Add hexchat-dev package for .pc and .h files.
|
||||
* Include dbus service file in hexchat-common.
|
||||
|
||||
[ Mattia Rizzolo ]
|
||||
* Take over maintenance from Jasse Rhodes.
|
||||
Thank you for all your work these years! Closes: #844574
|
||||
* debian/control:
|
||||
+ wrap-and-sort -ast.
|
||||
+ Bump Standards-Version to 3.9.8, no changes needed.
|
||||
+ Add proper Breaks/Replaces for the hexchat-dev addition-
|
||||
+ Have hexchat-plugins recommend hwdata for the sysinfo plugin.
|
||||
Closes: #845940
|
||||
+ Have hexchat recommend the hexchat-otr plugin.
|
||||
Thanks to Petter Reinholdtsen <pere@hungry.com> for the suggestion
|
||||
+ Bump the Breaks/Replaces of hexchat-plugins against hexchat;
|
||||
hexchat-plugin.pc has been moved from hexchat to hexchat-plugins
|
||||
in 2.12.0-1. LP: #1586239
|
||||
+ Set appropriate Breaks/Replaces to cope with the Ubuntu delta and
|
||||
make the package syncable.
|
||||
+ Mark hexchat-common as Multi-Arch:foreign (from the m-a hinter).
|
||||
* debian/rules:
|
||||
+ Remove huge override_dh_auto_clean: if anything of that is needed,
|
||||
it should be done on the upstream side.
|
||||
+ Remove *.la files before running dh_install.
|
||||
+ Use dh_install --fail-missing.
|
||||
* Package the Lua plugin. Closes: #834491
|
||||
* Update upstream changelog for 2.13.2.
|
||||
* Use dh_installchangelogs to install the upstream changelog, instead of
|
||||
manually compressing in rules and the install with d/*.docs.
|
||||
* Let the upstream build system put the manpage in place, instead of copying
|
||||
it of our own.
|
||||
* Add patch to properly clean the upstream sources and make possible to build
|
||||
the package twice in a row.
|
||||
* Bump debhelper compat level to 10.
|
||||
+ --with autoreconf is now default.
|
||||
* debian/copyright:
|
||||
+ Make it DEP-5 compliant.
|
||||
+ Update.
|
||||
* Drop nearly all lintian overrides; they are either fixed or unused.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Thu, 01 Dec 2016 18:30:03 +0100
|
||||
|
||||
hexchat (2.12.3-0.1) unstable; urgency=medium
|
||||
|
||||
* Non-maintainer upload, with maintainer ACK.
|
||||
|
||||
[ Jesse Rhodes ]
|
||||
* Fixed vcs-git url.
|
||||
|
||||
[ Mattia Rizzolo ]
|
||||
* Imported Upstream version 2.12.3. Closes: #836809
|
||||
* Refresh patches
|
||||
* d/rules: disable LUA bindings, as they would require a new binary package.
|
||||
* Add several patches from upstream to add support to OpenSSL 1.1.0.
|
||||
Closes: #828339
|
||||
* Revert upstream commit 15600f405f2d5bda6ccf0dd73957395716e0d4d3, which
|
||||
would cause users to lose their scrollback.
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Sun, 27 Nov 2016 13:41:25 +0100
|
||||
|
||||
hexchat (2.12.0-2) unstable; urgency=medium
|
||||
|
||||
* Removed patch correcting for missing translations,
|
||||
as translations are no longer missing
|
||||
* Removed patch correcting spelling error that would break
|
||||
some scripts and themes
|
||||
* Updated ubuntu server/channel defaults
|
||||
|
||||
-- Jesse Rhodes <drubo@drubo.net> Wed, 30 Mar 2016 11:44:04 -0600
|
||||
|
||||
hexchat (2.12.0-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release
|
||||
* Iceweasel no longer called Firefox in url dialog
|
||||
* Building both python2 and python3 plugins
|
||||
* Including hexchat-plugin.pc (Closes: 801767)
|
||||
|
||||
-- Jesse Rhodes <drubo@drubo.net> Fri, 25 Mar 2016 10:54:57 -0600
|
||||
|
||||
hexchat (2.10.2-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release
|
||||
* Includes upstream fixes for POODLE vulnerability
|
||||
(CVE-2014-3566)
|
||||
* Split plugins into modular packages rather than having all
|
||||
binaries in the main hexchat package
|
||||
|
||||
-- Jesse Rhodes <drubo@drubo.net> Fri, 28 Nov 2014 18:35:39 -0700
|
||||
|
||||
hexchat (2.10.1-2) unstable; urgency=medium
|
||||
|
||||
* Fix ubuntu_defaults.patch (LP: #1390851)
|
||||
* Disable SSLv3
|
||||
|
||||
-- Jesse Rhodes <drubo@drubo.net> Sun, 16 Nov 2014 11:47:12 -0700
|
||||
|
||||
hexchat (2.10.1-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release
|
||||
* No longer build-depend on libsexy-dev
|
||||
* URL handler dialog now labeled Iceweasel rather than Firefox
|
||||
|
||||
-- Jesse Rhodes <drubo@drubo.net> Mon, 18 Aug 2014 21:18:55 -0600
|
||||
|
||||
hexchat (2.10.0-1) unstable; urgency=medium
|
||||
|
||||
* New upstream release
|
||||
* Removed patches for issues fixed by upstream
|
||||
* Added default servers and recommended channels for debian
|
||||
and ubuntu (LP: #1294415)
|
||||
* Upstream commit fa955a0f fixes xdcc segfault (Closes: #745764)
|
||||
|
||||
-- Jesse Rhodes <drubo@drubo.net> Sun, 01 Jun 2014 16:45:22 -0600
|
||||
|
||||
hexchat (2.9.6.1-2) unstable; urgency=low
|
||||
|
||||
* Now using dh-autoreconf instead of autotools-dev (Closes: #739630)
|
||||
* Added gvfs-bin as Recommends so default url handlers work
|
||||
(Closes: #740006)
|
||||
* Added unifont as Suggests for unicode symbol support
|
||||
* Included png,svg icons in package
|
||||
|
||||
-- Jesse Rhodes <drubo@drubo.net> Tue, 25 Feb 2014 16:45:42 -0700
|
||||
|
||||
hexchat (2.9.6.1-1) unstable; urgency=low
|
||||
|
||||
* Initial release (Closes: #702075)
|
||||
|
||||
-- Jesse Rhodes <drubo@drubo.net> Mon, 03 Feb 2014 19:09:17 -0700
|
||||
126
debian/control
vendored
126
debian/control
vendored
@@ -1,126 +0,0 @@
|
||||
Source: zoitechat
|
||||
Section: net
|
||||
Priority: optional
|
||||
Maintainer: ZoiteChat Maintainers <zoitechat@users.noreply.github.com>
|
||||
Build-Depends:
|
||||
debhelper-compat (= 13),
|
||||
gettext,
|
||||
iso-codes,
|
||||
libcanberra-dev,
|
||||
libdbus-glib-1-dev,
|
||||
libglib2.0-dev,
|
||||
libgtk-3-dev,
|
||||
liblua5.3-dev,
|
||||
libpci-dev,
|
||||
libperl-dev,
|
||||
libssl-dev,
|
||||
meson,
|
||||
python3-cffi,
|
||||
python3-dev
|
||||
Standards-Version: 4.6.0
|
||||
Rules-Requires-Root: no
|
||||
Vcs-Git: https://github.com/zoitechat/zoitechat.git
|
||||
Vcs-Browser: https://github.com/zoitechat/zoitechat
|
||||
Homepage: https://zoitechat.zoite.net
|
||||
|
||||
Package: zoitechat
|
||||
Architecture: any
|
||||
Depends:
|
||||
zoitechat-common (= ${binary:Version}),
|
||||
${misc:Depends},
|
||||
${shlibs:Depends}
|
||||
Recommends:
|
||||
ca-certificates,
|
||||
zoitechat-lua,
|
||||
zoitechat-perl,
|
||||
zoitechat-plugins,
|
||||
libglib2.0-bin
|
||||
Suggests:
|
||||
zoitechat-python3,
|
||||
zoitechat-otr,
|
||||
unifont
|
||||
Description: IRC client for GNOME (fork of HexChat 2.18.0-pre1 base)
|
||||
ZoiteChat is a graphical IRC client with a GTK 3 GUI. Features include Python,
|
||||
Perl and Lua scripting support, a plugin API, multiple server/channel
|
||||
windows, spell checking, multiple authentication methods including SASL, and
|
||||
customizable notifications. For more information on IRC, see
|
||||
http://irchelp.org/.
|
||||
|
||||
Package: zoitechat-common
|
||||
Architecture: all
|
||||
Multi-Arch: foreign
|
||||
Provides: irc-client
|
||||
Depends: ${misc:Depends}
|
||||
Recommends:
|
||||
ca-certificates,
|
||||
zoitechat-lua,
|
||||
zoitechat-perl,
|
||||
zoitechat-plugins,
|
||||
libglib2.0-bin
|
||||
Suggests:
|
||||
zoitechat,
|
||||
zoitechat-python3,
|
||||
zoitechat-otr,
|
||||
unifont
|
||||
Description: Common data files for ZoiteChat
|
||||
This package includes architecture-independent files for ZoiteChat, such as
|
||||
translations, desktop integration, and shared data.
|
||||
|
||||
Package: zoitechat-perl
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends:
|
||||
zoitechat (= ${binary:Version}),
|
||||
${misc:Depends},
|
||||
${shlibs:Depends}
|
||||
Description: Perl plugin for ZoiteChat
|
||||
This package contains the Perl plugin for ZoiteChat. It is split out from the
|
||||
main package because it is optional.
|
||||
|
||||
Package: zoitechat-python3
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends:
|
||||
zoitechat (= ${binary:Version}),
|
||||
python3-cffi-backend,
|
||||
${misc:Depends},
|
||||
${shlibs:Depends}
|
||||
Description: Python 3 plugin for ZoiteChat
|
||||
This package contains the Python 3 plugin for ZoiteChat. It is split out from
|
||||
the main package because it is optional.
|
||||
.
|
||||
Known issue: the Python plugin may freeze the client in some builds.
|
||||
|
||||
Package: zoitechat-lua
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends:
|
||||
zoitechat (= ${binary:Version}),
|
||||
${misc:Depends},
|
||||
${shlibs:Depends}
|
||||
Description: Lua plugin for ZoiteChat
|
||||
This package contains the Lua plugin for ZoiteChat. It is split out from the
|
||||
main package because it is optional.
|
||||
|
||||
Package: zoitechat-plugins
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends:
|
||||
zoitechat (= ${binary:Version}),
|
||||
${misc:Depends},
|
||||
${shlibs:Depends}
|
||||
Suggests: pciutils
|
||||
Description: Extra plugins for ZoiteChat
|
||||
This package contains optional plugins (e.g. FiSHLiM, Sysinfo, Do At and
|
||||
Checksum). These are split out from the main package because they are not
|
||||
required for core functionality.
|
||||
|
||||
Package: zoitechat-dev
|
||||
Architecture: any
|
||||
Multi-Arch: same
|
||||
Depends:
|
||||
zoitechat-common (= ${binary:Version}),
|
||||
${misc:Depends}
|
||||
Description: Development files for ZoiteChat plugins
|
||||
This package contains zoitechat-plugin.h and zoitechat-plugin.pc, which
|
||||
facilitate building binary plugins for ZoiteChat.
|
||||
188
debian/copyright
vendored
188
debian/copyright
vendored
@@ -1,188 +0,0 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: zoitechat
|
||||
Source: https://zoitechat.zoite.net
|
||||
|
||||
Files: *
|
||||
Copyright: 1998-2010 Peter Zelezny
|
||||
2009-2013 Berke Viktor
|
||||
2015-2021 Patrick Griffis
|
||||
License: GPL-2+ with OpenSSL exception
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2014 Jesse Rhodes <drubo@drubo.net>
|
||||
2016-2022 Mattia Rizzolo <mattia@debian.org>
|
||||
2020-2024 Gianfranco Costamagna <locutusofborg@debian.org>
|
||||
License: GPL-2+
|
||||
|
||||
Files: data/man/zoitechat.1.in
|
||||
Copyright: Davide Puricelli <evo@debian.org>
|
||||
License: GPL-2+
|
||||
|
||||
Files: osx/gtkrc
|
||||
Copyright: 2012 Xamarin Inc.
|
||||
License: GPL-2+
|
||||
|
||||
Files: plugins/checksum/* plugins/exec/*
|
||||
Copyright: 2010-2012 Berke Viktor
|
||||
License: Expat
|
||||
|
||||
Files: plugins/fishlim/*
|
||||
Copyright: 2010 Samuel Lidén Borell <samuel@kodafritt.se>
|
||||
2015 <the.cypher@gmail.com>
|
||||
2019-2020 <bakasura@protonmail.ch>
|
||||
License: Expat
|
||||
|
||||
Files: plugins/lua/*
|
||||
Copyright: 2015-2016 mniip
|
||||
License: Expat
|
||||
|
||||
Files: plugins/perl/*
|
||||
Copyright: 1998-2002 Peter Zelezny
|
||||
License: GPL-2+
|
||||
|
||||
Files: plugins/python/*
|
||||
Copyright: 2002-2003 Gustavo Niemeyer <niemeyer@conectiva.com>
|
||||
License: GPL-2+
|
||||
|
||||
Files: plugins/sysinfo/*
|
||||
Copyright: 2003-2005 Michael Shoup
|
||||
2005-2007 Tony Vroon
|
||||
2012 Berke Viktor
|
||||
2015 Patrick Griffis
|
||||
License: GPL-2+
|
||||
|
||||
Files: plugins/winamp/*
|
||||
Copyright: Leo <leo.nard@free.fr>
|
||||
Silverex <SilvereX@karklas.mif.vu.lt>
|
||||
Derek Buitenhuis <daemon404@gmail.com>
|
||||
Berke Viktor <berkeviktor@aol.com>
|
||||
License: GPL-1.0
|
||||
|
||||
Files: src/common/dbus/*
|
||||
Copyright: 2006 Claessens Xavier
|
||||
License: GPL-2+
|
||||
|
||||
Files: src/common/dbus/example.py
|
||||
Copyright: 1998-2010 Peter Zelezny
|
||||
2009-2013 Berke Viktor
|
||||
License: GPL-2+
|
||||
|
||||
Files: src/common/scram.*
|
||||
Copyright: 2023 Patrick Okraku
|
||||
License: GPL-2+
|
||||
|
||||
Files: src/common/ssl.c
|
||||
Copyright: 2000 DaP <profeta@freemail.c3.hu>
|
||||
License: GPL-2+ with OpenSSL exception
|
||||
|
||||
Files: src/dirent/dirent-win32.h
|
||||
Copyright: 2006-2012 Toni Ronkko
|
||||
License: Expat
|
||||
|
||||
Files: src/fe-gtk/sexy-iso-codes.c src/fe-gtk/sexy-iso-codes.h
|
||||
Copyright: 2008 Novell, Inc.
|
||||
2013 Sandro Mani
|
||||
License: GPL-2+
|
||||
|
||||
Files: src/fe-gtk/sexy-spell-entry.c src/fe-gtk/sexy-spell-entry.h
|
||||
Copyright: 2002 Evan Martin
|
||||
2004-2006 Christian Hammond
|
||||
License: LGPL-2.1+
|
||||
|
||||
License: GPL-2+ with OpenSSL exception
|
||||
This package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
.
|
||||
This package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this package; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General
|
||||
Public License can be found in `/usr/share/common-licenses/GPL-2'.
|
||||
.
|
||||
In addition, as a special exception, the copyright holders give permission
|
||||
to link the code of portions of this program with the OpenSSL library.
|
||||
You must obey the GNU General Public License in all respects for all of
|
||||
the code used other than OpenSSL. If you modify file(s) with this
|
||||
exception, you may extend this exception to your version of the file(s),
|
||||
but you are not obligated to do so. If you do not wish to do so, delete
|
||||
this exception statement from your version. If you delete this exception
|
||||
statement from all source files in the program, then also delete it here.
|
||||
|
||||
License: Expat
|
||||
.
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
.
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
License: GPL-2+
|
||||
This package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
.
|
||||
This package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this package; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General
|
||||
Public License can be found in `/usr/share/common-licenses/GPL-2'.
|
||||
|
||||
License: GPL-1.0
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 1, or (at your option)
|
||||
any later version.
|
||||
.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
02110-1301, USA.
|
||||
|
||||
License: LGPL-2.1+
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA
|
||||
40
debian/default_servers/debian
vendored
40
debian/default_servers/debian
vendored
@@ -1,40 +0,0 @@
|
||||
Description: Changed default network to OFTC,
|
||||
suggests to join #debian on OFTC and Freenode
|
||||
|
||||
diff --git a/src/common/servlist.c b/src/common/servlist.c
|
||||
index a203e702..22fcd92b 100644
|
||||
--- a/src/common/servlist.c
|
||||
+++ b/src/common/servlist.c
|
||||
@@ -902,7 +902,7 @@ servlist_load_defaults (void)
|
||||
{
|
||||
int i = 0, j = 0;
|
||||
ircnet *net = NULL;
|
||||
- guint def_hash = g_str_hash ("Libera.Chat");
|
||||
+ guint def_hash = g_str_hash ("OFTC");
|
||||
|
||||
while (1)
|
||||
{
|
||||
diff --git a/src/fe-gtk/joind.c b/src/fe-gtk/joind.c
|
||||
index ce3cbcae..7f6b1116 100644
|
||||
--- a/src/fe-gtk/joind.c
|
||||
+++ b/src/fe-gtk/joind.c
|
||||
@@ -247,10 +247,18 @@ joind_show_dialog (server *serv)
|
||||
G_CALLBACK (joind_ok_cb), serv);
|
||||
|
||||
if (serv->network)
|
||||
+ {
|
||||
+ if (g_ascii_strcasecmp(((ircnet*)serv->network)->name, "OFTC") == 0)
|
||||
+ {
|
||||
+ gtk_entry_set_text (GTK_ENTRY (entry1), "#debian");
|
||||
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(radiobutton2), TRUE);
|
||||
+ }
|
||||
if (g_ascii_strcasecmp(((ircnet*)serv->network)->name, "Libera.Chat") == 0)
|
||||
{
|
||||
- gtk_entry_set_text (GTK_ENTRY (entry1), "#hexchat");
|
||||
+ gtk_entry_set_text (GTK_ENTRY (entry1), "#debian");
|
||||
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(radiobutton2), TRUE);
|
||||
}
|
||||
+ }
|
||||
|
||||
gtk_widget_grab_focus (okbutton1);
|
||||
gtk_widget_show_all (dialog1);
|
||||
43
debian/default_servers/ubuntu
vendored
43
debian/default_servers/ubuntu
vendored
@@ -1,43 +0,0 @@
|
||||
Description: Changed default channel to join from #hexchat to #ubuntu
|
||||
Also adds a "Ubuntu servers" entry, same as connecting to libera.chat.
|
||||
|
||||
diff --git a/src/common/servlist.c b/src/common/servlist.c
|
||||
index a203e702..18a6c4b3 100644
|
||||
--- a/src/common/servlist.c
|
||||
+++ b/src/common/servlist.c
|
||||
@@ -206,6 +206,9 @@ static const struct defaultserver def[] =
|
||||
{"Libera.Chat", 0, 0, 0, LOGIN_SASL, 0, TRUE},
|
||||
{0, "irc.libera.chat"},
|
||||
|
||||
+ {"Ubuntu Servers (Libera.Chat)", 0, 0, 0, LOGIN_SASL, 0, TRUE},
|
||||
+ {0, "irc.libera.chat"},
|
||||
+
|
||||
#ifdef USE_OPENSSL
|
||||
{"LibertaCasa", 0, 0, 0, LOGIN_SASL, 0, TRUE},
|
||||
{0, "irc.liberta.casa"},
|
||||
@@ -902,7 +905,7 @@ servlist_load_defaults (void)
|
||||
{
|
||||
int i = 0, j = 0;
|
||||
ircnet *net = NULL;
|
||||
- guint def_hash = g_str_hash ("Libera.Chat");
|
||||
+ guint def_hash = g_str_hash ("Ubuntu Servers (Libera.Chat)");
|
||||
|
||||
while (1)
|
||||
{
|
||||
diff --git a/src/fe-gtk/joind.c b/src/fe-gtk/joind.c
|
||||
index ce3cbcae..e94e562a 100644
|
||||
--- a/src/fe-gtk/joind.c
|
||||
+++ b/src/fe-gtk/joind.c
|
||||
@@ -247,9 +247,10 @@ joind_show_dialog (server *serv)
|
||||
G_CALLBACK (joind_ok_cb), serv);
|
||||
|
||||
if (serv->network)
|
||||
- if (g_ascii_strcasecmp(((ircnet*)serv->network)->name, "Libera.Chat") == 0)
|
||||
+ if (g_ascii_strcasecmp(((ircnet*)serv->network)->name, "Ubuntu Servers (Libera.Chat)") == 0)
|
||||
{
|
||||
- gtk_entry_set_text (GTK_ENTRY (entry1), "#hexchat");
|
||||
+ gtk_entry_set_text (GTK_ENTRY (entry1), "#ubuntu");
|
||||
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(radiobutton2), TRUE);
|
||||
}
|
||||
|
||||
gtk_widget_grab_focus (okbutton1);
|
||||
20
debian/net.zoite.Zoitechat.appdata.xml
vendored
20
debian/net.zoite.Zoitechat.appdata.xml
vendored
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>net.zoite.Zoitechat</id>
|
||||
<name>ZoiteChat</name>
|
||||
<summary>IRC client for GNOME</summary>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-2.0-or-later</project_license>
|
||||
|
||||
<description>
|
||||
<p>ZoiteChat is a graphical IRC client based on HexChat.</p>
|
||||
<p>Current Flatpak builds have a known issue where the Python plugin can freeze the client.</p>
|
||||
</description>
|
||||
|
||||
<launchable type="desktop-id">net.zoite.Zoitechat.desktop</launchable>
|
||||
<provides>
|
||||
<binary>zoitechat</binary>
|
||||
</provides>
|
||||
|
||||
<url type="homepage">https://zoitechat.zoite.net/</url>
|
||||
</component>
|
||||
1
debian/patches/series
vendored
1
debian/patches/series
vendored
@@ -1 +0,0 @@
|
||||
readmechanges.patch
|
||||
23
debian/rules
vendored
23
debian/rules
vendored
@@ -1,23 +0,0 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
export DH_VERBOSE=1
|
||||
|
||||
%:
|
||||
dh $@ --buildsystem=meson
|
||||
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure -- \
|
||||
-Dgtk3=true \
|
||||
-Dinstall-plugin-metainfo=false \
|
||||
-Dwith-lua=lua53
|
||||
|
||||
override_dh_installchangelogs:
|
||||
install -m0755 -d \
|
||||
debian/zoitechat/usr/share/doc/zoitechat \
|
||||
debian/zoitechat-common/usr/share/doc/zoitechat-common \
|
||||
debian/zoitechat-perl/usr/share/doc/zoitechat-perl \
|
||||
debian/zoitechat-python3/usr/share/doc/zoitechat-python3 \
|
||||
debian/zoitechat-lua/usr/share/doc/zoitechat-lua \
|
||||
debian/zoitechat-plugins/usr/share/doc/zoitechat-plugins \
|
||||
debian/zoitechat-dev/usr/share/doc/zoitechat-dev
|
||||
dh_installchangelogs changelog.rst
|
||||
1
debian/source/format
vendored
1
debian/source/format
vendored
@@ -1 +0,0 @@
|
||||
3.0 (quilt)
|
||||
2
debian/source/lintian-overrides
vendored
2
debian/source/lintian-overrides
vendored
@@ -1,2 +0,0 @@
|
||||
# the upstream maintainer says that he doesn't have time to go fish out his GPG key for now
|
||||
orig-tarball-missing-upstream-signature
|
||||
4
debian/upstream/metadata
vendored
4
debian/upstream/metadata
vendored
@@ -1,4 +0,0 @@
|
||||
Bug-Database: https://github.com/zoitechat/zoitechat/issues
|
||||
Bug-Submit: https://github.com/zoitechat/zoitechat/issues/new
|
||||
Repository: https://github.com/zoitechat/zoitechat.git
|
||||
Repository-Browse: https://github.com/zoitechat/zoitechat
|
||||
72
debian/upstream/signing-key.asc
vendored
72
debian/upstream/signing-key.asc
vendored
@@ -1,72 +0,0 @@
|
||||
pub rsa4096 2014-02-13 [SC] [expires: 2024-02-08]
|
||||
108BF2212A051F4A72B18448B3C7CE210DE76DFC
|
||||
uid [ unknown] Patrick Griffis <tingping@tingping.se>
|
||||
uid [ unknown] TingPing <tingping@fedoraproject.org>
|
||||
sub rsa4096 2014-02-13 [E] [expires: 2024-02-08]
|
||||
C6CAF2A624B9C2ECBF83ACBF488A9319DABACE61
|
||||
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQINBFL9JHIBEADDKL+vc3MHctXCWxG0IcuLPm4i+WO9jH6MdF8p2bokaL5lilcJ
|
||||
o2i0RHImP83FpqCDj/hE7AeB3Ix3Oq3tIe6lpCz468OVbLivErX/yL8rYUhC+yba
|
||||
zlSJcBipTIezD3pZI/vpFyCIC8mSEI4PJGiLotioNJWQBStQuuPqMKo4cd6cRWx6
|
||||
WovQMKa85rQPvv+wYCseBqU6xBx1xSgpkjDJnAH7We5G6T8TYVM2gqXtii/JYyUC
|
||||
8E7Z2BBdSGkq1Dma1W6paOw7VOtLu6YbAH9v/VUVx0UdzwiyXHQ8qLKbxeXkex9d
|
||||
zoe+oy8wt3bvVHirxU42IlJJVLY4NcUYhr/xOq/YqT+3sWAqgdVM/WnzY3bPiMnQ
|
||||
XqQ3UZ0LKXXsF2+9u2qM6FTiAHIMLtH95IlOQo1qXmDl1HRJTNq3B41UduLDRUhP
|
||||
uGBaXbOtb6ql4nV3/BTxcHumisMh5ALhqXHRNOdn+mEjvT2HT6pp07ZfVhFwM4U0
|
||||
K78f52S+NppiS0cWtn9ibq+UmqZyvw9HMOHYt51lSUOueg/sOvsxrG1gjvcUMlJw
|
||||
nCgS3b+QUmZYo+pl/l13fiWPQpteVGZqKPMBBaQ4MCrwHgvikN8uppKDw8fFGs44
|
||||
LgbCsDoQA8wKxNzMEMTvuhFFgCiOxMCzR0XKxlcKr8CiHZjYwovJLFfLvwARAQAB
|
||||
tCVUaW5nUGluZyA8dGluZ3BpbmdAZmVkb3JhcHJvamVjdC5vcmc+iQJVBBMBAgA/
|
||||
AhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgBYhBBCL8iEqBR9KcrGESLPHziEN
|
||||
5238BQJcXuBtBQkSx717AAoJELPHziEN5238pfAP/331a2PASeS1toBRNbMVyXcB
|
||||
8zEb5Q4MFiTmgy7aOOo2MDzV4VBiYEUa93pmWrozWudqZl1u+Cm7XC0Kxv7b6HRC
|
||||
/2UBDKY0FUk7xALFQN+XycNDweflT9SlJ+4IcgfHX3/FcF0Obl0fnNfr8DXXqdsj
|
||||
hxWqlXRkyvRC8VuJJkkufi4CxUBQPSSG+dGgskACP6e210rogPq7LyUIMKkKqKSV
|
||||
69RUHDJZOsObNA6q1gTNcb8G/lIGaqbVTJ/d+6X/iDkgMrxRi++OyAUa7aXMHGBn
|
||||
5PnFjqPKBP7qrEEl1nA0LcXhr1hCEVVXGosuqR1WjbbyOTOq50oGvk8zbTy/1mOc
|
||||
UwkJYbaMv20wAYXx9QSbYoTDMx+DXrB3NCtBHeM7o9igoom8n9khoVmC1SPMOsQM
|
||||
1xLAk22RuyeDw3C3K3xoar4tcrwXKRmTyUxDBvkR7gtySiAKWFZOEPbeeRzprpG+
|
||||
Fg48Zh7buqh3Rdk5rmXOeATbyRq9+D0p6WhtO6UdEbi9yNCGo/eTTs2a9CcxfW6E
|
||||
7gGrX/wP6eKrP7KiT5NqcM01R961IxRpNLM0Uy15Jf5paP9VoJBtR0hO+94Vc9ZJ
|
||||
jS9yv5iJ62FIqSkqXZ7v+59XFZjm84pI7ywHuzjv9poBi3W19jM1eyYeryLj8362
|
||||
w2z5UgLfllZv1o2NTLx6tCZQYXRyaWNrIEdyaWZmaXMgPHRpbmdwaW5nQHRpbmdw
|
||||
aW5nLnNlPokCVAQTAQgAPgIbAwULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgBYhBBCL
|
||||
8iEqBR9KcrGESLPHziEN5238BQJcXuBtBQkSx717AAoJELPHziEN5238J9cP/3SX
|
||||
UCZBFKf79LUfKVOxZYgAMKzL2CQdglNKrtE0aqMJwga6AUrSLEBWUqKHOFrcWYDi
|
||||
qKldpWGWv52lSlZL4YCIcgymOyYMbjQXkHUUaAH4tCzjT0yhFKKAAokJKBSinaO4
|
||||
cA6i3p3XdyUWbvjqnc8/2Mn31cyxiqj58EN5r7naS/5DaD+0q2dxhLW5/A+IKukk
|
||||
l12NhMpDbTkQ18brttBMCW5h5LPR7HDN5hVPCztj4BN5JqPeMyspemvGMT6G12vA
|
||||
5N+S83rAushIyu8Y88iKhPsNLbLgi3PCOZJDKeNlqdPoXJX7mau41U08/8NiORUP
|
||||
R4Dj9942c6rdHHXDyZ3puvsVK0YjwcmG5uSdG2tpyhNOBiyNQXgpPVHU5YKTob75
|
||||
vGs4uuxKYxNns/UULiC4fp/gGOIRh9f0veJG2DbMnEHXhnpQzIbsYSo1yeJ+8vFM
|
||||
FhbkHlylrkTUtOzQwFqybhgYGbfDvT4weMvCc9jEQXfIfI39/Tjx/JD0VVKu577X
|
||||
oZhtsb4rX2qEmiEnMrWAMM97LGyCNEi6DJipHse4Z5cc54/VswGF8Ze4VYF5hF8o
|
||||
DaIQfGXmuceMS3l4FXK0x6CYKpr7e0pY3zrsGIJ8Zwd11T9ubilAvK68Ix7j1puJ
|
||||
x8/ZD9NYP/NUNpriRVyFNiPlfKRqauDBnSKjiTiguQINBFL9JHIBEACx1FJWBK1R
|
||||
ORu+rHa52Uc0+Jkcr791A10Itwyv6fsA0RT6moob6s8Rvet8NQH6SZVRqiGy3d8g
|
||||
lxnedT32ZxHWRoLC8Pc6PnQhVXB3RSZoE9VVm9z+7nHOGXXCj0a0OsgyGSHLerE9
|
||||
7MvlMlkf2EsOTj6irZZDvJH4Eblbk1WzC4K5EC5r7FL/4sdHLbDWEUR3wemC7s0n
|
||||
9IusHwNBiTSSxpag/dq9+6eVyoA3opsqSU3wlSqfm3U/0G3MG4JkwDmS3nK4hmmq
|
||||
nCakdXZaqKZDGZjfaztTuO5RP73KfNHSNfsreOXY3ldX7Jy1qdHp/hBp6CFXhHul
|
||||
d4ZyWL+O6uMRcNQdfd/b8VBDe3z2LYw3AHnhjAnmwJqjfnhH3r7ibM2+HAtrj8J5
|
||||
Qwe/28QJOR3UfT1+tYW8I0bpnBesfzgm9Vp2t3IzkaGdXQOsB9KdcKRV4viiq4VP
|
||||
S1HdtvpLAxxrNxFguIlYAkLMJwwuaaK8X+K/kgAm3q5+txsxR/jDmDaFqqj0YnfT
|
||||
7s+czbSkkvXDG68sTVr1c2u71i8Q0XXSSrL30/j/+//CN9mP6oI6dYRDK5wCFaYw
|
||||
cQe5Td/biJDWXsXolOC0CHny1TTfNvaK+b0Yksas7aLypHOc5xfVJI1eovwkBpXA
|
||||
QQDFJoWlZudXXUvjPFsEyt9jd2LUl5fZcQARAQABiQI8BBgBAgAmAhsMFiEEEIvy
|
||||
ISoFH0pysYRIs8fOIQ3nbfwFAlxe4JAFCRLHvZ4ACgkQs8fOIQ3nbfwvsQ//QE7v
|
||||
neqZdFBq9PxIgu6S95PTchBI3BsCH6M3uv/hIpLgZwGzymHjCQlwYzjPYRAycphk
|
||||
VjsWP5T6hFPDfFhtAkdPuDd6LW+asUky1B8t802jGrVSmEA81s9jkjKBpdNR5JJr
|
||||
a8fAhUvZz9HW2SUwJyvVaO+q4GZep7VrNMKoCvC0K123V442wOYOLC3cldRgVRKY
|
||||
tXs4KHEjYaR0+zvX2zJvn/CIHWaxw2/qgArXIbTqwiqOWeXAkQWwcArZzkughGIb
|
||||
iv1DgkttTBLOZbiEUerwoMlGERlSTurhahoNInXD8vPPOrYMl7RSV8XUmgTKCJeN
|
||||
Xv/Jdg7ejfmPH9zABh8kh+eiL/yINwh2mmRK2aM+u8wghU7i0g72GSKBNgPHzw7X
|
||||
FDIN4diVX8MB93yeMOMzXGuyHzy3mQhj5LcqMKtTSOeqREAUTHoC0KvQ8kTeZ4N3
|
||||
czHndwBNEVxluR4ljQeqMdJHWoy6GxFGdrcAHqLZZyxbBQq2cYMwAdbscnQqIhhC
|
||||
luJgu4vA+7b8RQIZ725Ij+05J5vpHbPtEGACD09YChQL0OtLIZfS8RKP1lKLrmXC
|
||||
cnJzweMcISPi5PxPXlqXNFzwspK2PLHpmwZ1zSoARXB3BzzCYTE4Mw8UxsCqpbDG
|
||||
cBfbvGaxikGVOqMEoNo/umEhsyleb0gqXIoZJrc=
|
||||
=kssP
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
5
debian/watch
vendored
5
debian/watch
vendored
@@ -1,5 +0,0 @@
|
||||
version=4
|
||||
opts="searchmode=plain,\
|
||||
filenamemangle=s%.*/v?@ANY_VERSION@%@PACKAGE@-$1.tar.xz%" \
|
||||
https://api.github.com/repos/zoitechat/zoitechat/releases?per_page=50 \
|
||||
https://api.github.com/repos/[^/]+/[^/]+/tarball/v?@ANY_VERSION@
|
||||
7
debian/zoitechat-common.install
vendored
7
debian/zoitechat-common.install
vendored
@@ -1,7 +0,0 @@
|
||||
usr/share/applications/net.zoite.Zoitechat.desktop
|
||||
usr/share/dbus-1/services/org.zoitechat.service.service
|
||||
usr/share/icons/hicolor/48x48/apps/net.zoite.Zoitechat.png
|
||||
usr/share/icons/hicolor/scalable/apps/net.zoite.Zoitechat.svg
|
||||
usr/share/locale/*/LC_MESSAGES/zoitechat.mo
|
||||
usr/share/metainfo/net.zoite.Zoitechat.appdata.xml
|
||||
usr/share/mime/packages/net.zoite.Zoitechat.mime.xml
|
||||
2
debian/zoitechat-dev.install
vendored
2
debian/zoitechat-dev.install
vendored
@@ -1,2 +0,0 @@
|
||||
usr/include/zoitechat-plugin.h
|
||||
usr/lib/*/pkgconfig/zoitechat-plugin.pc
|
||||
1
debian/zoitechat-lua.install
vendored
1
debian/zoitechat-lua.install
vendored
@@ -1 +0,0 @@
|
||||
usr/lib/*/zoitechat/plugins/lua.so
|
||||
1
debian/zoitechat-perl.install
vendored
1
debian/zoitechat-perl.install
vendored
@@ -1 +0,0 @@
|
||||
usr/lib/*/zoitechat/plugins/perl.so
|
||||
3
debian/zoitechat-plugins.install
vendored
3
debian/zoitechat-plugins.install
vendored
@@ -1,3 +0,0 @@
|
||||
usr/lib/*/zoitechat/plugins/checksum.so
|
||||
usr/lib/*/zoitechat/plugins/fishlim.so
|
||||
usr/lib/*/zoitechat/plugins/sysinfo.so
|
||||
4
debian/zoitechat-python3.install
vendored
4
debian/zoitechat-python3.install
vendored
@@ -1,4 +0,0 @@
|
||||
usr/lib/*/zoitechat/plugins/python.so
|
||||
usr/lib/*/zoitechat/python/_zoitechat.py
|
||||
usr/lib/*/zoitechat/python/xchat.py
|
||||
usr/lib/*/zoitechat/python/zoitechat.py
|
||||
1
debian/zoitechat.debhelper.log
vendored
1
debian/zoitechat.debhelper.log
vendored
@@ -1 +0,0 @@
|
||||
dh_installchangelogs
|
||||
2
debian/zoitechat.install
vendored
2
debian/zoitechat.install
vendored
@@ -1,2 +0,0 @@
|
||||
usr/bin/zoitechat
|
||||
usr/share/man/man1/zoitechat.1
|
||||
6
debian/zoitechat.lintian-overrides
vendored
6
debian/zoitechat.lintian-overrides
vendored
@@ -1,6 +0,0 @@
|
||||
# intentional typo as example for autoreplace function
|
||||
zoitechat: spelling-error-in-binary usr/bin/zoitechat teh the
|
||||
# upstream will not correct misspelled variable names
|
||||
zoitechat: spelling-error-in-binary usr/bin/zoitechat hilight highlight
|
||||
# fixing this spelling error would break scripting/theming
|
||||
zoitechat: spelling-error-in-binary usr/bin/zoitechat Conection Connection
|
||||
@@ -7,7 +7,7 @@
|
||||
"command": "zoitechat",
|
||||
"finish-args": [
|
||||
"--share=ipc",
|
||||
"--socket=wayland",
|
||||
"--socket=x11",
|
||||
"--share=network",
|
||||
"--socket=pulseaudio",
|
||||
"--filesystem=xdg-download",
|
||||
@@ -15,8 +15,11 @@
|
||||
"--filesystem=xdg-data/icons:ro",
|
||||
"--filesystem=~/.themes:ro",
|
||||
"--filesystem=~/.icons:ro",
|
||||
"--filesystem=xdg-run/tray-icon:create",
|
||||
|
||||
"--talk-name=org.freedesktop.Notifications",
|
||||
"--talk-name=org.kde.StatusNotifierWatcher",
|
||||
"--talk-name=com.canonical.AppMenu.Registrar",
|
||||
|
||||
"--talk-name=org.mpris.MediaPlayer2.*"
|
||||
],
|
||||
@@ -52,14 +55,13 @@
|
||||
"name": "zoitechat",
|
||||
"buildsystem": "meson",
|
||||
"config-opts": [
|
||||
"-Dgtk3=true",
|
||||
"-Ddbus-service-use-appid=true",
|
||||
"-Dwith-perl=false",
|
||||
"-Dwith-python=false",
|
||||
"-Dwith-lua=lua"
|
||||
],
|
||||
"build-options": {
|
||||
"cflags": "-Dgtk3=true -Wno-error=missing-include-dirs"
|
||||
"cflags": "-Wno-error=missing-include-dirs"
|
||||
},
|
||||
"cleanup": [
|
||||
"/share/man"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
project('zoitechat', 'c',
|
||||
version: '2.18.0-pre1',
|
||||
version: '2.18.0~pre2',
|
||||
meson_version: '>= 0.55.0',
|
||||
default_options: [
|
||||
'c_std=c17',
|
||||
@@ -42,6 +42,7 @@ config_h.set('USE_OPENSSL', libssl_dep.found())
|
||||
config_h.set('USE_LIBCANBERRA', libcanberra_dep.found())
|
||||
config_h.set('USE_DBUS', dbus_glib_dep.found())
|
||||
config_h.set('USE_PLUGIN', get_option('plugin'))
|
||||
config_h.set('USE_GTK_FRONTEND', get_option('gtk-frontend'))
|
||||
|
||||
config_h.set('G_DISABLE_SINGLE_INCLUDES', true)
|
||||
config_h.set('GTK_DISABLE_DEPRECATED', true)
|
||||
@@ -177,6 +178,7 @@ if meson.version().version_compare('>= 0.55.0')
|
||||
}, section: 'Directories')
|
||||
|
||||
summary({
|
||||
'GTK Frontend': get_option('gtk-frontend') ? 'enabled (GTK+ 3.22+)' : 'disabled',
|
||||
'TLS (openssl)': libssl_dep.found(),
|
||||
'Plugin Support': get_option('plugin'),
|
||||
'DBus Support': dbus_glib_dep.found(),
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
option('gtk-frontend', type: 'boolean',
|
||||
description: 'Main graphical interface'
|
||||
)
|
||||
option('gtk3', type: 'boolean', value: false,
|
||||
description: 'Build GTK frontend against GTK 3'
|
||||
)
|
||||
option('text-frontend', type: 'boolean', value: false,
|
||||
description: 'Text interface (not generally useful)'
|
||||
)
|
||||
@@ -22,6 +19,9 @@ option('dbus', type: 'feature', value: 'auto',
|
||||
option('libcanberra', type: 'feature', value: 'auto',
|
||||
description: 'Support for sound alerts, Unix only'
|
||||
)
|
||||
option('appindicator', type: 'feature', value: 'auto',
|
||||
description: 'Use Ayatana/AppIndicator-based tray backend for GTK frontend (non-Windows only)'
|
||||
)
|
||||
|
||||
# Install options
|
||||
option('dbus-service-use-appid', type: 'boolean', value: false,
|
||||
|
||||
@@ -30,9 +30,10 @@ export GTK_DATA_PREFIX="$bundle_res"
|
||||
export GTK_EXE_PREFIX="$bundle_res"
|
||||
export GTK_PATH="$bundle_res"
|
||||
|
||||
export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc"
|
||||
export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules"
|
||||
export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
|
||||
export GTK_THEME="Mac"
|
||||
export GTK_KEY_THEME="Mac"
|
||||
export GTK_IM_MODULE_FILE="$bundle_etc/gtk-3.0/gtk.immodules"
|
||||
export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-3.0/gdk-pixbuf.loaders"
|
||||
export PANGO_LIBDIR="$bundle_lib"
|
||||
export PANGO_SYSCONFDIR="$bundle_etc"
|
||||
|
||||
|
||||
@@ -6,6 +6,4 @@ rm -f *.app.zip
|
||||
python $HOME/.local/bin/gtk-mac-bundler zoitechat.bundle
|
||||
|
||||
echo "Compressing bundle"
|
||||
#hdiutil create -format UDBZ -srcdir ZoiteChat.app -quiet ZoiteChat-2.9.6.1-$(git rev-parse --short master).dmg
|
||||
zip -9rXq ./ZoiteChat-$(git describe --tags).app.zip ./ZoiteChat.app
|
||||
|
||||
|
||||
5
osx/settings.ini
Normal file
5
osx/settings.ini
Normal file
@@ -0,0 +1,5 @@
|
||||
[Settings]
|
||||
gtk-theme-name=Mac
|
||||
gtk-key-theme-name=Mac
|
||||
gtk-menu-images=0
|
||||
gtk-button-images=0
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
<run-install-name-tool/>
|
||||
<launcher-script>${project}/launcher.sh</launcher-script >
|
||||
<gtk>gtk+-2.0</gtk>
|
||||
<gtk>gtk+-3.0</gtk>
|
||||
</meta>
|
||||
|
||||
<plist>${project}/Info.plist</plist>
|
||||
@@ -47,18 +47,18 @@
|
||||
${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/
|
||||
</binary>
|
||||
<data>
|
||||
${prefix}/share/themes/Mac/gtk-2.0-key/gtkrc
|
||||
${prefix}/share/themes/Mac/gtk-3.0/gtk-keys.css
|
||||
</data>
|
||||
|
||||
<translations name="gtk20">
|
||||
<translations name="gtk30">
|
||||
${prefix}/share/locale
|
||||
</translations>
|
||||
<translations name="zoitechat">
|
||||
${prefix}/share/locale
|
||||
</translations>
|
||||
|
||||
<data dest="${bundle}/Contents/Resources/etc/${gtkdir}/gtkrc">
|
||||
${project}/gtkrc
|
||||
<data dest="${bundle}/Contents/Resources/etc/${gtkdir}/settings.ini">
|
||||
${project}/settings.ini
|
||||
</data>
|
||||
|
||||
<data dest="${bundle}/Contents/Resources">
|
||||
|
||||
70
packaging/manjaro/PKGBUILD
Normal file
70
packaging/manjaro/PKGBUILD
Normal file
@@ -0,0 +1,70 @@
|
||||
# Maintainer: ZoiteChat Maintainers <zoitechat@users.noreply.github.com>
|
||||
|
||||
pkgname=zoitechat-git
|
||||
pkgver=0
|
||||
pkgrel=1
|
||||
pkgdesc='IRC client for GNOME (ZoiteChat development snapshot)'
|
||||
arch=('x86_64')
|
||||
url='https://github.com/zoitechat/zoitechat'
|
||||
license=('GPL-2.0-or-later')
|
||||
depends=(
|
||||
'dbus-glib'
|
||||
'glib2'
|
||||
'gtk3'
|
||||
'iso-codes'
|
||||
'libcanberra'
|
||||
'lua'
|
||||
'openssl'
|
||||
'perl'
|
||||
'python-cffi'
|
||||
)
|
||||
makedepends=(
|
||||
'git'
|
||||
'meson'
|
||||
'ninja'
|
||||
'pkgconf'
|
||||
'python'
|
||||
)
|
||||
optdepends=(
|
||||
'libayatana-appindicator: Ayatana/AppIndicator tray backend'
|
||||
'pciutils: sysinfo plugin hardware detection details'
|
||||
)
|
||||
provides=('zoitechat')
|
||||
conflicts=('zoitechat')
|
||||
|
||||
_repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
source=("zoitechat::git+file://${_repo_root}")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
pkgver() {
|
||||
cd "$srcdir/zoitechat"
|
||||
|
||||
if git describe --long --tags --abbrev=7 >/dev/null 2>&1; then
|
||||
git describe --long --tags --abbrev=7 \
|
||||
| sed 's/^v//' \
|
||||
| sed -E 's/([^-]+)-([0-9]+)-g/\1.r\2.g/' \
|
||||
| sed 's/-/./g'
|
||||
else
|
||||
printf '0.r%s.%s\n' \
|
||||
"$(git rev-list --count HEAD)" \
|
||||
"$(git rev-parse --short=7 HEAD)"
|
||||
fi
|
||||
}
|
||||
|
||||
build() {
|
||||
arch-meson zoitechat build \
|
||||
-Dtext-frontend=false \
|
||||
-Dwith-checksum=true \
|
||||
-Dwith-fishlim=true \
|
||||
-Dwith-lua=lua \
|
||||
-Dwith-perl=perl \
|
||||
-Dwith-python=python3 \
|
||||
-Dwith-sysinfo=true \
|
||||
-Dinstall-plugin-metainfo=true
|
||||
|
||||
meson compile -C build
|
||||
}
|
||||
|
||||
package() {
|
||||
meson install -C build --destdir "$pkgdir"
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
name : zoitechat
|
||||
version : 2.18.0
|
||||
version : 2.18.0~pre2
|
||||
release : 2
|
||||
source :
|
||||
- https://github.com/ZoiteChat/zoitechat/archive/e060d57baee1be22bee1f9c3b047be3fa71c6d35.tar.gz : ed315a0b1c46e798912fd830d3845427972857c43ccaa16284969c6f542add38
|
||||
@@ -26,7 +26,6 @@ builddeps :
|
||||
setup : |
|
||||
%meson_configure \
|
||||
-Dgtk-frontend=true \
|
||||
-Dgtk3=true \
|
||||
-Dinstall-appdata=true
|
||||
build : |
|
||||
%ninja_build
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include "zoitechat-plugin.h"
|
||||
|
||||
static zoitechat_plugin *ph; /* plugin handle */
|
||||
static zoitechat_plugin *ph;
|
||||
static char name[] = "Checksum";
|
||||
static char desc[] = "Calculate checksum for DCC file transfers";
|
||||
static char version[] = "4.0";
|
||||
@@ -42,18 +42,14 @@ typedef struct {
|
||||
static void
|
||||
print_sha256_result (ChecksumCallbackInfo *info, const char *checksum, const char *filename, GError *error)
|
||||
{
|
||||
// So then we get the next best available channel, since we always want to print at least somewhere, it's fine
|
||||
zoitechat_context *ctx = zoitechat_find_context(ph, info->servername, info->channel);
|
||||
if (!ctx) {
|
||||
// before we print a private message to the wrong channel, we exit early
|
||||
if (info->send_message) {
|
||||
return;
|
||||
}
|
||||
|
||||
// if the context isn't found the first time, we search in the server
|
||||
ctx = zoitechat_find_context(ph, info->servername, NULL);
|
||||
if (!ctx) {
|
||||
// The second time we exit early, since printing in another server isn't desireable
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#include "zoitechat-plugin.h"
|
||||
|
||||
static zoitechat_plugin *ph; /* plugin handle */
|
||||
static zoitechat_plugin *ph;
|
||||
static char name[] = "Exec";
|
||||
static char desc[] = "Execute commands inside ZoiteChat";
|
||||
static char version[] = "1.2";
|
||||
@@ -71,7 +71,7 @@ run_command (char *word[], char *word_eol[], void *userdata)
|
||||
strcat (commandLine, word_eol[2]);
|
||||
}
|
||||
|
||||
CreatePipe (&readPipe, &writePipe, &secattr, 0); /* might be replaced with MyCreatePipeEx */
|
||||
CreatePipe (&readPipe, &writePipe, &secattr, 0);
|
||||
|
||||
ZeroMemory (&sInfo, sizeof (sInfo));
|
||||
ZeroMemory (&pInfo, sizeof (pInfo));
|
||||
@@ -91,12 +91,10 @@ run_command (char *word[], char *word_eol[], void *userdata)
|
||||
{
|
||||
if (ReadFile (readPipe, buffer, sizeof (buffer) - 1, &dwRead, NULL) && dwRead != 0 )
|
||||
{
|
||||
/* avoid garbage */
|
||||
buffer[dwRead] = '\0';
|
||||
|
||||
if (announce)
|
||||
{
|
||||
/* Say each line seperately, TODO: improve... */
|
||||
token = strtok_s (buffer, "\n", &context);
|
||||
while (token != NULL)
|
||||
{
|
||||
@@ -110,13 +108,11 @@ run_command (char *word[], char *word_eol[], void *userdata)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* this way we'll more likely get full lines */
|
||||
SleepEx (100, TRUE);
|
||||
}
|
||||
timeElapsed = difftime (time (0), start);
|
||||
}
|
||||
|
||||
/* display a newline to separate things */
|
||||
if (!announce)
|
||||
zoitechat_printf (ph, "\n");
|
||||
|
||||
@@ -149,7 +145,7 @@ zoitechat_plugin_init (zoitechat_plugin *plugin_handle, char **plugin_name, char
|
||||
zoitechat_hook_command (ph, "EXEC", ZOITECHAT_PRI_NORM, run_command, "Usage: /EXEC [-O] - execute commands inside ZoiteChat", 0);
|
||||
zoitechat_printf (ph, "%s plugin loaded\n", name);
|
||||
|
||||
return 1; /* return 1 for success */
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -39,13 +39,11 @@ gboolean irc_parse_message(const char *words[],
|
||||
if (prefix) *prefix = NULL;
|
||||
if (command) *command = NULL;
|
||||
|
||||
/* See if the message starts with a prefix (sender user) */
|
||||
if (words[w][0] == ':') {
|
||||
if (prefix) *prefix = &words[w][1];
|
||||
w++;
|
||||
}
|
||||
|
||||
/* Check command */
|
||||
|
||||
if (words[w][0] == '\0') return FALSE;
|
||||
if (command) *command = words[w];
|
||||
w++;
|
||||
@@ -72,11 +70,9 @@ char *irc_prefix_get_nick(const char *prefix) {
|
||||
|
||||
if (!prefix) return NULL;
|
||||
|
||||
/* Find end of nick */
|
||||
end = prefix;
|
||||
while (*end != '\0' && *end != '!' && *end != '@') end++;
|
||||
|
||||
/* Allocate string */
|
||||
|
||||
length = end - prefix;
|
||||
return g_strndup (prefix, length);
|
||||
}
|
||||
|
||||
@@ -277,15 +277,6 @@ char *decrypt_raw_message(const char *message, const char *key) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*static int handle_debug(char *word[], char *word_eol[], void *userdata) {
|
||||
zoitechat_printf(ph, "debug incoming: ");
|
||||
for (size_t i = 1; word[i] != NULL && word[i][0] != '\0'; i++) {
|
||||
zoitechat_printf(ph, ">%s< ", word[i]);
|
||||
}
|
||||
zoitechat_printf(ph, "\n");
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Called when a message is to be sent.
|
||||
*/
|
||||
@@ -811,7 +802,6 @@ int zoitechat_plugin_init(zoitechat_plugin *plugin_handle,
|
||||
zoitechat_hook_server(ph, "NOTICE", ZOITECHAT_PRI_HIGHEST, handle_keyx_notice, NULL);
|
||||
zoitechat_hook_server_attrs(ph, "NOTICE", ZOITECHAT_PRI_NORM, handle_incoming, NULL);
|
||||
zoitechat_hook_server_attrs(ph, "PRIVMSG", ZOITECHAT_PRI_NORM, handle_incoming, NULL);
|
||||
/* zoitechat_hook_server(ph, "RAW LINE", ZOITECHAT_PRI_NORM, handle_debug, NULL); */
|
||||
zoitechat_hook_server_attrs(ph, "TOPIC", ZOITECHAT_PRI_NORM, handle_incoming, NULL);
|
||||
zoitechat_hook_server_attrs(ph, "332", ZOITECHAT_PRI_NORM, handle_incoming, NULL);
|
||||
|
||||
@@ -836,4 +826,3 @@ int zoitechat_plugin_deinit(void) {
|
||||
zoitechat_printf(ph, "%s plugin unloaded\n", plugin_name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1105,6 +1105,8 @@ static int luaopen_zoitechat(lua_State *L)
|
||||
lua_pushinteger(L, ZOITECHAT_PRI_LOWEST); lua_setfield(L, -2, "PRI_LOWEST");
|
||||
lua_pushinteger(L, ZOITECHAT_EAT_NONE); lua_setfield(L, -2, "EAT_NONE");
|
||||
lua_pushinteger(L, ZOITECHAT_EAT_ZOITECHAT); lua_setfield(L, -2, "EAT_ZOITECHAT");
|
||||
lua_pushinteger(L, ZOITECHAT_EAT_ZOITECHAT); lua_setfield(L, -2, "EAT_XCHAT");
|
||||
lua_pushinteger(L, ZOITECHAT_EAT_ZOITECHAT); lua_setfield(L, -2, "EAT_HEXCHAT");
|
||||
lua_pushinteger(L, ZOITECHAT_EAT_PLUGIN); lua_setfield(L, -2, "EAT_PLUGIN");
|
||||
lua_pushinteger(L, ZOITECHAT_EAT_ALL); lua_setfield(L, -2, "EAT_ALL");
|
||||
|
||||
@@ -1271,6 +1273,13 @@ static void prepare_state(lua_State *L, script_info *info)
|
||||
lua_setfield(L, LUA_REGISTRYINDEX, registry_field);
|
||||
luaopen_zoitechat(L);
|
||||
lua_setglobal(L, "zoitechat");
|
||||
|
||||
lua_getglobal(L, "zoitechat");
|
||||
lua_setglobal(L, "xchat");
|
||||
|
||||
lua_getglobal(L, "zoitechat");
|
||||
lua_setglobal(L, "hexchat");
|
||||
|
||||
lua_getglobal(L, "zoitechat");
|
||||
lua_getfield(L, -1, "print");
|
||||
lua_setglobal(L, "print");
|
||||
|
||||
1
plugins/perl/lib/HexChat.pm
Normal file
1
plugins/perl/lib/HexChat.pm
Normal file
@@ -0,0 +1 @@
|
||||
require ZoiteChat;
|
||||
@@ -53,14 +53,16 @@ sub ZoiteChat::Internal::print;
|
||||
|
||||
#keep compatibility with Xchat scripts
|
||||
sub EAT_XCHAT ();
|
||||
sub EAT_HEXCHAT ();
|
||||
BEGIN {
|
||||
*Xchat:: = *ZoiteChat::;
|
||||
*HexChat:: = *ZoiteChat::;
|
||||
}
|
||||
|
||||
our %EXPORT_TAGS = (
|
||||
constants => [
|
||||
qw(PRI_HIGHEST PRI_HIGH PRI_NORM PRI_LOW PRI_LOWEST), # priorities
|
||||
qw(EAT_NONE EAT_ZOITECHAT EAT_XCHAT EAT_PLUGIN EAT_ALL), # callback return values
|
||||
qw(EAT_NONE EAT_ZOITECHAT EAT_XCHAT EAT_HEXCHAT EAT_PLUGIN EAT_ALL), # callback return values
|
||||
qw(FD_READ FD_WRITE FD_EXCEPTION FD_NOTSOCKET), # fd flags
|
||||
qw(KEEP REMOVE), # timers
|
||||
],
|
||||
|
||||
@@ -4,6 +4,7 @@ zoitechat_perl_module = custom_target('zoitechat-perl-header',
|
||||
input: [
|
||||
'lib/ZoiteChat.pm',
|
||||
'lib/Xchat.pm',
|
||||
'lib/HexChat.pm',
|
||||
'lib/ZoiteChat/Embed.pm',
|
||||
'lib/ZoiteChat/List/Network.pm',
|
||||
'lib/ZoiteChat/List/Network/Entry.pm',
|
||||
|
||||
@@ -440,8 +440,6 @@ server_cb (char *word[], char *word_eol[], void *userdata)
|
||||
if (data->depth)
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
|
||||
/* zoitechat_printf (ph, */
|
||||
/* "Received %d words in server callback", av_len (wd)); */
|
||||
PUSHMARK (SP);
|
||||
XPUSHs (newRV_noinc ((SV *) array2av (word)));
|
||||
XPUSHs (newRV_noinc ((SV *) array2av (word_eol)));
|
||||
@@ -489,8 +487,6 @@ command_cb (char *word[], char *word_eol[], void *userdata)
|
||||
if (data->depth)
|
||||
return ZOITECHAT_EAT_NONE;
|
||||
|
||||
/* zoitechat_printf (ph, "Received %d words in command callback", */
|
||||
/* av_len (wd)); */
|
||||
PUSHMARK (SP);
|
||||
XPUSHs (newRV_noinc ((SV *) array2av (word)));
|
||||
XPUSHs (newRV_noinc ((SV *) array2av (word_eol)));
|
||||
@@ -567,7 +563,6 @@ print_cb (char *word[], void *userdata)
|
||||
}
|
||||
}
|
||||
|
||||
/*zoitechat_printf (ph, "Received %d words in print callback", av_len (wd)+1); */
|
||||
PUSHMARK (SP);
|
||||
XPUSHs (newRV_noinc ((SV *) wd));
|
||||
XPUSHs (data->userdata);
|
||||
@@ -1365,6 +1360,7 @@ xs_init (pTHX)
|
||||
newCONSTSUB (stash, "EAT_NONE", newSViv (ZOITECHAT_EAT_NONE));
|
||||
newCONSTSUB (stash, "EAT_ZOITECHAT", newSViv (ZOITECHAT_EAT_ZOITECHAT));
|
||||
newCONSTSUB (stash, "EAT_XCHAT", newSViv (ZOITECHAT_EAT_ZOITECHAT)); /* for compatibility */
|
||||
newCONSTSUB (stash, "EAT_HEXCHAT", newSViv (ZOITECHAT_EAT_ZOITECHAT)); /* for compatibility */
|
||||
newCONSTSUB (stash, "EAT_PLUGIN", newSViv (ZOITECHAT_EAT_PLUGIN));
|
||||
newCONSTSUB (stash, "EAT_ALL", newSViv (ZOITECHAT_EAT_ALL));
|
||||
newCONSTSUB (stash, "FD_READ", newSViv (ZOITECHAT_FD_READ));
|
||||
|
||||
@@ -5,7 +5,7 @@ from contextlib import contextmanager
|
||||
from _zoitechat_embedded import ffi, lib
|
||||
|
||||
__all__ = [
|
||||
'EAT_ALL', 'EAT_ZOITECHAT', 'EAT_NONE', 'EAT_PLUGIN', 'EAT_XCHAT',
|
||||
'EAT_ALL', 'EAT_ZOITECHAT', 'EAT_NONE', 'EAT_PLUGIN', 'EAT_XCHAT', 'EAT_HEXCHAT',
|
||||
'PRI_HIGH', 'PRI_HIGHEST', 'PRI_LOW', 'PRI_LOWEST', 'PRI_NORM',
|
||||
'__doc__', '__version__', 'command', 'del_pluginpref', 'emit_print',
|
||||
'find_context', 'get_context', 'get_info',
|
||||
@@ -22,6 +22,7 @@ __license__ = 'GPL-2.0+'
|
||||
EAT_NONE = 0
|
||||
EAT_ZOITECHAT = 1
|
||||
EAT_XCHAT = EAT_ZOITECHAT
|
||||
EAT_HEXCHAT = EAT_ZOITECHAT
|
||||
EAT_PLUGIN = 2
|
||||
EAT_ALL = EAT_ZOITECHAT | EAT_PLUGIN
|
||||
|
||||
@@ -78,7 +79,6 @@ def emit_print(event_name, *args, **kwargs):
|
||||
return ret
|
||||
|
||||
|
||||
# TODO: this shadows itself. command should be changed to cmd
|
||||
def command(command):
|
||||
lib.zoitechat_command(lib.ph, command.encode())
|
||||
|
||||
@@ -220,7 +220,6 @@ def get_list(name):
|
||||
return ret
|
||||
|
||||
|
||||
# TODO: 'command' here shadows command above, and should be renamed to cmd
|
||||
def hook_command(command, callback, userdata=None, priority=PRI_NORM, help=None):
|
||||
plugin = __get_current_plugin()
|
||||
hook = plugin.add_hook(callback, userdata)
|
||||
|
||||
@@ -5,11 +5,9 @@ import cffi
|
||||
|
||||
builder = cffi.FFI()
|
||||
|
||||
# zoitechat-plugin.h
|
||||
with open(sys.argv[1]) as f:
|
||||
output = []
|
||||
eat_until_endif = 0
|
||||
# This is very specific to zoitechat-plugin.h, it is not a cpp
|
||||
for line in f:
|
||||
if line.startswith('#define'):
|
||||
continue
|
||||
@@ -81,9 +79,7 @@ int zoitechat_plugin_deinit(void)
|
||||
}
|
||||
''')
|
||||
|
||||
# python.py
|
||||
with open(sys.argv[2]) as f:
|
||||
builder.embedding_init_code(f.read())
|
||||
|
||||
# python.c
|
||||
builder.emit_c_code(sys.argv[3])
|
||||
|
||||
1
plugins/python/hexchat.py
Normal file
1
plugins/python/hexchat.py
Normal file
@@ -0,0 +1 @@
|
||||
from _zoitechat import *
|
||||
@@ -19,7 +19,7 @@ python3_source = custom_target('python-bindings',
|
||||
command: [find_program('generate_plugin.py'), '@INPUT@', '@OUTPUT@']
|
||||
)
|
||||
|
||||
install_data(['_zoitechat.py', 'zoitechat.py', 'xchat.py'],
|
||||
install_data(['_zoitechat.py', 'zoitechat.py', 'xchat.py', 'hexchat.py'],
|
||||
install_dir: join_paths(get_option('libdir'), 'zoitechat/python')
|
||||
)
|
||||
|
||||
|
||||
@@ -19,12 +19,11 @@ else:
|
||||
if not hasattr(sys, 'argv'):
|
||||
sys.argv = ['<zoitechat>']
|
||||
|
||||
VERSION = b'2.18.0-pre1' # Sync with zoitechat.__version__
|
||||
VERSION = b'2.18.0~pre2'
|
||||
PLUGIN_NAME = ffi.new('char[]', b'Python')
|
||||
PLUGIN_DESC = ffi.new('char[]', b'Python %d.%d scripting interface' % (sys.version_info[0], sys.version_info[1]))
|
||||
PLUGIN_VERSION = ffi.new('char[]', VERSION)
|
||||
|
||||
# TODO: Constants should be screaming snake case
|
||||
zoitechat = None
|
||||
local_interp = None
|
||||
zoitechat_stdout = None
|
||||
@@ -106,8 +105,6 @@ if sys.version_info[0] == 2:
|
||||
return compile(string, '<string>', 'eval', dont_inherit=True)
|
||||
|
||||
except SyntaxError:
|
||||
# For some reason `print` is invalid for eval
|
||||
# This will hide any return value though
|
||||
return compile(string, '<string>', 'exec', dont_inherit=True)
|
||||
else:
|
||||
def compile_file(data, filename):
|
||||
@@ -115,7 +112,6 @@ else:
|
||||
|
||||
|
||||
def compile_line(string):
|
||||
# newline appended to solve unexpected EOF issues
|
||||
return compile(string + '\n', '<string>', 'single', optimize=2, dont_inherit=True)
|
||||
|
||||
|
||||
@@ -200,8 +196,6 @@ else:
|
||||
return string.decode()
|
||||
|
||||
|
||||
# There can be empty entries between non-empty ones so find the actual last value
|
||||
|
||||
def _cstr(ptr):
|
||||
"""Safely convert a C char* (possibly NULL) to bytes."""
|
||||
if ptr == ffi.NULL:
|
||||
@@ -212,7 +206,6 @@ def _cstr(ptr):
|
||||
return b''
|
||||
|
||||
def wordlist_len(words):
|
||||
# ZoiteChat passes a fixed-size array (typically 32) where unused entries may be NULL.
|
||||
for i in range(31, 0, -1):
|
||||
if _cstr(words[i]):
|
||||
return i
|
||||
@@ -299,12 +292,8 @@ def _on_timer_hook(userdata):
|
||||
return 1
|
||||
|
||||
try:
|
||||
# Avoid calling zoitechat_unhook twice if unnecessary
|
||||
hook.is_unload = True
|
||||
except ReferenceError:
|
||||
# hook is a weak reference, it might have been destroyed by the callback
|
||||
# in which case it has already been removed from hook.plugin.hooks and
|
||||
# we wouldn't be able to test it with h == hook anyway.
|
||||
return 0
|
||||
|
||||
for h in hook.plugin.hooks:
|
||||
@@ -338,11 +327,9 @@ def _on_say_command(word, word_eol, userdata):
|
||||
if not python:
|
||||
return 1
|
||||
|
||||
# Don’t let exceptions here swallow core commands or wedge the UI.
|
||||
try:
|
||||
exec_in_interp(python)
|
||||
except Exception:
|
||||
# Best effort: surface the traceback in the python tab.
|
||||
exc = traceback.format_exc().encode('utf-8', errors='replace')
|
||||
lib.zoitechat_print(lib.ph, exc)
|
||||
return 1
|
||||
@@ -397,11 +384,10 @@ def autoload():
|
||||
configdir = __decode(_cstr(lib.zoitechat_get_info(lib.ph, b'configdir')))
|
||||
addondir = os.path.join(configdir, 'addons')
|
||||
try:
|
||||
with change_cwd(addondir): # Maintaining old behavior
|
||||
with change_cwd(addondir):
|
||||
for f in os.listdir(addondir):
|
||||
if f.endswith('.py'):
|
||||
log('Autoloading', f)
|
||||
# TODO: Set cwd
|
||||
load_filename(os.path.join(addondir, f))
|
||||
|
||||
except FileNotFoundError as e:
|
||||
@@ -538,8 +524,28 @@ def _on_plugin_init(plugin_name, plugin_desc, plugin_version, arg, libdir):
|
||||
|
||||
try:
|
||||
libdir = __decode(_cstr(libdir))
|
||||
modpath = os.path.join(libdir, '..', 'python')
|
||||
sys.path.append(os.path.abspath(modpath))
|
||||
modpaths = [
|
||||
os.path.abspath(os.path.join(libdir, '..', 'python')),
|
||||
os.path.abspath(os.path.join(libdir, 'python')),
|
||||
]
|
||||
|
||||
appdir = os.getenv('APPDIR')
|
||||
if appdir:
|
||||
modpaths.extend([
|
||||
os.path.join(appdir, 'usr', 'lib', 'zoitechat', 'python'),
|
||||
os.path.join(appdir, 'usr', 'lib', 'x86_64-linux-gnu', 'zoitechat', 'python'),
|
||||
])
|
||||
|
||||
if os.getenv('FLATPAK_ID'):
|
||||
modpaths.extend([
|
||||
'/app/lib/zoitechat/python',
|
||||
'/app/lib/x86_64-linux-gnu/zoitechat/python',
|
||||
])
|
||||
|
||||
for modpath in modpaths:
|
||||
if os.path.isdir(modpath) and modpath not in sys.path:
|
||||
sys.path.append(modpath)
|
||||
|
||||
zoitechat = importlib.import_module('zoitechat')
|
||||
|
||||
except (UnicodeDecodeError, ImportError) as e:
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
<None Include="python.def" />
|
||||
<None Include="python.py" />
|
||||
<None Include="xchat.py" />
|
||||
<None Include="hexchat.py" />
|
||||
<None Include="_zoitechat.py" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -30,5 +30,8 @@
|
||||
<None Include="xchat.py">
|
||||
<Filter>Source Files</Filter>
|
||||
</None>
|
||||
<None Include="hexchat.py">
|
||||
<Filter>Source Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -10,7 +10,7 @@ sysinfo_deps = [
|
||||
]
|
||||
|
||||
sysinfo_includes = []
|
||||
sysinfo_cargs = []
|
||||
sysinfo_cargs = ['-DHAVE_CONFIG_H']
|
||||
|
||||
system = host_machine.system()
|
||||
if system == 'linux' or system == 'gnu' or system.startswith('gnu/') or system == 'darwin' or system == 'freebsd'
|
||||
@@ -19,6 +19,10 @@ if system == 'linux' or system == 'gnu' or system.startswith('gnu/') or system =
|
||||
'shared/df.c'
|
||||
]
|
||||
|
||||
if get_option('gtk-frontend')
|
||||
sysinfo_cargs += '-DUSE_GTK_FRONTEND'
|
||||
endif
|
||||
|
||||
if system == 'linux' or system == 'gnu' or system.startswith('gnu/') or system == 'freebsd'
|
||||
libpci = dependency('libpci', required: false, method: 'pkg-config')
|
||||
if libpci.found()
|
||||
@@ -30,6 +34,10 @@ if system == 'linux' or system == 'gnu' or system.startswith('gnu/') or system =
|
||||
pciids = join_paths(picidsdir, 'pci.ids')
|
||||
sysinfo_cargs += '-DPCIIDS_FILE="@0@"'.format(pciids)
|
||||
endif
|
||||
if get_option('gtk-frontend')
|
||||
sysinfo_deps += dependency('gtk+-3.0', version: '>= 3.22')
|
||||
endif
|
||||
|
||||
sysinfo_includes += 'unix'
|
||||
sysinfo_sources += [
|
||||
'unix/backend.c',
|
||||
@@ -52,7 +60,7 @@ endif
|
||||
|
||||
shared_module('sysinfo', sysinfo_sources,
|
||||
dependencies: sysinfo_deps,
|
||||
include_directories: include_directories(sysinfo_includes),
|
||||
include_directories: [config_h_include, include_directories(sysinfo_includes)],
|
||||
c_args: sysinfo_cargs,
|
||||
install: true,
|
||||
install_dir: plugindir,
|
||||
|
||||
@@ -32,6 +32,10 @@
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "format.h"
|
||||
#include "df.h"
|
||||
|
||||
@@ -276,12 +280,8 @@ sysinfo_backend_get_network(void)
|
||||
|
||||
static const char *sysinfo_detect_toolkit(void)
|
||||
{
|
||||
#if defined(HAVE_GTK3)
|
||||
#if defined(USE_GTK_FRONTEND)
|
||||
return "GTK3";
|
||||
#elif defined(HAVE_GTK2)
|
||||
return "GTK2";
|
||||
#elif defined(HAVE_GTK)
|
||||
return "GTK";
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,7 @@ char *sysinfo_backend_get_network(void);
|
||||
|
||||
/*
|
||||
* Short description of the UI/toolkit + display backend.
|
||||
* Examples: "GTK3 / Wayland", "GTK2 / X11", "Windows / GTK3".
|
||||
* Examples: "GTK3 / Wayland", "Windows / GTK3".
|
||||
*/
|
||||
char *sysinfo_backend_get_ui(void);
|
||||
|
||||
|
||||
@@ -208,7 +208,6 @@ sysinfo_cb (char *word[], char *word_eol[], void *userdata)
|
||||
int offset = 0, channel_type;
|
||||
char *cmd;
|
||||
|
||||
/* Allow overriding global announce setting */
|
||||
if (!strcmp ("-e", word[2]))
|
||||
{
|
||||
announce = FALSE;
|
||||
@@ -220,7 +219,6 @@ sysinfo_cb (char *word[], char *word_eol[], void *userdata)
|
||||
offset++;
|
||||
}
|
||||
|
||||
/* Cannot send to server tab */
|
||||
channel_type = zoitechat_list_int (ph, NULL, "type");
|
||||
if (channel_type != 2 /* SESS_CHANNEL */ && channel_type != 3 /* SESS_DIALOG */)
|
||||
announce = FALSE;
|
||||
@@ -246,7 +244,6 @@ zoitechat_plugin_init (zoitechat_plugin *plugin_handle, char **plugin_name, char
|
||||
|
||||
zoitechat_hook_command (ph, "SYSINFO", ZOITECHAT_PRI_NORM, sysinfo_cb, sysinfo_help, NULL);
|
||||
|
||||
/* Match the classic label from HexChat so people can actually find it. */
|
||||
zoitechat_command (ph, "MENU ADD \"Window/Display System Info\" \"SYSINFO\"");
|
||||
zoitechat_printf (ph, _("%s plugin loaded\n"), name);
|
||||
return 1;
|
||||
@@ -255,7 +252,6 @@ zoitechat_plugin_init (zoitechat_plugin *plugin_handle, char **plugin_name, char
|
||||
int
|
||||
zoitechat_plugin_deinit (void)
|
||||
{
|
||||
/* Keep both in case older builds used a different label. */
|
||||
zoitechat_command (ph, "MENU DEL \"Window/Send System Info\"");
|
||||
zoitechat_command (ph, "MENU DEL \"Window/Display System Info\"");
|
||||
zoitechat_printf (ph, _("%s plugin unloaded\n"), name);
|
||||
|
||||
@@ -19,7 +19,11 @@
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#if defined(HAVE_GTK3) || defined(HAVE_GTK2) || defined(HAVE_GTK)
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#if defined(USE_GTK_FRONTEND)
|
||||
#include <gdk/gdk.h>
|
||||
#endif
|
||||
#include "parse.h"
|
||||
@@ -175,12 +179,8 @@ char *sysinfo_backend_get_network(void)
|
||||
|
||||
static const char *sysinfo_detect_toolkit(void)
|
||||
{
|
||||
#if defined(HAVE_GTK3)
|
||||
#if defined(USE_GTK_FRONTEND)
|
||||
return "GTK3";
|
||||
#elif defined(HAVE_GTK2)
|
||||
return "GTK2";
|
||||
#elif defined(HAVE_GTK)
|
||||
return "GTK";
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
@@ -194,7 +194,7 @@ static const char *sysinfo_detect_display_backend(void)
|
||||
const gboolean session_wayland = session && g_ascii_strcasecmp(session, "wayland") == 0;
|
||||
|
||||
/* Best-effort: ask GDK what it actually opened, if available. */
|
||||
#if defined(HAVE_GTK3) || defined(HAVE_GTK2) || defined(HAVE_GTK)
|
||||
#if defined(USE_GTK_FRONTEND)
|
||||
{
|
||||
GdkDisplay *display = gdk_display_get_default();
|
||||
if (display)
|
||||
|
||||
@@ -132,7 +132,6 @@ void pci_find_fullname(char *fullname, char *vendor, char *device)
|
||||
if(fp == NULL)
|
||||
{
|
||||
g_snprintf(fullname, bsize, "%s:%s", vendor, device);
|
||||
//sysinfo_print_error ("pci.ids file not found! You might want to adjust your pciids setting with /SYSINFO SET pciids (you can query its current value with /SYSINFO LIST).\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "../../../src/common/sysinfo/sysinfo.h"
|
||||
|
||||
#include "../format.h"
|
||||
@@ -106,12 +110,8 @@ static char *get_memory_info (void)
|
||||
|
||||
static const char *sysinfo_detect_toolkit(void)
|
||||
{
|
||||
#if defined(HAVE_GTK3)
|
||||
#if defined(USE_GTK_FRONTEND)
|
||||
return "GTK3";
|
||||
#elif defined(HAVE_GTK2)
|
||||
return "GTK2";
|
||||
#elif defined(HAVE_GTK)
|
||||
return "GTK";
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#define APPCAST_URL "https://zoitechat.zoite.net/appcast.xml"
|
||||
|
||||
static zoitechat_plugin *ph; /* plugin handle */
|
||||
static zoitechat_plugin *ph;
|
||||
static char name[] = "Update Checker";
|
||||
static char desc[] = "Check for ZoiteChat updates automatically";
|
||||
static char version[] = "5.0";
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#define PLAYING 1
|
||||
#define PAUSED 3
|
||||
|
||||
static zoitechat_plugin *ph; /* plugin handle */
|
||||
static zoitechat_plugin *ph;
|
||||
|
||||
static int
|
||||
winamp(char *word[], char *word_eol[], void *userdata)
|
||||
@@ -130,7 +130,6 @@ zoitechat_plugin_init(zoitechat_plugin *plugin_handle,
|
||||
char **plugin_version,
|
||||
char *arg)
|
||||
{
|
||||
/* we need to save this for use with any zoitechat_* functions */
|
||||
ph = plugin_handle;
|
||||
|
||||
*plugin_name = "Winamp";
|
||||
@@ -142,7 +141,7 @@ zoitechat_plugin_init(zoitechat_plugin *plugin_handle,
|
||||
|
||||
zoitechat_print (ph, "Winamp plugin loaded\n");
|
||||
|
||||
return 1; /* return 1 for success */
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<div align="center">
|
||||
<img src="data/icons/zoitechat.svg" height="230">
|
||||
|
||||
[](https://github.com/ZoiteChat/zoitechat/actions/workflows/debian-build.yml)
|
||||
[](https://github.com/ZoiteChat/zoitechat/actions/workflows/flatpak-build.yml)
|
||||
[](https://github.com/ZoiteChat/zoitechat/actions/workflows/appimage-build.yml)
|
||||
[](https://github.com/ZoiteChat/zoitechat/actions/workflows/windows-build.yml)
|
||||
[](https://github.com/ZoiteChat/zoitechat/actions/workflows/openbsd-build.yml)
|
||||
[](https://github.com/ZoiteChat/zoitechat/actions/workflows/manjaro-package-build.yml)
|
||||
|
||||
[![Version][github-version-img]][github-version-uri] [![Downloads][github-downloads-img]][github-downloads-uri] [![Size][github-size-img]][github-size-img] [![Last Commit][github-commit-img]][github-commit-img] [![Contributors][contribs-all-img]](#contributors-)
|
||||
|
||||
@@ -37,6 +36,9 @@ See [IRCHelp.org](http://irchelp.org) for information about IRC in general.
|
||||
For more information on ZoiteChat please read our [documentation](https://docs.zoitechat.zoite.net/):
|
||||
- [Downloads](https://zoitechat.zoite.net/download)
|
||||
|
||||
- [Troubleshooting](troubleshooting.md)
|
||||
|
||||
|
||||
---
|
||||
|
||||
<sub>
|
||||
|
||||
@@ -419,6 +419,7 @@ const struct prefs vars[] =
|
||||
{"gui_input_nick", P_OFFINT (hex_gui_input_nick), TYPE_BOOL},
|
||||
{"gui_input_spell", P_OFFINT (hex_gui_input_spell), TYPE_BOOL},
|
||||
{"gui_input_style", P_OFFINT (hex_gui_input_style), TYPE_BOOL},
|
||||
{"gui_gtk3_theme_name", P_OFFSET (hex_gui_gtk3_theme_name), TYPE_STR},
|
||||
{"gui_join_dialog", P_OFFINT (hex_gui_join_dialog), TYPE_BOOL},
|
||||
{"gui_lagometer", P_OFFINT (hex_gui_lagometer), TYPE_INT},
|
||||
{"gui_lang", P_OFFINT (hex_gui_lang), TYPE_INT},
|
||||
@@ -764,7 +765,6 @@ load_default_config(void)
|
||||
prefs.hex_gui_input_style = 1;
|
||||
prefs.hex_gui_join_dialog = 1;
|
||||
prefs.hex_gui_quit_dialog = 1;
|
||||
/* prefs.hex_gui_slist_skip = 1; */
|
||||
prefs.hex_gui_tab_chans = 1;
|
||||
prefs.hex_gui_tab_dialogs = 1;
|
||||
prefs.hex_gui_tab_icons = 1;
|
||||
@@ -788,7 +788,7 @@ load_default_config(void)
|
||||
prefs.hex_irc_reconnect_rejoin = 1;
|
||||
prefs.hex_irc_cap_server_time = 1;
|
||||
prefs.hex_irc_logging = 1;
|
||||
prefs.hex_irc_who_join = 1; /* Can kick with inordinate amount of channels, required for some of our features though, TODO: add cap like away check? */
|
||||
prefs.hex_irc_who_join = 1;
|
||||
prefs.hex_irc_whois_front = 1;
|
||||
prefs.hex_net_auto_reconnect = 1;
|
||||
prefs.hex_net_throttle = 1;
|
||||
@@ -819,7 +819,7 @@ load_default_config(void)
|
||||
prefs.hex_flood_ctcp_num = 5;
|
||||
prefs.hex_flood_ctcp_time = 30;
|
||||
prefs.hex_flood_msg_num = 5;
|
||||
/*FIXME*/ prefs.hex_flood_msg_time = 30;
|
||||
prefs.hex_flood_msg_time = 30;
|
||||
prefs.hex_gui_chanlist_maxusers = 9999;
|
||||
prefs.hex_gui_chanlist_minusers = 5;
|
||||
prefs.hex_gui_dialog_height = 256;
|
||||
|
||||
@@ -99,8 +99,6 @@ str_to_chanopt (const char *str)
|
||||
return SET_DEFAULT;
|
||||
}
|
||||
|
||||
/* handle the /CHANOPT command */
|
||||
|
||||
int
|
||||
chanopt_command (session *sess, char *tbuf, char *word[], char *word_eol[])
|
||||
{
|
||||
@@ -135,13 +133,13 @@ chanopt_command (session *sess, char *tbuf, char *word[], char *word_eol[])
|
||||
{
|
||||
if (find[0] == 0 || match (find, chanopt[i].name) || (chanopt[i].alias && match (find, chanopt[i].alias)))
|
||||
{
|
||||
if (newval != -1) /* set new value */
|
||||
if (newval != -1)
|
||||
{
|
||||
*(guint8 *)G_STRUCT_MEMBER_P(sess, chanopt[i].offset) = newval;
|
||||
chanopt_changed = TRUE;
|
||||
}
|
||||
|
||||
if (!quiet) /* print value */
|
||||
if (!quiet)
|
||||
{
|
||||
strcpy (tbuf, chanopt[i].name);
|
||||
p = strlen (tbuf);
|
||||
@@ -177,18 +175,13 @@ chanopt_is_set (unsigned int global, guint8 per_chan_setting)
|
||||
return global;
|
||||
}
|
||||
|
||||
/* === below is LOADING/SAVING stuff only === */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Per-Channel Alerts */
|
||||
/* use a byte, because we need a pointer to each element */
|
||||
guint8 alert_balloon;
|
||||
guint8 alert_beep;
|
||||
guint8 alert_taskbar;
|
||||
guint8 alert_tray;
|
||||
|
||||
/* Per-Channel Settings */
|
||||
guint8 text_hidejoinpart;
|
||||
guint8 text_logging;
|
||||
guint8 text_scrollback;
|
||||
@@ -218,12 +211,10 @@ chanopt_find (char *network, char *channel, gboolean add_new)
|
||||
if (!add_new)
|
||||
return NULL;
|
||||
|
||||
/* allocate a new one */
|
||||
co = g_new0 (chanopt_in_memory, 1);
|
||||
co->channel = g_strdup (channel);
|
||||
co->network = g_strdup (network);
|
||||
|
||||
/* set all values to SET_DEFAULT */
|
||||
i = 0;
|
||||
while (i < sizeof (chanopt) / sizeof (channel_options))
|
||||
{
|
||||
@@ -254,8 +245,6 @@ chanopt_add_opt (chanopt_in_memory *co, char *var, int new_value)
|
||||
}
|
||||
}
|
||||
|
||||
/* load chanopt.conf from disk into our chanopt_list GSList */
|
||||
|
||||
static void
|
||||
chanopt_load_all (void)
|
||||
{
|
||||
@@ -265,7 +254,6 @@ chanopt_load_all (void)
|
||||
char *network = NULL;
|
||||
chanopt_in_memory *current = NULL;
|
||||
|
||||
/* 1. load the old file into our GSList */
|
||||
fh = zoitechat_open_file ("chanopt.conf", O_RDONLY, 0, 0);
|
||||
if (fh != -1)
|
||||
{
|
||||
@@ -326,7 +314,6 @@ chanopt_load (session *sess)
|
||||
if (!co)
|
||||
return;
|
||||
|
||||
/* fill in all the sess->xxxxx fields */
|
||||
i = 0;
|
||||
while (i < sizeof (chanopt) / sizeof (channel_options))
|
||||
{
|
||||
@@ -352,8 +339,6 @@ chanopt_save (session *sess)
|
||||
if (!network)
|
||||
return;
|
||||
|
||||
/* 2. reconcile sess with what we loaded from disk */
|
||||
|
||||
co = chanopt_find (network, sess->session_name, TRUE);
|
||||
|
||||
i = 0;
|
||||
|
||||
@@ -743,9 +743,6 @@ dcc_read (GIOChannel *source, GIOCondition condition, struct DCC *dcc)
|
||||
EMIT_SIGNAL (XP_TE_DCCRECVERR, dcc->serv->front_session, dcc->file,
|
||||
dcc->destfile, dcc->nick,
|
||||
errorstring ((n < 0) ? sock_error () : 0), 0);
|
||||
/* send ack here? but the socket is dead */
|
||||
/*if (need_ack)
|
||||
dcc_send_ack (dcc);*/
|
||||
dcc_close (dcc, STAT_FAILED, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1383,7 +1380,6 @@ dcc_connect (struct DCC *dcc)
|
||||
dcc_close (dcc, STAT_FAILED, FALSE);
|
||||
return;
|
||||
}
|
||||
/* possible problems with filenames containing spaces? */
|
||||
if (dcc->type == TYPE_RECV)
|
||||
g_snprintf (tbuf, sizeof (tbuf), strchr (dcc->file, ' ') ?
|
||||
"DCC SEND \"%s\" %u %d %" G_GUINT64_FORMAT " %d" :
|
||||
@@ -1660,17 +1656,14 @@ dcc_listen_init (struct DCC *dcc, session *sess)
|
||||
|
||||
SAddr.sin_family = AF_INET;
|
||||
|
||||
/*if local_ip is specified use that*/
|
||||
if (prefs.local_ip != 0xffffffff)
|
||||
{
|
||||
my_addr = prefs.local_ip;
|
||||
SAddr.sin_addr.s_addr = prefs.local_ip;
|
||||
}
|
||||
/*otherwise use the default*/
|
||||
else
|
||||
my_addr = SAddr.sin_addr.s_addr;
|
||||
|
||||
/*if we have a valid portrange try to use that*/
|
||||
if (prefs.hex_dcc_port_first > 0)
|
||||
{
|
||||
SAddr.sin_port = 0;
|
||||
@@ -1680,7 +1673,6 @@ dcc_listen_init (struct DCC *dcc, session *sess)
|
||||
{
|
||||
SAddr.sin_port = htons (prefs.hex_dcc_port_first + i);
|
||||
i++;
|
||||
/*printf("Trying to bind against port: %d\n",ntohs(SAddr.sin_port));*/
|
||||
bindretval = bind (dcc->sok, (struct sockaddr *) &SAddr, sizeof (SAddr));
|
||||
}
|
||||
|
||||
@@ -1707,12 +1699,8 @@ dcc_listen_init (struct DCC *dcc, session *sess)
|
||||
|
||||
dcc->port = ntohs (SAddr.sin_port);
|
||||
|
||||
/*if we have a dcc_ip, we use that, so the remote client can connect*/
|
||||
/*else we try to take an address from hex_dcc_ip*/
|
||||
/*if something goes wrong we tell the client to connect to our LAN ip*/
|
||||
dcc->addr = dcc_get_my_address (sess);
|
||||
|
||||
/*if nothing else worked we use the address we bound to*/
|
||||
if (dcc->addr == 0)
|
||||
dcc->addr = my_addr;
|
||||
|
||||
@@ -1728,7 +1716,7 @@ dcc_listen_init (struct DCC *dcc, session *sess)
|
||||
}
|
||||
|
||||
static struct session *dccsess;
|
||||
static char *dccto; /* lame!! */
|
||||
static char *dccto;
|
||||
static gint64 dccmaxcps;
|
||||
static int recursive = FALSE;
|
||||
|
||||
|
||||
@@ -153,8 +153,6 @@ ignore_showlist (session *sess)
|
||||
strcat (tbuf, _("NO "));
|
||||
strcat (tbuf, "\n");
|
||||
PrintText (sess, tbuf);
|
||||
/*EMIT_SIGNAL (XP_TE_IGNORELIST, sess, ig->mask, 0, 0, 0, 0); */
|
||||
/* use this later, when TE's support 7 args */
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
@@ -413,4 +411,3 @@ flood_check (char *nick, char *ip, server *serv, session *sess, int what) /*0=ct
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,6 @@ find_session_from_nick (char *nick, server *serv)
|
||||
|
||||
if (serv->front_session)
|
||||
{
|
||||
// If we are here for ChanServ, then it is usually a reply for the user
|
||||
if (!g_ascii_strcasecmp(nick, "ChanServ") || userlist_find (serv->front_session, nick))
|
||||
return serv->front_session;
|
||||
}
|
||||
@@ -222,15 +221,51 @@ inbound_privmsg (server *serv, char *from, char *ip, char *text, int id,
|
||||
|
||||
/* used for Alerts section. Masks can be separated by commas and spaces. */
|
||||
|
||||
static char *
|
||||
alert_normalize_word (const char *text)
|
||||
{
|
||||
GString *normalized;
|
||||
char *composed;
|
||||
const char *p;
|
||||
|
||||
composed = g_utf8_normalize (text, -1, G_NORMALIZE_ALL_COMPOSE);
|
||||
if (!composed)
|
||||
composed = g_strdup (text);
|
||||
|
||||
normalized = g_string_sized_new (strlen (composed));
|
||||
p = composed;
|
||||
|
||||
while (*p)
|
||||
{
|
||||
gunichar ch = g_utf8_get_char ((const guchar *)p);
|
||||
|
||||
/* Ignore selector/joiner codepoints that vary by input method. */
|
||||
if (ch != 0x200D && ch != 0xFE0E && ch != 0xFE0F)
|
||||
g_string_append_unichar (normalized, ch);
|
||||
|
||||
p = g_utf8_next_char (p);
|
||||
}
|
||||
|
||||
g_free (composed);
|
||||
return g_string_free (normalized, FALSE);
|
||||
}
|
||||
|
||||
gboolean
|
||||
alert_match_word (char *word, char *masks)
|
||||
{
|
||||
char *p = masks;
|
||||
char endchar;
|
||||
char *word_normalized;
|
||||
char *mask_normalized;
|
||||
int res;
|
||||
|
||||
word_normalized = alert_normalize_word (word);
|
||||
|
||||
if (masks[0] == 0)
|
||||
{
|
||||
g_free (word_normalized);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
while (1)
|
||||
{
|
||||
@@ -239,15 +274,23 @@ alert_match_word (char *word, char *masks)
|
||||
{
|
||||
endchar = *p;
|
||||
*p = 0;
|
||||
res = match (g_strchug (masks), word);
|
||||
mask_normalized = alert_normalize_word (g_strchug (masks));
|
||||
res = match (mask_normalized, word_normalized);
|
||||
g_free (mask_normalized);
|
||||
*p = endchar;
|
||||
|
||||
if (res)
|
||||
{
|
||||
g_free (word_normalized);
|
||||
return TRUE; /* yes, matched! */
|
||||
}
|
||||
|
||||
masks = p + 1;
|
||||
if (*p == 0)
|
||||
{
|
||||
g_free (word_normalized);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
p++;
|
||||
}
|
||||
@@ -258,6 +301,8 @@ alert_match_text (char *text, char *masks)
|
||||
{
|
||||
unsigned char *p = text;
|
||||
unsigned char endchar;
|
||||
gunichar ch;
|
||||
GUnicodeType ch_type;
|
||||
int res;
|
||||
|
||||
if (masks[0] == 0)
|
||||
@@ -265,26 +310,38 @@ alert_match_text (char *text, char *masks)
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (*p >= '0' && *p <= '9')
|
||||
ch = g_utf8_get_char (p);
|
||||
ch_type = g_unichar_type (ch);
|
||||
|
||||
if (g_unichar_isdigit (ch) || g_unichar_isalpha (ch))
|
||||
{
|
||||
p++;
|
||||
p += g_utf8_skip [p[0]];
|
||||
continue;
|
||||
}
|
||||
|
||||
/* if it's RFC1459 <special>, it can be inside a word */
|
||||
switch (*p)
|
||||
switch (ch)
|
||||
{
|
||||
case '-': case '[': case ']': case '\\':
|
||||
case '`': case '^': case '{': case '}':
|
||||
case '_': case '|':
|
||||
p++;
|
||||
p += g_utf8_skip [p[0]];
|
||||
continue;
|
||||
}
|
||||
|
||||
/* if it's a 0, space or comma, the word has ended. */
|
||||
if (*p == 0 || *p == ' ' || *p == ',' ||
|
||||
/* if it's anything BUT a letter, the word has ended. */
|
||||
(!g_unichar_isalpha (g_utf8_get_char (p))))
|
||||
/* Symbols (including emoji) can be part of highlighted words. */
|
||||
if (ch_type == G_UNICODE_MATH_SYMBOL ||
|
||||
ch_type == G_UNICODE_CURRENCY_SYMBOL ||
|
||||
ch_type == G_UNICODE_MODIFIER_SYMBOL ||
|
||||
ch_type == G_UNICODE_OTHER_SYMBOL)
|
||||
{
|
||||
p += g_utf8_skip [p[0]];
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Delimiters end the word. */
|
||||
if (*p == 0 || g_unichar_isspace (ch) || g_unichar_ispunct (ch) ||
|
||||
g_unichar_iscntrl (ch))
|
||||
{
|
||||
endchar = *p;
|
||||
*p = 0;
|
||||
@@ -2063,7 +2120,6 @@ scram_authenticate (server *serv, const char *data, const char *digest,
|
||||
|
||||
if (status == SCRAM_IN_PROGRESS)
|
||||
{
|
||||
// Authentication is still in progress
|
||||
encoded = g_base64_encode ((guchar *) output, output_len);
|
||||
tcp_sendf (serv, "AUTHENTICATE %s\r\n", encoded);
|
||||
g_free (encoded);
|
||||
@@ -2071,13 +2127,11 @@ scram_authenticate (server *serv, const char *data, const char *digest,
|
||||
}
|
||||
else if (status == SCRAM_SUCCESS)
|
||||
{
|
||||
// Authentication succeeded
|
||||
tcp_sendf (serv, "AUTHENTICATE +\r\n");
|
||||
g_clear_pointer (&serv->scram_session, scram_session_free);
|
||||
}
|
||||
else if (status == SCRAM_ERROR)
|
||||
{
|
||||
// Authentication failed
|
||||
tcp_sendf (serv, "AUTHENTICATE *\r\n");
|
||||
|
||||
if (serv->scram_session->error != NULL)
|
||||
|
||||
@@ -55,12 +55,39 @@ if host_machine.system() == 'windows'
|
||||
common_includes += include_directories('sysinfo')
|
||||
endif
|
||||
|
||||
marshal = gnome.genmarshal('marshal',
|
||||
sources: 'marshalers.list',
|
||||
prefix: '_zoitechat_marshal',
|
||||
internal: true
|
||||
glib_genmarshal = find_program(
|
||||
'glib-genmarshal',
|
||||
'glib-genmarshal-2.0',
|
||||
required: true,
|
||||
)
|
||||
|
||||
marshal = [
|
||||
custom_target('marshal_h',
|
||||
input: 'marshalers.list',
|
||||
output: 'marshal.h',
|
||||
command: [
|
||||
glib_genmarshal,
|
||||
'--prefix=_zoitechat_marshal',
|
||||
'--header',
|
||||
'@INPUT@',
|
||||
'--output',
|
||||
'@OUTPUT@',
|
||||
]
|
||||
),
|
||||
custom_target('marshal_c',
|
||||
input: 'marshalers.list',
|
||||
output: 'marshal.c',
|
||||
command: [
|
||||
glib_genmarshal,
|
||||
'--prefix=_zoitechat_marshal',
|
||||
'--body',
|
||||
'@INPUT@',
|
||||
'--output',
|
||||
'@OUTPUT@',
|
||||
]
|
||||
)
|
||||
]
|
||||
|
||||
make_te = find_program('make-te.py')
|
||||
|
||||
textevents = custom_target('textevents',
|
||||
@@ -69,11 +96,6 @@ textevents = custom_target('textevents',
|
||||
command: [make_te, '@INPUT@', '@OUTPUT0@', '@OUTPUT1@']
|
||||
)
|
||||
|
||||
# TODO:
|
||||
# LOOKUPD
|
||||
# SIGACTION
|
||||
# HAVE_GTK_MAC
|
||||
|
||||
if libssl_dep.found()
|
||||
common_sources += 'ssl.c'
|
||||
common_deps += libssl_dep
|
||||
|
||||
@@ -87,7 +87,7 @@ notify_do_network (struct notify *notify, server *serv)
|
||||
return TRUE;
|
||||
|
||||
if (token_foreach (notify->networks, ',', notify_netcmp, serv))
|
||||
return FALSE; /* network list doesn't contain this one */
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -106,8 +106,6 @@ notify_find_server_entry (struct notify *notify, struct server *serv)
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
/* not found, should we add it, or is this not a network where
|
||||
we're monitoring this nick? */
|
||||
if (!notify_do_network (notify, serv))
|
||||
return NULL;
|
||||
|
||||
@@ -123,11 +121,7 @@ notify_save (void)
|
||||
{
|
||||
int fh;
|
||||
struct notify *notify;
|
||||
// while reading the notify.conf file, elements are added by prepending to the
|
||||
// list. reverse the list before writing to disk to keep the original
|
||||
// order of the list
|
||||
GSList *list = g_slist_copy(notify_list);
|
||||
list = g_slist_reverse(list);
|
||||
GSList *list = g_slist_reverse (g_slist_copy (notify_list));
|
||||
|
||||
fh = zoitechat_open_file ("notify.conf", O_TRUNC | O_WRONLY | O_CREAT, 0600, XOF_DOMODE);
|
||||
if (fh != -1)
|
||||
@@ -146,7 +140,7 @@ notify_save (void)
|
||||
}
|
||||
close (fh);
|
||||
}
|
||||
g_slist_free(list);
|
||||
g_slist_free (list);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -42,19 +42,16 @@ struct notify_per_server
|
||||
extern GSList *notify_list;
|
||||
extern int notify_tag;
|
||||
|
||||
/* the WATCH stuff */
|
||||
void notify_set_online (server * serv, char *nick,
|
||||
const message_tags_data *tags_data);
|
||||
void notify_set_offline (server * serv, char *nick, int quiet,
|
||||
const message_tags_data *tags_data);
|
||||
/* the MONITOR stuff */
|
||||
const message_tags_data *tags_data);
|
||||
void notify_set_online_list (server * serv, char *users,
|
||||
const message_tags_data *tags_data);
|
||||
void notify_set_offline_list (server * serv, char *users, int quiet,
|
||||
const message_tags_data *tags_data);
|
||||
const message_tags_data *tags_data);
|
||||
void notify_send_watches (server * serv);
|
||||
|
||||
/* the general stuff */
|
||||
void notify_adduser (char *name, char *networks);
|
||||
int notify_deluser (char *name);
|
||||
void notify_cleanup (void);
|
||||
@@ -65,7 +62,6 @@ gboolean notify_is_in_list (server *serv, char *name);
|
||||
int notify_isnotify (session *sess, char *name);
|
||||
struct notify_per_server *notify_find_server_entry (struct notify *notify, struct server *serv);
|
||||
|
||||
/* the old ISON stuff - remove me? */
|
||||
void notify_markonline (server *serv, char *word[],
|
||||
const message_tags_data *tags_data);
|
||||
int notify_checklist (void);
|
||||
|
||||
@@ -3774,37 +3774,29 @@ cmd_url (struct session *sess, char *tbuf, char *word[], char *word_eol[])
|
||||
if (zoitechat_theme_path_from_arg (word[2], &theme_path))
|
||||
{
|
||||
GError *error = NULL;
|
||||
char *basename = g_path_get_basename (theme_path);
|
||||
char *dot = strrchr (basename, '.');
|
||||
char *message;
|
||||
char *theme_name = NULL;
|
||||
|
||||
if (dot)
|
||||
*dot = '\0';
|
||||
|
||||
if (zoitechat_import_theme (theme_path, &error))
|
||||
if (zoitechat_import_gtk3_theme_archive (theme_path, &theme_name, &error))
|
||||
{
|
||||
if (zoitechat_apply_theme (basename, &error))
|
||||
if (theme_name)
|
||||
{
|
||||
message = g_strdup_printf (_("Theme \"%s\" imported and applied."), basename);
|
||||
char *message = g_strdup_printf (_("GTK3 theme \"%s\" imported. Use Theme settings to apply it."), theme_name);
|
||||
fe_message (message, FE_MSG_INFO);
|
||||
handle_command (sess, "gui apply", FALSE);
|
||||
g_free (message);
|
||||
}
|
||||
else
|
||||
{
|
||||
fe_message (error ? error->message : _("Theme imported, but failed to apply."),
|
||||
FE_MSG_ERROR);
|
||||
g_clear_error (&error);
|
||||
fe_message (_("GTK3 theme imported. Use Theme settings to apply it."), FE_MSG_INFO);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fe_message (error ? error->message : _("Failed to import theme."),
|
||||
fe_message (error ? error->message : _("Failed to import GTK3 theme archive."),
|
||||
FE_MSG_ERROR);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
g_free (basename);
|
||||
g_free (theme_name);
|
||||
g_free (theme_path);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#define _(x) zoitechat_gettext(ph,x)
|
||||
|
||||
static zoitechat_plugin *ph; /* plugin handle */
|
||||
static zoitechat_plugin *ph;
|
||||
static GSList *timer_list = NULL;
|
||||
|
||||
#define STATIC
|
||||
@@ -146,7 +146,6 @@ timer_showlist (void)
|
||||
zoitechat_print (ph, _(HELP));
|
||||
return;
|
||||
}
|
||||
/* 00000 00000000 0000000 abc */
|
||||
zoitechat_print (ph, _("\026 Ref# Seconds Repeat Command \026\n"));
|
||||
list = timer_list;
|
||||
while (list)
|
||||
@@ -218,7 +217,6 @@ zoitechat_plugin_init
|
||||
(zoitechat_plugin *plugin_handle, char **plugin_name,
|
||||
char **plugin_desc, char **plugin_version, char *arg)
|
||||
{
|
||||
/* we need to save this for use with any zoitechat_* functions */
|
||||
ph = plugin_handle;
|
||||
|
||||
*plugin_name = "Timer";
|
||||
@@ -227,5 +225,5 @@ zoitechat_plugin_init
|
||||
|
||||
zoitechat_hook_command (ph, "TIMER", ZOITECHAT_PRI_NORM, timer_cb, _(HELP), 0);
|
||||
|
||||
return 1; /* return 1 for success */
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#define CLIENT_KEY "Client Key"
|
||||
#define SERVER_KEY "Server Key"
|
||||
|
||||
// EVP_MD_CTX_create() and EVP_MD_CTX_destroy() were renamed in OpenSSL 1.1.0
|
||||
#if (OPENSSL_VERSION_NUMBER < 0x10100000L)
|
||||
#define EVP_MD_CTX_new(ctx) EVP_MD_CTX_create(ctx)
|
||||
#define EVP_MD_CTX_free(ctx) EVP_MD_CTX_destroy(ctx)
|
||||
@@ -46,7 +45,6 @@ scram_session
|
||||
|
||||
if (md == NULL)
|
||||
{
|
||||
// Unknown message digest
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -189,7 +187,6 @@ process_server_first (scram_session *session, const char *data, char **output,
|
||||
|
||||
client_nonce_len = strlen (session->client_nonce_b64);
|
||||
|
||||
// The server can append his nonce to the client's nonce
|
||||
if (strlen (server_nonce_b64) < client_nonce_len ||
|
||||
strncmp (server_nonce_b64, session->client_nonce_b64, client_nonce_len))
|
||||
{
|
||||
@@ -199,28 +196,22 @@ process_server_first (scram_session *session, const char *data, char **output,
|
||||
|
||||
g_base64_decode_inplace ((gchar *) salt, &salt_len);
|
||||
|
||||
// SaltedPassword := Hi(Normalize(password), salt, i)
|
||||
session->salted_password = g_malloc (session->digest_size);
|
||||
|
||||
PKCS5_PBKDF2_HMAC (session->password, strlen (session->password), (unsigned char *) salt,
|
||||
salt_len, iteration_count, session->digest, session->digest_size,
|
||||
session->salted_password);
|
||||
|
||||
// AuthMessage := client-first-message-bare + "," +
|
||||
// server-first-message + "," +
|
||||
// client-final-message-without-proof
|
||||
client_final_message_without_proof = g_strdup_printf ("c=biws,r=%s", server_nonce_b64);
|
||||
|
||||
session->auth_message = g_strdup_printf ("%s,%s,%s", session->client_first_message_bare,
|
||||
data, client_final_message_without_proof);
|
||||
|
||||
// ClientKey := HMAC(SaltedPassword, "Client Key")
|
||||
client_key = g_malloc0 (session->digest_size);
|
||||
|
||||
HMAC (session->digest, session->salted_password, session->digest_size,
|
||||
(unsigned char *) CLIENT_KEY, strlen (CLIENT_KEY), client_key, &client_key_len);
|
||||
|
||||
// StoredKey := H(ClientKey)
|
||||
if (!create_SHA (session, client_key, session->digest_size, stored_key, &stored_key_len))
|
||||
{
|
||||
g_free (client_final_message_without_proof);
|
||||
@@ -230,12 +221,10 @@ process_server_first (scram_session *session, const char *data, char **output,
|
||||
return SCRAM_ERROR;
|
||||
}
|
||||
|
||||
// ClientSignature := HMAC(StoredKey, AuthMessage)
|
||||
client_signature = g_malloc0 (session->digest_size);
|
||||
HMAC (session->digest, stored_key, stored_key_len, (unsigned char *) session->auth_message,
|
||||
strlen ((char *) session->auth_message), client_signature, NULL);
|
||||
|
||||
// ClientProof := ClientKey XOR ClientSignature
|
||||
client_proof = g_malloc0 (client_key_len);
|
||||
|
||||
for (i = 0; i < client_key_len; i++)
|
||||
@@ -276,12 +265,10 @@ process_server_final (scram_session *session, const char *data)
|
||||
verifier = g_strdup (data + 2);
|
||||
g_base64_decode_inplace (verifier, &verifier_len);
|
||||
|
||||
// ServerKey := HMAC(SaltedPassword, "Server Key")
|
||||
server_key = g_malloc0 (session->digest_size);
|
||||
HMAC (session->digest, session->salted_password, session->digest_size,
|
||||
(unsigned char *) SERVER_KEY, strlen (SERVER_KEY), server_key, &server_key_len);
|
||||
|
||||
// ServerSignature := HMAC(ServerKey, AuthMessage)
|
||||
server_signature = g_malloc0 (session->digest_size);
|
||||
HMAC (session->digest, server_key, session->digest_size,
|
||||
(unsigned char *) session->auth_message, strlen ((char *) session->auth_message),
|
||||
@@ -330,4 +317,4 @@ scram_process (scram_session *session, const char *input, char **output, size_t
|
||||
return status;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -510,16 +510,7 @@ server_stopconnecting (server * serv)
|
||||
static void
|
||||
ssl_cb_info (SSL * s, int where, int ret)
|
||||
{
|
||||
/* char buf[128];*/
|
||||
|
||||
|
||||
return; /* FIXME: make debug level adjustable in serverlist or settings */
|
||||
|
||||
/* g_snprintf (buf, sizeof (buf), "%s (%d)", SSL_state_string_long (s), where);
|
||||
if (g_sess)
|
||||
EMIT_SIGNAL (XP_TE_SSLMESSAGE, g_sess, buf, NULL, NULL, NULL, 0);
|
||||
else
|
||||
fprintf (stderr, "%s\n", buf);*/
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -625,14 +616,6 @@ ssl_do_connect (server * serv)
|
||||
cert_info.algorithm, cert_info.algorithm_bits);
|
||||
EMIT_SIGNAL (XP_TE_SSLMESSAGE, serv->server_session, buf, NULL, NULL,
|
||||
NULL, 0);
|
||||
/*if (cert_info.rsa_tmp_bits)
|
||||
{
|
||||
g_snprintf (buf, sizeof (buf),
|
||||
" Public key algorithm uses ephemeral key with %d bits",
|
||||
cert_info.rsa_tmp_bits);
|
||||
EMIT_SIGNAL (XP_TE_SSLMESSAGE, serv->server_session, buf, NULL, NULL,
|
||||
NULL, 0);
|
||||
}*/
|
||||
g_snprintf (buf, sizeof (buf), " Sign algorithm %s",
|
||||
cert_info.sign_algorithm/*, cert_info.sign_algorithm_bits*/);
|
||||
EMIT_SIGNAL (XP_TE_SSLMESSAGE, serv->server_session, buf, NULL, NULL,
|
||||
@@ -675,8 +658,6 @@ ssl_do_connect (server * serv)
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* g_snprintf (buf, sizeof (buf), "* Verify OK (?)"); */
|
||||
/* EMIT_SIGNAL (XP_TE_SSLMESSAGE, serv->server_session, buf, NULL, NULL, NULL, 0); */
|
||||
case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
|
||||
case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE:
|
||||
case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
|
||||
@@ -1447,6 +1428,16 @@ server_child (server * serv)
|
||||
GProxyResolver *resolver;
|
||||
GError *error = NULL;
|
||||
|
||||
/*
|
||||
* In Flatpak, auto proxy resolution may block indefinitely when
|
||||
* proxy backends are unavailable in the sandbox. If this happens,
|
||||
* the connection attempt appears to hang after pressing Connect.
|
||||
* Prefer direct connections there unless the user configured a
|
||||
* specific proxy manually.
|
||||
*/
|
||||
if (g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS))
|
||||
goto proxy_lookup_done;
|
||||
|
||||
resolver = g_proxy_resolver_get_default ();
|
||||
url = g_strdup_printf ("irc://%s:%d", hostname, port);
|
||||
proxy_list = g_proxy_resolver_lookup (resolver, url, NULL, &error);
|
||||
@@ -1477,6 +1468,8 @@ server_child (server * serv)
|
||||
|
||||
g_strfreev (proxy_list);
|
||||
g_free (url);
|
||||
|
||||
proxy_lookup_done:;
|
||||
}
|
||||
|
||||
if (prefs.hex_net_proxy_host[0] &&
|
||||
@@ -1858,11 +1851,9 @@ server_set_defaults (server *serv)
|
||||
char *
|
||||
server_get_network (server *serv, gboolean fallback)
|
||||
{
|
||||
/* check the network list */
|
||||
if (serv->network)
|
||||
return ((ircnet *)serv->network)->name;
|
||||
|
||||
/* check the network name given in 005 NETWORK=... */
|
||||
if (serv->server_session && *serv->server_session->channel)
|
||||
return serv->server_session->channel;
|
||||
|
||||
@@ -1881,7 +1872,6 @@ server_set_name (server *serv, char *name)
|
||||
if (name[0] == 0)
|
||||
name = serv->hostname;
|
||||
|
||||
/* strncpy parameters must NOT overlap */
|
||||
if (name != serv->servername)
|
||||
{
|
||||
safe_strcpy (serv->servername, name, sizeof (serv->servername));
|
||||
|
||||
@@ -1065,7 +1065,7 @@ servlist_load (void)
|
||||
}
|
||||
}
|
||||
if (buf[0] == 'N')
|
||||
net = servlist_net_add (buf + 2, /* comment */ NULL, FALSE);
|
||||
net = servlist_net_add (buf + 2, NULL, FALSE);
|
||||
}
|
||||
fclose (fp);
|
||||
|
||||
|
||||
@@ -125,8 +125,4 @@ GSList *servlist_favchan_listadd (GSList *chanlist, char *channel, char *key);
|
||||
|
||||
gboolean joinlist_is_in_list (server *serv, char *channel);
|
||||
|
||||
/* FIXME
|
||||
void joinlist_split (char *autojoin, GSList **channels, GSList **keys);
|
||||
void joinlist_free (GSList *channels, GSList *keys);
|
||||
*/
|
||||
#endif
|
||||
|
||||
@@ -465,7 +465,6 @@ static char *read_hdd_info (IWbemClassObject *object)
|
||||
|
||||
if (name_len >= 4 && name_bstr[0] == L'\\' && name_bstr[1] == L'\\' && name_bstr[2] == L'?' && name_bstr[3] == L'\\')
|
||||
{
|
||||
// This is not a named volume. Skip it.
|
||||
VariantClear (&name_variant);
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -95,7 +95,6 @@ url_save_node (char* url)
|
||||
{
|
||||
FILE *fd;
|
||||
|
||||
/* open <config>/url.log in append mode */
|
||||
fd = zoitechat_fopen_file ("url.log", "a", 0);
|
||||
if (fd == NULL)
|
||||
{
|
||||
@@ -118,7 +117,6 @@ url_add (char *urltext, int len)
|
||||
char *data;
|
||||
int size;
|
||||
|
||||
/* we don't need any URLs if we have neither URL grabbing nor URL logging enabled */
|
||||
if (!prefs.hex_url_grabber && !prefs.hex_url_logging)
|
||||
{
|
||||
return;
|
||||
@@ -126,12 +124,11 @@ url_add (char *urltext, int len)
|
||||
|
||||
data = g_strndup (urltext, len);
|
||||
|
||||
if (data[len - 1] == '.') /* chop trailing dot */
|
||||
if (data[len - 1] == '.')
|
||||
{
|
||||
len--;
|
||||
data[len] = 0;
|
||||
}
|
||||
/* chop trailing ) but only if there's no counterpart */
|
||||
if (data[len - 1] == ')' && strchr (data, '(') == NULL)
|
||||
{
|
||||
data[len - 1] = 0;
|
||||
@@ -142,7 +139,6 @@ url_add (char *urltext, int len)
|
||||
url_save_node (data);
|
||||
}
|
||||
|
||||
/* the URL is saved already, only continue if we need the URL grabber too */
|
||||
if (!prefs.hex_url_grabber)
|
||||
{
|
||||
g_free (data);
|
||||
@@ -162,11 +158,8 @@ url_add (char *urltext, int len)
|
||||
}
|
||||
|
||||
size = tree_size (url_tree);
|
||||
/* 0 is unlimited */
|
||||
if (prefs.hex_url_grabber_limit > 0 && size >= prefs.hex_url_grabber_limit)
|
||||
{
|
||||
/* the loop is necessary to handle having the limit lowered while
|
||||
ZoiteChat is running */
|
||||
size -= prefs.hex_url_grabber_limit;
|
||||
for(; size > 0; size--)
|
||||
{
|
||||
@@ -183,10 +176,6 @@ url_add (char *urltext, int len)
|
||||
fe_url_add (data);
|
||||
}
|
||||
|
||||
/* check if a word is clickable. This is called on mouse motion events, so
|
||||
keep it FAST! This new version was found to be almost 3x faster than
|
||||
2.4.4 release. */
|
||||
|
||||
static int laststart = 0;
|
||||
static int lastend = 0;
|
||||
static int lasttype = 0;
|
||||
@@ -234,7 +223,6 @@ match_nick (const char *word, int *start, int *end)
|
||||
if (!regex_match (re_nick (), word, start, end))
|
||||
return FALSE;
|
||||
|
||||
/* ignore matches with prefixes that the server doesn't use */
|
||||
if (strchr (NICKPRE, word[*start])
|
||||
&& !strchr (nick_prefixes, word[*start]))
|
||||
return FALSE;
|
||||
|
||||
@@ -169,13 +169,12 @@ errorstring (int err)
|
||||
return tbuf;
|
||||
}
|
||||
}
|
||||
} /* ! if (osvi.dwMajorVersion >= 5) */
|
||||
}
|
||||
|
||||
/* fallback to error number */
|
||||
sprintf (tbuf, "%s %d", _("Error"), err);
|
||||
return tbuf;
|
||||
} /* ! if (err >= WSABASEERR) */
|
||||
#endif /* ! WIN32 */
|
||||
}
|
||||
#endif
|
||||
|
||||
return strerror (err);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -24,14 +24,16 @@
|
||||
#include <glib/gi18n.h>
|
||||
#include <gio/gio.h>
|
||||
|
||||
#include <time.h> /* need time_t */
|
||||
#include <time.h>
|
||||
|
||||
#ifndef ZOITECHAT_H
|
||||
#define ZOITECHAT_H
|
||||
|
||||
gboolean zoitechat_theme_path_from_arg (const char *arg, char **path_out);
|
||||
gboolean zoitechat_import_theme (const char *path, GError **error);
|
||||
gboolean zoitechat_apply_theme (const char *theme_name, GError **error);
|
||||
/* Imports a GTK3 theme archive into ZoiteChat's own gtk3-themes store. */
|
||||
gboolean zoitechat_import_gtk3_theme_archive (const char *archive_path,
|
||||
char **theme_name_out,
|
||||
GError **error);
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
#ifdef __APPLE__
|
||||
@@ -44,11 +46,11 @@ gboolean zoitechat_apply_theme (const char *theme_name, GError **error);
|
||||
#include "tree.h"
|
||||
|
||||
#ifdef USE_OPENSSL
|
||||
#include <openssl/ssl.h> /* SSL_() */
|
||||
#include <openssl/ssl.h>
|
||||
#include "scram.h"
|
||||
#endif
|
||||
|
||||
#ifdef __EMX__ /* for o/s 2 */
|
||||
#ifdef __EMX__
|
||||
#define OFLAGS O_BINARY
|
||||
#define g_ascii_strcasecmp stricmp
|
||||
#define g_ascii_strncasecmp strnicmp
|
||||
@@ -59,7 +61,7 @@ gboolean zoitechat_apply_theme (const char *theme_name, GError **error);
|
||||
/* force a 32bit CMP.L */
|
||||
#define WORDL(c0, c1, c2, c3) (guint32)(c0 | (c1 << 8) | (c2 << 16) | (c3 << 24))
|
||||
|
||||
#ifdef WIN32 /* for win32 */
|
||||
#ifdef WIN32
|
||||
#define OFLAGS O_BINARY
|
||||
#define sleep(t) Sleep(t*1000)
|
||||
#include <direct.h>
|
||||
@@ -71,7 +73,7 @@ gboolean zoitechat_apply_theme (const char *theme_name, GError **error);
|
||||
#define S_ISDIR(m) ((m) & _S_IFDIR)
|
||||
#endif
|
||||
#define NETWORK_PRIVATE
|
||||
#else /* for unix */
|
||||
#else
|
||||
#define OFLAGS 0
|
||||
#endif
|
||||
|
||||
@@ -295,6 +297,7 @@ struct zoitechatprefs
|
||||
char hex_dcc_completed_dir[PATHLEN + 1];
|
||||
char hex_dcc_dir[PATHLEN + 1];
|
||||
char hex_dcc_ip[DOMAINLEN + 1];
|
||||
char hex_gui_gtk3_theme_name[128];
|
||||
char hex_gui_ulist_doubleclick[256];
|
||||
char hex_input_command_char[4];
|
||||
char hex_irc_extra_hilight[300];
|
||||
|
||||
@@ -137,11 +137,7 @@ ascii_open (void)
|
||||
if (table_pos[0] == '\n' || i == 0)
|
||||
{
|
||||
table_pos++;
|
||||
#if HAVE_GTK3
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
#elif !HAVE_GTK3
|
||||
hbox = gtk_hbox_new (0, 0);
|
||||
#endif
|
||||
gtk_container_add (GTK_CONTAINER (vbox), hbox);
|
||||
gtk_widget_show (hbox);
|
||||
i++;
|
||||
|
||||
@@ -37,16 +37,9 @@
|
||||
#include "maingui.h"
|
||||
#include "banlist.h"
|
||||
|
||||
#if HAVE_GTK3
|
||||
#define ICON_BANLIST_REMOVE "list-remove"
|
||||
#define ICON_BANLIST_CLEAR "edit-clear"
|
||||
#define ICON_BANLIST_REFRESH "view-refresh"
|
||||
#endif
|
||||
#if !HAVE_GTK3
|
||||
#define ICON_BANLIST_REMOVE GTK_STOCK_REMOVE
|
||||
#define ICON_BANLIST_CLEAR GTK_STOCK_CLEAR
|
||||
#define ICON_BANLIST_REFRESH GTK_STOCK_REFRESH
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These supports_* routines set capable, readable, writable bits */
|
||||
@@ -495,7 +488,6 @@ banlist_unban_inner (gpointer none, banlist_info *banl, int mode_num)
|
||||
int num_sel, i;
|
||||
|
||||
|
||||
/* grab the list of selected items */
|
||||
model = GTK_TREE_MODEL (get_store (sess));
|
||||
sel = gtk_tree_view_get_selection (get_view (sess));
|
||||
|
||||
@@ -508,14 +500,11 @@ banlist_unban_inner (gpointer none, banlist_info *banl, int mode_num)
|
||||
{
|
||||
if (gtk_tree_selection_iter_is_selected (sel, &iter))
|
||||
{
|
||||
/* Get the mask part of this selected line */
|
||||
gtk_tree_model_get (model, &iter, TYPE_COLUMN, &type, MASK_COLUMN, &mask, -1);
|
||||
|
||||
/* If it's the wrong type of mask, just continue */
|
||||
if (strcmp (_(modes[mode_num].type), type) != 0)
|
||||
continue;
|
||||
|
||||
/* Otherwise add it to our array of mask pointers */
|
||||
masks[num_sel++] = g_strdup (mask);
|
||||
g_free (mask);
|
||||
g_free (type);
|
||||
@@ -523,11 +512,9 @@ banlist_unban_inner (gpointer none, banlist_info *banl, int mode_num)
|
||||
}
|
||||
while (gtk_tree_model_iter_next (model, &iter));
|
||||
|
||||
/* and send to server */
|
||||
if (num_sel)
|
||||
send_channel_modes (sess, tbuf, masks, 0, num_sel, '-', modes[mode_num].letter, 0);
|
||||
|
||||
/* now free everything */
|
||||
for (i=0; i < num_sel; i++)
|
||||
g_free (masks[i]);
|
||||
g_free (masks);
|
||||
@@ -543,7 +530,6 @@ banlist_unban (GtkWidget * wid, banlist_info *banl)
|
||||
for (i = 0; i < MODE_CT; i++)
|
||||
num += banlist_unban_inner (wid, banl, i);
|
||||
|
||||
/* This really should not occur with the redesign */
|
||||
if (num < 1)
|
||||
{
|
||||
fe_message (_("You must select some bans."), FE_MSG_ERROR);
|
||||
@@ -576,7 +562,10 @@ banlist_clear (GtkWidget * wid, banlist_info *banl)
|
||||
|
||||
dialog = gtk_message_dialog_new (NULL, 0,
|
||||
GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL,
|
||||
_("Are you sure you want to remove all listed items in %s?"), banl->sess->channel);
|
||||
_("Are you sure you want to remove all listed items in %s?"), banl->sess->channel);
|
||||
/* Window classes are required for GTK CSS selectors like
|
||||
* .zoitechat-dark / .zoitechat-light. */
|
||||
fe_apply_theme_to_toplevel (dialog);
|
||||
|
||||
g_signal_connect (G_OBJECT (dialog), "response",
|
||||
G_CALLBACK (banlist_clear_cb), banl);
|
||||
@@ -609,14 +598,11 @@ banlist_crop (GtkWidget * wid, banlist_info *banl)
|
||||
GSList *list = NULL, *node;
|
||||
int num_sel;
|
||||
|
||||
/* remember which bans are selected */
|
||||
select = gtk_tree_view_get_selection (get_view (sess));
|
||||
/* gtk_tree_selected_get_selected_rows() isn't present in gtk 2.0.x */
|
||||
gtk_tree_selection_selected_foreach (select, banlist_add_selected_cb,
|
||||
&list);
|
||||
|
||||
num_sel = g_slist_length (list);
|
||||
/* select all, then unselect those that we remembered */
|
||||
if (num_sel)
|
||||
{
|
||||
gtk_tree_selection_select_all (select);
|
||||
@@ -645,7 +631,7 @@ banlist_toggle (GtkWidget *item, gpointer data)
|
||||
break;
|
||||
}
|
||||
|
||||
if (bit) /* Should be gassert() */
|
||||
if (bit)
|
||||
{
|
||||
banl->checked &= ~bit;
|
||||
banl->checked |= (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (item)))? bit: 0;
|
||||
@@ -788,11 +774,7 @@ banlist_table_new (void)
|
||||
{
|
||||
GtkWidget *table = gtkutil_grid_new (1, MODE_CT, FALSE);
|
||||
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_set_column_spacing (GTK_GRID (table), 16);
|
||||
#else
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 16);
|
||||
#endif
|
||||
return table;
|
||||
}
|
||||
|
||||
@@ -857,13 +839,8 @@ banlist_opengui (struct session *sess)
|
||||
GTKUTIL_ATTACH_FILL, GTKUTIL_ATTACH_FILL, 0, 0);
|
||||
}
|
||||
|
||||
#if HAVE_GTK3
|
||||
bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
|
||||
#elif !HAVE_GTK3
|
||||
bbox = gtk_hbutton_box_new ();
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
|
||||
#endif
|
||||
gtk_container_set_border_width (GTK_CONTAINER (bbox), 5);
|
||||
gtk_box_pack_end (GTK_BOX (vbox), bbox, 0, 0, 0);
|
||||
gtk_widget_show (bbox);
|
||||
|
||||
@@ -77,15 +77,10 @@ chanlistrow;
|
||||
static void
|
||||
chanlist_set_label_alignment (GtkWidget *widget)
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_halign (widget, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
|
||||
#elif !HAVE_GTK3
|
||||
gtk_misc_set_alignment (GTK_MISC (widget), 0, 0.5);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if HAVE_GTK3
|
||||
static void
|
||||
chanlist_grid_attach (GtkWidget *grid, GtkWidget *child,
|
||||
gint column, gint row,
|
||||
@@ -99,19 +94,14 @@ chanlist_grid_attach (GtkWidget *grid, GtkWidget *child,
|
||||
gtk_widget_set_valign (child, valign);
|
||||
gtk_grid_attach (GTK_GRID (grid), child, column, row, width, height);
|
||||
}
|
||||
#endif
|
||||
|
||||
static GtkWidget *
|
||||
chanlist_box_new (void)
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
|
||||
gtk_box_set_homogeneous (GTK_BOX (box), FALSE);
|
||||
return box;
|
||||
#elif !HAVE_GTK3
|
||||
return gtk_hbox_new (FALSE, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
@@ -136,7 +126,6 @@ chanlist_icon_menu_item (const char *label, const char *icon_name,
|
||||
GCallback callback, gpointer userdata)
|
||||
{
|
||||
GtkWidget *item;
|
||||
#if HAVE_GTK3
|
||||
GtkWidget *box;
|
||||
GtkWidget *image = NULL;
|
||||
GtkWidget *label_widget;
|
||||
@@ -149,13 +138,6 @@ chanlist_icon_menu_item (const char *label, const char *icon_name,
|
||||
gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (box), label_widget, FALSE, FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (item), box);
|
||||
#else
|
||||
GtkWidget *image;
|
||||
|
||||
item = gtk_image_menu_item_new_with_mnemonic (label);
|
||||
image = gtkutil_image_new_from_stock (icon_name, GTK_ICON_SIZE_MENU);
|
||||
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
|
||||
#endif
|
||||
g_signal_connect (G_OBJECT (item), "activate", callback, userdata);
|
||||
gtk_widget_show_all (item);
|
||||
|
||||
@@ -735,7 +717,6 @@ chanlist_button_cb (GtkTreeView *tree, GdkEventButton *event, server *serv)
|
||||
menu_addfavoritemenu (serv, menu, chan, FALSE);
|
||||
g_free (chan);
|
||||
|
||||
#if HAVE_GTK3
|
||||
if (event)
|
||||
{
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *)event);
|
||||
@@ -747,10 +728,6 @@ chanlist_button_cb (GtkTreeView *tree, GdkEventButton *event, server *serv)
|
||||
GDK_GRAVITY_NORTH_WEST,
|
||||
NULL);
|
||||
}
|
||||
#endif
|
||||
#if !HAVE_GTK3
|
||||
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, event ? event->time : 0);
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -902,108 +879,48 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
|
||||
/* ============================================================= */
|
||||
|
||||
#if HAVE_GTK3
|
||||
table = gtk_grid_new ();
|
||||
gtk_grid_set_column_spacing (GTK_GRID (table), 12);
|
||||
gtk_grid_set_row_spacing (GTK_GRID (table), 3);
|
||||
#else
|
||||
table = gtk_table_new (4, 4, FALSE);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 12);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 3);
|
||||
#endif
|
||||
gtk_box_pack_start (GTK_BOX (vbox), table, 0, 1, 0);
|
||||
gtk_widget_show (table);
|
||||
|
||||
#if HAVE_GTK3
|
||||
wid = chanlist_icon_button (_("_Search"), ICON_CHANLIST_FIND,
|
||||
G_CALLBACK (chanlist_search_pressed), serv);
|
||||
#endif
|
||||
#if !HAVE_GTK3
|
||||
wid = gtkutil_button (NULL, ICON_CHANLIST_FIND, 0, chanlist_search_pressed, serv,
|
||||
_("_Search"));
|
||||
#endif
|
||||
serv->gui->chanlist_search = wid;
|
||||
#if HAVE_GTK3
|
||||
chanlist_grid_attach (table, wid, 3, 3, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_FILL);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 3, 4, 3, 4,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
#endif
|
||||
|
||||
#if HAVE_GTK3
|
||||
wid = chanlist_icon_button (_("_Download List"), ICON_CHANLIST_REFRESH,
|
||||
G_CALLBACK (chanlist_refresh), serv);
|
||||
#endif
|
||||
#if !HAVE_GTK3
|
||||
wid = gtkutil_button (NULL, ICON_CHANLIST_REFRESH, 0, chanlist_refresh, serv,
|
||||
_("_Download List"));
|
||||
#endif
|
||||
serv->gui->chanlist_refresh = wid;
|
||||
#if HAVE_GTK3
|
||||
chanlist_grid_attach (table, wid, 3, 2, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_FILL);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 3, 4, 2, 3,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
#endif
|
||||
|
||||
#if HAVE_GTK3
|
||||
wid = chanlist_icon_button (_("Save _List..."), ICON_CHANLIST_SAVE,
|
||||
G_CALLBACK (chanlist_save), serv);
|
||||
#endif
|
||||
#if !HAVE_GTK3
|
||||
wid = gtkutil_button (NULL, ICON_CHANLIST_SAVE, 0, chanlist_save, serv,
|
||||
_("Save _List..."));
|
||||
#endif
|
||||
serv->gui->chanlist_savelist = wid;
|
||||
#if HAVE_GTK3
|
||||
chanlist_grid_attach (table, wid, 3, 1, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_FILL);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 3, 4, 1, 2,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
#endif
|
||||
|
||||
#if HAVE_GTK3
|
||||
wid = chanlist_icon_button (_("_Join Channel"), ICON_CHANLIST_JOIN,
|
||||
G_CALLBACK (chanlist_join), serv);
|
||||
#endif
|
||||
#if !HAVE_GTK3
|
||||
wid = gtkutil_button (NULL, ICON_CHANLIST_JOIN, 0, chanlist_join, serv,
|
||||
_("_Join Channel"));
|
||||
#endif
|
||||
serv->gui->chanlist_join = wid;
|
||||
#if HAVE_GTK3
|
||||
chanlist_grid_attach (table, wid, 3, 0, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_FILL);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 3, 4, 0, 1,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
#endif
|
||||
|
||||
/* ============================================================= */
|
||||
|
||||
wid = gtk_label_new (_("Show only:"));
|
||||
chanlist_set_label_alignment (wid);
|
||||
#if HAVE_GTK3
|
||||
chanlist_grid_attach (table, wid, 0, 3, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_START, GTK_ALIGN_CENTER);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 0, 1, 3, 4,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
#endif
|
||||
gtk_widget_show (wid);
|
||||
|
||||
hbox = chanlist_box_new ();
|
||||
gtk_box_set_spacing (GTK_BOX (hbox), 9);
|
||||
#if HAVE_GTK3
|
||||
chanlist_grid_attach (table, hbox, 1, 3, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_FILL);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, 3, 4,
|
||||
GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
wid = gtk_label_new (_("channels with"));
|
||||
@@ -1039,24 +956,14 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
|
||||
wid = gtk_label_new (_("Look in:"));
|
||||
chanlist_set_label_alignment (wid);
|
||||
#if HAVE_GTK3
|
||||
chanlist_grid_attach (table, wid, 0, 2, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_START, GTK_ALIGN_CENTER);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 0, 1, 2, 3,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
#endif
|
||||
gtk_widget_show (wid);
|
||||
|
||||
hbox = chanlist_box_new ();
|
||||
gtk_box_set_spacing (GTK_BOX (hbox), 12);
|
||||
#if HAVE_GTK3
|
||||
chanlist_grid_attach (table, hbox, 1, 2, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_FILL);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, 2, 3,
|
||||
GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
wid = gtk_check_button_new_with_label (_("Channel name"));
|
||||
@@ -1081,13 +988,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
|
||||
wid = gtk_label_new (_("Search type:"));
|
||||
chanlist_set_label_alignment (wid);
|
||||
#if HAVE_GTK3
|
||||
chanlist_grid_attach (table, wid, 0, 1, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_START, GTK_ALIGN_CENTER);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 0, 1, 1, 2,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
#endif
|
||||
gtk_widget_show (wid);
|
||||
|
||||
wid = gtk_combo_box_text_new ();
|
||||
@@ -1095,13 +997,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (wid), _("Pattern Match (Wildcards)"));
|
||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (wid), _("Regular Expression"));
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (wid), serv->gui->chanlist_search_type);
|
||||
#if HAVE_GTK3
|
||||
chanlist_grid_attach (table, wid, 1, 1, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_CENTER);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 1, 2, 1, 2,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
#endif
|
||||
g_signal_connect (G_OBJECT (wid), "changed",
|
||||
G_CALLBACK (chanlist_combo_cb), serv);
|
||||
gtk_widget_show (wid);
|
||||
@@ -1110,13 +1007,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
|
||||
wid = gtk_label_new (_("Find:"));
|
||||
chanlist_set_label_alignment (wid);
|
||||
#if HAVE_GTK3
|
||||
chanlist_grid_attach (table, wid, 0, 0, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_START, GTK_ALIGN_CENTER);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 0, 1, 0, 1,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
#endif
|
||||
gtk_widget_show (wid);
|
||||
|
||||
wid = gtk_entry_new ();
|
||||
@@ -1126,13 +1018,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
g_signal_connect (G_OBJECT (wid), "activate",
|
||||
G_CALLBACK (chanlist_search_pressed),
|
||||
(gpointer) serv);
|
||||
#if HAVE_GTK3
|
||||
chanlist_grid_attach (table, wid, 1, 0, 1, 1, TRUE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_CENTER);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 1, 2, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, 0, 0, 0);
|
||||
#endif
|
||||
gtk_widget_show (wid);
|
||||
serv->gui->chanlist_wild = wid;
|
||||
|
||||
@@ -1140,18 +1027,9 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
|
||||
/* ============================================================= */
|
||||
|
||||
#if HAVE_GTK3
|
||||
wid = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
|
||||
#else
|
||||
wid = gtk_vseparator_new ();
|
||||
#endif
|
||||
#if HAVE_GTK3
|
||||
chanlist_grid_attach (table, wid, 2, 0, 1, 5, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_FILL);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 2, 3, 0, 5,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
#endif
|
||||
gtk_widget_show (wid);
|
||||
|
||||
g_signal_connect (G_OBJECT (serv->gui->chanlist_window), "destroy",
|
||||
|
||||
@@ -27,12 +27,7 @@ typedef struct
|
||||
GtkWidget *b2; /* button2 */
|
||||
} tabview;
|
||||
|
||||
#if HAVE_GTK3
|
||||
#define ICON_CHANVIEW_CLOSE "window-close"
|
||||
#endif
|
||||
#if !HAVE_GTK3
|
||||
#define ICON_CHANVIEW_CLOSE GTK_STOCK_CLOSE
|
||||
#endif
|
||||
|
||||
static void chanview_populate (chanview *cv);
|
||||
|
||||
@@ -57,17 +52,10 @@ cv_tabs_get_viewport_size (GdkWindow *parent_win, gboolean vertical)
|
||||
{
|
||||
gint viewport_size = 0;
|
||||
|
||||
#if HAVE_GTK3
|
||||
if (vertical)
|
||||
viewport_size = gdk_window_get_height (parent_win);
|
||||
else
|
||||
viewport_size = gdk_window_get_width (parent_win);
|
||||
#else
|
||||
if (vertical)
|
||||
gdk_window_get_geometry (parent_win, 0, 0, 0, &viewport_size, 0);
|
||||
else
|
||||
gdk_window_get_geometry (parent_win, 0, 0, &viewport_size, 0, 0);
|
||||
#endif
|
||||
|
||||
return viewport_size;
|
||||
}
|
||||
@@ -202,11 +190,11 @@ tab_scroll_left_up_clicked (GtkWidget *widget, chanview *cv)
|
||||
|
||||
gtk_adjustment_set_value (adj, new_value);
|
||||
|
||||
tab_left_is_moving = 0; /* hSP: set to false in case we didnt get stopped (the normal case) */
|
||||
tab_left_is_moving = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
tab_left_is_moving = 0; /* hSP: jump directly to next element if user is clicking faster than we can scroll.. */
|
||||
tab_left_is_moving = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,11 +239,11 @@ tab_scroll_right_down_clicked (GtkWidget *widget, chanview *cv)
|
||||
|
||||
gtk_adjustment_set_value (adj, new_value);
|
||||
|
||||
tab_right_is_moving = 0; /* hSP: set to false in case we didnt get stopped (the normal case) */
|
||||
tab_right_is_moving = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
tab_right_is_moving = 0; /* hSP: jump directly to next element if user is clicking faster than we can scroll.. */
|
||||
tab_right_is_moving = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,12 +281,9 @@ static GtkWidget *
|
||||
make_sbutton (GtkArrowType type, void *click_cb, void *userdata)
|
||||
{
|
||||
GtkWidget *button, *arrow;
|
||||
#if HAVE_GTK3
|
||||
const char *icon_name = "pan-end-symbolic";
|
||||
#endif
|
||||
|
||||
button = gtk_button_new ();
|
||||
#if HAVE_GTK3
|
||||
switch (type)
|
||||
{
|
||||
case GTK_ARROW_UP:
|
||||
@@ -317,9 +302,6 @@ make_sbutton (GtkArrowType type, void *click_cb, void *userdata)
|
||||
}
|
||||
|
||||
arrow = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON);
|
||||
#elif !HAVE_GTK3
|
||||
arrow = gtk_arrow_new (type, GTK_SHADOW_NONE);
|
||||
#endif
|
||||
gtk_container_add (GTK_CONTAINER (button), arrow);
|
||||
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
@@ -350,7 +332,6 @@ cv_tabs_init (chanview *cv)
|
||||
((tabview *)cv)->outer = outer;
|
||||
g_signal_connect (G_OBJECT (outer), "size_allocate",
|
||||
G_CALLBACK (cv_tabs_sizealloc), cv);
|
||||
/* gtk_container_set_border_width (GTK_CONTAINER (outer), 2);*/
|
||||
gtk_widget_show (outer);
|
||||
|
||||
viewport = gtk_viewport_new (0, 0);
|
||||
@@ -546,20 +527,12 @@ tab_add_real (chanview *cv, GtkWidget *tab, chan *ch)
|
||||
{
|
||||
/* vertical */
|
||||
box = gtkutil_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 0);
|
||||
#if HAVE_GTK3
|
||||
sep = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
#elif !HAVE_GTK3
|
||||
sep = gtk_hseparator_new ();
|
||||
#endif
|
||||
} else
|
||||
{
|
||||
/* horiz */
|
||||
box = gtkutil_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
|
||||
#if HAVE_GTK3
|
||||
sep = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
|
||||
#elif !HAVE_GTK3
|
||||
sep = gtk_vseparator_new ();
|
||||
#endif
|
||||
}
|
||||
|
||||
gtk_box_pack_end (GTK_BOX (box), sep, 0, 0, 4);
|
||||
@@ -600,7 +573,7 @@ tab_pressed_cb (GtkToggleButton *tab, chan *ch)
|
||||
ignore_toggle = FALSE;
|
||||
cv->focused = ch;
|
||||
|
||||
if (/*tab->active*/is_switching)
|
||||
if (is_switching)
|
||||
/* call the focus callback */
|
||||
cv->cb_focus (cv, ch, ch->tag, ch->userdata);
|
||||
}
|
||||
|
||||
@@ -137,21 +137,11 @@ cv_tree_init (chanview *cv)
|
||||
gtk_widget_set_vexpand (view, TRUE);
|
||||
gtk_widget_set_name (view, "zoitechat-tree");
|
||||
if (
|
||||
#if HAVE_GTK3
|
||||
cv->font_desc
|
||||
#else
|
||||
cv->style
|
||||
#endif
|
||||
)
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
gtkutil_apply_palette (view, &colors[COL_BG], &colors[COL_FG],
|
||||
cv->font_desc);
|
||||
#else
|
||||
gtkutil_apply_palette (view, &cv->style->base[GTK_STATE_NORMAL],
|
||||
&cv->style->text[GTK_STATE_NORMAL],
|
||||
cv->style->font_desc);
|
||||
#endif
|
||||
}
|
||||
/*gtk_widget_modify_base (view, GTK_STATE_NORMAL, &colors[COL_BG]);*/
|
||||
gtk_widget_set_can_focus (view, FALSE);
|
||||
|
||||
@@ -46,11 +46,7 @@ struct _chanview
|
||||
int size; /* number of channels in view */
|
||||
|
||||
GtkWidget *box; /* the box we destroy when changing implementations */
|
||||
#if HAVE_GTK3
|
||||
PangoFontDescription *font_desc; /* font used for tree */
|
||||
#else
|
||||
InputStyle *style; /* style used for tree */
|
||||
#endif
|
||||
chan *focused; /* currently focused channel */
|
||||
int trunc_len;
|
||||
|
||||
@@ -131,15 +127,15 @@ chanview_apply_theme (chanview *cv)
|
||||
if (input_style)
|
||||
font = input_style->font_desc;
|
||||
|
||||
if (fe_dark_mode_is_enabled () || prefs.hex_gui_dark_mode == ZOITECHAT_DARK_MODE_LIGHT)
|
||||
{
|
||||
gtkutil_apply_palette (w, &colors[COL_BG], &colors[COL_FG], font);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Keep list font in sync while reverting colors to theme defaults. */
|
||||
gtkutil_apply_palette (w, NULL, NULL, font);
|
||||
}
|
||||
/*
|
||||
* setup_apply_to_sess() and palette_apply_dark_mode() treat all dark-mode
|
||||
* preference modes as palette-driven: dark uses curated dark colors, while
|
||||
* light/auto-light use the user's saved palette.
|
||||
*
|
||||
* Keep chanview aligned with that resolved behavior so AUTO doesn't
|
||||
* accidentally revert to theme defaults and clear custom colors.
|
||||
*/
|
||||
gtkutil_apply_palette (w, &colors[COL_BG], &colors[COL_FG], font);
|
||||
}
|
||||
|
||||
static char *
|
||||
@@ -301,11 +297,7 @@ chanview_box_destroy_cb (GtkWidget *box, chanview *cv)
|
||||
|
||||
chanview *
|
||||
chanview_new (int type, int trunc_len, gboolean sort, gboolean use_icons,
|
||||
#if HAVE_GTK3
|
||||
PangoFontDescription *font_desc
|
||||
#else
|
||||
InputStyle *style
|
||||
#endif
|
||||
)
|
||||
{
|
||||
chanview *cv;
|
||||
@@ -313,16 +305,8 @@ chanview_new (int type, int trunc_len, gboolean sort, gboolean use_icons,
|
||||
cv = g_new0 (chanview, 1);
|
||||
cv->store = gtk_tree_store_new (5, G_TYPE_STRING, G_TYPE_POINTER,
|
||||
PANGO_TYPE_ATTR_LIST, GDK_TYPE_PIXBUF, G_TYPE_INT);
|
||||
#if HAVE_GTK3
|
||||
cv->font_desc = font_desc;
|
||||
#else
|
||||
cv->style = style;
|
||||
#endif
|
||||
#if HAVE_GTK3
|
||||
cv->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
#elif !HAVE_GTK3
|
||||
cv->box = gtk_hbox_new (0, 0);
|
||||
#endif
|
||||
cv->trunc_len = trunc_len;
|
||||
cv->sorted = sort;
|
||||
cv->use_icons = use_icons;
|
||||
|
||||
@@ -26,11 +26,7 @@ typedef struct _chanview chanview;
|
||||
typedef struct _chan chan;
|
||||
|
||||
chanview *chanview_new (int type, int trunc_len, gboolean sort, gboolean use_icons,
|
||||
#if HAVE_GTK3
|
||||
PangoFontDescription *font_desc
|
||||
#else
|
||||
InputStyle *style
|
||||
#endif
|
||||
);
|
||||
void chanview_set_callbacks (chanview *cv,
|
||||
void (*cb_focus) (chanview *, chan *, int tag, void *userdata),
|
||||
|
||||
@@ -73,11 +73,7 @@ chanlistrow;
|
||||
* structure. */
|
||||
struct _CustomList
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
GObject parent_instance;
|
||||
#else
|
||||
GObject parent;
|
||||
#endif
|
||||
|
||||
guint num_rows; /* number of rows that we have used */
|
||||
guint num_alloc; /* number of rows allocated */
|
||||
|
||||
@@ -37,18 +37,10 @@
|
||||
#include "palette.h"
|
||||
#include "maingui.h"
|
||||
|
||||
#if HAVE_GTK3
|
||||
#define ICON_DCC_CANCEL "dialog-cancel"
|
||||
#define ICON_DCC_ACCEPT "dialog-apply"
|
||||
#define ICON_DCC_RESUME "view-refresh"
|
||||
#define ICON_DCC_CLEAR "edit-clear"
|
||||
#endif
|
||||
#if !HAVE_GTK3
|
||||
#define ICON_DCC_CANCEL GTK_STOCK_CANCEL
|
||||
#define ICON_DCC_ACCEPT GTK_STOCK_APPLY
|
||||
#define ICON_DCC_RESUME GTK_STOCK_REFRESH
|
||||
#define ICON_DCC_CLEAR GTK_STOCK_CLEAR
|
||||
#endif
|
||||
|
||||
|
||||
enum /* DCC SEND/RECV */
|
||||
@@ -116,7 +108,6 @@ static short view_mode; /* 1=download 2=upload 3=both */
|
||||
#define VIEW_UPLOAD 2
|
||||
#define VIEW_BOTH 3
|
||||
|
||||
#if HAVE_GTK3
|
||||
static GdkPixbuf *
|
||||
dcc_load_icon (const char *stock_name)
|
||||
{
|
||||
@@ -134,7 +125,6 @@ dcc_load_icon (const char *stock_name)
|
||||
|
||||
return gtk_icon_theme_load_icon (theme, icon_name, width, 0, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
@@ -192,7 +182,6 @@ dcc_store_color (GtkListStore *store, GtkTreeIter *iter, int column, int color_i
|
||||
if (color_index != 1)
|
||||
color = &colors[color_index];
|
||||
|
||||
#if HAVE_GTK3
|
||||
if (color)
|
||||
{
|
||||
GdkRGBA rgba = *color;
|
||||
@@ -202,9 +191,6 @@ dcc_store_color (GtkListStore *store, GtkTreeIter *iter, int column, int color_i
|
||||
{
|
||||
gtk_list_store_set (store, iter, column, NULL, -1);
|
||||
}
|
||||
#else
|
||||
gtk_list_store_set (store, iter, column, color, -1);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -240,12 +226,7 @@ dcc_prepare_row_send (struct DCC *dcc, GtkListStore *store, GtkTreeIter *iter,
|
||||
float per;
|
||||
|
||||
if (!pix_up)
|
||||
#if HAVE_GTK3
|
||||
pix_up = dcc_load_icon ("gtk-go-up");
|
||||
#elif !HAVE_GTK3
|
||||
pix_up = gtk_widget_render_icon (dccfwin.window, "gtk-go-up",
|
||||
GTK_ICON_SIZE_MENU, NULL);
|
||||
#endif
|
||||
|
||||
/* percentage ack'ed */
|
||||
per = (float) ((dcc->ack * 100.00) / dcc->size);
|
||||
@@ -294,12 +275,7 @@ dcc_prepare_row_recv (struct DCC *dcc, GtkListStore *store, GtkTreeIter *iter,
|
||||
int to_go;
|
||||
|
||||
if (!pix_dn)
|
||||
#if HAVE_GTK3
|
||||
pix_dn = dcc_load_icon ("gtk-go-down");
|
||||
#elif !HAVE_GTK3
|
||||
pix_dn = gtk_widget_render_icon (dccfwin.window, "gtk-go-down",
|
||||
GTK_ICON_SIZE_MENU, NULL);
|
||||
#endif
|
||||
|
||||
proper_unit (dcc->size, size, sizeof (size));
|
||||
if (dcc->dccstat == STAT_QUEUED)
|
||||
@@ -791,31 +767,19 @@ dcc_detail_label (char *text, GtkWidget *box, int num)
|
||||
label = gtk_label_new (NULL);
|
||||
g_snprintf (buf, sizeof (buf), "<b>%s</b>", text);
|
||||
gtk_label_set_markup (GTK_LABEL (label), buf);
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (label, FALSE);
|
||||
gtk_widget_set_vexpand (label, FALSE);
|
||||
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (label, GTK_ALIGN_START);
|
||||
gtk_grid_attach (GTK_GRID (box), label, 0, 0 + num, 1, 1);
|
||||
#elif !HAVE_GTK3
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
|
||||
gtk_table_attach (GTK_TABLE (box), label, 0, 1, 0 + num, 1 + num,
|
||||
GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (label, FALSE);
|
||||
gtk_widget_set_vexpand (label, FALSE);
|
||||
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (label, GTK_ALIGN_START);
|
||||
gtk_grid_attach (GTK_GRID (box), label, 1, 0 + num, 1, 1);
|
||||
#elif !HAVE_GTK3
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
|
||||
gtk_table_attach (GTK_TABLE (box), label, 1, 2, 0 + num, 1 + num,
|
||||
GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
|
||||
return label;
|
||||
}
|
||||
@@ -914,100 +878,63 @@ fe_dcc_open_recv_win (int passive)
|
||||
g_signal_connect (G_OBJECT (view), "row-activated",
|
||||
G_CALLBACK (dcc_dclick_cb), NULL);
|
||||
|
||||
#if HAVE_GTK3
|
||||
table = gtk_grid_new ();
|
||||
gtk_grid_set_column_spacing (GTK_GRID (table), 16);
|
||||
#else
|
||||
table = gtk_table_new (1, 3, FALSE);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 16);
|
||||
#endif
|
||||
gtk_box_pack_start (GTK_BOX (vbox), table, 0, 0, 0);
|
||||
|
||||
radio = gtk_radio_button_new_with_mnemonic (NULL, _("Both"));
|
||||
g_signal_connect (G_OBJECT (radio), "toggled",
|
||||
G_CALLBACK (dcc_toggle), GINT_TO_POINTER (VIEW_BOTH));
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (radio, FALSE);
|
||||
gtk_widget_set_vexpand (radio, FALSE);
|
||||
gtk_widget_set_halign (radio, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (radio, GTK_ALIGN_FILL);
|
||||
gtk_grid_attach (GTK_GRID (table), radio, 3, 0, 1, 1);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), radio, 3, 4, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio));
|
||||
|
||||
radio = gtk_radio_button_new_with_mnemonic (group, _("Uploads"));
|
||||
g_signal_connect (G_OBJECT (radio), "toggled",
|
||||
G_CALLBACK (dcc_toggle), GINT_TO_POINTER (VIEW_UPLOAD));
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (radio, FALSE);
|
||||
gtk_widget_set_vexpand (radio, FALSE);
|
||||
gtk_widget_set_halign (radio, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (radio, GTK_ALIGN_FILL);
|
||||
gtk_grid_attach (GTK_GRID (table), radio, 1, 0, 1, 1);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), radio, 1, 2, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio));
|
||||
|
||||
radio = gtk_radio_button_new_with_mnemonic (group, _("Downloads"));
|
||||
g_signal_connect (G_OBJECT (radio), "toggled",
|
||||
G_CALLBACK (dcc_toggle), GINT_TO_POINTER (VIEW_DOWNLOAD));
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (radio, FALSE);
|
||||
gtk_widget_set_vexpand (radio, FALSE);
|
||||
gtk_widget_set_halign (radio, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (radio, GTK_ALIGN_FILL);
|
||||
gtk_grid_attach (GTK_GRID (table), radio, 2, 0, 1, 1);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), radio, 2, 3, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
|
||||
exp = gtk_expander_new (_("Details"));
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (exp, TRUE);
|
||||
gtk_widget_set_vexpand (exp, FALSE);
|
||||
gtk_widget_set_halign (exp, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (exp, GTK_ALIGN_FILL);
|
||||
gtk_grid_attach (GTK_GRID (table), exp, 0, 0, 1, 1);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), exp, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
|
||||
#if HAVE_GTK3
|
||||
detailbox = gtk_grid_new ();
|
||||
gtk_grid_set_column_spacing (GTK_GRID (detailbox), 6);
|
||||
gtk_grid_set_row_spacing (GTK_GRID (detailbox), 2);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (detailbox), 6);
|
||||
#else
|
||||
detailbox = gtk_table_new (3, 3, FALSE);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (detailbox), 6);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (detailbox), 2);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (detailbox), 6);
|
||||
#endif
|
||||
g_signal_connect (G_OBJECT (exp), "activate",
|
||||
G_CALLBACK (dcc_exp_cb), detailbox);
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (detailbox, TRUE);
|
||||
gtk_widget_set_vexpand (detailbox, FALSE);
|
||||
gtk_widget_set_halign (detailbox, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (detailbox, GTK_ALIGN_FILL);
|
||||
gtk_grid_attach (GTK_GRID (table), detailbox, 0, 1, 4, 1);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), detailbox, 0, 4, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
|
||||
dccfwin.file_label = dcc_detail_label (_("File:"), detailbox, 0);
|
||||
dccfwin.address_label = dcc_detail_label (_("Address:"), detailbox, 1);
|
||||
|
||||
#if HAVE_GTK3
|
||||
bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
|
||||
#elif !HAVE_GTK3
|
||||
bbox = gtk_hbutton_box_new ();
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
|
||||
#endif
|
||||
gtk_box_pack_end (GTK_BOX (vbox), bbox, FALSE, FALSE, 2);
|
||||
|
||||
dccfwin.abort_button = gtkutil_button (bbox, ICON_DCC_CANCEL, 0, abort_clicked, 0, _("Abort"));
|
||||
@@ -1209,13 +1136,8 @@ fe_dcc_open_chat_win (int passive)
|
||||
g_signal_connect (G_OBJECT (view), "row-activated",
|
||||
G_CALLBACK (dcc_chat_dclick_cb), NULL);
|
||||
|
||||
#if HAVE_GTK3
|
||||
bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
|
||||
#elif !HAVE_GTK3
|
||||
bbox = gtk_hbutton_box_new ();
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
|
||||
#endif
|
||||
gtk_box_pack_end (GTK_BOX (vbox), bbox, FALSE, FALSE, 2);
|
||||
|
||||
dcccwin.abort_button = gtkutil_button (bbox, ICON_DCC_CANCEL, 0, abort_chat_clicked, 0, _("Abort"));
|
||||
|
||||
@@ -42,18 +42,10 @@
|
||||
#include "maingui.h"
|
||||
#include "editlist.h"
|
||||
|
||||
#if HAVE_GTK3
|
||||
#define ICON_EDITLIST_NEW "document-new"
|
||||
#define ICON_EDITLIST_DELETE "edit-delete"
|
||||
#define ICON_EDITLIST_CANCEL "dialog-cancel"
|
||||
#define ICON_EDITLIST_SAVE "document-save"
|
||||
#endif
|
||||
#if !HAVE_GTK3
|
||||
#define ICON_EDITLIST_NEW GTK_STOCK_NEW
|
||||
#define ICON_EDITLIST_DELETE GTK_STOCK_DELETE
|
||||
#define ICON_EDITLIST_CANCEL GTK_STOCK_CANCEL
|
||||
#define ICON_EDITLIST_SAVE GTK_STOCK_SAVE
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -361,13 +353,8 @@ editlist_gui_open (char *title1, char *title2, GSList *list, char *title, char *
|
||||
if (help)
|
||||
gtk_widget_set_tooltip_text (view, help);
|
||||
|
||||
#if HAVE_GTK3
|
||||
box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (box), GTK_BUTTONBOX_SPREAD);
|
||||
#elif !HAVE_GTK3
|
||||
box = gtk_hbutton_box_new ();
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (box), GTK_BUTTONBOX_SPREAD);
|
||||
#endif
|
||||
gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, FALSE, 2);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box), 5);
|
||||
gtk_widget_show (box);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "fe-gtk.h"
|
||||
|
||||
@@ -105,6 +106,9 @@ create_msg_dialog (gchar *title, gchar *message)
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "%s", message);
|
||||
/* Window classes are required for GTK CSS selectors like
|
||||
* .zoitechat-dark / .zoitechat-light. */
|
||||
fe_apply_theme_to_toplevel (dialog);
|
||||
gtk_window_set_title (GTK_WINDOW (dialog), title);
|
||||
|
||||
/* On Win32 we automatically have the icon. If we try to load it explicitly, it will look ugly for some reason. */
|
||||
@@ -406,7 +410,12 @@ fe_args (int argc, char *argv[])
|
||||
/* of the exe. */
|
||||
{
|
||||
g_free (win32_argv0_dir);
|
||||
win32_argv0_dir = g_path_get_dirname (argv[0]);
|
||||
/* In subsystem:windows builds, argv can be absent/invalid depending on
|
||||
* launch context (e.g. shell URL handlers). Prefer the module path,
|
||||
* then only fall back to argv[0] when it is available. */
|
||||
win32_argv0_dir = g_win32_get_package_installation_directory_of_module (NULL);
|
||||
if (win32_argv0_dir == NULL && argc > 0 && argv != NULL && argv[0] != NULL)
|
||||
win32_argv0_dir = g_path_get_dirname (argv[0]);
|
||||
if (win32_argv0_dir)
|
||||
chdir (win32_argv0_dir);
|
||||
}
|
||||
@@ -537,10 +546,13 @@ static gboolean
|
||||
fe_system_prefers_dark (void)
|
||||
{
|
||||
GtkSettings *settings = gtk_settings_get_default ();
|
||||
gboolean theme_name_prefers_dark = FALSE;
|
||||
gboolean property_prefers_dark = FALSE;
|
||||
gboolean prefer_dark = FALSE;
|
||||
char *theme_name = NULL;
|
||||
#ifdef G_OS_WIN32
|
||||
gboolean have_win_pref = FALSE;
|
||||
gboolean win_prefers_dark = FALSE;
|
||||
|
||||
if (fe_win32_high_contrast_is_enabled ())
|
||||
return FALSE;
|
||||
@@ -549,37 +561,336 @@ fe_system_prefers_dark (void)
|
||||
if (!settings)
|
||||
return FALSE;
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
have_win_pref = fe_win32_try_get_system_dark (&prefer_dark);
|
||||
if (!have_win_pref)
|
||||
#endif
|
||||
g_object_get (settings, "gtk-theme-name", &theme_name, NULL);
|
||||
if (theme_name)
|
||||
{
|
||||
char *lower = g_ascii_strdown (theme_name, -1);
|
||||
if (g_str_has_suffix (lower, "-dark") || g_strrstr (lower, "dark"))
|
||||
theme_name_prefers_dark = TRUE;
|
||||
g_free (lower);
|
||||
g_free (theme_name);
|
||||
}
|
||||
|
||||
if (g_object_class_find_property (G_OBJECT_GET_CLASS (settings),
|
||||
"gtk-application-prefer-dark-theme"))
|
||||
{
|
||||
g_object_get (settings, "gtk-application-prefer-dark-theme", &prefer_dark, NULL);
|
||||
/* Even if we last wrote this property, the toolkit or desktop can update
|
||||
* it later, so AUTO mode should keep reading it as a signal. */
|
||||
g_object_get (settings, "gtk-application-prefer-dark-theme", &property_prefers_dark, NULL);
|
||||
}
|
||||
|
||||
if (!prefer_dark)
|
||||
{
|
||||
g_object_get (settings, "gtk-theme-name", &theme_name, NULL);
|
||||
if (theme_name)
|
||||
{
|
||||
char *lower = g_ascii_strdown (theme_name, -1);
|
||||
if (g_str_has_suffix (lower, "-dark") || g_strrstr (lower, "dark"))
|
||||
prefer_dark = TRUE;
|
||||
g_free (lower);
|
||||
g_free (theme_name);
|
||||
}
|
||||
}
|
||||
#ifdef G_OS_WIN32
|
||||
have_win_pref = fe_win32_try_get_system_dark (&win_prefers_dark);
|
||||
#endif
|
||||
|
||||
/* Deterministic precedence: any explicit dark signal wins. */
|
||||
prefer_dark = theme_name_prefers_dark || property_prefers_dark;
|
||||
#ifdef G_OS_WIN32
|
||||
prefer_dark = prefer_dark || (have_win_pref && win_prefers_dark);
|
||||
#endif
|
||||
|
||||
return prefer_dark;
|
||||
}
|
||||
|
||||
static gboolean auto_dark_mode_enabled = FALSE;
|
||||
static gboolean dark_mode_state_initialized = FALSE;
|
||||
|
||||
|
||||
static gboolean
|
||||
fe_parse_gtk3_minor_from_dirname (const char *name, gint *minor_out)
|
||||
{
|
||||
const char *prefix = "gtk-3.";
|
||||
char *endptr = NULL;
|
||||
long value;
|
||||
|
||||
if (!name || !g_str_has_prefix (name, prefix))
|
||||
return FALSE;
|
||||
|
||||
value = strtol (name + strlen (prefix), &endptr, 10);
|
||||
if (endptr == name + strlen (prefix) || *endptr != '\0' || value < 0 || value > G_MAXINT)
|
||||
return FALSE;
|
||||
|
||||
if (minor_out)
|
||||
*minor_out = (gint) value;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
fe_resolve_gtk3_theme_dir (const char *theme_root,
|
||||
char **gtk3_dir_out,
|
||||
gboolean *has_dark_css_out)
|
||||
{
|
||||
GDir *dir;
|
||||
const char *entry;
|
||||
gint runtime_minor = gtk_get_minor_version ();
|
||||
gint best_minor = -1;
|
||||
gint best_distance = G_MAXINT;
|
||||
char *best_dir = NULL;
|
||||
gboolean has_dark = FALSE;
|
||||
|
||||
if (gtk3_dir_out)
|
||||
*gtk3_dir_out = NULL;
|
||||
if (has_dark_css_out)
|
||||
*has_dark_css_out = FALSE;
|
||||
|
||||
if (!theme_root || !*theme_root)
|
||||
return FALSE;
|
||||
|
||||
dir = g_dir_open (theme_root, 0, NULL);
|
||||
if (!dir)
|
||||
return FALSE;
|
||||
|
||||
while ((entry = g_dir_read_name (dir)) != NULL)
|
||||
{
|
||||
char *candidate_dir;
|
||||
char *gtk_css;
|
||||
char *gtk_dark_css;
|
||||
gint minor;
|
||||
gint distance;
|
||||
|
||||
if (!fe_parse_gtk3_minor_from_dirname (entry, &minor))
|
||||
continue;
|
||||
|
||||
candidate_dir = g_build_filename (theme_root, entry, NULL);
|
||||
if (!g_file_test (candidate_dir, G_FILE_TEST_IS_DIR))
|
||||
{
|
||||
g_free (candidate_dir);
|
||||
continue;
|
||||
}
|
||||
|
||||
gtk_css = g_build_filename (candidate_dir, "gtk.css", NULL);
|
||||
if (!g_file_test (gtk_css, G_FILE_TEST_IS_REGULAR))
|
||||
{
|
||||
g_free (gtk_css);
|
||||
g_free (candidate_dir);
|
||||
continue;
|
||||
}
|
||||
g_free (gtk_css);
|
||||
|
||||
distance = (minor <= runtime_minor)
|
||||
? (runtime_minor - minor)
|
||||
: (10000 + (minor - runtime_minor));
|
||||
|
||||
if (!best_dir || distance < best_distance || (distance == best_distance && minor > best_minor))
|
||||
{
|
||||
g_free (best_dir);
|
||||
best_dir = candidate_dir;
|
||||
best_minor = minor;
|
||||
best_distance = distance;
|
||||
|
||||
gtk_dark_css = g_build_filename (best_dir, "gtk-dark.css", NULL);
|
||||
has_dark = g_file_test (gtk_dark_css, G_FILE_TEST_IS_REGULAR);
|
||||
g_free (gtk_dark_css);
|
||||
|
||||
candidate_dir = NULL;
|
||||
}
|
||||
|
||||
g_free (candidate_dir);
|
||||
}
|
||||
|
||||
g_dir_close (dir);
|
||||
|
||||
if (!best_dir)
|
||||
return FALSE;
|
||||
|
||||
if (gtk3_dir_out)
|
||||
*gtk3_dir_out = g_strdup (best_dir);
|
||||
if (has_dark_css_out)
|
||||
*has_dark_css_out = has_dark;
|
||||
g_free (best_dir);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GtkCssProvider *gtk3_theme_provider = NULL;
|
||||
static char *gtk3_theme_provider_name = NULL;
|
||||
static gboolean gtk3_theme_provider_dark = FALSE;
|
||||
static GResource *gtk3_theme_resource = NULL;
|
||||
static char *gtk3_theme_resource_path = NULL;
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
static void fe_apply_windows_theme (gboolean dark);
|
||||
#endif
|
||||
|
||||
static void
|
||||
fe_apply_windows_theme (gboolean dark)
|
||||
fe_gtk3_theme_unregister_resource (void)
|
||||
{
|
||||
if (gtk3_theme_resource)
|
||||
{
|
||||
g_resources_unregister (gtk3_theme_resource);
|
||||
g_clear_pointer (>k3_theme_resource, g_resource_unref);
|
||||
}
|
||||
|
||||
g_clear_pointer (>k3_theme_resource_path, g_free);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
fe_gtk3_theme_register_resource (const char *resource_path, GError **error)
|
||||
{
|
||||
GResource *resource;
|
||||
|
||||
if (!resource_path || !*resource_path)
|
||||
{
|
||||
fe_gtk3_theme_unregister_resource ();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (gtk3_theme_resource && gtk3_theme_resource_path
|
||||
&& g_strcmp0 (gtk3_theme_resource_path, resource_path) == 0)
|
||||
return TRUE;
|
||||
|
||||
resource = g_resource_load (resource_path, error);
|
||||
if (!resource)
|
||||
return FALSE;
|
||||
|
||||
fe_gtk3_theme_unregister_resource ();
|
||||
g_resources_register (resource);
|
||||
gtk3_theme_resource = resource;
|
||||
gtk3_theme_resource_path = g_strdup (resource_path);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
fe_apply_gtk3_theme_with_reload (const char *theme_name, gboolean force_reload, GError **error)
|
||||
{
|
||||
GdkScreen *screen = gdk_screen_get_default ();
|
||||
char *theme_dir = NULL;
|
||||
char *gtk3_dir = NULL;
|
||||
char *gtk_css = NULL;
|
||||
char *gtk_dark_css = NULL;
|
||||
char *gtk_resource = NULL;
|
||||
const char *selected_css = NULL;
|
||||
gboolean dark = fe_dark_mode_is_enabled ();
|
||||
GList *toplevels, *node;
|
||||
|
||||
if (!theme_name || !*theme_name)
|
||||
{
|
||||
#ifdef G_OS_WIN32
|
||||
/* Keep the Win32 fallback provider in sync when returning to the
|
||||
* system theme from Preferences > Themes. */
|
||||
fe_apply_windows_theme (dark);
|
||||
#endif
|
||||
|
||||
if (gtk3_theme_provider && screen)
|
||||
{
|
||||
gtk_style_context_remove_provider_for_screen (
|
||||
screen,
|
||||
GTK_STYLE_PROVIDER (gtk3_theme_provider));
|
||||
gtk_style_context_reset_widgets (screen);
|
||||
}
|
||||
g_clear_object (>k3_theme_provider);
|
||||
g_clear_pointer (>k3_theme_provider_name, g_free);
|
||||
gtk3_theme_provider_dark = FALSE;
|
||||
fe_gtk3_theme_unregister_resource ();
|
||||
|
||||
toplevels = gtk_window_list_toplevels ();
|
||||
for (node = toplevels; node; node = node->next)
|
||||
fe_apply_theme_to_toplevel (GTK_WIDGET (node->data));
|
||||
g_list_free (toplevels);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!force_reload
|
||||
&& gtk3_theme_provider_name
|
||||
&& g_strcmp0 (gtk3_theme_provider_name, theme_name) == 0
|
||||
&& gtk3_theme_provider_dark == dark)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
theme_dir = g_build_filename (get_xdir (), "gtk3-themes", theme_name, NULL);
|
||||
if (!fe_resolve_gtk3_theme_dir (theme_dir, >k3_dir, NULL))
|
||||
{
|
||||
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_NOENT,
|
||||
_("GTK3 theme '%s' is missing a valid gtk-3.x/gtk.css directory."), theme_name);
|
||||
g_free (theme_dir);
|
||||
return FALSE;
|
||||
}
|
||||
gtk_css = g_build_filename (gtk3_dir, "gtk.css", NULL);
|
||||
gtk_dark_css = g_build_filename (gtk3_dir, "gtk-dark.css", NULL);
|
||||
gtk_resource = g_build_filename (gtk3_dir, "gtk.gresource", NULL);
|
||||
|
||||
if (dark && g_file_test (gtk_dark_css, G_FILE_TEST_IS_REGULAR))
|
||||
selected_css = gtk_dark_css;
|
||||
else
|
||||
selected_css = gtk_css;
|
||||
|
||||
if (g_file_test (gtk_resource, G_FILE_TEST_IS_REGULAR))
|
||||
{
|
||||
if (!fe_gtk3_theme_register_resource (gtk_resource, error))
|
||||
{
|
||||
g_free (gtk_resource);
|
||||
g_free (gtk_dark_css);
|
||||
g_free (gtk_css);
|
||||
g_free (gtk3_dir);
|
||||
g_free (theme_dir);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fe_gtk3_theme_unregister_resource ();
|
||||
}
|
||||
|
||||
if (!gtk3_theme_provider)
|
||||
gtk3_theme_provider = gtk_css_provider_new ();
|
||||
|
||||
if (!gtk_css_provider_load_from_path (gtk3_theme_provider, selected_css, error))
|
||||
{
|
||||
g_free (gtk_dark_css);
|
||||
g_free (gtk_css);
|
||||
g_free (gtk_resource);
|
||||
g_free (gtk3_dir);
|
||||
g_free (theme_dir);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (screen)
|
||||
{
|
||||
gtk_style_context_add_provider_for_screen (
|
||||
screen,
|
||||
GTK_STYLE_PROVIDER (gtk3_theme_provider),
|
||||
/* Use user priority so imported GTK3 themes can also override
|
||||
* ZoiteChat's own application CSS (for example, button backgrounds). */
|
||||
GTK_STYLE_PROVIDER_PRIORITY_USER);
|
||||
gtk_style_context_reset_widgets (screen);
|
||||
}
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
/* Applying a GTK3 theme should immediately disable ZoiteChat's Win32
|
||||
* fallback window CSS so buttons/chat widgets are fully theme-driven. */
|
||||
fe_apply_windows_theme (dark);
|
||||
#endif
|
||||
|
||||
g_free (gtk3_theme_provider_name);
|
||||
gtk3_theme_provider_name = g_strdup (theme_name);
|
||||
gtk3_theme_provider_dark = dark;
|
||||
|
||||
toplevels = gtk_window_list_toplevels ();
|
||||
for (node = toplevels; node; node = node->next)
|
||||
fe_apply_theme_to_toplevel (GTK_WIDGET (node->data));
|
||||
g_list_free (toplevels);
|
||||
|
||||
g_free (gtk_dark_css);
|
||||
g_free (gtk_css);
|
||||
g_free (gtk_resource);
|
||||
g_free (gtk3_dir);
|
||||
g_free (theme_dir);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
gboolean
|
||||
fe_apply_gtk3_theme (const char *theme_name, GError **error)
|
||||
{
|
||||
return fe_apply_gtk3_theme_with_reload (theme_name, FALSE, error);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
fe_set_gtk_prefer_dark_theme (gboolean dark)
|
||||
{
|
||||
GtkSettings *settings = gtk_settings_get_default ();
|
||||
|
||||
@@ -588,32 +899,100 @@ fe_apply_windows_theme (gboolean dark)
|
||||
{
|
||||
g_object_set (settings, "gtk-application-prefer-dark-theme", dark, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
static void
|
||||
fe_append_window_theme_class_css (GString *css,
|
||||
const char *class_name,
|
||||
const PaletteColor *fg,
|
||||
const PaletteColor *bg)
|
||||
{
|
||||
char *fg_css = gdk_rgba_to_string (fg);
|
||||
char *bg_css = gdk_rgba_to_string (bg);
|
||||
|
||||
g_string_append_printf (css,
|
||||
"window.%s, .%s {"
|
||||
"background-color: %s;"
|
||||
"color: %s;"
|
||||
"}"
|
||||
"window.%s button, .%s button, window.%s entry, .%s entry, "
|
||||
"window.%s treeview, .%s treeview, window.%s scrolledwindow, .%s scrolledwindow {"
|
||||
"background-color: %s;"
|
||||
"color: %s;"
|
||||
"}",
|
||||
class_name,
|
||||
class_name,
|
||||
class_name,
|
||||
class_name,
|
||||
class_name,
|
||||
class_name,
|
||||
class_name,
|
||||
class_name,
|
||||
class_name,
|
||||
class_name,
|
||||
bg_css,
|
||||
fg_css);
|
||||
|
||||
g_free (fg_css);
|
||||
g_free (bg_css);
|
||||
}
|
||||
|
||||
static void
|
||||
fe_apply_windows_theme (gboolean dark)
|
||||
{
|
||||
static GtkCssProvider *win_theme_provider = NULL;
|
||||
fe_set_gtk_prefer_dark_theme (dark);
|
||||
|
||||
#if HAVE_GTK3
|
||||
{
|
||||
static GtkCssProvider *win_theme_provider = NULL;
|
||||
GdkScreen *screen = gdk_screen_get_default ();
|
||||
const char *css =
|
||||
"window.zoitechat-dark, .zoitechat-dark {"
|
||||
"background-color: #202020;"
|
||||
"color: #f0f0f0;"
|
||||
"}"
|
||||
"window.zoitechat-light, .zoitechat-light {"
|
||||
"background-color: #f6f6f6;"
|
||||
"color: #101010;"
|
||||
"}";
|
||||
const PaletteColor *light_palette = palette_user_colors ();
|
||||
const PaletteColor *dark_palette = palette_dark_colors ();
|
||||
GString *css;
|
||||
|
||||
/* Let imported GTK3 themes own all widget/window colors on Windows.
|
||||
* Otherwise ZoiteChat's fallback dark/light window background CSS can
|
||||
* clash with theme widget colors (for example white buttons on a dark
|
||||
* window background).
|
||||
*
|
||||
* Use the active provider state (not only the configured preference): if
|
||||
* a configured theme fails to load we still want fallback palette CSS so
|
||||
* the app keeps a coherent dark/light appearance on Windows releases.
|
||||
*/
|
||||
if (gtk3_theme_provider != NULL)
|
||||
{
|
||||
if (win_theme_provider && screen)
|
||||
{
|
||||
gtk_style_context_remove_provider_for_screen (
|
||||
screen,
|
||||
GTK_STYLE_PROVIDER (win_theme_provider));
|
||||
gtk_style_context_reset_widgets (screen);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
css = g_string_new (NULL);
|
||||
|
||||
if (!win_theme_provider)
|
||||
win_theme_provider = gtk_css_provider_new ();
|
||||
|
||||
gtk_css_provider_load_from_data (win_theme_provider, css, -1, NULL);
|
||||
fe_append_window_theme_class_css (css,
|
||||
"zoitechat-dark",
|
||||
&dark_palette[COL_FG],
|
||||
&dark_palette[COL_BG]);
|
||||
fe_append_window_theme_class_css (css,
|
||||
"zoitechat-light",
|
||||
&light_palette[COL_FG],
|
||||
&light_palette[COL_BG]);
|
||||
|
||||
gtk_css_provider_load_from_data (win_theme_provider, css->str, -1, NULL);
|
||||
g_string_free (css, TRUE);
|
||||
if (screen)
|
||||
gtk_style_context_add_provider_for_screen (
|
||||
screen,
|
||||
GTK_STYLE_PROVIDER (win_theme_provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -642,6 +1021,13 @@ void
|
||||
fe_set_auto_dark_mode_state (gboolean enabled)
|
||||
{
|
||||
auto_dark_mode_enabled = enabled;
|
||||
dark_mode_state_initialized = TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
fe_dark_mode_state_is_initialized (void)
|
||||
{
|
||||
return dark_mode_state_initialized;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -654,6 +1040,11 @@ gboolean
|
||||
fe_apply_theme_for_mode (unsigned int mode, gboolean *palette_changed)
|
||||
{
|
||||
gboolean enabled = fe_dark_mode_is_enabled_for (mode);
|
||||
GList *toplevels, *node;
|
||||
|
||||
/* Apply the optional global GTK preference first, then reapply palette-driven
|
||||
* chat/input colors so Preferences > Colors continues to take precedence. */
|
||||
fe_set_gtk_prefer_dark_theme (enabled);
|
||||
gboolean changed = palette_apply_dark_mode (enabled);
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
@@ -666,30 +1057,42 @@ fe_apply_theme_for_mode (unsigned int mode, gboolean *palette_changed)
|
||||
if (input_style)
|
||||
create_input_style (input_style);
|
||||
|
||||
if (!fe_apply_gtk3_theme (prefs.hex_gui_gtk3_theme_name, NULL)
|
||||
&& prefs.hex_gui_gtk3_theme_name[0] != '\0')
|
||||
{
|
||||
fe_message (_("Failed to apply configured GTK3 theme from gtk3-themes."), FE_MSG_ERROR);
|
||||
}
|
||||
|
||||
/* Existing toplevel windows also need the class refreshed for selectors like
|
||||
* .zoitechat-dark / .zoitechat-light to update immediately. */
|
||||
toplevels = gtk_window_list_toplevels ();
|
||||
for (node = toplevels; node; node = node->next)
|
||||
fe_apply_theme_to_toplevel (GTK_WIDGET (node->data));
|
||||
g_list_free (toplevels);
|
||||
|
||||
return enabled;
|
||||
}
|
||||
|
||||
void
|
||||
fe_apply_theme_to_toplevel (GtkWidget *window)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
gboolean dark;
|
||||
|
||||
if (!window)
|
||||
return;
|
||||
|
||||
#if defined(G_OS_WIN32) && HAVE_GTK3
|
||||
context = gtk_widget_get_style_context (window);
|
||||
dark = fe_dark_mode_is_enabled ();
|
||||
|
||||
if (context)
|
||||
{
|
||||
GtkStyleContext *context = gtk_widget_get_style_context (window);
|
||||
gboolean dark = fe_dark_mode_is_enabled ();
|
||||
|
||||
if (context)
|
||||
{
|
||||
gtk_style_context_remove_class (context, "zoitechat-dark");
|
||||
gtk_style_context_remove_class (context, "zoitechat-light");
|
||||
gtk_style_context_add_class (context, dark ? "zoitechat-dark" : "zoitechat-light");
|
||||
}
|
||||
gtk_style_context_remove_class (context, "zoitechat-dark");
|
||||
gtk_style_context_remove_class (context, "zoitechat-light");
|
||||
gtk_style_context_add_class (context, dark ? "zoitechat-dark" : "zoitechat-light");
|
||||
}
|
||||
#endif
|
||||
|
||||
fe_win32_apply_native_titlebar (window, fe_dark_mode_is_enabled ());
|
||||
fe_win32_apply_native_titlebar (window, dark);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -718,7 +1121,6 @@ create_input_style (InputStyle *style)
|
||||
{
|
||||
char buf[256];
|
||||
static int done_rc = FALSE;
|
||||
#if HAVE_GTK3
|
||||
static GtkCssProvider *input_css_provider = NULL;
|
||||
static char *last_theme_name = NULL;
|
||||
static gboolean last_dark_mode = FALSE;
|
||||
@@ -730,12 +1132,15 @@ create_input_style (InputStyle *style)
|
||||
static guint16 last_bg_red;
|
||||
static guint16 last_bg_green;
|
||||
static guint16 last_bg_blue;
|
||||
#endif
|
||||
static guint16 last_sel_fg_red;
|
||||
static guint16 last_sel_fg_green;
|
||||
static guint16 last_sel_fg_blue;
|
||||
static guint16 last_sel_bg_red;
|
||||
static guint16 last_sel_bg_green;
|
||||
static guint16 last_sel_bg_blue;
|
||||
|
||||
#if HAVE_GTK3
|
||||
if (!style)
|
||||
style = g_new0 (InputStyle, 1);
|
||||
#endif
|
||||
|
||||
if (style->font_desc)
|
||||
pango_font_description_free (style->font_desc);
|
||||
@@ -752,31 +1157,6 @@ create_input_style (InputStyle *style)
|
||||
|
||||
if (prefs.hex_gui_input_style)
|
||||
{
|
||||
#if !HAVE_GTK3
|
||||
if (!done_rc)
|
||||
{
|
||||
GtkSettings *settings = gtk_settings_get_default ();
|
||||
char *theme_name;
|
||||
|
||||
/* gnome-themes-standard 3.20+ relies on images to do theming
|
||||
* so we have to override that. */
|
||||
g_object_get (settings, "gtk-theme-name", &theme_name, NULL);
|
||||
if (g_str_has_prefix (theme_name, "Adwaita") || g_str_has_prefix (theme_name, "Yaru"))
|
||||
gtk_rc_parse_string (adwaita_workaround_rc);
|
||||
g_free (theme_name);
|
||||
|
||||
{
|
||||
guint16 red;
|
||||
guint16 green;
|
||||
guint16 blue;
|
||||
|
||||
palette_color_get_rgb16 (&colors[COL_FG], &red, &green, &blue);
|
||||
sprintf (buf, cursor_color_rc, (red >> 8), (green >> 8), (blue >> 8));
|
||||
}
|
||||
gtk_rc_parse_string (buf);
|
||||
done_rc = TRUE;
|
||||
}
|
||||
#else
|
||||
GtkSettings *settings = gtk_settings_get_default ();
|
||||
GdkScreen *screen = gdk_screen_get_default ();
|
||||
char *theme_name;
|
||||
@@ -789,6 +1169,12 @@ create_input_style (InputStyle *style)
|
||||
guint16 bg_red;
|
||||
guint16 bg_green;
|
||||
guint16 bg_blue;
|
||||
guint16 sel_fg_red;
|
||||
guint16 sel_fg_green;
|
||||
guint16 sel_fg_blue;
|
||||
guint16 sel_bg_red;
|
||||
guint16 sel_bg_green;
|
||||
guint16 sel_bg_blue;
|
||||
gboolean dark_mode = fe_dark_mode_is_enabled ();
|
||||
gboolean needs_reload;
|
||||
|
||||
@@ -796,6 +1182,8 @@ create_input_style (InputStyle *style)
|
||||
|
||||
palette_color_get_rgb16 (&colors[COL_FG], &fg_red, &fg_green, &fg_blue);
|
||||
palette_color_get_rgb16 (&colors[COL_BG], &bg_red, &bg_green, &bg_blue);
|
||||
palette_color_get_rgb16 (&colors[COL_MARK_FG], &sel_fg_red, &sel_fg_green, &sel_fg_blue);
|
||||
palette_color_get_rgb16 (&colors[COL_MARK_BG], &sel_bg_red, &sel_bg_green, &sel_bg_blue);
|
||||
needs_reload = !done_rc
|
||||
|| !last_input_style
|
||||
|| last_dark_mode != dark_mode
|
||||
@@ -806,7 +1194,13 @@ create_input_style (InputStyle *style)
|
||||
|| last_fg_blue != fg_blue
|
||||
|| last_bg_red != bg_red
|
||||
|| last_bg_green != bg_green
|
||||
|| last_bg_blue != bg_blue;
|
||||
|| last_bg_blue != bg_blue
|
||||
|| last_sel_fg_red != sel_fg_red
|
||||
|| last_sel_fg_green != sel_fg_green
|
||||
|| last_sel_fg_blue != sel_fg_blue
|
||||
|| last_sel_bg_red != sel_bg_red
|
||||
|| last_sel_bg_green != sel_bg_green
|
||||
|| last_sel_bg_blue != sel_bg_blue;
|
||||
|
||||
if (needs_reload)
|
||||
{
|
||||
@@ -830,28 +1224,107 @@ create_input_style (InputStyle *style)
|
||||
}
|
||||
{
|
||||
GString *css = g_string_new ("#zoitechat-inputbox {");
|
||||
GtkWidget *tmp_entry = NULL;
|
||||
GtkStyleContext *tmp_context = NULL;
|
||||
GdkRGBA selected_fg = { 0.0, 0.0, 0.0, 1.0 };
|
||||
GdkRGBA selected_bg = { 0.0, 0.0, 0.0, 1.0 };
|
||||
gboolean have_palette_selected_colors;
|
||||
const char *selection_fg_css = NULL;
|
||||
const char *selection_bg_css = NULL;
|
||||
char selection_fg_hex[8];
|
||||
char selection_bg_hex[8];
|
||||
char *selection_fg_fallback = NULL;
|
||||
char *selection_bg_fallback = NULL;
|
||||
|
||||
/* GTK3 equivalents for adwaita_workaround_rc/cursor_color_rc. */
|
||||
if (adwaita_workaround_rc[0] != '\0'
|
||||
&& theme_name
|
||||
&& (g_str_has_prefix (theme_name, "Adwaita")
|
||||
|| g_str_has_prefix (theme_name, "Yaru")))
|
||||
g_string_append (css, "background-image: none;");
|
||||
|
||||
have_palette_selected_colors =
|
||||
isfinite (colors[COL_MARK_FG].red)
|
||||
&& isfinite (colors[COL_MARK_FG].green)
|
||||
&& isfinite (colors[COL_MARK_FG].blue)
|
||||
&& isfinite (colors[COL_MARK_BG].red)
|
||||
&& isfinite (colors[COL_MARK_BG].green)
|
||||
&& isfinite (colors[COL_MARK_BG].blue);
|
||||
|
||||
if (have_palette_selected_colors)
|
||||
{
|
||||
g_snprintf (selection_fg_hex, sizeof (selection_fg_hex), "#%02x%02x%02x",
|
||||
(sel_fg_red >> 8), (sel_fg_green >> 8), (sel_fg_blue >> 8));
|
||||
g_snprintf (selection_bg_hex, sizeof (selection_bg_hex), "#%02x%02x%02x",
|
||||
(sel_bg_red >> 8), (sel_bg_green >> 8), (sel_bg_blue >> 8));
|
||||
selection_fg_css = selection_fg_hex;
|
||||
selection_bg_css = selection_bg_hex;
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp_entry = gtk_entry_new ();
|
||||
tmp_context = tmp_entry ? gtk_widget_get_style_context (tmp_entry) : NULL;
|
||||
|
||||
if (tmp_context)
|
||||
{
|
||||
if (!gtk_style_context_lookup_color (
|
||||
tmp_context,
|
||||
"theme_selected_fg_color",
|
||||
&selected_fg))
|
||||
selected_fg = colors[COL_MARK_FG];
|
||||
|
||||
if (!gtk_style_context_lookup_color (
|
||||
tmp_context,
|
||||
"theme_selected_bg_color",
|
||||
&selected_bg))
|
||||
selected_bg = colors[COL_MARK_BG];
|
||||
}
|
||||
else
|
||||
{
|
||||
selected_fg = colors[COL_MARK_FG];
|
||||
selected_bg = colors[COL_MARK_BG];
|
||||
}
|
||||
|
||||
selection_fg_fallback = gdk_rgba_to_string (&selected_fg);
|
||||
selection_bg_fallback = gdk_rgba_to_string (&selected_bg);
|
||||
selection_fg_css = selection_fg_fallback ? selection_fg_fallback : "@theme_selected_fg_color";
|
||||
selection_bg_css = selection_bg_fallback ? selection_bg_fallback : "@theme_selected_bg_color";
|
||||
}
|
||||
|
||||
g_string_append_printf (
|
||||
css,
|
||||
"background-color: #%02x%02x%02x;"
|
||||
"color: #%02x%02x%02x;"
|
||||
"caret-color: %s;"
|
||||
"}"
|
||||
"#zoitechat-inputbox text {"
|
||||
"color: #%02x%02x%02x;"
|
||||
"caret-color: %s;"
|
||||
"}"
|
||||
"#zoitechat-inputbox:focus text,"
|
||||
"#zoitechat-inputbox:backdrop text {"
|
||||
"color: #%02x%02x%02x;"
|
||||
"caret-color: %s;"
|
||||
"}"
|
||||
"#zoitechat-inputbox:disabled text {"
|
||||
"color: alpha(#%02x%02x%02x, 0.7);"
|
||||
"}"
|
||||
"#zoitechat-inputbox text selection {"
|
||||
"color: %s;"
|
||||
"background-color: %s;"
|
||||
"}",
|
||||
(bg_red >> 8), (bg_green >> 8), (bg_blue >> 8),
|
||||
cursor_color,
|
||||
(fg_red >> 8), (fg_green >> 8), (fg_blue >> 8),
|
||||
cursor_color,
|
||||
(fg_red >> 8), (fg_green >> 8), (fg_blue >> 8),
|
||||
cursor_color);
|
||||
cursor_color,
|
||||
(fg_red >> 8), (fg_green >> 8), (fg_blue >> 8),
|
||||
selection_fg_css,
|
||||
selection_bg_css);
|
||||
if (tmp_entry)
|
||||
gtk_widget_destroy (tmp_entry);
|
||||
g_clear_pointer (&selection_fg_fallback, g_free);
|
||||
g_clear_pointer (&selection_bg_fallback, g_free);
|
||||
gtk_css_provider_load_from_data (input_css_provider, css->str, -1, NULL);
|
||||
g_string_free (css, TRUE);
|
||||
}
|
||||
@@ -872,14 +1345,18 @@ create_input_style (InputStyle *style)
|
||||
last_bg_red = bg_red;
|
||||
last_bg_green = bg_green;
|
||||
last_bg_blue = bg_blue;
|
||||
last_sel_fg_red = sel_fg_red;
|
||||
last_sel_fg_green = sel_fg_green;
|
||||
last_sel_fg_blue = sel_fg_blue;
|
||||
last_sel_bg_red = sel_bg_red;
|
||||
last_sel_bg_green = sel_bg_green;
|
||||
last_sel_bg_blue = sel_bg_blue;
|
||||
g_free (last_theme_name);
|
||||
last_theme_name = g_strdup (theme_name);
|
||||
}
|
||||
|
||||
g_free (theme_name);
|
||||
#endif
|
||||
}
|
||||
#if HAVE_GTK3
|
||||
else
|
||||
{
|
||||
GdkScreen *screen = gdk_screen_get_default ();
|
||||
@@ -896,13 +1373,7 @@ create_input_style (InputStyle *style)
|
||||
last_input_style = FALSE;
|
||||
last_colors_set = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !HAVE_GTK3
|
||||
style->bg[GTK_STATE_NORMAL] = colors[COL_FG];
|
||||
style->base[GTK_STATE_NORMAL] = colors[COL_BG];
|
||||
style->text[GTK_STATE_NORMAL] = colors[COL_FG];
|
||||
#endif
|
||||
|
||||
return style;
|
||||
}
|
||||
@@ -915,7 +1386,10 @@ fe_init (void)
|
||||
palette_load ();
|
||||
settings = gtk_settings_get_default ();
|
||||
if (settings)
|
||||
{
|
||||
auto_dark_mode_enabled = fe_system_prefers_dark ();
|
||||
dark_mode_state_initialized = TRUE;
|
||||
}
|
||||
|
||||
fe_apply_theme_for_mode (prefs.hex_gui_dark_mode, NULL);
|
||||
key_init ();
|
||||
@@ -925,11 +1399,7 @@ fe_init (void)
|
||||
gtkosx_application_set_dock_icon_pixbuf (osx_app, pix_zoitechat);
|
||||
#endif
|
||||
channelwin_pix = pixmap_load_from_file (prefs.hex_text_background);
|
||||
#if HAVE_GTK3
|
||||
input_style = create_input_style (input_style);
|
||||
#else
|
||||
input_style = create_input_style (gtk_style_new ());
|
||||
#endif
|
||||
|
||||
if (settings)
|
||||
{
|
||||
@@ -968,8 +1438,6 @@ fe_main (void)
|
||||
void
|
||||
fe_cleanup (void)
|
||||
{
|
||||
/* it's saved when pressing OK in setup.c */
|
||||
/*palette_save ();*/
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1006,8 +1474,7 @@ log_handler (const gchar *log_domain,
|
||||
{
|
||||
session *sess;
|
||||
|
||||
/* if (getenv ("ZOITECHAT_WARNING_IGNORE")) this gets ignored sometimes, so simply just disable all warnings */
|
||||
return;
|
||||
return;
|
||||
|
||||
sess = find_dialog (serv_list->data, "(warnings)");
|
||||
if (!sess)
|
||||
@@ -1020,8 +1487,6 @@ log_handler (const gchar *log_domain,
|
||||
|
||||
#endif
|
||||
|
||||
/* install tray stuff */
|
||||
|
||||
static int
|
||||
fe_idle (gpointer data)
|
||||
{
|
||||
@@ -1087,7 +1552,10 @@ fe_message (char *msg, int flags)
|
||||
type = GTK_MESSAGE_INFO;
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (parent_window), 0, type,
|
||||
GTK_BUTTONS_OK, "%s", msg);
|
||||
GTK_BUTTONS_OK, "%s", msg);
|
||||
/* Window classes are required for GTK CSS selectors like
|
||||
* .zoitechat-dark / .zoitechat-light. */
|
||||
fe_apply_theme_to_toplevel (dialog);
|
||||
if (flags & FE_MSG_MARKUP)
|
||||
gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog), msg);
|
||||
g_signal_connect (G_OBJECT (dialog), "response",
|
||||
@@ -1488,6 +1956,9 @@ fe_ctrl_gui (session *sess, fe_gui_action action, int arg)
|
||||
mg_detach (sess, arg); /* arg: 0=toggle 1=detach 2=attach */
|
||||
break;
|
||||
case FE_GUI_APPLY:
|
||||
/* Keep parity with Preferences -> Theme apply path (setup_theme_apply_cb). */
|
||||
palette_load ();
|
||||
fe_apply_theme_for_mode (prefs.hex_gui_dark_mode, NULL);
|
||||
setup_apply_real (TRUE, TRUE, TRUE, FALSE);
|
||||
}
|
||||
}
|
||||
@@ -1723,9 +2194,62 @@ fe_open_url_inner (const char *url)
|
||||
#elif defined(__APPLE__)
|
||||
osx_show_uri (url);
|
||||
#else
|
||||
GError *error = NULL;
|
||||
char *escaped_url = maybe_escape_uri (url);
|
||||
gchar *xdg_open_argv[] = {(gchar *) "xdg-open", escaped_url, NULL};
|
||||
gchar **spawn_env = NULL;
|
||||
gboolean opened = FALSE;
|
||||
g_debug ("Opening URL \"%s\" (%s)", escaped_url, url);
|
||||
gtk_show_uri (NULL, escaped_url, GDK_CURRENT_TIME, NULL);
|
||||
|
||||
/* AppImage runtime variables can point host binaries like /bin/sh at
|
||||
* bundled libraries, which may not be ABI-compatible with system tools. */
|
||||
spawn_env = g_get_environ ();
|
||||
{
|
||||
gchar **tmp_env = spawn_env;
|
||||
spawn_env = g_environ_unsetenv (tmp_env, "LD_LIBRARY_PATH");
|
||||
if (spawn_env != tmp_env)
|
||||
g_strfreev (tmp_env);
|
||||
|
||||
tmp_env = spawn_env;
|
||||
spawn_env = g_environ_unsetenv (tmp_env, "LD_PRELOAD");
|
||||
if (spawn_env != tmp_env)
|
||||
g_strfreev (tmp_env);
|
||||
}
|
||||
|
||||
/* Prefer xdg-open when available because gtk_show_uri can inherit
|
||||
* AppImage runtime state and fail before we can control the environment. */
|
||||
{
|
||||
gchar *xdg_open_path = g_find_program_in_path ("xdg-open");
|
||||
if (xdg_open_path &&
|
||||
g_spawn_async (NULL, xdg_open_argv, spawn_env,
|
||||
G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
|
||||
NULL, NULL, NULL, &error))
|
||||
{
|
||||
opened = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_clear_error (&error);
|
||||
}
|
||||
g_free (xdg_open_path);
|
||||
}
|
||||
|
||||
if (!opened && gtk_show_uri (NULL, escaped_url, GDK_CURRENT_TIME, &error))
|
||||
{
|
||||
opened = TRUE;
|
||||
}
|
||||
else if (!opened)
|
||||
{
|
||||
g_warning ("gtk_show_uri failed for '%s': %s", escaped_url, error ? error->message : "unknown error");
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
if (!opened)
|
||||
{
|
||||
g_warning ("Unable to open URL '%s' via xdg-open or gtk_show_uri", escaped_url);
|
||||
}
|
||||
|
||||
g_strfreev (spawn_env);
|
||||
g_free (escaped_url);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -32,22 +32,6 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <cairo.h>
|
||||
|
||||
#ifndef HAVE_GTK3
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
#define HAVE_GTK3 1
|
||||
#else
|
||||
#define HAVE_GTK3 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !HAVE_GTK3
|
||||
/* GtkWidget expansion APIs were introduced in GTK3. Keep GTK2 builds
|
||||
* source-compatible by accepting the calls as no-ops.
|
||||
*/
|
||||
#define gtk_widget_set_hexpand(widget, expand) G_STMT_START { (void) (widget); (void) (expand); } G_STMT_END
|
||||
#define gtk_widget_set_vexpand(widget, expand) G_STMT_START { (void) (widget); (void) (expand); } G_STMT_END
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GTK_MAC
|
||||
#include <gtkosxapplication.h>
|
||||
#endif
|
||||
@@ -64,14 +48,10 @@
|
||||
#define flag_b flag_wid[7]
|
||||
#define NUM_FLAG_WIDS 8
|
||||
|
||||
#if HAVE_GTK3
|
||||
typedef struct _input_style
|
||||
{
|
||||
PangoFontDescription *font_desc;
|
||||
} InputStyle;
|
||||
#else
|
||||
typedef GtkStyle InputStyle;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GTK_MAC
|
||||
extern GtkosxApplication *osx_app;
|
||||
@@ -209,9 +189,16 @@ extern cairo_surface_t *dialogwin_pix;
|
||||
|
||||
gboolean fe_dark_mode_is_enabled (void);
|
||||
gboolean fe_dark_mode_is_enabled_for (unsigned int mode);
|
||||
gboolean fe_dark_mode_state_is_initialized (void);
|
||||
void fe_set_auto_dark_mode_state (gboolean enabled);
|
||||
void fe_refresh_auto_dark_mode (void);
|
||||
gboolean fe_apply_theme_for_mode (unsigned int mode, gboolean *palette_changed);
|
||||
gboolean fe_apply_gtk3_theme (const char *theme_name, GError **error);
|
||||
gboolean fe_apply_gtk3_theme_with_reload (const char *theme_name, gboolean force_reload,
|
||||
GError **error);
|
||||
gboolean fe_resolve_gtk3_theme_dir (const char *theme_root,
|
||||
char **gtk3_dir_out,
|
||||
gboolean *has_dark_css_out);
|
||||
void fe_apply_theme_to_toplevel (GtkWidget *window);
|
||||
|
||||
#define SPELL_ENTRY_GET_TEXT(e) ((char *)(gtk_entry_get_text (GTK_ENTRY(e))))
|
||||
|
||||
@@ -53,18 +53,10 @@
|
||||
#include "textgui.h"
|
||||
#include "fkeys.h"
|
||||
|
||||
#if HAVE_GTK3
|
||||
#define ICON_FKEYS_NEW "document-new"
|
||||
#define ICON_FKEYS_DELETE "edit-delete"
|
||||
#define ICON_FKEYS_CANCEL "dialog-cancel"
|
||||
#define ICON_FKEYS_SAVE "document-save"
|
||||
#endif
|
||||
#if !HAVE_GTK3
|
||||
#define ICON_FKEYS_NEW GTK_STOCK_NEW
|
||||
#define ICON_FKEYS_DELETE GTK_STOCK_DELETE
|
||||
#define ICON_FKEYS_CANCEL GTK_STOCK_CANCEL
|
||||
#define ICON_FKEYS_SAVE GTK_STOCK_SAVE
|
||||
#endif
|
||||
|
||||
static void replace_handle (GtkWidget * wid);
|
||||
void key_check_replace_on_change (GtkEditable *editable, gpointer data);
|
||||
@@ -753,7 +745,6 @@ key_dialog_treeview_new (GtkWidget *box)
|
||||
g_signal_connect (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW(view))),
|
||||
"changed", G_CALLBACK (key_dialog_selection_changed), NULL);
|
||||
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_name (view, "fkeys-treeview");
|
||||
{
|
||||
GtkCssProvider *provider = gtk_css_provider_new ();
|
||||
@@ -773,10 +764,6 @@ key_dialog_treeview_new (GtkWidget *box)
|
||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
g_object_unref (provider);
|
||||
}
|
||||
#endif
|
||||
#if !HAVE_GTK3
|
||||
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (view), TRUE);
|
||||
#endif
|
||||
|
||||
render = gtk_cell_renderer_accel_new ();
|
||||
g_object_set (render, "editable", TRUE,
|
||||
@@ -925,13 +912,8 @@ key_dialog_show ()
|
||||
g_object_set_data (G_OBJECT (key_dialog), "view", view);
|
||||
g_object_set_data (G_OBJECT (key_dialog), "xtext", xtext);
|
||||
|
||||
#if HAVE_GTK3
|
||||
box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (box), GTK_BUTTONBOX_SPREAD);
|
||||
#elif !HAVE_GTK3
|
||||
box = gtk_hbutton_box_new ();
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (box), GTK_BUTTONBOX_SPREAD);
|
||||
#endif
|
||||
gtk_box_pack_start (GTK_BOX (vbox), box, FALSE, FALSE, 2);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box), 5);
|
||||
|
||||
@@ -1217,11 +1199,6 @@ corrupt_file:
|
||||
return 5;
|
||||
}
|
||||
|
||||
/* ***** Key actions start here *********** */
|
||||
|
||||
/* See the NOTES above --AGL */
|
||||
|
||||
/* "Run command" */
|
||||
static int
|
||||
key_action_handle_command (GtkWidget * wid, GdkEventKey * evt, char *d1,
|
||||
char *d2, struct session *sess)
|
||||
@@ -1242,7 +1219,6 @@ key_action_handle_command (GtkWidget * wid, GdkEventKey * evt, char *d1,
|
||||
/*
|
||||
* Check if the given session is inside the main window. This predicate
|
||||
* is passed to lastact_getfirst() as a way to filter out detached sessions.
|
||||
* XXX: Consider moving this in a different file?
|
||||
*/
|
||||
static int
|
||||
session_check_is_tab(session *sess)
|
||||
@@ -1824,7 +1800,7 @@ key_action_move_tab_left (GtkWidget * wid, GdkEventKey * ent, char *d1,
|
||||
char *d2, struct session *sess)
|
||||
{
|
||||
mg_move_tab (sess, +1);
|
||||
return 2; /* don't allow default action */
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1832,7 +1808,7 @@ key_action_move_tab_right (GtkWidget * wid, GdkEventKey * ent, char *d1,
|
||||
char *d2, struct session *sess)
|
||||
{
|
||||
mg_move_tab (sess, -1);
|
||||
return 2; /* -''- */
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1840,7 +1816,7 @@ key_action_move_tab_family_left (GtkWidget * wid, GdkEventKey * ent, char *d1,
|
||||
char *d2, struct session *sess)
|
||||
{
|
||||
mg_move_tab_family (sess, +1);
|
||||
return 2; /* don't allow default action */
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1848,7 +1824,7 @@ key_action_move_tab_family_right (GtkWidget * wid, GdkEventKey * ent, char *d1,
|
||||
char *d2, struct session *sess)
|
||||
{
|
||||
mg_move_tab_family (sess, -1);
|
||||
return 2; /* -''- */
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -1857,12 +1833,9 @@ key_action_put_history (GtkWidget * wid, GdkEventKey * ent, char *d1,
|
||||
{
|
||||
history_add (&sess->history, SPELL_ENTRY_GET_TEXT (wid));
|
||||
SPELL_ENTRY_SET_TEXT (wid, "");
|
||||
return 2; /* -''- */
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
/* -------- */
|
||||
|
||||
static void
|
||||
replace_handle (GtkWidget *t)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,6 @@ struct file_req
|
||||
int flags; /* FRF_* flags */
|
||||
};
|
||||
|
||||
#if HAVE_GTK3
|
||||
static const char *
|
||||
gtkutil_menu_custom_icon_from_stock (const char *stock_name)
|
||||
{
|
||||
@@ -162,84 +161,8 @@ gtkutil_menu_custom_icon_from_icon_name (const char *icon_name)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !HAVE_GTK3
|
||||
static const char *
|
||||
gtkutil_stock_from_menu_custom_icon (const char *custom_icon)
|
||||
{
|
||||
static const struct
|
||||
{
|
||||
const char *custom_icon;
|
||||
const char *stock;
|
||||
} icon_map[] = {
|
||||
{ "zc-menu-new", GTK_STOCK_NEW },
|
||||
{ "zc-menu-network-list", GTK_STOCK_INDEX },
|
||||
{ "zc-menu-load-plugin", GTK_STOCK_REVERT_TO_SAVED },
|
||||
{ "zc-menu-detach", GTK_STOCK_REDO },
|
||||
{ "zc-menu-close", GTK_STOCK_CLOSE },
|
||||
{ "zc-menu-quit", GTK_STOCK_QUIT },
|
||||
{ "zc-menu-disconnect", GTK_STOCK_DISCONNECT },
|
||||
{ "zc-menu-connect", GTK_STOCK_CONNECT },
|
||||
{ "zc-menu-join", GTK_STOCK_JUMP_TO },
|
||||
{ "zc-menu-chanlist", GTK_STOCK_INDEX },
|
||||
{ "zc-menu-preferences", GTK_STOCK_PREFERENCES },
|
||||
{ "zc-menu-clear", GTK_STOCK_CLEAR },
|
||||
{ "zc-menu-copy", GTK_STOCK_COPY },
|
||||
{ "zc-menu-delete", GTK_STOCK_DELETE },
|
||||
{ "zc-menu-add", GTK_STOCK_ADD },
|
||||
{ "zc-menu-remove", GTK_STOCK_REMOVE },
|
||||
{ "zc-menu-spell-check", GTK_STOCK_SPELL_CHECK },
|
||||
{ "zc-menu-save", GTK_STOCK_SAVE },
|
||||
{ "zc-menu-save-as", GTK_STOCK_SAVE_AS },
|
||||
{ "zc-menu-refresh", GTK_STOCK_REFRESH },
|
||||
{ "zc-menu-search", GTK_STOCK_JUSTIFY_LEFT },
|
||||
{ "zc-menu-find", GTK_STOCK_FIND },
|
||||
{ "zc-menu-previous", GTK_STOCK_GO_BACK },
|
||||
{ "zc-menu-next", GTK_STOCK_GO_FORWARD },
|
||||
{ "zc-menu-help", GTK_STOCK_HELP },
|
||||
{ "zc-menu-about", GTK_STOCK_ABOUT },
|
||||
{ "zc-menu-emoji", GTK_STOCK_CONVERT },
|
||||
{ "zc-menu-update", GTK_STOCK_REFRESH },
|
||||
};
|
||||
size_t i;
|
||||
|
||||
if (!custom_icon)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (icon_map); i++)
|
||||
{
|
||||
if (strcmp (custom_icon, icon_map[i].custom_icon) == 0)
|
||||
return icon_map[i].stock;
|
||||
}
|
||||
|
||||
return custom_icon;
|
||||
}
|
||||
#endif
|
||||
|
||||
static GdkPixbuf *
|
||||
gtkutil_menu_icon_pixbuf_new (const char *icon_name)
|
||||
{
|
||||
GdkPixbuf *pixbuf = NULL;
|
||||
char *resource_path;
|
||||
|
||||
if (!icon_name || !g_str_has_prefix (icon_name, "zc-menu-"))
|
||||
return NULL;
|
||||
|
||||
resource_path = g_strdup_printf ("/icons/menu/light/%s.png", icon_name + strlen ("zc-menu-"));
|
||||
pixbuf = gdk_pixbuf_new_from_resource (resource_path, NULL);
|
||||
if (!pixbuf)
|
||||
{
|
||||
g_free (resource_path);
|
||||
resource_path = g_strdup_printf ("/icons/menu/light/%s.svg", icon_name + strlen ("zc-menu-"));
|
||||
pixbuf = gdk_pixbuf_new_from_resource (resource_path, NULL);
|
||||
}
|
||||
g_free (resource_path);
|
||||
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
#if HAVE_GTK3
|
||||
const char *
|
||||
gtkutil_icon_name_from_stock (const char *stock_name)
|
||||
{
|
||||
@@ -296,9 +219,7 @@ gtkutil_icon_name_from_stock (const char *stock_name)
|
||||
|
||||
return stock_name;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HAVE_GTK3
|
||||
static const char *
|
||||
gtkutil_menu_icon_theme_variant (void)
|
||||
{
|
||||
@@ -308,6 +229,11 @@ gtkutil_menu_icon_theme_variant (void)
|
||||
char *theme_name_lower = NULL;
|
||||
const char *theme_variant = "light";
|
||||
|
||||
/* Prefer ZoiteChat's explicit dark-mode selection when available so icon
|
||||
* variants stay in sync with the app mode, not only the system theme. */
|
||||
if (fe_dark_mode_state_is_initialized () || prefs.hex_gui_dark_mode != ZOITECHAT_DARK_MODE_AUTO)
|
||||
return fe_dark_mode_is_enabled () ? "dark" : "light";
|
||||
|
||||
settings = gtk_settings_get_default ();
|
||||
if (settings)
|
||||
{
|
||||
@@ -326,41 +252,68 @@ gtkutil_menu_icon_theme_variant (void)
|
||||
return theme_variant;
|
||||
}
|
||||
|
||||
static char *
|
||||
gtkutil_menu_icon_resource_path (const char *icon_name, const char *extension)
|
||||
{
|
||||
char *resource_path;
|
||||
const char *variant;
|
||||
|
||||
if (!icon_name || !extension || !g_str_has_prefix (icon_name, "zc-menu-"))
|
||||
return NULL;
|
||||
|
||||
variant = gtkutil_menu_icon_theme_variant ();
|
||||
resource_path = g_strdup_printf ("/icons/menu/%s/%s.%s", variant,
|
||||
icon_name + strlen ("zc-menu-"), extension);
|
||||
if (!g_resources_get_info (resource_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
|
||||
{
|
||||
g_free (resource_path);
|
||||
resource_path = g_strdup_printf ("/icons/menu/light/%s.%s",
|
||||
icon_name + strlen ("zc-menu-"), extension);
|
||||
if (!g_resources_get_info (resource_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
|
||||
{
|
||||
g_free (resource_path);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return resource_path;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gtkutil_menu_icon_exists (const char *icon_name)
|
||||
{
|
||||
char *resource_path;
|
||||
gboolean found;
|
||||
|
||||
resource_path = gtkutil_menu_icon_resource_path (icon_name, "png");
|
||||
if (!resource_path)
|
||||
resource_path = gtkutil_menu_icon_resource_path (icon_name, "svg");
|
||||
|
||||
found = resource_path != NULL;
|
||||
g_free (resource_path);
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
gtkutil_menu_icon_image_new (const char *icon_name, GtkIconSize size)
|
||||
{
|
||||
GtkWidget *image = NULL;
|
||||
GdkPixbuf *pixbuf = NULL;
|
||||
char *resource_path;
|
||||
const char *variant;
|
||||
|
||||
if (!icon_name || !g_str_has_prefix (icon_name, "zc-menu-"))
|
||||
return NULL;
|
||||
resource_path = gtkutil_menu_icon_resource_path (icon_name, "png");
|
||||
if (!resource_path)
|
||||
resource_path = gtkutil_menu_icon_resource_path (icon_name, "svg");
|
||||
|
||||
variant = gtkutil_menu_icon_theme_variant ();
|
||||
resource_path = g_strdup_printf ("/icons/menu/%s/%s.png", variant, icon_name + strlen ("zc-menu-"));
|
||||
if (!g_resources_get_info (resource_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
|
||||
if (resource_path)
|
||||
{
|
||||
g_free (resource_path);
|
||||
resource_path = g_strdup_printf ("/icons/menu/light/%s.png", icon_name + strlen ("zc-menu-"));
|
||||
}
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_resource (resource_path, NULL);
|
||||
if (!pixbuf)
|
||||
{
|
||||
g_free (resource_path);
|
||||
resource_path = g_strdup_printf ("/icons/menu/%s/%s.svg", variant, icon_name + strlen ("zc-menu-"));
|
||||
if (!g_resources_get_info (resource_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
|
||||
{
|
||||
g_free (resource_path);
|
||||
resource_path = g_strdup_printf ("/icons/menu/light/%s.svg", icon_name + strlen ("zc-menu-"));
|
||||
}
|
||||
pixbuf = gdk_pixbuf_new_from_resource (resource_path, NULL);
|
||||
}
|
||||
if (pixbuf)
|
||||
{
|
||||
image = gtk_image_new_from_pixbuf (pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
if (pixbuf)
|
||||
{
|
||||
image = gtk_image_new_from_pixbuf (pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
}
|
||||
|
||||
g_free (resource_path);
|
||||
@@ -378,57 +331,36 @@ gtkutil_menu_icon_image_new (const char *icon_name, GtkIconSize size)
|
||||
|
||||
return image;
|
||||
}
|
||||
#endif
|
||||
|
||||
GtkWidget *
|
||||
gtkutil_image_new_from_stock (const char *stock, GtkIconSize size)
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
GtkWidget *image;
|
||||
const char *icon_name;
|
||||
const char *custom_icon_name;
|
||||
|
||||
icon_name = gtkutil_icon_name_from_stock (stock);
|
||||
if (!icon_name && stock && g_str_has_prefix (stock, "zc-menu-"))
|
||||
icon_name = stock;
|
||||
if (size == GTK_ICON_SIZE_MENU)
|
||||
{
|
||||
const char *menu_icon_name = gtkutil_menu_custom_icon_from_stock (stock);
|
||||
|
||||
if (!menu_icon_name)
|
||||
menu_icon_name = gtkutil_menu_custom_icon_from_icon_name (icon_name);
|
||||
|
||||
if (menu_icon_name)
|
||||
icon_name = menu_icon_name;
|
||||
}
|
||||
/* Use ZoiteChat's themed icon resources consistently across menu and button
|
||||
* images so dark/light mode swaps all app icons together. */
|
||||
custom_icon_name = gtkutil_menu_custom_icon_from_stock (stock);
|
||||
if (!custom_icon_name)
|
||||
custom_icon_name = gtkutil_menu_custom_icon_from_icon_name (icon_name);
|
||||
if (custom_icon_name)
|
||||
icon_name = custom_icon_name;
|
||||
|
||||
image = gtkutil_menu_icon_image_new (icon_name, size);
|
||||
if (image)
|
||||
return image;
|
||||
|
||||
return gtk_image_new_from_icon_name (icon_name, size);
|
||||
#elif !HAVE_GTK3
|
||||
if (stock && g_str_has_prefix (stock, "zc-menu-"))
|
||||
{
|
||||
GdkPixbuf *pixbuf = gtkutil_menu_icon_pixbuf_new (stock);
|
||||
|
||||
if (pixbuf)
|
||||
{
|
||||
GtkWidget *image = gtk_image_new_from_pixbuf (pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
return image;
|
||||
}
|
||||
}
|
||||
|
||||
if (stock && g_str_has_prefix (stock, "zc-menu-"))
|
||||
stock = gtkutil_stock_from_menu_custom_icon (stock);
|
||||
return gtk_image_new_from_stock (stock, size);
|
||||
#endif
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gtkutil_button_new_from_stock (const char *stock, const char *label)
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
GtkWidget *button = label ? gtk_button_new_with_mnemonic (label) : gtk_button_new ();
|
||||
|
||||
if (stock)
|
||||
@@ -443,16 +375,8 @@ gtkutil_button_new_from_stock (const char *stock, const char *label)
|
||||
}
|
||||
|
||||
return button;
|
||||
#elif !HAVE_GTK3
|
||||
if (stock)
|
||||
return gtk_button_new_from_stock (stock);
|
||||
if (label)
|
||||
return gtk_button_new_with_mnemonic (label);
|
||||
return gtk_button_new ();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if HAVE_GTK3
|
||||
void
|
||||
gtkutil_append_font_css (GString *css, const PangoFontDescription *font_desc)
|
||||
{
|
||||
@@ -568,16 +492,10 @@ gtkutil_append_font_css (GString *css, const PangoFontDescription *font_desc)
|
||||
void
|
||||
gtkutil_apply_palette (GtkWidget *widget, const GdkRGBA *bg, const GdkRGBA *fg,
|
||||
const PangoFontDescription *font_desc)
|
||||
#else
|
||||
void
|
||||
gtkutil_apply_palette (GtkWidget *widget, const GdkColor *bg, const GdkColor *fg,
|
||||
const PangoFontDescription *font_desc)
|
||||
#endif
|
||||
{
|
||||
if (!widget)
|
||||
return;
|
||||
|
||||
#if HAVE_GTK3
|
||||
{
|
||||
static const char *class_name = "zoitechat-palette";
|
||||
GtkStyleContext *context = gtk_widget_get_style_context (widget);
|
||||
@@ -635,11 +553,6 @@ gtkutil_apply_palette (GtkWidget *widget, const GdkColor *bg, const GdkColor *fg
|
||||
g_free (bg_color);
|
||||
g_free (fg_color);
|
||||
}
|
||||
#else
|
||||
gtk_widget_modify_base (widget, GTK_STATE_NORMAL, bg);
|
||||
gtk_widget_modify_text (widget, GTK_STATE_NORMAL, fg);
|
||||
gtk_widget_modify_font (widget, (PangoFontDescription *) font_desc);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -764,8 +677,6 @@ static void
|
||||
gtkutil_file_req_done (GtkWidget * wid, struct file_req *freq)
|
||||
{
|
||||
gtkutil_file_req_done_chooser (GTK_FILE_CHOOSER (freq->dialog), freq);
|
||||
|
||||
/* this should call the "destroy" cb, where we free(freq) */
|
||||
gtk_widget_destroy (freq->dialog);
|
||||
}
|
||||
|
||||
@@ -778,11 +689,10 @@ gtkutil_file_req_response (GtkWidget *dialog, gint res, struct file_req *freq)
|
||||
return;
|
||||
}
|
||||
|
||||
/* this should call the "destroy" cb, where we free(freq) */
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
|
||||
#if defined (WIN32) && HAVE_GTK3
|
||||
#ifdef WIN32
|
||||
static gboolean
|
||||
gtkutil_native_dialog_unref_idle (gpointer native)
|
||||
{
|
||||
@@ -826,7 +736,7 @@ gtkutil_file_req (GtkWindow *parent, const char *title, void *callback, void *us
|
||||
|
||||
xdir = get_xdir ();
|
||||
|
||||
#if defined (WIN32) && HAVE_GTK3
|
||||
#ifdef WIN32
|
||||
{
|
||||
GtkFileChooserNative *native = gtk_file_chooser_native_new (
|
||||
title,
|
||||
@@ -902,37 +812,25 @@ gtkutil_file_req (GtkWindow *parent, const char *title, void *callback, void *us
|
||||
|
||||
if (flags & FRF_WRITE)
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
dialog = gtk_file_chooser_dialog_new (title, NULL,
|
||||
GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||
_("_Cancel"), GTK_RESPONSE_CANCEL,
|
||||
_("_Save"), GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
#elif !HAVE_GTK3
|
||||
dialog = gtk_file_chooser_dialog_new (title, NULL,
|
||||
GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
#endif
|
||||
dialog = gtk_file_chooser_dialog_new (title, effective_parent,
|
||||
GTK_FILE_CHOOSER_ACTION_SAVE,
|
||||
_("_Cancel"), GTK_RESPONSE_CANCEL,
|
||||
_("_Save"), GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
|
||||
if (!(flags & FRF_NOASKOVERWRITE))
|
||||
gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);
|
||||
}
|
||||
else
|
||||
#if HAVE_GTK3
|
||||
dialog = gtk_file_chooser_dialog_new (title, NULL,
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
_("_Cancel"), GTK_RESPONSE_CANCEL,
|
||||
_("_Open"), GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
#elif !HAVE_GTK3
|
||||
dialog = gtk_file_chooser_dialog_new (title, NULL,
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
#endif
|
||||
dialog = gtk_file_chooser_dialog_new (title, effective_parent,
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
_("_Cancel"), GTK_RESPONSE_CANCEL,
|
||||
_("_Open"), GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
|
||||
/* Window classes are required for GTK CSS selectors like
|
||||
* .zoitechat-dark / .zoitechat-light. */
|
||||
fe_apply_theme_to_toplevel (dialog);
|
||||
|
||||
if (filter && filter[0] && (flags & FRF_FILTERISINITIAL))
|
||||
{
|
||||
@@ -1003,7 +901,8 @@ gtkutil_file_req (GtkWindow *parent, const char *title, void *callback, void *us
|
||||
g_signal_connect (G_OBJECT (dialog), "destroy",
|
||||
G_CALLBACK (gtkutil_file_req_destroy), (gpointer) freq);
|
||||
|
||||
if (effective_parent)
|
||||
if (effective_parent &&
|
||||
gtk_window_get_transient_for (GTK_WINDOW (dialog)) != effective_parent)
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog), effective_parent);
|
||||
|
||||
if (flags & FRF_MODAL)
|
||||
@@ -1088,17 +987,13 @@ fe_get_str (char *msg, char *def, void *callback, void *userdata)
|
||||
GtkWidget *label;
|
||||
extern GtkWidget *parent_window;
|
||||
|
||||
#if HAVE_GTK3
|
||||
dialog = gtk_dialog_new_with_buttons (msg, NULL, 0,
|
||||
_("_Cancel"), GTK_RESPONSE_REJECT,
|
||||
_("_OK"), GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
#elif !HAVE_GTK3
|
||||
dialog = gtk_dialog_new_with_buttons (msg, NULL, 0,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
|
||||
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
#endif
|
||||
/* Window classes are required for GTK CSS selectors like
|
||||
* .zoitechat-dark / .zoitechat-light. */
|
||||
fe_apply_theme_to_toplevel (dialog);
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent_window));
|
||||
gtk_box_set_homogeneous (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), TRUE);
|
||||
@@ -1190,17 +1085,13 @@ fe_get_int (char *msg, int def, void *callback, void *userdata)
|
||||
GtkAdjustment *adj;
|
||||
extern GtkWidget *parent_window;
|
||||
|
||||
#if HAVE_GTK3
|
||||
dialog = gtk_dialog_new_with_buttons (msg, NULL, 0,
|
||||
_("_Cancel"), GTK_RESPONSE_REJECT,
|
||||
_("_OK"), GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
#elif !HAVE_GTK3
|
||||
dialog = gtk_dialog_new_with_buttons (msg, NULL, 0,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
|
||||
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
#endif
|
||||
/* Window classes are required for GTK CSS selectors like
|
||||
* .zoitechat-dark / .zoitechat-light. */
|
||||
fe_apply_theme_to_toplevel (dialog);
|
||||
gtk_box_set_homogeneous (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), TRUE);
|
||||
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent_window));
|
||||
@@ -1237,17 +1128,13 @@ fe_get_bool (char *title, char *prompt, void *callback, void *userdata)
|
||||
GtkWidget *prompt_label;
|
||||
extern GtkWidget *parent_window;
|
||||
|
||||
#if HAVE_GTK3
|
||||
dialog = gtk_dialog_new_with_buttons (title, NULL, 0,
|
||||
_("_No"), GTK_RESPONSE_REJECT,
|
||||
_("_Yes"), GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
#elif !HAVE_GTK3
|
||||
dialog = gtk_dialog_new_with_buttons (title, NULL, 0,
|
||||
GTK_STOCK_NO, GTK_RESPONSE_REJECT,
|
||||
GTK_STOCK_YES, GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
#endif
|
||||
/* Window classes are required for GTK CSS selectors like
|
||||
* .zoitechat-dark / .zoitechat-light. */
|
||||
fe_apply_theme_to_toplevel (dialog);
|
||||
gtk_box_set_homogeneous (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), TRUE);
|
||||
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent_window));
|
||||
@@ -1278,20 +1165,12 @@ gtkutil_button (GtkWidget *box, char *stock, char *tip, void *callback,
|
||||
{
|
||||
gtk_button_set_label (GTK_BUTTON (wid), labeltext);
|
||||
img = NULL;
|
||||
#if HAVE_GTK3
|
||||
if (stock)
|
||||
img = gtkutil_image_new_from_stock (stock, GTK_ICON_SIZE_BUTTON);
|
||||
#endif
|
||||
#if !HAVE_GTK3
|
||||
if (stock)
|
||||
img = gtk_image_new_from_stock (stock, GTK_ICON_SIZE_BUTTON);
|
||||
#endif
|
||||
if (img)
|
||||
{
|
||||
gtk_button_set_image (GTK_BUTTON (wid), img);
|
||||
#if HAVE_GTK3
|
||||
gtk_button_set_always_show_image (GTK_BUTTON (wid), TRUE);
|
||||
#endif
|
||||
}
|
||||
gtk_button_set_use_underline (GTK_BUTTON (wid), TRUE);
|
||||
if (box)
|
||||
@@ -1304,21 +1183,13 @@ gtkutil_button (GtkWidget *box, char *stock, char *tip, void *callback,
|
||||
gtk_widget_show (bbox);
|
||||
|
||||
img = NULL;
|
||||
#if HAVE_GTK3
|
||||
if (stock)
|
||||
img = gtkutil_image_new_from_stock (stock, GTK_ICON_SIZE_BUTTON);
|
||||
#endif
|
||||
#if !HAVE_GTK3
|
||||
if (stock)
|
||||
img = gtk_image_new_from_stock (stock, GTK_ICON_SIZE_BUTTON);
|
||||
#endif
|
||||
if (img)
|
||||
{
|
||||
gtk_container_add (GTK_CONTAINER (bbox), img);
|
||||
gtk_widget_show (img);
|
||||
#if HAVE_GTK3
|
||||
gtk_button_set_always_show_image (GTK_BUTTON (wid), TRUE);
|
||||
#endif
|
||||
}
|
||||
gtk_box_pack_start (GTK_BOX (box), wid, 0, 0, 0);
|
||||
}
|
||||
@@ -1387,6 +1258,7 @@ gtkutil_window_new (char *title, char *role, int width, int height, int flags)
|
||||
gtk_window_set_title (GTK_WINDOW (win), title);
|
||||
gtk_window_set_default_size (GTK_WINDOW (win), width, height);
|
||||
gtk_window_set_role (GTK_WINDOW (win), role);
|
||||
fe_apply_theme_to_toplevel (win);
|
||||
if (flags & 1)
|
||||
gtk_window_set_position (GTK_WINDOW (win), GTK_WIN_POS_MOUSE);
|
||||
if ((flags & 2) && parent_window)
|
||||
@@ -1509,16 +1381,6 @@ gtkutil_treemodel_string_to_iter (GtkTreeModel *model, gchar *pathstr, GtkTreeIt
|
||||
return success;
|
||||
}
|
||||
|
||||
/*gboolean
|
||||
gtkutil_treeview_get_selected_iter (GtkTreeView *view, GtkTreeIter *iter_ret)
|
||||
{
|
||||
GtkTreeModel *store;
|
||||
GtkTreeSelection *select;
|
||||
|
||||
select = gtk_tree_view_get_selection (view);
|
||||
return gtk_tree_selection_get_selected (select, &store, iter_ret);
|
||||
}*/
|
||||
|
||||
gboolean
|
||||
gtkutil_treeview_get_selected (GtkTreeView *view, GtkTreeIter *iter_ret, ...)
|
||||
{
|
||||
@@ -1545,10 +1407,8 @@ gtkutil_tray_icon_supported (GtkWindow *window)
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
GdkScreen *screen = gtk_window_get_screen (window);
|
||||
GdkDisplay *display = gdk_screen_get_display (screen);
|
||||
#if HAVE_GTK3
|
||||
if (!GDK_IS_X11_DISPLAY (display))
|
||||
return FALSE;
|
||||
#endif
|
||||
int screen_number = gdk_screen_get_number (screen);
|
||||
Display *xdisplay = gdk_x11_display_get_xdisplay (display);
|
||||
char *selection_name = g_strdup_printf ("_NET_SYSTEM_TRAY_S%d", screen_number);
|
||||
@@ -1603,34 +1463,22 @@ gtkutil_find_font (const char *fontname)
|
||||
GtkWidget *
|
||||
gtkutil_box_new (GtkOrientation orientation, gboolean homogeneous, gint spacing)
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
GtkWidget *box = gtk_box_new (orientation, spacing);
|
||||
|
||||
gtk_box_set_homogeneous (GTK_BOX (box), homogeneous);
|
||||
return box;
|
||||
#elif !HAVE_GTK3
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
return gtk_hbox_new (homogeneous, spacing);
|
||||
|
||||
return gtk_vbox_new (homogeneous, spacing);
|
||||
#endif
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gtkutil_grid_new (guint rows, guint columns, gboolean homogeneous)
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
GtkWidget *grid = gtk_grid_new ();
|
||||
|
||||
gtk_grid_set_row_homogeneous (GTK_GRID (grid), homogeneous);
|
||||
gtk_grid_set_column_homogeneous (GTK_GRID (grid), homogeneous);
|
||||
return grid;
|
||||
#elif !HAVE_GTK3
|
||||
return gtk_table_new (rows, columns, homogeneous);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if HAVE_GTK3
|
||||
static GtkAlign
|
||||
gtkutil_align_from_options (GtkutilAttachOptions options, GtkAlign default_align)
|
||||
{
|
||||
@@ -1639,7 +1487,6 @@ gtkutil_align_from_options (GtkutilAttachOptions options, GtkAlign default_align
|
||||
|
||||
return default_align;
|
||||
}
|
||||
#endif
|
||||
|
||||
static gboolean
|
||||
gtkutil_expansion_from_options (GtkutilAttachOptions options, gboolean default_expand)
|
||||
@@ -1657,7 +1504,6 @@ gtkutil_grid_attach (GtkWidget *table, GtkWidget *child,
|
||||
GtkutilAttachOptions xoptions, GtkutilAttachOptions yoptions,
|
||||
guint xpad, guint ypad)
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (child, gtkutil_expansion_from_options (xoptions, FALSE));
|
||||
gtk_widget_set_vexpand (child, gtkutil_expansion_from_options (yoptions, FALSE));
|
||||
gtk_widget_set_halign (child, gtkutil_align_from_options (xoptions, GTK_ALIGN_CENTER));
|
||||
@@ -1668,10 +1514,6 @@ gtkutil_grid_attach (GtkWidget *table, GtkWidget *child,
|
||||
gtk_widget_set_margin_bottom (child, ypad);
|
||||
gtk_grid_attach (GTK_GRID (table), child, left_attach, top_attach,
|
||||
right_attach - left_attach, bottom_attach - top_attach);
|
||||
#elif !HAVE_GTK3
|
||||
gtk_table_attach (GTK_TABLE (table), child, left_attach, right_attach,
|
||||
top_attach, bottom_attach, xoptions, yoptions, xpad, ypad);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1679,15 +1521,10 @@ gtkutil_grid_attach_defaults (GtkWidget *table, GtkWidget *child,
|
||||
guint left_attach, guint right_attach,
|
||||
guint top_attach, guint bottom_attach)
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (child, TRUE);
|
||||
gtk_widget_set_vexpand (child, TRUE);
|
||||
gtk_widget_set_halign (child, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (child, GTK_ALIGN_FILL);
|
||||
gtk_grid_attach (GTK_GRID (table), child, left_attach, top_attach,
|
||||
right_attach - left_attach, bottom_attach - top_attach);
|
||||
#elif !HAVE_GTK3
|
||||
gtk_table_attach_defaults (GTK_TABLE (table), child, left_attach, right_attach,
|
||||
top_attach, bottom_attach);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -26,27 +26,13 @@
|
||||
|
||||
typedef void (*filereqcallback) (void *, char *file);
|
||||
|
||||
#ifndef HAVE_GTK3
|
||||
#if GTK_MAJOR_VERSION >= 3
|
||||
#define HAVE_GTK3 1
|
||||
#else
|
||||
#define HAVE_GTK3 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAVE_GTK3
|
||||
typedef enum
|
||||
{
|
||||
GTKUTIL_ATTACH_EXPAND = 1 << 0,
|
||||
GTKUTIL_ATTACH_SHRINK = 1 << 1,
|
||||
GTKUTIL_ATTACH_FILL = 1 << 2
|
||||
} GtkutilAttachOptions;
|
||||
#else
|
||||
typedef GtkAttachOptions GtkutilAttachOptions;
|
||||
#define GTKUTIL_ATTACH_EXPAND GTK_EXPAND
|
||||
#define GTKUTIL_ATTACH_SHRINK GTK_SHRINK
|
||||
#define GTKUTIL_ATTACH_FILL GTK_FILL
|
||||
#endif
|
||||
|
||||
void gtkutil_file_req (GtkWindow *parent, const char *title, void *callback, void *userdata, char *filter, char *extensions, int flags);
|
||||
void gtkutil_destroy (GtkWidget * igad, GtkWidget * dgad);
|
||||
@@ -55,9 +41,8 @@ GtkWidget *gtkutil_button (GtkWidget *box, char *stock, char *tip, void *callbac
|
||||
void *userdata, char *labeltext);
|
||||
GtkWidget *gtkutil_image_new_from_stock (const char *stock, GtkIconSize size);
|
||||
GtkWidget *gtkutil_button_new_from_stock (const char *stock, const char *label);
|
||||
#if HAVE_GTK3
|
||||
gboolean gtkutil_menu_icon_exists (const char *icon_name);
|
||||
const char *gtkutil_icon_name_from_stock (const char *stock_name);
|
||||
#endif
|
||||
void gtkutil_label_new (char *text, GtkWidget * box);
|
||||
GtkWidget *gtkutil_entry_new (int max, GtkWidget * box, void *callback,
|
||||
gpointer userdata);
|
||||
@@ -82,14 +67,9 @@ void gtkutil_grid_attach (GtkWidget *table, GtkWidget *child,
|
||||
void gtkutil_grid_attach_defaults (GtkWidget *table, GtkWidget *child,
|
||||
guint left_attach, guint right_attach,
|
||||
guint top_attach, guint bottom_attach);
|
||||
#if HAVE_GTK3
|
||||
void gtkutil_apply_palette (GtkWidget *widget, const GdkRGBA *bg, const GdkRGBA *fg,
|
||||
const PangoFontDescription *font_desc);
|
||||
void gtkutil_append_font_css (GString *css, const PangoFontDescription *font_desc);
|
||||
#else
|
||||
void gtkutil_apply_palette (GtkWidget *widget, const GdkColor *bg, const GdkColor *fg,
|
||||
const PangoFontDescription *font_desc);
|
||||
#endif
|
||||
|
||||
#if defined (WIN32) || defined (__APPLE__)
|
||||
gboolean gtkutil_find_font (const char *fontname);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user