mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-06-15 03:00:18 +00:00
Compare commits
6 Commits
d93c9aa780
...
flatpak-fl
| Author | SHA1 | Date | |
|---|---|---|---|
| 57f8f97e59 | |||
| f0a0ea699d | |||
| 005d9c6849 | |||
| 115ac17968 | |||
| d8600a2237 | |||
| 6535810ca3 |
38
.github/workflows/appimage-build.yml
vendored
38
.github/workflows/appimage-build.yml
vendored
@@ -86,21 +86,11 @@ jobs:
|
||||
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-base" ]; then
|
||||
install -d AppDir/usr/lib/x86_64-linux-gnu
|
||||
cp -a /usr/lib/x86_64-linux-gnu/perl-base AppDir/usr/lib/x86_64-linux-gnu/
|
||||
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/lib/x86_64-linux-gnu/perl5" ]; then
|
||||
install -d AppDir/usr/lib/x86_64-linux-gnu
|
||||
cp -a /usr/lib/x86_64-linux-gnu/perl5 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/
|
||||
@@ -110,10 +100,6 @@ jobs:
|
||||
install -d AppDir/usr/share
|
||||
cp -a /usr/share/perl5 AppDir/usr/share/
|
||||
fi
|
||||
|
||||
perl -MFile::Spec -e 'print "Build host File::Spec: $INC{\"File/Spec.pm\"}\n"'
|
||||
find AppDir/usr -path '*/File/Spec.pm' -print -quit | grep -q .
|
||||
|
||||
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/
|
||||
@@ -176,7 +162,7 @@ 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}"
|
||||
export GTK_EXE_PREFIX="$APPDIR/usr"
|
||||
@@ -225,23 +211,6 @@ jobs:
|
||||
|
||||
unset GTK_MODULES
|
||||
|
||||
perl5lib_entries=""
|
||||
for dir in \
|
||||
"$APPDIR/usr/lib/x86_64-linux-gnu/perl-base" \
|
||||
"$APPDIR/usr/lib/x86_64-linux-gnu/perl"/* \
|
||||
"$APPDIR/usr/lib/x86_64-linux-gnu/perl5"/* \
|
||||
"$APPDIR/usr/share/perl"/* \
|
||||
"$APPDIR/usr/share/perl5"
|
||||
do
|
||||
if [ -d "$dir" ]; then
|
||||
perl5lib_entries="${perl5lib_entries:+$perl5lib_entries:}$dir"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$perl5lib_entries" ]; then
|
||||
export PERL5LIB="$perl5lib_entries${PERL5LIB:+:$PERL5LIB}"
|
||||
fi
|
||||
|
||||
export PYTHONHOME="$APPDIR/usr"
|
||||
python_stdlib_dir="$(find "$APPDIR/usr/lib" -maxdepth 1 -type d -name 'python3.*' | head -n 1 || true)"
|
||||
pythonpath_entries=""
|
||||
@@ -287,12 +256,13 @@ jobs:
|
||||
EOF
|
||||
chmod +x AppRun
|
||||
|
||||
|
||||
VERSION="$(git describe --tags --always)"
|
||||
|
||||
./linuxdeploy-x86_64.AppImage \
|
||||
--appdir AppDir \
|
||||
--desktop-file AppDir/usr/share/applications/net.zoite.Zoitechat.desktop \
|
||||
--icon-file AppDir/usr/share/icons/hicolor/48x48/apps/net.zoite.Zoitechat.png \
|
||||
--desktop-file AppDir/usr/share/applications/org.zoitechat.ZoiteChat.desktop \
|
||||
--icon-file AppDir/usr/share/icons/hicolor/48x48/apps/org.zoitechat.ZoiteChat.png \
|
||||
--custom-apprun ./AppRun \
|
||||
--plugin gtk \
|
||||
--output appimage
|
||||
|
||||
2
.github/workflows/flatpak-build.yml
vendored
2
.github/workflows/flatpak-build.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
||||
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
|
||||
with:
|
||||
bundle: zoitechat.flatpak
|
||||
manifest-path: flatpak/net.zoite.Zoitechat.json
|
||||
manifest-path: flatpak/org.zoitechat.ZoiteChat.json
|
||||
cache: false
|
||||
restore-cache: false
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
icondir = join_paths(get_option('datadir'), 'icons/hicolor')
|
||||
install_data(
|
||||
'zoitechat.png',
|
||||
rename: 'net.zoite.Zoitechat.png',
|
||||
rename: 'org.zoitechat.ZoiteChat.png',
|
||||
install_dir: join_paths(icondir, '48x48/apps')
|
||||
)
|
||||
install_data(
|
||||
'zoitechat.svg',
|
||||
rename: 'net.zoite.Zoitechat.svg',
|
||||
rename: 'org.zoitechat.ZoiteChat.svg',
|
||||
install_dir: join_paths(icondir, 'scalable/apps')
|
||||
)
|
||||
|
||||
@@ -6,8 +6,8 @@ desktop_utils = find_program('desktop-file-validate', required: false)
|
||||
if get_option('gtk-frontend')
|
||||
if get_option('install-appdata')
|
||||
zoitechat_appdata = i18n.merge_file(
|
||||
input: 'net.zoite.Zoitechat.appdata.xml.in',
|
||||
output: 'net.zoite.Zoitechat.appdata.xml',
|
||||
input: 'org.zoitechat.ZoiteChat.metainfo.xml.in',
|
||||
output: 'org.zoitechat.ZoiteChat.metainfo.xml',
|
||||
po_dir: '../../po',
|
||||
install: true,
|
||||
install_dir: metainfodir
|
||||
@@ -15,7 +15,7 @@ if get_option('gtk-frontend')
|
||||
|
||||
appstreamcli = find_program('appstreamcli', required: false)
|
||||
if appstreamcli.found()
|
||||
test('Validate net.zoite.Zoitechat.appdata.xml', appstreamcli,
|
||||
test('Validate org.zoitechat.ZoiteChat.metainfo.xml', appstreamcli,
|
||||
args: ['validate', zoitechat_appdata]
|
||||
)
|
||||
endif
|
||||
@@ -29,14 +29,14 @@ if get_option('gtk-frontend')
|
||||
endif
|
||||
|
||||
desktop_file = configure_file(
|
||||
input: 'net.zoite.Zoitechat.desktop.in.in',
|
||||
output: 'net.zoite.Zoitechat.desktop.in',
|
||||
input: 'org.zoitechat.ZoiteChat.desktop.in.in',
|
||||
output: 'org.zoitechat.ZoiteChat.desktop.in',
|
||||
configuration: desktop_conf
|
||||
)
|
||||
|
||||
zoitechat_desktop = i18n.merge_file(
|
||||
input: desktop_file,
|
||||
output: 'net.zoite.Zoitechat.desktop',
|
||||
output: 'org.zoitechat.ZoiteChat.desktop',
|
||||
po_dir: '../../po',
|
||||
type: 'desktop',
|
||||
install: true,
|
||||
@@ -44,7 +44,7 @@ if get_option('gtk-frontend')
|
||||
)
|
||||
|
||||
if desktop_utils.found()
|
||||
test('Validate net.zoite.Zoitechat.desktop', desktop_utils,
|
||||
test('Validate org.zoitechat.ZoiteChat.desktop', desktop_utils,
|
||||
args: [zoitechat_desktop]
|
||||
)
|
||||
endif
|
||||
@@ -98,14 +98,14 @@ if get_option('plugin')
|
||||
conf.set('LICENSE', metainfo[2])
|
||||
|
||||
plugin_appdata = configure_file(
|
||||
input: 'net.zoite.Zoitechat.Plugin.metainfo.xml.in',
|
||||
output: 'net.zoite.Zoitechat.Plugin.@0@.metainfo.xml'.format(name),
|
||||
input: 'org.zoitechat.ZoiteChat.Plugin.metainfo.xml.in',
|
||||
output: 'org.zoitechat.ZoiteChat.Plugin.@0@.metainfo.xml'.format(name),
|
||||
configuration: conf,
|
||||
install_dir: get_option('install-plugin-metainfo') ? metainfodir : '',
|
||||
)
|
||||
|
||||
if appstreamcli.found()
|
||||
test('Validate net.zoite.Zoitechat.Plugin.@0@.metainfo.xml'.format(name), appstreamcli,
|
||||
test('Validate org.zoitechat.ZoiteChat.Plugin.@0@.metainfo.xml'.format(name), appstreamcli,
|
||||
args: ['validate', plugin_appdata]
|
||||
)
|
||||
endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="addon">
|
||||
<id>net.zoite.Zoitechat.Plugin.@NAME@</id>
|
||||
<extends>net.zoite.Zoitechat</extends>
|
||||
<id>org.zoitechat.ZoiteChat.Plugin.@NAME@</id>
|
||||
<extends>org.zoitechat.ZoiteChat</extends>
|
||||
<name>@NAME@ Plugin</name>
|
||||
<summary>@SUMMARY@</summary>
|
||||
<url type="homepage">https://zoitechat.org/</url>
|
||||
@@ -4,12 +4,12 @@ GenericName=IRC Client
|
||||
Comment=Chat with other people online
|
||||
Keywords=IM;Chat;
|
||||
Exec=@exec_command@
|
||||
Icon=net.zoite.Zoitechat
|
||||
Icon=org.zoitechat.ZoiteChat
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=GTK;Network;IRCClient;
|
||||
StartupNotify=true
|
||||
StartupWMClass=net.zoite.Zoitechat
|
||||
StartupWMClass=org.zoitechat.ZoiteChat
|
||||
X-GNOME-UsesNotifications=true
|
||||
MimeType=x-scheme-handler/irc;x-scheme-handler/ircs;
|
||||
Actions=SafeMode;
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>net.zoite.Zoitechat</id>
|
||||
<id>org.zoitechat.ZoiteChat</id>
|
||||
<name>ZoiteChat</name>
|
||||
<launchable type="desktop-id">net.zoite.Zoitechat.desktop</launchable>
|
||||
<launchable type="desktop-id">org.zoitechat.ZoiteChat.desktop</launchable>
|
||||
|
||||
<developer id="net.zoite">
|
||||
<developer id="org.zoitechat">
|
||||
<name translate="no">ZoiteChat</name>
|
||||
</developer>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<provides>
|
||||
<id>zoitechat.desktop</id>
|
||||
<id>org.zoitechat.ZoiteChat.desktop</id>
|
||||
</provides>
|
||||
<releases>
|
||||
<release date="2026-05-21" version="2.18.1">
|
||||
@@ -339,7 +339,7 @@
|
||||
<description>
|
||||
<p>This is largely a bug fix release though it has some large behind the scenes changes:</p>
|
||||
<ul>
|
||||
<li>Rename data files to use *net.zoite.Zoitechat* name</li>
|
||||
<li>Rename data files to use *org.zoitechat.ZoiteChat* name</li>
|
||||
<li>Add option (irc_reconnect_rejoin) to disable auto-rejoin on reconnect</li>
|
||||
<li>Add ability to set custom tray icon separate of app icon</li>
|
||||
<li>Fix Enchant 2.0+ support</li>
|
||||
@@ -1,25 +1,17 @@
|
||||
From 918503d57c6740d20be68a6717158673a2a8b25f Mon Sep 17 00:00:00 2001
|
||||
From: Patrick Griffis <tingping@tingping.se>
|
||||
Date: Sat, 17 Mar 2018 05:57:49 -0400
|
||||
Subject: [PATCH] Support loading Flatpak extensions
|
||||
|
||||
---
|
||||
src/common/plugin.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/common/plugin.c b/src/common/plugin.c
|
||||
index 3ad3c558..6addf962 100644
|
||||
--- a/src/common/plugin.c
|
||||
+++ b/src/common/plugin.c
|
||||
@@ -450,6 +450,8 @@ plugin_auto_load (session *sess)
|
||||
lib_dir = plugin_get_libdir ();
|
||||
sub_dir = g_build_filename (get_xdir (), "addons", NULL);
|
||||
|
||||
+ for_files ("/app/extensions/lib/zoitechat/plugins", "*.so", plugin_auto_load_cb);
|
||||
@@ -470,7 +470,14 @@
|
||||
if (libdir && *libdir)
|
||||
return libdir;
|
||||
else
|
||||
+ {
|
||||
+ if (g_file_test ("/app/extensions/lib/zoitechat/plugins", G_FILE_TEST_IS_DIR))
|
||||
+ {
|
||||
+ return "/app/extensions/lib/zoitechat/plugins";
|
||||
+ }
|
||||
+
|
||||
#ifdef WIN32
|
||||
/* a long list of bundled plugins that should be loaded automatically,
|
||||
* user plugins should go to <config>, leave Program Files alone! */
|
||||
--
|
||||
2.14.3
|
||||
|
||||
return ZOITECHATLIBDIR;
|
||||
+ }
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
{
|
||||
"app-id": "net.zoite.Zoitechat",
|
||||
"branch": "master",
|
||||
"runtime": "org.gnome.Platform",
|
||||
"runtime-version": "49",
|
||||
"sdk": "org.gnome.Sdk",
|
||||
"command": "zoitechat",
|
||||
"finish-args": [
|
||||
"--share=ipc",
|
||||
"--socket=wayland",
|
||||
"--socket=fallback-x11",
|
||||
"--share=network",
|
||||
"--socket=pulseaudio",
|
||||
"--filesystem=xdg-download",
|
||||
"--filesystem=xdg-data/themes:ro",
|
||||
"--filesystem=xdg-data/icons:ro",
|
||||
"--filesystem=xdg-run/tray-icon:create",
|
||||
"--env=GTK_CSD=1",
|
||||
"--talk-name=org.freedesktop.Notifications",
|
||||
"--talk-name=org.kde.StatusNotifierWatcher",
|
||||
"--talk-name=com.canonical.AppMenu.Registrar",
|
||||
"--talk-name=org.mpris.MediaPlayer2.*"
|
||||
],
|
||||
"add-extensions": {
|
||||
"net.zoite.Zoitechat.Plugin": {
|
||||
"version": "49",
|
||||
"directory": "extensions",
|
||||
"add-ld-path": "lib",
|
||||
"merge-dirs": "lib/zoitechat/plugins",
|
||||
"subdirectories": true,
|
||||
"no-autodownload": true,
|
||||
"autodelete": true
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
"shared-modules/lua5.4/lua-5.4.json",
|
||||
"shared-modules/libcanberra/libcanberra.json",
|
||||
"shared-modules/libayatana-appindicator/libayatana-appindicator-gtk3.json",
|
||||
"python3-cffi.json",
|
||||
"perl.json",
|
||||
{
|
||||
"name": "lgi",
|
||||
"buildsystem": "meson",
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://github.com/pavouk/lgi/archive/c9b8e4473c6421f2a215d8c06c0d94b86eb0b26a.tar.gz",
|
||||
"sha256": "db67b2b7ee89fa566f783486d56be7203552a997bc55f35020b57dd2776b9943"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "zoitechat",
|
||||
"buildsystem": "meson",
|
||||
"config-opts": [
|
||||
"-Ddbus-service-use-appid=true",
|
||||
"-Dwith-perl=perl",
|
||||
"-Dwith-python=python3",
|
||||
"-Dwith-lua=lua"
|
||||
],
|
||||
"build-options": {
|
||||
"cflags": "-Wno-error=missing-include-dirs"
|
||||
},
|
||||
"cleanup": [
|
||||
"/share/man"
|
||||
],
|
||||
"post-install": [
|
||||
"install -d /app/extensions"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "dir",
|
||||
"path": ".."
|
||||
},
|
||||
{
|
||||
"type": "patch",
|
||||
"path": "Load-plugins-from-Flatpak-extensions.patch"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
127
flatpak/org.zoitechat.ZoiteChat.json
Normal file
127
flatpak/org.zoitechat.ZoiteChat.json
Normal file
@@ -0,0 +1,127 @@
|
||||
{
|
||||
"app-id": "org.zoitechat.ZoiteChat",
|
||||
"runtime": "org.gnome.Platform",
|
||||
"runtime-version": "50",
|
||||
"sdk": "org.gnome.Sdk",
|
||||
"command": "zoitechat",
|
||||
"finish-args": [
|
||||
"--share=ipc",
|
||||
"--socket=wayland",
|
||||
"--socket=fallback-x11",
|
||||
"--share=network",
|
||||
"--socket=pulseaudio",
|
||||
"--filesystem=xdg-download",
|
||||
"--filesystem=xdg-run/tray-icon:create",
|
||||
"--env=GTK_CSD=1",
|
||||
"--talk-name=org.freedesktop.Notifications",
|
||||
"--talk-name=org.kde.StatusNotifierWatcher",
|
||||
"--talk-name=com.canonical.AppMenu.Registrar"
|
||||
],
|
||||
"add-extensions": {
|
||||
"org.zoitechat.ZoiteChat.Plugin": {
|
||||
"version": "50",
|
||||
"directory": "extensions",
|
||||
"add-ld-path": "lib",
|
||||
"merge-dirs": "lib/zoitechat/plugins",
|
||||
"subdirectories": true,
|
||||
"no-autodownload": true,
|
||||
"autodelete": true
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
"shared-modules/lua5.4/lua-5.4.json",
|
||||
"shared-modules/libcanberra/libcanberra.json",
|
||||
"shared-modules/libayatana-appindicator/libayatana-appindicator-gtk3.json",
|
||||
{
|
||||
"name": "python3-cffi",
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"cffi\" --no-build-isolation"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/1d/b2/31537cf4b1ca988837256c910a668b553fceb8f069bedc4b1c826024b52c/pycparser-2.22.tar.gz",
|
||||
"sha256": "491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/fc/97/c783634659c2920c3fc70419e3af40972dbaf758daa229a7d6ea6135c90d/cffi-1.17.1.tar.gz",
|
||||
"sha256": "1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "perl",
|
||||
"buildsystem": "simple",
|
||||
"build-options": {
|
||||
"no-debuginfo": true
|
||||
},
|
||||
"build-commands": [
|
||||
"./Configure -des -Dprefix=/app -Dvendorprefix=/app -Duseshrplib -Dman1dir=none -Dman3dir=none",
|
||||
"make -j${FLATPAK_BUILDER_N_JOBS}",
|
||||
"make install"
|
||||
],
|
||||
"cleanup": [
|
||||
"/share/man",
|
||||
"/lib/perl5/*/*/CORE/*.a"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://www.cpan.org/src/5.0/perl-5.42.2.tar.xz",
|
||||
"sha256": "0a585eeb9e363c0f80482ddb3571625250c2c86aeb408853e8ea50805cfb14bb"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "lgi",
|
||||
"buildsystem": "meson",
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://github.com/pavouk/lgi/archive/c9b8e4473c6421f2a215d8c06c0d94b86eb0b26a.tar.gz",
|
||||
"sha256": "db67b2b7ee89fa566f783486d56be7203552a997bc55f35020b57dd2776b9943"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "zoitechat",
|
||||
"buildsystem": "meson",
|
||||
"config-opts": [
|
||||
"-Ddbus-service-use-appid=true",
|
||||
"-Dwith-perl=perl",
|
||||
"-Dwith-python=python3",
|
||||
"-Dwith-lua=lua"
|
||||
],
|
||||
"build-options": {
|
||||
"cflags": "-Wno-error=missing-include-dirs"
|
||||
},
|
||||
"cleanup": [
|
||||
"/share/man"
|
||||
],
|
||||
"post-install": [
|
||||
"install -d /app/extensions"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "https://github.com/ZoiteChat/zoitechat.git",
|
||||
"tag": "zoitechat-2.18.1",
|
||||
"commit": "479f1649efa0e5b166a7c7c9d86214b42ec9f794"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://publicsuffix.org/list/public_suffix_list.dat",
|
||||
"sha256": "6f7f7d9e8c68447f1c74095a12574b7fee46b0cd759c518a659aee0615d8e118",
|
||||
"dest": "src/common",
|
||||
"dest-filename": "public_suffix_list.dat"
|
||||
},
|
||||
{
|
||||
"type": "patch",
|
||||
"path": "Load-plugins-from-Flatpak-extensions.patch"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"name": "perl",
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"./Configure -des -Dprefix=/app -Dvendorprefix=/app -Duseshrplib -Dman1dir=none -Dman3dir=none",
|
||||
"make -j${FLATPAK_BUILDER_N_JOBS}",
|
||||
"make install"
|
||||
],
|
||||
"cleanup": [
|
||||
"/share/man",
|
||||
"/lib/perl5/*/*/CORE/*.a"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://www.cpan.org/src/5.0/perl-5.42.2.tar.xz",
|
||||
"sha256": "0a585eeb9e363c0f80482ddb3571625250c2c86aeb408853e8ea50805cfb14bb"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"name": "python3-cffi",
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"cffi\" --no-build-isolation"
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/1d/b2/31537cf4b1ca988837256c910a668b553fceb8f069bedc4b1c826024b52c/pycparser-2.22.tar.gz",
|
||||
"sha256": "491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"
|
||||
},
|
||||
{
|
||||
"type": "file",
|
||||
"url": "https://files.pythonhosted.org/packages/fc/97/c783634659c2920c3fc70419e3af40972dbaf758daa229a7d6ea6135c90d/cffi-1.17.1.tar.gz",
|
||||
"sha256": "1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -91,13 +91,27 @@ static const signed char fish_unbase64[256] = {
|
||||
#include <openssl/provider.h>
|
||||
static OSSL_PROVIDER *legacy_provider;
|
||||
static OSSL_PROVIDER *default_provider;
|
||||
static OSSL_LIB_CTX *ossl_ctx;
|
||||
#endif
|
||||
|
||||
int fish_init(void)
|
||||
{
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
legacy_provider = OSSL_PROVIDER_load(NULL, "legacy");
|
||||
default_provider = OSSL_PROVIDER_load(NULL, "default");
|
||||
ossl_ctx = OSSL_LIB_CTX_new();
|
||||
if (!ossl_ctx)
|
||||
return 0;
|
||||
|
||||
legacy_provider = OSSL_PROVIDER_load(ossl_ctx, "legacy");
|
||||
if (!legacy_provider) {
|
||||
fish_deinit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
default_provider = OSSL_PROVIDER_load(ossl_ctx, "default");
|
||||
if (!default_provider) {
|
||||
fish_deinit();
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
@@ -115,6 +129,10 @@ void fish_deinit(void)
|
||||
default_provider = NULL;
|
||||
}
|
||||
|
||||
if (ossl_ctx) {
|
||||
OSSL_LIB_CTX_free(ossl_ctx);
|
||||
ossl_ctx = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -260,9 +278,7 @@ char *fish_cipher(const char *plaintext, size_t plaintext_len, const char *key,
|
||||
}
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
cipher = EVP_CIPHER_fetch(NULL, "BF-CBC", NULL);
|
||||
if (!cipher)
|
||||
cipher = (EVP_CIPHER *) EVP_bf_cbc();
|
||||
cipher = EVP_CIPHER_fetch(ossl_ctx, "BF-CBC", NULL);
|
||||
#else
|
||||
cipher = (EVP_CIPHER *) EVP_bf_cbc();
|
||||
#endif
|
||||
@@ -270,9 +286,7 @@ char *fish_cipher(const char *plaintext, size_t plaintext_len, const char *key,
|
||||
} else if (mode == EVP_CIPH_ECB_MODE) {
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
cipher = EVP_CIPHER_fetch(NULL, "BF-ECB", NULL);
|
||||
if (!cipher)
|
||||
cipher = (EVP_CIPHER *) EVP_bf_ecb();
|
||||
cipher = EVP_CIPHER_fetch(ossl_ctx, "BF-ECB", NULL);
|
||||
#else
|
||||
cipher = (EVP_CIPHER *) EVP_bf_ecb();
|
||||
#endif
|
||||
|
||||
@@ -421,7 +421,7 @@ static int handle_keyx_notice(char *word[], char *word_eol[], void *userdata) {
|
||||
zoitechat_commandf(ph, "quote NOTICE %s :DH1080_FINISH %s%s", sender, pub_key, (mode == FISH_CBC_MODE) ? " CBC" : "");
|
||||
g_free(pub_key);
|
||||
} else {
|
||||
zoitechat_printf(ph, "Failed to generate keys");
|
||||
zoitechat_print(ph, "Failed to generate keys");
|
||||
goto cleanup;
|
||||
}
|
||||
} else if (!strcmp (dh_message, "DH1080_FINISH")) {
|
||||
@@ -446,7 +446,7 @@ static int handle_keyx_notice(char *word[], char *word_eol[], void *userdata) {
|
||||
zoitechat_printf(ph, "Stored new key for %s (%s)", sender, fish_modes[mode]);
|
||||
g_free(secret_key);
|
||||
} else {
|
||||
zoitechat_printf(ph, "Failed to create secret key!");
|
||||
zoitechat_print(ph, "Failed to create secret key!");
|
||||
}
|
||||
|
||||
cleanup:
|
||||
@@ -548,7 +548,7 @@ static int handle_keyx(char *word[], char *word_eol[], void *userdata) {
|
||||
}
|
||||
|
||||
if ((query_ctx && ctx_type != 3) || (!query_ctx && !irc_is_query(target))) {
|
||||
zoitechat_printf(ph, "You can only exchange keys with individuals");
|
||||
zoitechat_print(ph, "You can only exchange keys with individuals");
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
@@ -560,7 +560,7 @@ static int handle_keyx(char *word[], char *word_eol[], void *userdata) {
|
||||
|
||||
g_free(pub_key);
|
||||
} else {
|
||||
zoitechat_printf(ph, "Failed to generate keys");
|
||||
zoitechat_print(ph, "Failed to generate keys");
|
||||
}
|
||||
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
@@ -577,7 +577,7 @@ static int handle_crypt_topic(char *word[], char *word_eol[], void *userdata) {
|
||||
GSList *encrypted_list;
|
||||
|
||||
if (!*topic) {
|
||||
zoitechat_printf(ph, "%s", usage_topic);
|
||||
zoitechat_print(ph, usage_topic);
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
@@ -624,7 +624,7 @@ static int handle_crypt_notice(char *word[], char *word_eol[], void *userdata) {
|
||||
GSList *encrypted_list, *encrypted_item;
|
||||
|
||||
if (!*target || !*notice) {
|
||||
zoitechat_printf(ph, "%s", usage_notice);
|
||||
zoitechat_print(ph, usage_notice);
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
@@ -676,7 +676,7 @@ static int handle_crypt_msg(char *word[], char *word_eol[], void *userdata) {
|
||||
GSList *encrypted_list, *encrypted_item;
|
||||
|
||||
if (!*target || !*message) {
|
||||
zoitechat_printf(ph, "%s", usage_msg);
|
||||
zoitechat_print(ph, usage_msg);
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
@@ -805,15 +805,11 @@ int zoitechat_plugin_init(zoitechat_plugin *plugin_handle,
|
||||
zoitechat_hook_server_attrs(ph, "TOPIC", ZOITECHAT_PRI_NORM, handle_incoming, NULL);
|
||||
zoitechat_hook_server_attrs(ph, "332", ZOITECHAT_PRI_NORM, handle_incoming, NULL);
|
||||
|
||||
if (!fish_init()) {
|
||||
zoitechat_printf(ph, "FiSHLiM failed to initialize crypto backend");
|
||||
if (!fish_init())
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!dh1080_init()) {
|
||||
zoitechat_printf(ph, "FiSHLiM failed to initialize DH1080");
|
||||
if (!dh1080_init())
|
||||
return 0;
|
||||
}
|
||||
|
||||
pending_exchanges = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
|
||||
|
||||
|
||||
15
readme.md
15
readme.md
@@ -31,19 +31,12 @@
|
||||
<br />
|
||||
|
||||
|
||||
ZoiteChat is a GTK3 IRC client based on HexChat, available for Windows and UNIX-like operating systems.
|
||||
|
||||
Features include HexChat-compatible Python, Perl and Lua scripting support, a plugin API,
|
||||
multiple server/channel windows, spell checking, multiple authentication methods including SASL,
|
||||
and customizable notifications.
|
||||
|
||||
ZoiteChat is an HexChat based IRC client for Windows and UNIX-like operating systems.
|
||||
See [IRCHelp.org](http://irchelp.org) for information about IRC in general.
|
||||
For more information on ZoiteChat please read our [documentation](https://docs.zoitechat.org/):
|
||||
- [Downloads](https://zoitechat.org/download)
|
||||
|
||||
For more information on ZoiteChat:
|
||||
|
||||
- [Main Documentation](https://docs.zoitechat.org/) and [FAQ](https://docs.zoitechat.org/en/latest/faq.html)
|
||||
|
||||
- [Downloads](https://zoitechat.org/download.php)
|
||||
- [Troubleshooting](troubleshooting.md)
|
||||
|
||||
|
||||
---
|
||||
|
||||
@@ -447,7 +447,6 @@ const struct prefs vars[] =
|
||||
{"gui_tab_layout", P_OFFINT (hex_gui_tab_layout), TYPE_INT},
|
||||
{"gui_tab_closebuttons", P_OFFINT (hex_gui_tab_closebuttons), TYPE_BOOL},
|
||||
{"gui_tab_middleclose", P_OFFINT (hex_gui_tab_middleclose), TYPE_BOOL},
|
||||
{"gui_mouse_scroll_speed", P_OFFINT (hex_gui_mouse_scroll_speed), TYPE_INT},
|
||||
{"gui_tab_newtofront", P_OFFINT (hex_gui_tab_newtofront), TYPE_INT},
|
||||
{"gui_tab_pos", P_OFFINT (hex_gui_tab_pos), TYPE_INT},
|
||||
{"gui_tab_scrollchans", P_OFFINT (hex_gui_tab_scrollchans), TYPE_BOOL},
|
||||
@@ -549,10 +548,6 @@ const struct prefs vars[] =
|
||||
#endif
|
||||
{"net_bind_host", P_OFFSET (hex_net_bind_host), TYPE_STR},
|
||||
{"net_ping_timeout", P_OFFINT (hex_net_ping_timeout), TYPE_INT, zoitechat_reinit_timers},
|
||||
{"net_lag_check", P_OFFINT (hex_net_lag_check), TYPE_INT, zoitechat_reinit_timers},
|
||||
{"net_keepalive_idle", P_OFFINT (hex_net_keepalive_idle), TYPE_INT},
|
||||
{"net_keepalive_interval", P_OFFINT (hex_net_keepalive_interval), TYPE_INT},
|
||||
{"net_keepalive_count", P_OFFINT (hex_net_keepalive_count), TYPE_INT},
|
||||
{"net_proxy_auth", P_OFFINT (hex_net_proxy_auth), TYPE_BOOL},
|
||||
{"net_proxy_host", P_OFFSET (hex_net_proxy_host), TYPE_STR},
|
||||
{"net_proxy_pass", P_OFFSET (hex_net_proxy_pass), TYPE_STR},
|
||||
@@ -788,7 +783,6 @@ load_default_config(void)
|
||||
prefs.hex_gui_tab_server = 1;
|
||||
prefs.hex_gui_tab_sort = 1;
|
||||
prefs.hex_gui_tab_scrollchans = 1;
|
||||
prefs.hex_gui_mouse_scroll_speed = 10;
|
||||
prefs.hex_gui_topicbar = 1;
|
||||
prefs.hex_gui_transparency = 255;
|
||||
prefs.hex_gui_tray = 1;
|
||||
@@ -864,10 +858,6 @@ load_default_config(void)
|
||||
prefs.hex_irc_ban_type = 1;
|
||||
prefs.hex_irc_join_delay = 5;
|
||||
prefs.hex_net_ping_timeout = 60;
|
||||
prefs.hex_net_lag_check = 60;
|
||||
prefs.hex_net_keepalive_idle = 60;
|
||||
prefs.hex_net_keepalive_interval = 20;
|
||||
prefs.hex_net_keepalive_count = 3;
|
||||
prefs.hex_net_reconnect_delay = 10;
|
||||
prefs.hex_notify_timeout = 15;
|
||||
prefs.hex_text_max_indent = 256;
|
||||
|
||||
@@ -34,9 +34,6 @@
|
||||
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_NETINET_TCP_H
|
||||
#include <netinet/tcp.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define WANTSOCKET
|
||||
@@ -46,9 +43,6 @@
|
||||
|
||||
#define NETWORK_PRIVATE
|
||||
#include "network.h"
|
||||
#include "zoitechat.h"
|
||||
|
||||
extern struct zoitechatprefs prefs;
|
||||
|
||||
#define RAND_INT(n) ((int)(rand() / (RAND_MAX + 1.0) * (n)))
|
||||
|
||||
@@ -64,27 +58,6 @@ net_set_socket_options (int sok)
|
||||
setsockopt (sok, SOL_SOCKET, SO_REUSEADDR, (char *) &sw, sizeof (sw));
|
||||
sw = 1;
|
||||
setsockopt (sok, SOL_SOCKET, SO_KEEPALIVE, (char *) &sw, sizeof (sw));
|
||||
#ifdef TCP_KEEPIDLE
|
||||
{
|
||||
int keepidle = prefs.hex_net_keepalive_idle;
|
||||
if (keepidle > 0)
|
||||
setsockopt (sok, IPPROTO_TCP, TCP_KEEPIDLE, (char *) &keepidle, sizeof (keepidle));
|
||||
}
|
||||
#endif
|
||||
#ifdef TCP_KEEPINTVL
|
||||
{
|
||||
int keepintvl = prefs.hex_net_keepalive_interval;
|
||||
if (keepintvl > 0)
|
||||
setsockopt (sok, IPPROTO_TCP, TCP_KEEPINTVL, (char *) &keepintvl, sizeof (keepintvl));
|
||||
}
|
||||
#endif
|
||||
#ifdef TCP_KEEPCNT
|
||||
{
|
||||
int keepcnt = prefs.hex_net_keepalive_count;
|
||||
if (keepcnt > 0)
|
||||
setsockopt (sok, IPPROTO_TCP, TCP_KEEPCNT, (char *) &keepcnt, sizeof (keepcnt));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
char *
|
||||
|
||||
@@ -379,7 +379,6 @@ lag_check (void)
|
||||
char tbuf[128];
|
||||
time_t now = time (0);
|
||||
time_t lag;
|
||||
time_t ping_age;
|
||||
|
||||
tim = make_ping_time ();
|
||||
|
||||
@@ -389,7 +388,7 @@ lag_check (void)
|
||||
if (serv->connected && serv->end_of_motd)
|
||||
{
|
||||
lag = now - serv->ping_recv;
|
||||
if (serv->lag_sent && prefs.hex_net_ping_timeout != 0 && lag > prefs.hex_net_ping_timeout && lag > 0)
|
||||
if (prefs.hex_net_ping_timeout != 0 && lag > prefs.hex_net_ping_timeout && lag > 0)
|
||||
{
|
||||
sprintf (tbuf, "%" G_GINT64_FORMAT, (gint64) lag);
|
||||
EMIT_SIGNAL (XP_TE_PINGTIMEOUT, serv->server_session, tbuf, NULL,
|
||||
@@ -399,11 +398,11 @@ lag_check (void)
|
||||
}
|
||||
else
|
||||
{
|
||||
ping_age = now - serv->ping_recv;
|
||||
if (!serv->lag_sent && prefs.hex_net_lag_check > 0 && ping_age >= prefs.hex_net_lag_check)
|
||||
g_snprintf (tbuf, sizeof (tbuf), "LAG%lu", tim);
|
||||
serv->p_ping (serv, "", tbuf);
|
||||
|
||||
if (!serv->lag_sent)
|
||||
{
|
||||
g_snprintf (tbuf, sizeof (tbuf), "LAG%lu", tim);
|
||||
serv->p_ping (serv, "", tbuf);
|
||||
serv->lag_sent = tim;
|
||||
fe_set_lag (serv, -1);
|
||||
}
|
||||
@@ -526,7 +525,7 @@ zoitechat_reinit_timers (void)
|
||||
if ((prefs.hex_net_ping_timeout != 0 || prefs.hex_gui_lagometer)
|
||||
&& lag_check_tag == 0)
|
||||
{
|
||||
lag_check_tag = fe_timeout_add_seconds (1, zoitechat_lag_check, NULL);
|
||||
lag_check_tag = fe_timeout_add_seconds (30, zoitechat_lag_check, NULL);
|
||||
}
|
||||
else if ((!prefs.hex_net_ping_timeout && !prefs.hex_gui_lagometer)
|
||||
&& lag_check_tag != 0)
|
||||
|
||||
@@ -267,7 +267,6 @@ struct zoitechatprefs
|
||||
int hex_gui_tab_layout;
|
||||
int hex_gui_tab_closebuttons;
|
||||
int hex_gui_tab_middleclose;
|
||||
int hex_gui_mouse_scroll_speed;
|
||||
int hex_gui_tab_newtofront;
|
||||
int hex_gui_tab_pos;
|
||||
int hex_gui_tab_small;
|
||||
@@ -290,10 +289,6 @@ struct zoitechatprefs
|
||||
int hex_irc_join_delay;
|
||||
int hex_irc_notice_pos;
|
||||
int hex_net_ping_timeout;
|
||||
int hex_net_lag_check;
|
||||
int hex_net_keepalive_idle;
|
||||
int hex_net_keepalive_interval;
|
||||
int hex_net_keepalive_count;
|
||||
int hex_net_proxy_port;
|
||||
int hex_net_proxy_type; /* 0=disabled, 1=wingate 2=socks4, 3=socks5, 4=http */
|
||||
int hex_net_proxy_use; /* 0=all 1=IRC_ONLY 2=DCC_ONLY */
|
||||
|
||||
@@ -305,14 +305,12 @@ static gboolean
|
||||
tab_scroll_cb (GtkWidget *widget, GdkEventScroll *event, gpointer cv)
|
||||
{
|
||||
int direction = cv_scroll_direction (event);
|
||||
int i;
|
||||
|
||||
if (prefs.hex_gui_tab_scrollchans)
|
||||
{
|
||||
if (direction != 0)
|
||||
{
|
||||
for (i = 0; i < cv_scroll_step_count (); i++)
|
||||
mg_switch_page (1, direction);
|
||||
mg_switch_page (1, direction);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -320,14 +318,12 @@ tab_scroll_cb (GtkWidget *widget, GdkEventScroll *event, gpointer cv)
|
||||
{
|
||||
if (direction < 0)
|
||||
{
|
||||
for (i = 0; i < cv_scroll_step_count (); i++)
|
||||
tab_scroll_left_up_clicked (widget, cv);
|
||||
tab_scroll_left_up_clicked (widget, cv);
|
||||
return TRUE;
|
||||
}
|
||||
else if (direction > 0)
|
||||
{
|
||||
for (i = 0; i < cv_scroll_step_count (); i++)
|
||||
tab_scroll_right_down_clicked (widget, cv);
|
||||
tab_scroll_right_down_clicked (widget, cv);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,11 +112,9 @@ cv_tree_scroll_event_cb (GtkWidget *widget, GdkEventScroll *event, gpointer user
|
||||
if (prefs.hex_gui_tab_scrollchans)
|
||||
{
|
||||
int direction = cv_scroll_direction (event);
|
||||
int i;
|
||||
|
||||
if (direction != 0)
|
||||
for (i = 0; i < cv_scroll_step_count (); i++)
|
||||
mg_switch_page (1, direction);
|
||||
mg_switch_page (1, direction);
|
||||
|
||||
return direction != 0;
|
||||
}
|
||||
|
||||
@@ -126,15 +126,6 @@ cv_scroll_direction (GdkEventScroll *event)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
cv_scroll_step_count (void)
|
||||
{
|
||||
int speed = prefs.hex_gui_mouse_scroll_speed;
|
||||
if (speed < 1)
|
||||
speed = 1;
|
||||
return (speed + 9) / 10;
|
||||
}
|
||||
|
||||
|
||||
/* ======= TABS ======= */
|
||||
|
||||
|
||||
@@ -320,7 +320,7 @@ fe_args (int argc, char *argv[])
|
||||
GError *error = NULL;
|
||||
GOptionContext *context;
|
||||
char *buffer;
|
||||
const char *desktop_id = "net.zoite.Zoitechat";
|
||||
const char *desktop_id = "org.zoitechat.ZoiteChat";
|
||||
#ifdef WIN32
|
||||
char *base_path = NULL;
|
||||
char *locale_path = NULL;
|
||||
|
||||
@@ -272,6 +272,13 @@ gtkutil_apply_palette (GtkWidget *widget, const GdkRGBA *bg, const GdkRGBA *fg,
|
||||
theme_manager_apply_palette_widget (widget, bg, fg, font_desc);
|
||||
}
|
||||
|
||||
static void
|
||||
gtkutil_file_req_destroy (GtkWidget * wid, struct file_req *freq)
|
||||
{
|
||||
freq->callback (freq->userdata, NULL);
|
||||
g_free (freq);
|
||||
}
|
||||
|
||||
static void
|
||||
gtkutil_check_file (char *filename, struct file_req *freq)
|
||||
{
|
||||
@@ -383,6 +390,26 @@ gtkutil_file_req_done_chooser (GtkFileChooser *fs, struct file_req *freq)
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
gtkutil_file_req_done (GtkWidget * wid, struct file_req *freq)
|
||||
{
|
||||
gtkutil_file_req_done_chooser (GTK_FILE_CHOOSER (freq->dialog), freq);
|
||||
gtk_widget_destroy (freq->dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
gtkutil_file_req_response (GtkWidget *dialog, gint res, struct file_req *freq)
|
||||
{
|
||||
if (res == GTK_RESPONSE_ACCEPT)
|
||||
{
|
||||
gtkutil_file_req_done (dialog, freq);
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
static gboolean
|
||||
gtkutil_native_dialog_unref_idle (gpointer native)
|
||||
{
|
||||
@@ -396,16 +423,27 @@ gtkutil_native_file_req_response (GtkNativeDialog *dialog, gint res, struct file
|
||||
if (res == GTK_RESPONSE_ACCEPT)
|
||||
gtkutil_file_req_done_chooser (GTK_FILE_CHOOSER (dialog), freq);
|
||||
|
||||
/* Match gtk dialog flow by always sending NULL to indicate completion. */
|
||||
freq->callback (freq->userdata, NULL);
|
||||
g_free (freq);
|
||||
|
||||
/*
|
||||
* Defer unref until idle to avoid disposing the native chooser while
|
||||
* still in the button-release signal stack on Windows.
|
||||
*/
|
||||
g_idle_add (gtkutil_native_dialog_unref_idle, dialog);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
gtkutil_file_req (GtkWindow *parent, const char *title, void *callback, void *userdata, char *filter, char *extensions,
|
||||
int flags)
|
||||
{
|
||||
struct file_req *freq;
|
||||
GtkWidget *dialog;
|
||||
GtkFileFilter *filefilter;
|
||||
char *token;
|
||||
char *tokenbuffer;
|
||||
const char *xdir;
|
||||
GtkWindow *effective_parent = parent;
|
||||
|
||||
@@ -415,6 +453,7 @@ gtkutil_file_req (GtkWindow *parent, const char *title, void *callback, void *us
|
||||
|
||||
xdir = get_xdir ();
|
||||
|
||||
#ifdef WIN32
|
||||
{
|
||||
GtkFileChooserNative *native = gtk_file_chooser_native_new (
|
||||
title,
|
||||
@@ -490,7 +529,107 @@ gtkutil_file_req (GtkWindow *parent, const char *title, void *callback, void *us
|
||||
gtk_native_dialog_show (GTK_NATIVE_DIALOG (native));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (flags & FRF_WRITE)
|
||||
{
|
||||
dialog = gtk_file_chooser_dialog_new (title, NULL,
|
||||
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
|
||||
dialog = gtk_file_chooser_dialog_new (title, NULL,
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
_("_Cancel"), GTK_RESPONSE_CANCEL,
|
||||
_("_Open"), GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
|
||||
theme_manager_attach_window (dialog);
|
||||
|
||||
if (filter && filter[0] && (flags & FRF_FILTERISINITIAL))
|
||||
{
|
||||
if (flags & FRF_WRITE)
|
||||
{
|
||||
char temp[1024];
|
||||
path_part (filter, temp, sizeof (temp));
|
||||
if (temp[0] && g_file_test (temp, G_FILE_TEST_IS_DIR))
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), temp);
|
||||
else if (xdir && xdir[0] && g_file_test (xdir, G_FILE_TEST_IS_DIR))
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), xdir);
|
||||
gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), file_part (filter));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (g_file_test (filter, G_FILE_TEST_IS_DIR))
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), filter);
|
||||
else if (xdir && xdir[0] && g_file_test (xdir, G_FILE_TEST_IS_DIR))
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), xdir);
|
||||
}
|
||||
}
|
||||
else if (!(flags & FRF_RECENTLYUSED))
|
||||
{
|
||||
if (xdir && xdir[0] && g_file_test (xdir, G_FILE_TEST_IS_DIR))
|
||||
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), xdir);
|
||||
}
|
||||
|
||||
if (flags & FRF_MULTIPLE)
|
||||
gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (dialog), TRUE);
|
||||
if (flags & FRF_CHOOSEFOLDER)
|
||||
gtk_file_chooser_set_action (GTK_FILE_CHOOSER (dialog), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
|
||||
|
||||
if ((flags & FRF_EXTENSIONS || flags & FRF_MIMETYPES) && extensions != NULL)
|
||||
{
|
||||
filefilter = gtk_file_filter_new ();
|
||||
tokenbuffer = g_strdup (extensions);
|
||||
token = strtok (tokenbuffer, ";");
|
||||
|
||||
while (token != NULL)
|
||||
{
|
||||
if (flags & FRF_EXTENSIONS)
|
||||
gtk_file_filter_add_pattern (filefilter, token);
|
||||
else
|
||||
gtk_file_filter_add_mime_type (filefilter, token);
|
||||
token = strtok (NULL, ";");
|
||||
}
|
||||
|
||||
g_free (tokenbuffer);
|
||||
gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filefilter);
|
||||
}
|
||||
|
||||
if (xdir && xdir[0] && g_file_test (xdir, G_FILE_TEST_IS_DIR))
|
||||
{
|
||||
GError *shortcut_error = NULL;
|
||||
|
||||
gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (dialog), xdir, &shortcut_error);
|
||||
if (shortcut_error)
|
||||
g_error_free (shortcut_error);
|
||||
}
|
||||
freq = g_new (struct file_req, 1);
|
||||
freq->dialog = dialog;
|
||||
freq->flags = flags;
|
||||
freq->callback = callback;
|
||||
freq->userdata = userdata;
|
||||
|
||||
g_signal_connect (G_OBJECT (dialog), "response",
|
||||
G_CALLBACK (gtkutil_file_req_response), freq);
|
||||
g_signal_connect (G_OBJECT (dialog), "destroy",
|
||||
G_CALLBACK (gtkutil_file_req_destroy), (gpointer) freq);
|
||||
|
||||
if (effective_parent)
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog), effective_parent);
|
||||
|
||||
if (flags & FRF_MODAL)
|
||||
{
|
||||
g_assert (effective_parent);
|
||||
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
|
||||
}
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -2705,6 +2705,7 @@ mg_changui_destroy (session *sess)
|
||||
/* it fixes: Gdk-CRITICAL **: gdk_colormap_get_screen: */
|
||||
/* assertion `GDK_IS_COLORMAP (cmap)' failed */
|
||||
ret = sess->gui->window;
|
||||
g_free (sess->gui);
|
||||
sess->gui = NULL;
|
||||
}
|
||||
return ret;
|
||||
@@ -2726,17 +2727,13 @@ mg_link_irctab (session *sess, int focus)
|
||||
return;
|
||||
}
|
||||
|
||||
session_gui *old_gui;
|
||||
|
||||
mg_unpopulate (sess);
|
||||
old_gui = sess->gui;
|
||||
win = mg_changui_destroy (sess);
|
||||
mg_changui_new (sess, sess->res, 1, focus);
|
||||
/* the buffer is now attached to a different widget */
|
||||
((xtext_buffer *)sess->res->buffer)->xtext = (GtkXText *)sess->gui->xtext;
|
||||
if (win)
|
||||
gtk_widget_destroy (win);
|
||||
g_free (old_gui);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -56,7 +56,7 @@ notification_backend_show (const char *title, const char *text)
|
||||
g_variant_builder_init (¶ms, G_VARIANT_TYPE ("(susssasa{sv}i)"));
|
||||
g_variant_builder_add (¶ms, "s", "zoitechat"); /* App name */
|
||||
g_variant_builder_add (¶ms, "u", 0); /* ID, 0 means don't replace */
|
||||
g_variant_builder_add (¶ms, "s", "net.zoite.Zoitechat"); /* App icon */
|
||||
g_variant_builder_add (¶ms, "s", "org.zoitechat.ZoiteChat"); /* App icon */
|
||||
g_variant_builder_add (¶ms, "s", title);
|
||||
g_variant_builder_add (¶ms, "s", text);
|
||||
g_variant_builder_add (¶ms, "as", NULL); /* Actions */
|
||||
@@ -65,7 +65,7 @@ notification_backend_show (const char *title, const char *text)
|
||||
g_variant_builder_open (¶ms, G_VARIANT_TYPE ("a{sv}"));
|
||||
g_variant_builder_open (¶ms, G_VARIANT_TYPE ("{sv}"));
|
||||
g_variant_builder_add (¶ms, "s", "desktop-entry");
|
||||
g_variant_builder_add (¶ms, "v", g_variant_new_string ("net.zoite.Zoitechat"));
|
||||
g_variant_builder_add (¶ms, "v", g_variant_new_string ("org.zoitechat.ZoiteChat"));
|
||||
g_variant_builder_close (¶ms);
|
||||
g_variant_builder_close (¶ms);
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ typedef GIcon *TrayIcon;
|
||||
typedef GIcon *TrayCustomIcon;
|
||||
#define tray_icon_free(i) g_object_unref(i)
|
||||
|
||||
#define ICON_NORMAL_NAME "net.zoite.Zoitechat"
|
||||
#define ICON_NORMAL_NAME "org.zoitechat.ZoiteChat"
|
||||
#define ICON_MSG_NAME "mail-unread"
|
||||
#define ICON_HILIGHT_NAME "dialog-warning"
|
||||
#define ICON_FILE_NAME "folder-download"
|
||||
|
||||
@@ -193,7 +193,6 @@ static const setting appearance_advanced_settings[] =
|
||||
{ST_HEADER, N_("Advanced"),0,0,0},
|
||||
{ST_EFILE, N_ ("Background image:"), P_OFFSETNL (hex_text_background), 0, 0, sizeof prefs.hex_text_background},
|
||||
{ST_HSCALE, N_("Window opacity:"), P_OFFINTNL(hex_gui_transparency),0,0,0},
|
||||
{ST_HSCALE, N_("Mouse wheel scroll speed (Slower ← → Faster):"), P_OFFINTNL(hex_gui_mouse_scroll_speed), 0, 0, 100},
|
||||
|
||||
{ST_END, 0, 0, 0, 0, 0}
|
||||
};
|
||||
@@ -583,7 +582,6 @@ static const setting advanced_settings[] =
|
||||
{ST_TOGGLE, N_("Display lists in compact mode"), P_OFFINTNL(hex_gui_compact), N_("Use less spacing between user list/channel tree rows."), 0, 0},
|
||||
{ST_TOGGLE, N_("Use server time if supported"), P_OFFINTNL(hex_irc_cap_server_time), N_("Display timestamps obtained from server if it supports the time-server extension."), 0, 0},
|
||||
{ST_TOGGLE, N_("Automatically reconnect to servers on disconnect"), P_OFFINTNL(hex_net_auto_reconnect), 0, 0, 1},
|
||||
{ST_NUMBER, N_("Lag check interval:"), P_OFFINTNL(hex_net_lag_check), 0, (const char **)N_("seconds."), 9999},
|
||||
{ST_NUMBER, N_("Auto reconnect delay:"), P_OFFINTNL(hex_net_reconnect_delay), 0, 0, 9999},
|
||||
{ST_NUMBER, N_("Auto join delay:"), P_OFFINTNL(hex_irc_join_delay), 0, 0, 9999},
|
||||
{ST_MENU, N_("Ban Type:"), P_OFFINTNL(hex_irc_ban_type), N_("Attempt to use this banmask when banning or quieting. (requires irc_who_join)"), bantypemenu, 0},
|
||||
@@ -657,11 +655,6 @@ static const setting network_settings[] =
|
||||
{ST_MENU, N_("Type:"), P_OFFINTNL(hex_net_proxy_type), 0, proxytypes, 0},
|
||||
{ST_MENU, N_("Use proxy for:"), P_OFFINTNL(hex_net_proxy_use), 0, proxyuse, 0},
|
||||
|
||||
{ST_HEADER, N_("Connection Health"), 0, 0, 0, 0},
|
||||
{ST_NUMBER, N_("TCP keepalive idle:"), P_OFFINTNL(hex_net_keepalive_idle), 0, (const char **)N_("seconds."), 7200},
|
||||
{ST_NUMBER, N_("TCP keepalive interval:"), P_OFFINTNL(hex_net_keepalive_interval), 0, (const char **)N_("seconds."), 600},
|
||||
{ST_NUMBER, N_("TCP keepalive probes:"), P_OFFINTNL(hex_net_keepalive_count), 0, 0, 20},
|
||||
|
||||
{ST_HEADER, N_("Proxy Authentication"), 0, 0, 0, 0},
|
||||
{ST_TOGGLE, N_("Use authentication (HTTP or SOCKS5 only)"), P_OFFINTNL(hex_net_proxy_auth), 0, 0, 0},
|
||||
{ST_ENTRY, N_("Username:"), P_OFFSETNL(hex_net_proxy_user), 0, 0, sizeof prefs.hex_net_proxy_user},
|
||||
|
||||
@@ -2300,12 +2300,6 @@ gtk_xtext_leave_notify (GtkWidget * widget, GdkEventCrossing * event)
|
||||
xtext->hilight_ent = NULL;
|
||||
}
|
||||
|
||||
if (xtext->tooltip_stamp_set)
|
||||
{
|
||||
gtk_widget_set_tooltip_text (widget, NULL);
|
||||
xtext->tooltip_stamp_set = FALSE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -2472,7 +2466,7 @@ gtk_xtext_motion_notify (GtkWidget * widget, GdkEventMotion * event)
|
||||
}
|
||||
|
||||
if (xtext->urlcheck_function == NULL)
|
||||
goto tooltip_check;
|
||||
return FALSE;
|
||||
|
||||
word_type = gtk_xtext_get_word_adjust (xtext, x, y, &word_ent, &offset, &len);
|
||||
if (word_type > 0)
|
||||
@@ -2510,46 +2504,6 @@ gtk_xtext_motion_notify (GtkWidget * widget, GdkEventMotion * event)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
tooltip_check:
|
||||
if (xtext->buffer->time_stamp && xtext->buffer->indent > 0 && x >= 0 && x < xtext->stamp_width)
|
||||
{
|
||||
textentry *ent = gtk_xtext_find_char (xtext, x, y, NULL, NULL);
|
||||
if (ent && (!xtext->tooltip_stamp_set || xtext->tooltip_stamp != ent->stamp))
|
||||
{
|
||||
char tooltip[96];
|
||||
strftime_utf8 (tooltip, sizeof (tooltip), "%Y-%m-%d", ent->stamp);
|
||||
gtk_widget_set_tooltip_text (widget, tooltip);
|
||||
xtext->tooltip_stamp = ent->stamp;
|
||||
xtext->tooltip_stamp_set = TRUE;
|
||||
}
|
||||
if (ent)
|
||||
return FALSE;
|
||||
}
|
||||
else if (!xtext->buffer->time_stamp && x >= xtext->buffer->indent)
|
||||
{
|
||||
textentry *ent = gtk_xtext_find_char (xtext, x, y, NULL, NULL);
|
||||
if (ent && ent->stamp && (!xtext->tooltip_stamp_set || xtext->tooltip_stamp != ent->stamp))
|
||||
{
|
||||
char tooltip[128];
|
||||
char date[64];
|
||||
char *stamp_text;
|
||||
strftime_utf8 (date, sizeof (date), "%Y-%m-%d", ent->stamp);
|
||||
xtext_get_stamp_str (ent->stamp, &stamp_text);
|
||||
g_snprintf (tooltip, sizeof (tooltip), "%s %s", date, stamp_text);
|
||||
gtk_widget_set_tooltip_text (widget, tooltip);
|
||||
g_free (stamp_text);
|
||||
xtext->tooltip_stamp = ent->stamp;
|
||||
xtext->tooltip_stamp_set = TRUE;
|
||||
}
|
||||
if (ent)
|
||||
return FALSE;
|
||||
}
|
||||
else if (xtext->tooltip_stamp_set)
|
||||
{
|
||||
gtk_widget_set_tooltip_text (widget, NULL);
|
||||
xtext->tooltip_stamp_set = FALSE;
|
||||
}
|
||||
|
||||
gtk_xtext_leave_notify (widget, NULL);
|
||||
|
||||
return FALSE;
|
||||
@@ -2984,41 +2938,19 @@ gtk_xtext_scroll (GtkWidget *widget, GdkEventScroll *event)
|
||||
{
|
||||
GtkXText *xtext = GTK_XTEXT (widget);
|
||||
gfloat new_value;
|
||||
gfloat step;
|
||||
gdouble dx;
|
||||
gdouble dy;
|
||||
int direction = 0;
|
||||
int speed = prefs.hex_gui_mouse_scroll_speed;
|
||||
|
||||
if (speed < 1)
|
||||
speed = 1;
|
||||
step = (xtext_adj_get_page_increment (xtext->adj) * speed) / 100.0f;
|
||||
|
||||
if (event->direction == GDK_SCROLL_SMOOTH &&
|
||||
gdk_event_get_scroll_deltas ((GdkEvent *)event, &dx, &dy))
|
||||
{
|
||||
if (dy > 0)
|
||||
direction = 1;
|
||||
else if (dy < 0)
|
||||
direction = -1;
|
||||
}
|
||||
else if (event->direction == GDK_SCROLL_UP)
|
||||
direction = -1;
|
||||
else if (event->direction == GDK_SCROLL_DOWN)
|
||||
direction = 1;
|
||||
|
||||
if (direction < 0)
|
||||
if (event->direction == GDK_SCROLL_UP) /* mouse wheel pageUp */
|
||||
{
|
||||
new_value = xtext_adj_get_value (xtext->adj) -
|
||||
step;
|
||||
(xtext_adj_get_page_increment (xtext->adj) / 10);
|
||||
if (new_value < xtext_adj_get_lower (xtext->adj))
|
||||
new_value = xtext_adj_get_lower (xtext->adj);
|
||||
xtext_adj_set_value (xtext->adj, new_value);
|
||||
}
|
||||
else if (direction > 0)
|
||||
else if (event->direction == GDK_SCROLL_DOWN) /* mouse wheel pageDn */
|
||||
{
|
||||
new_value = xtext_adj_get_value (xtext->adj) +
|
||||
step;
|
||||
(xtext_adj_get_page_increment (xtext->adj) / 10);
|
||||
if (new_value > (xtext_adj_get_upper (xtext->adj) -
|
||||
xtext_adj_get_page_size (xtext->adj)))
|
||||
new_value = xtext_adj_get_upper (xtext->adj) -
|
||||
@@ -3026,7 +2958,7 @@ gtk_xtext_scroll (GtkWidget *widget, GdkEventScroll *event)
|
||||
xtext_adj_set_value (xtext->adj, new_value);
|
||||
}
|
||||
|
||||
return direction != 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -190,8 +190,6 @@ struct _GtkXText
|
||||
textentry *hilight_ent;
|
||||
int hilight_start;
|
||||
int hilight_end;
|
||||
time_t tooltip_stamp;
|
||||
unsigned int tooltip_stamp_set:1;
|
||||
|
||||
guint16 fontwidth[128]; /* each char's width, only the ASCII ones */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user