Compare commits
3 Commits
master
...
c801c1fb11
| Author | SHA1 | Date | |
|---|---|---|---|
| c801c1fb11 | |||
| 3ad7dbd008 | |||
| 39f5dabf24 |
10
.github/workflows/appimage-build.yml
vendored
@@ -28,16 +28,20 @@ jobs:
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
build-essential pkg-config meson ninja-build cmake \
|
||||
gettext \
|
||||
libcanberra-dev libglib2.0-dev \
|
||||
libcanberra-dev libdbus-glib-1-dev libglib2.0-dev \
|
||||
libarchive-dev \
|
||||
libgtk-3-dev \
|
||||
libwayland-client0 libwayland-cursor0 libwayland-egl1 \
|
||||
libxkbcommon0 \
|
||||
libgtk-3-bin libglib2.0-bin shared-mime-info gsettings-desktop-schemas \
|
||||
liblua5.4-dev libpci-dev libperl-dev libssl-dev libayatana-appindicator3-dev \
|
||||
libluajit-5.1-dev libpci-dev libperl-dev libssl-dev libayatana-appindicator3-dev \
|
||||
perl python3 python3-minimal python3-dev python3-cffi mono-devel desktop-file-utils \
|
||||
fonts-noto-color-emoji breeze-gtk-theme \
|
||||
patchelf file curl
|
||||
patchelf file curl imagemagick
|
||||
if ! command -v magick >/dev/null 2>&1 && command -v convert >/dev/null 2>&1; then
|
||||
printf '%s\n' '#!/bin/sh' 'exec convert "$@"' | sudo tee /usr/local/bin/magick >/dev/null
|
||||
sudo chmod +x /usr/local/bin/magick
|
||||
fi
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
|
||||
10
.github/workflows/flatpak-build.yml
vendored
@@ -25,8 +25,14 @@ jobs:
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Generate PSL list
|
||||
run: curl -fsSL https://publicsuffix.org/list/public_suffix_list.dat -o src/common/public_suffix_list.dat
|
||||
- name: Install ImageMagick
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends imagemagick
|
||||
if ! command -v magick >/dev/null 2>&1 && command -v convert >/dev/null 2>&1; then
|
||||
printf '%s\n' '#!/bin/sh' 'exec convert "$@"' > /usr/local/bin/magick
|
||||
chmod +x /usr/local/bin/magick
|
||||
fi
|
||||
|
||||
- name: Build Flatpak
|
||||
id: flatpak_builder
|
||||
|
||||
9
.github/workflows/manjaro-package-build.yml
vendored
@@ -32,14 +32,21 @@ jobs:
|
||||
glib2-devel \
|
||||
gtk3 \
|
||||
openssl \
|
||||
dbus-glib \
|
||||
libcanberra \
|
||||
libayatana-appindicator \
|
||||
luajit \
|
||||
iso-codes \
|
||||
lua \
|
||||
perl \
|
||||
python \
|
||||
python-cffi \
|
||||
pciutils
|
||||
pciutils \
|
||||
imagemagick
|
||||
if ! command -v magick >/dev/null 2>&1 && command -v convert >/dev/null 2>&1; then
|
||||
printf '%s\n' '#!/bin/sh' 'exec convert "$@"' > /usr/local/bin/magick
|
||||
chmod +x /usr/local/bin/magick
|
||||
fi
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
|
||||
7
.github/workflows/windows-build.yml
vendored
@@ -39,6 +39,13 @@ jobs:
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install cffi
|
||||
python -m pip install zstandard
|
||||
choco install imagemagick -y --no-progress
|
||||
if (-not (Get-Command magick -ErrorAction SilentlyContinue)) {
|
||||
$magickDir = Get-ChildItem 'C:\Program Files\ImageMagick-*' -Directory -ErrorAction SilentlyContinue | Sort-Object LastWriteTime -Descending | Select-Object -First 1
|
||||
if ($magickDir) {
|
||||
$magickDir.FullName | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
||||
}
|
||||
}
|
||||
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
function Download-WithRetry {
|
||||
|
||||
@@ -1,47 +1,6 @@
|
||||
ZoiteChat ChangeLog
|
||||
=================
|
||||
|
||||
2.18.0 (2026-04-20)
|
||||
|
||||
- Added optional close buttons on tabs.
|
||||
- Added Ctrl+W to close tabs and Ctrl+Shift+T to reopen recently closed tabs.
|
||||
- Expanded theme import support with .hct support in colors.conf import.
|
||||
- Added pevent import support from .hct theme files and improved import result messaging.
|
||||
- Expanded palette and selection CSS styling for better theme consistency.
|
||||
- Auto-sizes the topic bar to wrapped text for better multi-line topic handling.
|
||||
- Refined command-character parsing when pasting path-like text.
|
||||
- Tightened topic link detection and opening rules.
|
||||
- Added Public Suffix List validation for host links to reduce bad link matches.
|
||||
- Improved channel tree behavior by ignoring collapsed parent selections.
|
||||
- Sanitized the Linux open environment for AppImage builds and added safer fallback handling.
|
||||
- Labeled Windows installer runtimes with exact versions.
|
||||
- Fixed the notification icon and corrected the Flatpak screenshot asset.
|
||||
- Improved AppStream metainfo validation.
|
||||
|
||||
2.18.0~pre6 (2026-03-30)
|
||||
|
||||
- Applied app theme CSS to the menubar consistently across the app.
|
||||
- Restored horizontal separator lines in menus.
|
||||
- Improved Windows installer VC++ redistributable handling by failing loudly when missing and using the official Microsoft download endpoint.
|
||||
- Fixed Windows locale path resolution in both GTK and text frontends.
|
||||
- Fixed duplicate dialog buttons persisting in the UI.
|
||||
- Fixed GTK auto-replace cursor snapback.
|
||||
- Restored hiding of formatting control bytes so only formatted output is shown.
|
||||
- Added one-click client SSL certificate tools, including generation with P-256 certificates.
|
||||
- Added client SSL certificate import support in the network editor.
|
||||
- Added 99-color support.
|
||||
- Fixed xtext link hit-testing coordinates.
|
||||
- Fixed short-palette fallback clobbering tab colors.
|
||||
- Lazy-loads Preferences pages on first open for faster dialog startup.
|
||||
- Removed unused UI icons.
|
||||
- Added a None option for resetting the GTK3 theme back to system/default behavior.
|
||||
- Added channel-only mode to Ctrl+F search.
|
||||
- Disabled disk info in sysinfo.
|
||||
- Wrapped the topic bar in a scroller with bounded height.
|
||||
- Added close buttons to tabs.
|
||||
- Fixed fallback GTK menu highlight states.
|
||||
- Applied configured font preferences to the topic bar, channel tree, user list, and input box.
|
||||
|
||||
2.18.0~pre5 (2026-03-22)
|
||||
------------------------
|
||||
- Overhauled preferences/config saving: fully staged and transactional, debounced
|
||||
|
||||
121
data/icons/generate_icons.py
Normal file
@@ -0,0 +1,121 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import contextlib
|
||||
import pathlib
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
SIZES = [16, 24, 32, 40, 48, 64, 96, 128, 256]
|
||||
|
||||
|
||||
def run(cmd):
|
||||
subprocess.run(cmd, check=True)
|
||||
|
||||
|
||||
def try_run(cmd):
|
||||
result = subprocess.run(cmd, text=True, capture_output=True)
|
||||
return result.returncode == 0, result.stderr.strip()
|
||||
|
||||
|
||||
def magick_cmd():
|
||||
magick = shutil.which('magick')
|
||||
if not magick:
|
||||
raise RuntimeError('missing tool: install ImageMagick (magick)')
|
||||
return magick
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def magick_svg(svg):
|
||||
text = pathlib.Path(svg).read_text(encoding='utf-8')
|
||||
fixed = text.replace('href="image/', 'href="data:image/')
|
||||
fixed = fixed.replace('xlink:href="image/', 'xlink:href="data:image/')
|
||||
if fixed == text:
|
||||
yield str(svg)
|
||||
return
|
||||
with tempfile.NamedTemporaryFile('w', suffix='.svg', delete=False, encoding='utf-8') as tmp:
|
||||
tmp.write(fixed)
|
||||
tmp_path = tmp.name
|
||||
try:
|
||||
yield tmp_path
|
||||
finally:
|
||||
pathlib.Path(tmp_path).unlink(missing_ok=True)
|
||||
|
||||
|
||||
def render_png(svg, out_png, size):
|
||||
errors = []
|
||||
rsvg = shutil.which('rsvg-convert')
|
||||
if rsvg:
|
||||
ok, err = try_run([rsvg, '-w', str(size), '-h', str(size), '-o', str(out_png), str(svg)])
|
||||
if ok:
|
||||
return
|
||||
errors.append(err)
|
||||
inkscape = shutil.which('inkscape')
|
||||
if inkscape:
|
||||
ok, err = try_run([
|
||||
inkscape,
|
||||
str(svg),
|
||||
'--export-type=png',
|
||||
'--export-width',
|
||||
str(size),
|
||||
'--export-height',
|
||||
str(size),
|
||||
'--export-filename',
|
||||
str(out_png),
|
||||
])
|
||||
if ok:
|
||||
return
|
||||
errors.append(err)
|
||||
with magick_svg(svg) as svg_for_magick:
|
||||
ok, err = try_run([
|
||||
magick_cmd(),
|
||||
svg_for_magick,
|
||||
'-background',
|
||||
'none',
|
||||
'-resize',
|
||||
f'{size}x{size}',
|
||||
str(out_png),
|
||||
])
|
||||
if ok:
|
||||
return
|
||||
errors.append(err)
|
||||
raise RuntimeError('failed to render png: ' + ' | '.join(e for e in errors if e))
|
||||
|
||||
|
||||
def build_ico(svg, out_ico):
|
||||
with magick_svg(svg) as svg_for_magick:
|
||||
run([
|
||||
magick_cmd(),
|
||||
svg_for_magick,
|
||||
'-background',
|
||||
'none',
|
||||
'-define',
|
||||
'icon:auto-resize=' + ','.join(str(size) for size in SIZES),
|
||||
str(out_ico),
|
||||
])
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(prog='generate_icons.py')
|
||||
parser.add_argument('input_svg')
|
||||
parser.add_argument('output_png')
|
||||
parser.add_argument('--ico', dest='output_ico')
|
||||
parser.add_argument('--size', type=int, default=48)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
magick_cmd()
|
||||
svg = pathlib.Path(args.input_svg)
|
||||
out_png = pathlib.Path(args.output_png)
|
||||
out_png.parent.mkdir(parents=True, exist_ok=True)
|
||||
render_png(svg, out_png, args.size)
|
||||
if args.output_ico:
|
||||
out_ico = pathlib.Path(args.output_ico)
|
||||
out_ico.parent.mkdir(parents=True, exist_ok=True)
|
||||
build_ico(svg, out_ico)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,9 +1,24 @@
|
||||
icon_gen = find_program('generate_icons.py')
|
||||
find_program('magick', required: true)
|
||||
|
||||
icondir = join_paths(get_option('datadir'), 'icons/hicolor')
|
||||
install_data(
|
||||
'zoitechat.png',
|
||||
rename: 'net.zoite.Zoitechat.png',
|
||||
install_dir: join_paths(icondir, '48x48/apps')
|
||||
custom_target('zoitechat_png',
|
||||
input: 'zoitechat.svg',
|
||||
output: 'net.zoite.Zoitechat.png',
|
||||
command: [icon_gen, '@INPUT@', '@OUTPUT@', '--size', '48'],
|
||||
install: true,
|
||||
install_dir: join_paths(icondir, '48x48/apps'),
|
||||
)
|
||||
|
||||
if host_machine.system() == 'windows'
|
||||
custom_target('zoitechat_ico',
|
||||
input: 'zoitechat.svg',
|
||||
output: 'zoitechat.ico',
|
||||
command: [icon_gen, '@INPUT@', '@PRIVATE_DIR@/zoitechat.png', '--size', '48', '--ico', '@OUTPUT@'],
|
||||
build_by_default: true,
|
||||
)
|
||||
endif
|
||||
|
||||
install_data(
|
||||
'zoitechat.svg',
|
||||
rename: 'net.zoite.Zoitechat.svg',
|
||||
|
||||
|
Before Width: | Height: | Size: 129 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.8 KiB |
@@ -13,16 +13,16 @@ if get_option('gtk-frontend')
|
||||
install_dir: metainfodir
|
||||
)
|
||||
|
||||
appstreamcli = find_program('appstreamcli', required: false)
|
||||
if appstreamcli.found()
|
||||
test('Validate net.zoite.Zoitechat.appdata.xml', appstreamcli,
|
||||
args: ['validate', zoitechat_appdata]
|
||||
appstream_util = find_program('appstream-util', required: false)
|
||||
if appstream_util.found()
|
||||
test('Validate net.zoite.Zoitechat.appdata.xml', appstream_util,
|
||||
args: ['validate-relax', zoitechat_appdata]
|
||||
)
|
||||
endif
|
||||
endif
|
||||
|
||||
desktop_conf = configuration_data()
|
||||
if dbus_dep.found()
|
||||
if dbus_glib_dep.found()
|
||||
desktop_conf.set('exec_command', 'zoitechat --existing %U')
|
||||
else
|
||||
desktop_conf.set('exec_command', 'zoitechat %U')
|
||||
@@ -97,18 +97,11 @@ if get_option('plugin')
|
||||
conf.set('SUMMARY', metainfo[1])
|
||||
conf.set('LICENSE', metainfo[2])
|
||||
|
||||
plugin_appdata = configure_file(
|
||||
configure_file(
|
||||
input: 'net.zoite.Zoitechat.Plugin.metainfo.xml.in',
|
||||
output: 'net.zoite.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,
|
||||
args: ['validate', plugin_appdata]
|
||||
)
|
||||
endif
|
||||
|
||||
endforeach
|
||||
endif
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<extends>net.zoite.Zoitechat</extends>
|
||||
<name>@NAME@ Plugin</name>
|
||||
<summary>@SUMMARY@</summary>
|
||||
<url type="homepage">https://zoitechat.org/</url>
|
||||
<url type="homepage">https://zoitechat.zoite.net/</url>
|
||||
<project_license>@LICENSE@</project_license>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<update_contact>deepend_AT_zoite.net</update_contact>
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
<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">https://zoitechat.org</url>
|
||||
<url type="homepage">https://zoitechat.zoite.net</url>
|
||||
<url type="bugtracker">https://github.com/zoitechat/zoitechat</url>
|
||||
<url type="help">https://docs.zoitechat.org/en/latest/</url>
|
||||
<url type="help">https://docs.zoitechat.zoite.net/en/latest/</url>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://zoitechat.org/assets/img/zoitechat-screenshot.png</image>
|
||||
<image>https://zoitechat.zoite.net/assets/ZoiteChat.png</image>
|
||||
<caption>Main Chat Window</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
@@ -29,77 +29,7 @@
|
||||
<id>zoitechat.desktop</id>
|
||||
</provides>
|
||||
<releases>
|
||||
<release date="2026-04-20" version="2.18.0">
|
||||
<description>
|
||||
<p>Tabs and navigation:</p>
|
||||
<ul>
|
||||
<li>Added optional close buttons on tabs.</li>
|
||||
<li>Added Ctrl+W to close tabs and Ctrl+Shift+T to reopen recently closed tabs.</li>
|
||||
<li>Improved channel tree behavior by ignoring collapsed parent selections.</li>
|
||||
</ul>
|
||||
<p>Themes and appearance:</p>
|
||||
<ul>
|
||||
<li>Expanded theme import support with .hct support in colors.conf import.</li>
|
||||
<li>Added pevent import support from .hct theme files and improved import result messaging.</li>
|
||||
<li>Expanded palette and selection CSS styling for better theme consistency.</li>
|
||||
<li>Auto-sizes the topic bar to wrapped text for better multi-line topic handling.</li>
|
||||
</ul>
|
||||
<p>Links and text handling:</p>
|
||||
<ul>
|
||||
<li>Refined command-character parsing when pasting path-like text.</li>
|
||||
<li>Tightened topic link detection and opening rules.</li>
|
||||
<li>Added Public Suffix List validation for host links to reduce bad link matches.</li>
|
||||
</ul>
|
||||
<p>Packaging and platform integration:</p>
|
||||
<ul>
|
||||
<li>Sanitized the Linux open environment for AppImage builds and added safer fallback handling.</li>
|
||||
<li>Labeled Windows installer runtimes with exact versions.</li>
|
||||
<li>Fixed the notification icon and corrected the Flatpak screenshot asset.</li>
|
||||
<li>Improved AppStream metainfo validation.</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release date="2026-03-30" version="2.18.0~pre6">
|
||||
<description>
|
||||
<p>GTK theme and UI:</p>
|
||||
<ul>
|
||||
<li>Applied app theme CSS to the menubar consistently across the app.</li>
|
||||
<li>Restored horizontal separator lines in menus.</li>
|
||||
<li>Fixed duplicate dialog buttons persisting in the UI.</li>
|
||||
<li>Fixed GTK auto-replace cursor snapback.</li>
|
||||
<li>Restored hiding of formatting control bytes so only formatted output is shown.</li>
|
||||
<li>Fixed xtext link hit-testing coordinates.</li>
|
||||
<li>Fixed short-palette fallback clobbering tab colors.</li>
|
||||
<li>Added a None option for resetting the GTK3 theme back to system/default behavior.</li>
|
||||
<li>Wrapped the topic bar in a scroller with bounded height.</li>
|
||||
<li>Fixed fallback GTK menu highlight states.</li>
|
||||
<li>Applied configured font preferences to the topic bar, channel tree, user list, and input box.</li>
|
||||
<li>Removed unused UI icons.</li>
|
||||
<li>Added close buttons to tabs.</li>
|
||||
</ul>
|
||||
<p>Preferences and search:</p>
|
||||
<ul>
|
||||
<li>Lazy-loads Preferences pages on first open for faster dialog startup.</li>
|
||||
<li>Added channel-only mode to Ctrl+F search.</li>
|
||||
</ul>
|
||||
<p>Security and certificates:</p>
|
||||
<ul>
|
||||
<li>Added one-click client SSL certificate tools, including generation with P-256 certificates.</li>
|
||||
<li>Added client SSL certificate import support in the network editor.</li>
|
||||
</ul>
|
||||
<p>Windows and packaging:</p>
|
||||
<ul>
|
||||
<li>Improved Windows installer VC++ redistributable handling by failing loudly when missing and using the official Microsoft download endpoint.</li>
|
||||
<li>Fixed Windows locale path resolution in both GTK and text frontends.</li>
|
||||
</ul>
|
||||
<p>Other changes:</p>
|
||||
<ul>
|
||||
<li>Added 99-color support.</li>
|
||||
<li>Disabled disk info in sysinfo.</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release date="2026-03-22" version="2.18.0~pre5">
|
||||
<release date="2026-03-22" version="2.18.0~pre5">
|
||||
<description>
|
||||
<p>Preferences and config saving:</p>
|
||||
<ul>
|
||||
@@ -130,6 +60,14 @@
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release date="2026-03-22" version="2.18.0~pre5">
|
||||
<description>
|
||||
<p>Version metadata update:</p>
|
||||
<ul>
|
||||
<li>Bumped release version references to <code>2.18.0~pre5</code> across build and packaging files.</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release date="2026-03-14" version="2.18.0~pre4">
|
||||
<description>
|
||||
<p>UI fixes, topic bar improvements, and selection styling updates:</p>
|
||||
|
||||
27
data/zoitechat.gresource.xml.in
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/icons">
|
||||
<file alias="zoitechat.png" preprocess="to-pixdata">@ZOITECHAT_PNG@</file>
|
||||
<file alias="zoitechat.svg">icons/zoitechat.svg</file>
|
||||
<file alias="book.png" preprocess="to-pixdata">icons/book.png</file>
|
||||
|
||||
<file alias="ulist_voice.png" preprocess="to-pixdata">icons/ulist_voice.png</file>
|
||||
<file alias="ulist_halfop.png" preprocess="to-pixdata">icons/ulist_halfop.png</file>
|
||||
<file alias="ulist_op.png" preprocess="to-pixdata">icons/ulist_op.png</file>
|
||||
<file alias="ulist_owner.png" preprocess="to-pixdata">icons/ulist_owner.png</file>
|
||||
<file alias="ulist_founder.png" preprocess="to-pixdata">icons/ulist_founder.png</file>
|
||||
<file alias="ulist_netop.png" preprocess="to-pixdata">icons/ulist_netop.png</file>
|
||||
|
||||
<file alias="tray_normal.png" preprocess="to-pixdata">@ZOITECHAT_PNG@</file>
|
||||
<file alias="tray_fileoffer.png" preprocess="to-pixdata">icons/tray_fileoffer.png</file>
|
||||
<file alias="tray_highlight.png" preprocess="to-pixdata">icons/tray_highlight.png</file>
|
||||
<file alias="tray_message.png" preprocess="to-pixdata">icons/tray_message.png</file>
|
||||
|
||||
<file alias="tree_channel.png" preprocess="to-pixdata">icons/tree_channel.png</file>
|
||||
<file alias="tree_dialog.png" preprocess="to-pixdata">icons/tree_dialog.png</file>
|
||||
<file alias="tree_server.png" preprocess="to-pixdata">icons/tree_server.png</file>
|
||||
<file alias="tree_util.png" preprocess="to-pixdata">icons/tree_util.png</file>
|
||||
|
||||
|
||||
</gresource>
|
||||
</gresources>
|
||||
@@ -7,13 +7,14 @@
|
||||
"command": "zoitechat",
|
||||
"finish-args": [
|
||||
"--share=ipc",
|
||||
"--socket=wayland",
|
||||
"--socket=fallback-x11",
|
||||
"--socket=x11",
|
||||
"--share=network",
|
||||
"--socket=pulseaudio",
|
||||
"--filesystem=xdg-download",
|
||||
"--filesystem=xdg-data/themes:ro",
|
||||
"--filesystem=xdg-data/icons:ro",
|
||||
"--filesystem=~/.themes:ro",
|
||||
"--filesystem=~/.icons:ro",
|
||||
"--filesystem=xdg-run/tray-icon:create",
|
||||
"--env=GTK_CSD=1",
|
||||
"--talk-name=org.freedesktop.Notifications",
|
||||
@@ -33,6 +34,7 @@
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
"shared-modules/dbus-glib/dbus-glib.json",
|
||||
"shared-modules/lua5.4/lua-5.4.json",
|
||||
"shared-modules/libcanberra/libcanberra.json",
|
||||
"shared-modules/libayatana-appindicator/libayatana-appindicator-gtk3.json",
|
||||
@@ -43,9 +45,9 @@
|
||||
"buildsystem": "meson",
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://github.com/pavouk/lgi/archive/c9b8e4473c6421f2a215d8c06c0d94b86eb0b26a.tar.gz",
|
||||
"sha256": "db67b2b7ee89fa566f783486d56be7203552a997bc55f35020b57dd2776b9943"
|
||||
"type": "git",
|
||||
"url": "https://github.com/pavouk/lgi.git",
|
||||
"commit": "c9b8e4473c6421f2a215d8c06c0d94b86eb0b26a"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://www.cpan.org/src/5.0/perl-5.42.2.tar.xz",
|
||||
"sha256": "0a585eeb9e363c0f80482ddb3571625250c2c86aeb408853e8ea50805cfb14bb"
|
||||
"url": "https://www.cpan.org/src/5.0/perl-5.40.1.tar.xz",
|
||||
"sha256": "dfa20c2eef2b4af133525610bbb65dd13777ecf998c9c5b1ccf0d308e732ee3f"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
project('zoitechat', 'c',
|
||||
version: '2.18.0',
|
||||
version: '2.18.0~pre5',
|
||||
meson_version: '>= 0.55.0',
|
||||
default_options: [
|
||||
'c_std=c17',
|
||||
@@ -18,7 +18,7 @@ libgmodule_dep = dependency('gmodule-2.0')
|
||||
|
||||
libcanberra_dep = dependency('libcanberra', version: '>= 0.22',
|
||||
required: get_option('libcanberra'))
|
||||
dbus_dep = dependency('gio-2.0', required: get_option('dbus'))
|
||||
dbus_glib_dep = dependency('dbus-glib-1', required: get_option('dbus'))
|
||||
|
||||
global_deps = []
|
||||
if cc.get_id() == 'msvc'
|
||||
@@ -39,7 +39,7 @@ config_h.set10('ENABLE_NLS', true)
|
||||
# Optional features
|
||||
config_h.set('USE_OPENSSL', libssl_dep.found())
|
||||
config_h.set('USE_LIBCANBERRA', libcanberra_dep.found())
|
||||
config_h.set('USE_DBUS', dbus_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'))
|
||||
|
||||
@@ -181,7 +181,7 @@ if meson.version().version_compare('>= 0.55.0')
|
||||
'GTK Frontend': get_option('gtk-frontend') ? 'enabled (GTK+ 3.22+)' : 'disabled',
|
||||
'TLS (openssl)': libssl_dep.found(),
|
||||
'Plugin Support': get_option('plugin'),
|
||||
'DBus Support': dbus_dep.found(),
|
||||
'DBus Support': dbus_glib_dep.found(),
|
||||
'libcanberra': libcanberra_dep.found(),
|
||||
}, section: 'Features')
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ option('with-exec', type: 'boolean',
|
||||
option('with-fishlim', type: 'boolean',
|
||||
description: 'Fish encryption plugin, requires openssl'
|
||||
)
|
||||
option('with-lua', type: 'string', value: 'lua-5.4',
|
||||
option('with-lua', type: 'string', value: 'luajit',
|
||||
description: 'Lua scripting plugin, value is pkg-config name to use or "false"'
|
||||
)
|
||||
option('with-perl', type: 'string', value: 'perl',
|
||||
@@ -59,6 +59,9 @@ option('with-sysinfo', type: 'boolean',
|
||||
option('with-upd', type: 'boolean',
|
||||
description: 'Update plugin, Windows only'
|
||||
)
|
||||
option('with-winamp', type: 'boolean',
|
||||
description: 'Winamp plugin, Windows only'
|
||||
)
|
||||
option('with-perl-legacy-api', type: 'boolean', value: false,
|
||||
description: 'Enables the legacy IRC perl module for compatibility with old scripts'
|
||||
)
|
||||
|
||||
@@ -8,6 +8,7 @@ arch=('x86_64')
|
||||
url='https://github.com/zoitechat/zoitechat'
|
||||
license=('GPL-2.0-or-later')
|
||||
depends=(
|
||||
'dbus-glib'
|
||||
'glib2'
|
||||
'gtk3'
|
||||
'iso-codes'
|
||||
|
||||
@@ -104,14 +104,12 @@ thread_sha256_file (GTask *task, GFile *file, gpointer task_data, GCancellable *
|
||||
g_checksum_update (checksum, buffer, ret);
|
||||
|
||||
if (error) {
|
||||
g_checksum_free (checksum);
|
||||
g_task_return_error (task, error);
|
||||
goto cleanup;
|
||||
return;
|
||||
}
|
||||
|
||||
g_task_return_pointer (task, g_strdup (g_checksum_get_string (checksum)), g_free);
|
||||
cleanup:
|
||||
g_input_stream_close(G_INPUT_STREAM(istream), NULL, NULL);
|
||||
g_object_unref(istream);
|
||||
g_checksum_free (checksum);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
if cc.get_id() == 'msvc'
|
||||
lua_dep = cc.find_library('lua51')
|
||||
else
|
||||
lua_opt = get_option('with-lua')
|
||||
lua_dep = dependency(lua_opt, required: false)
|
||||
if not lua_dep.found() and lua_opt == 'lua-5.4'
|
||||
foreach lua_name : ['lua5.4', 'lua-5.3', 'lua5.3', 'lua']
|
||||
lua_dep = dependency(lua_name, required: false)
|
||||
if lua_dep.found()
|
||||
break
|
||||
endif
|
||||
endforeach
|
||||
endif
|
||||
if not lua_dep.found()
|
||||
error('Dependency "' + lua_opt + '" not found')
|
||||
endif
|
||||
lua_dep = dependency(get_option('with-lua'))
|
||||
endif
|
||||
|
||||
shared_module('lua', 'lua.c',
|
||||
|
||||
@@ -9,6 +9,9 @@ if host_machine.system() == 'windows'
|
||||
subdir('upd')
|
||||
endif
|
||||
|
||||
if get_option('with-winamp')
|
||||
subdir('winamp')
|
||||
endif
|
||||
endif
|
||||
|
||||
if get_option('with-checksum')
|
||||
|
||||
@@ -1457,14 +1457,14 @@ perl_load_file (char *filename)
|
||||
"You must have a Visual C++ build of Perl "
|
||||
PERL_REQUIRED_VERSION " installed in order to\n"
|
||||
"run Perl scripts. A reboot may be required.\n\n"
|
||||
"http://zoitechat.org/downloads.html\n\n"
|
||||
"http://zoitechat.zoite.net/downloads.html\n\n"
|
||||
"I have found Perl 5.6, but that is too old.");
|
||||
} else {
|
||||
thread_mbox ("Cannot open " PERL_DLL "!\n\n"
|
||||
"You must have a Visual C++ build of Perl "
|
||||
PERL_REQUIRED_VERSION " installed in order to\n"
|
||||
"run Perl scripts. A reboot may be required.\n\n"
|
||||
"http://zoitechat.org/downloads.html\n\n"
|
||||
"http://zoitechat.zoite.net/downloads.html\n\n"
|
||||
"Make sure Perl's bin directory is in your PATH.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ else:
|
||||
if not hasattr(sys, 'argv'):
|
||||
sys.argv = ['<zoitechat>']
|
||||
|
||||
VERSION = b'2.18.0'
|
||||
VERSION = b'2.18.0~pre5'
|
||||
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)
|
||||
@@ -320,9 +320,9 @@ def _on_say_command(word, word_eol, userdata):
|
||||
return 0
|
||||
|
||||
try:
|
||||
python = __decode(_cstr(word_eol[1]))
|
||||
python = _cstr(word_eol[1])
|
||||
except Exception:
|
||||
python = ''
|
||||
python = b''
|
||||
|
||||
if not python:
|
||||
return 1
|
||||
|
||||
@@ -41,7 +41,7 @@ static zoitechat_plugin *ph;
|
||||
static char name[] = "Sysinfo";
|
||||
static char desc[] = "Display info about your hardware and OS";
|
||||
static char version[] = "1.0";
|
||||
static char sysinfo_help[] = "SysInfo Usage:\n /SYSINFO [-e|-o] [CLIENT|UI|OS|CPU|RAM|STORAGE|GPU|CHIPSET|SOUND|ETHERNET|UPTIME], print various details about your system or print a summary without arguments\n /SYSINFO SET <variable>\n";
|
||||
static char sysinfo_help[] = "SysInfo Usage:\n /SYSINFO [-e|-o] [CLIENT|UI|OS|CPU|RAM|DISK|GPU|CHIPSET|SOUND|ETHERNET|UPTIME], print various details about your system or print a summary without arguments\n /SYSINFO SET <variable>\n";
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -68,7 +68,7 @@ static hwinfo hwinfos[] = {
|
||||
{"os", "OS", sysinfo_backend_get_os},
|
||||
{"cpu", "CPU", sysinfo_backend_get_cpu},
|
||||
{"memory", "Memory", sysinfo_backend_get_memory},
|
||||
{"storage", "Storage", sysinfo_backend_get_disk, TRUE},
|
||||
{"storage", "Storage", sysinfo_backend_get_disk},
|
||||
{"gpu", "GPU", sysinfo_backend_get_gpu},
|
||||
{"chipset", "CHIPSET", sysinfo_backend_get_chipset, TRUE},
|
||||
{"sound", "Sound", sysinfo_backend_get_sound, TRUE},
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "zoitechat-plugin.h"
|
||||
|
||||
#define APPCAST_URL "https://zoitechat.org/appcast.xml"
|
||||
#define APPCAST_URL "https://zoitechat.zoite.net/appcast.xml"
|
||||
|
||||
static zoitechat_plugin *ph;
|
||||
static char name[] = "Update Checker";
|
||||
|
||||
7
plugins/winamp/meson.build
Normal file
@@ -0,0 +1,7 @@
|
||||
shared_module('winamp', 'winamp.c',
|
||||
dependencies: [libgio_dep, zoitechat_plugin_dep],
|
||||
install: true,
|
||||
install_dir: plugindir,
|
||||
name_prefix: '',
|
||||
vs_module_defs: 'winamp.def',
|
||||
)
|
||||
153
plugins/winamp/winamp.c
Normal file
@@ -0,0 +1,153 @@
|
||||
/********************* Winamp Plugin 0.3******************************
|
||||
*
|
||||
* Distribution: GPL
|
||||
*
|
||||
* Originally written by: Leo - leo.nard@free.fr
|
||||
* Modified by: SilvereX - SilvereX@karklas.mif.vu.lt
|
||||
* Modified again by: Derek Buitenhuis - daemon404@gmail.com
|
||||
* Modified yet again by: Berke Viktor - berkeviktor@aol.com
|
||||
*********************************************************************/
|
||||
|
||||
#include "windows.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include "zoitechat-plugin.h"
|
||||
|
||||
#define PLAYING 1
|
||||
#define PAUSED 3
|
||||
|
||||
static zoitechat_plugin *ph;
|
||||
|
||||
static int
|
||||
winamp(char *word[], char *word_eol[], void *userdata)
|
||||
{
|
||||
HWND hwndWinamp = FindWindowW(L"Winamp v1.x",NULL);
|
||||
|
||||
if (hwndWinamp)
|
||||
{
|
||||
if (!stricmp("PAUSE", word[2]))
|
||||
{
|
||||
if (SendMessage(hwndWinamp,WM_USER, 0, 104))
|
||||
{
|
||||
SendMessage(hwndWinamp, WM_COMMAND, 40046, 0);
|
||||
|
||||
if (SendMessage(hwndWinamp, WM_USER, 0, 104) == PLAYING)
|
||||
zoitechat_printf(ph, "Winamp: playing");
|
||||
else
|
||||
zoitechat_printf(ph, "Winamp: paused");
|
||||
}
|
||||
}
|
||||
else if (!stricmp("STOP", word[2]))
|
||||
{
|
||||
SendMessage(hwndWinamp, WM_COMMAND, 40047, 0);
|
||||
zoitechat_printf(ph, "Winamp: stopped");
|
||||
}
|
||||
else if (!stricmp("PLAY", word[2]))
|
||||
{
|
||||
SendMessage(hwndWinamp, WM_COMMAND, 40045, 0);
|
||||
zoitechat_printf(ph, "Winamp: playing");
|
||||
}
|
||||
else if (!stricmp("NEXT", word[2]))
|
||||
{
|
||||
SendMessage(hwndWinamp, WM_COMMAND, 40048, 0);
|
||||
zoitechat_printf(ph, "Winamp: next playlist entry");
|
||||
}
|
||||
else if (!stricmp("PREV", word[2]))
|
||||
{
|
||||
SendMessage(hwndWinamp, WM_COMMAND, 40044, 0);
|
||||
zoitechat_printf(ph, "Winamp: previous playlist entry");
|
||||
}
|
||||
else if (!stricmp("START", word[2]))
|
||||
{
|
||||
SendMessage(hwndWinamp, WM_COMMAND, 40154, 0);
|
||||
zoitechat_printf(ph, "Winamp: playlist start");
|
||||
}
|
||||
else if (!word_eol[2][0])
|
||||
{
|
||||
wchar_t wcurrent_play[2048];
|
||||
char *current_play, *p;
|
||||
int len = GetWindowTextW(hwndWinamp, wcurrent_play, G_N_ELEMENTS(wcurrent_play));
|
||||
|
||||
current_play = g_utf16_to_utf8 (wcurrent_play, len, NULL, NULL, NULL);
|
||||
if (!current_play)
|
||||
{
|
||||
zoitechat_print (ph, "Winamp: Error getting song information.");
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
if (strchr(current_play, '-'))
|
||||
{
|
||||
/* Remove any trailing text and whitespace */
|
||||
p = current_play + strlen(current_play) - 8;
|
||||
while (p >= current_play)
|
||||
{
|
||||
if (!strnicmp(p, "- Winamp", 8))
|
||||
break;
|
||||
p--;
|
||||
}
|
||||
|
||||
if (p >= current_play)
|
||||
p--;
|
||||
|
||||
while (p >= current_play && *p == ' ')
|
||||
p--;
|
||||
*++p = '\0';
|
||||
|
||||
/* Ignore any leading track number */
|
||||
p = strstr (current_play, ". ");
|
||||
if (p)
|
||||
p += 2;
|
||||
else
|
||||
p = current_play;
|
||||
|
||||
if (*p != '\0')
|
||||
zoitechat_commandf (ph, "me is now playing: %s", p);
|
||||
else
|
||||
zoitechat_print (ph, "Winamp: No song information found.");
|
||||
g_free (current_play);
|
||||
}
|
||||
else
|
||||
zoitechat_print(ph, "Winamp: Nothing being played.");
|
||||
}
|
||||
else
|
||||
zoitechat_printf(ph, "Usage: /WINAMP [PAUSE|PLAY|STOP|NEXT|PREV|START]\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
zoitechat_print(ph, "Winamp not found.\n");
|
||||
}
|
||||
return ZOITECHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
int
|
||||
zoitechat_plugin_init(zoitechat_plugin *plugin_handle,
|
||||
char **plugin_name,
|
||||
char **plugin_desc,
|
||||
char **plugin_version,
|
||||
char *arg)
|
||||
{
|
||||
ph = plugin_handle;
|
||||
|
||||
*plugin_name = "Winamp";
|
||||
*plugin_desc = "Winamp plugin for ZoiteChat";
|
||||
*plugin_version = "0.6";
|
||||
|
||||
zoitechat_hook_command (ph, "WINAMP", ZOITECHAT_PRI_NORM, winamp, "Usage: /WINAMP [PAUSE|PLAY|STOP|NEXT|PREV|START] - control Winamp or show what's currently playing", 0);
|
||||
zoitechat_command (ph, "MENU -ishare\\music.png ADD \"Window/Display Current Song (Winamp)\" \"WINAMP\"");
|
||||
|
||||
zoitechat_print (ph, "Winamp plugin loaded\n");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
zoitechat_plugin_deinit(void)
|
||||
{
|
||||
zoitechat_command (ph, "MENU DEL \"Window/Display Current Song (Winamp)\"");
|
||||
zoitechat_print (ph, "Winamp plugin unloaded\n");
|
||||
return 1;
|
||||
}
|
||||
3
plugins/winamp/winamp.def
Normal file
@@ -0,0 +1,3 @@
|
||||
EXPORTS
|
||||
zoitechat_plugin_init
|
||||
zoitechat_plugin_deinit
|
||||
48
plugins/winamp/winamp.vcxproj
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Configuration">
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>winamp</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\zoitechat.props" />
|
||||
<PropertyGroup>
|
||||
<TargetName>hcwinamp</TargetName>
|
||||
<OutDir>$(ZoiteChatRel)plugins\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;WINAMP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(OpenSslInclude);$(Glib);..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<ModuleDefinitionFile>winamp.def</ModuleDefinitionFile>
|
||||
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="winamp.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="winamp.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
||||
23
plugins/winamp/winamp.vcxproj.filters
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="winamp.def">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="winamp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
[![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-)
|
||||
|
||||
[](https://docs.zoitechat.org)
|
||||
[](https://docs.zoitechat.zoite.net)
|
||||
|
||||
</div>
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
|
||||
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 please read our [documentation](https://docs.zoitechat.zoite.net/):
|
||||
- [Downloads](https://zoitechat.zoite.net/download)
|
||||
|
||||
- [Troubleshooting](troubleshooting.md)
|
||||
|
||||
|
||||
@@ -445,7 +445,6 @@ const struct prefs vars[] =
|
||||
{"gui_dark_mode", P_OFFINT (hex_gui_dark_mode), TYPE_INT},
|
||||
{"gui_gtk3_variant", P_OFFINT (hex_gui_gtk3_variant), TYPE_INT},
|
||||
{"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_tab_newtofront", P_OFFINT (hex_gui_tab_newtofront), TYPE_INT},
|
||||
{"gui_tab_pos", P_OFFINT (hex_gui_tab_pos), TYPE_INT},
|
||||
@@ -778,16 +777,13 @@ load_default_config(void)
|
||||
prefs.hex_gui_tab_chans = 1;
|
||||
prefs.hex_gui_tab_dialogs = 1;
|
||||
prefs.hex_gui_tab_icons = 1;
|
||||
prefs.hex_gui_tab_closebuttons = 1;
|
||||
prefs.hex_gui_tab_middleclose = 1;
|
||||
prefs.hex_gui_tab_server = 1;
|
||||
prefs.hex_gui_tab_sort = 1;
|
||||
prefs.hex_gui_tab_scrollchans = 1;
|
||||
prefs.hex_gui_topicbar = 1;
|
||||
prefs.hex_gui_transparency = 255;
|
||||
prefs.hex_gui_tray = 1;
|
||||
prefs.hex_gui_tray_blink = 1;
|
||||
prefs.hex_gui_ulist_color = 1;
|
||||
prefs.hex_gui_ulist_count = 1;
|
||||
prefs.hex_gui_ulist_icons = 1;
|
||||
prefs.hex_gui_ulist_style = 1;
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
<ClInclude Include="plugin-timer.h" />
|
||||
<ClInclude Include="plugin.h" />
|
||||
<ClInclude Include="proto-irc.h" />
|
||||
<ClInclude Include="public_suffix_data.h" />
|
||||
<ClInclude Include="server.h" />
|
||||
<ClInclude Include="servlist.h" />
|
||||
<ClInclude Include="ssl.h" />
|
||||
@@ -110,7 +109,6 @@
|
||||
<Command><![CDATA[
|
||||
SET SOLUTIONDIR=$(SolutionDir)..\
|
||||
"$(Python3Path)\python.exe" $(ProjectDir)make-te.py "$(ProjectDir)textevents.in" "$(ZoiteChatLib)textevents.h" "$(ZoiteChatLib)textenums.h"
|
||||
"$(Python3Path)\python.exe" $(ProjectDir)gen-public-suffix.py "$(ZoiteChatLib)public_suffix_data.h"
|
||||
powershell -File "$(SolutionDir)..\win32\version-template.ps1" "$(SolutionDir)..\win32\config.h.tt" "$(ZoiteChatLib)config.h"
|
||||
$(GlibGenMarshal) --prefix=_zoitechat_marshal --header "$(ProjectDir)marshalers.list" --output "$(ZoiteChatLib)marshal.h"
|
||||
$(GlibGenMarshal) --prefix=_zoitechat_marshal --body "$(ProjectDir)marshalers.list" --output "$(ZoiteChatLib)marshal.c"
|
||||
|
||||
@@ -65,9 +65,6 @@
|
||||
<ClInclude Include="proto-irc.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="public_suffix_data.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="server.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -82,6 +82,10 @@ has_theme_argument (void)
|
||||
|
||||
void
|
||||
zoitechat_remote (void)
|
||||
/* TODO: dbus_g_connection_unref (connection) are commented because it makes
|
||||
* dbus to crash. Fixed in dbus >=0.70 ?!?
|
||||
* https://launchpad.net/distros/ubuntu/+source/dbus/+bug/54375
|
||||
*/
|
||||
{
|
||||
GDBusConnection *connection;
|
||||
GDBusProxy *dbus = NULL;
|
||||
|
||||
@@ -1,122 +1,203 @@
|
||||
#include <gio/gio.h>
|
||||
#include <glib.h>
|
||||
/* example.c - program to demonstrate some D-BUS stuffs.
|
||||
* Copyright (C) 2006 Claessens Xavier
|
||||
*
|
||||
* 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 2 of the License, 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
|
||||
*
|
||||
* Claessens Xavier
|
||||
* xclaesse@gmail.com
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <dbus/dbus-glib.h>
|
||||
#include <stdlib.h>
|
||||
#include "../marshal.c"
|
||||
|
||||
#define DBUS_SERVICE "org.zoitechat.service"
|
||||
#define DBUS_CONNECTION_PATH "/org/zoitechat"
|
||||
#define DBUS_CONNECTION_INTERFACE "org.zoitechat.connection"
|
||||
#define DBUS_PLUGIN_INTERFACE "org.zoitechat.plugin"
|
||||
#define DBUS_REMOTE "/org/zoitechat/Remote"
|
||||
#define DBUS_REMOTE_CONNECTION_INTERFACE "org.zoitechat.connection"
|
||||
#define DBUS_REMOTE_PLUGIN_INTERFACE "org.zoitechat.plugin"
|
||||
|
||||
static gboolean
|
||||
call_sync (GDBusProxy *proxy, const char *method, GVariant *params, GVariant **out)
|
||||
guint command_id;
|
||||
guint server_id;
|
||||
|
||||
static void
|
||||
write_error (const char *message,
|
||||
GError **error)
|
||||
{
|
||||
if (error == NULL || *error == NULL) {
|
||||
return;
|
||||
}
|
||||
g_printerr ("%s: %s\n", message, (*error)->message);
|
||||
g_clear_error (error);
|
||||
}
|
||||
|
||||
static void
|
||||
test_server_cb (DBusGProxy *proxy,
|
||||
char *word[],
|
||||
char *word_eol[],
|
||||
guint hook_id,
|
||||
guint context_id,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (hook_id == server_id) {
|
||||
g_print ("message: %s\n", word_eol[0]);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
test_command_cb (DBusGProxy *proxy,
|
||||
char *word[],
|
||||
char *word_eol[],
|
||||
guint hook_id,
|
||||
guint context_id,
|
||||
gpointer user_data)
|
||||
{
|
||||
GError *error = NULL;
|
||||
GVariant *result;
|
||||
|
||||
result = g_dbus_proxy_call_sync (proxy,
|
||||
method,
|
||||
params,
|
||||
G_DBUS_CALL_FLAGS_NONE,
|
||||
-1,
|
||||
NULL,
|
||||
&error);
|
||||
if (!result)
|
||||
{
|
||||
g_printerr ("%s failed: %s\n", method, error->message);
|
||||
g_clear_error (&error);
|
||||
return FALSE;
|
||||
if (hook_id == command_id) {
|
||||
if (!dbus_g_proxy_call (proxy, "Unhook",
|
||||
&error,
|
||||
G_TYPE_UINT, hook_id,
|
||||
G_TYPE_INVALID, G_TYPE_INVALID)) {
|
||||
write_error ("Failed to complete unhook", &error);
|
||||
}
|
||||
/* Now if you write "/test blah" again in the ZoiteChat window
|
||||
* you'll get a "Unknown command" error message */
|
||||
g_print ("test command received: %s\n", word_eol[1]);
|
||||
if (!dbus_g_proxy_call (proxy, "Print",
|
||||
&error,
|
||||
G_TYPE_STRING, "test command succeed",
|
||||
G_TYPE_INVALID,
|
||||
G_TYPE_INVALID)) {
|
||||
write_error ("Failed to complete Print", &error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (out)
|
||||
*out = result;
|
||||
else
|
||||
g_variant_unref (result);
|
||||
|
||||
return TRUE;
|
||||
static void
|
||||
unload_cb (void)
|
||||
{
|
||||
g_print ("Good bye !\n");
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
GDBusConnection *connection;
|
||||
GDBusProxy *connection_proxy;
|
||||
GDBusProxy *plugin_proxy;
|
||||
GVariant *connect_result = NULL;
|
||||
gchar *remote_path = NULL;
|
||||
gchar *command = NULL;
|
||||
const char *path_tmp;
|
||||
int status = EXIT_FAILURE;
|
||||
DBusGConnection *connection;
|
||||
DBusGProxy *remote_object;
|
||||
GMainLoop *mainloop;
|
||||
gchar *path;
|
||||
GError *error = NULL;
|
||||
|
||||
connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
|
||||
if (!connection)
|
||||
{
|
||||
g_printerr ("Bus connection failed: %s\n", error->message);
|
||||
g_clear_error (&error);
|
||||
#if ! GLIB_CHECK_VERSION (2, 36, 0)
|
||||
g_type_init ();
|
||||
#endif
|
||||
|
||||
connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
|
||||
if (connection == NULL) {
|
||||
write_error ("Couldn't connect to session bus", &error);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
connection_proxy = g_dbus_proxy_new_sync (connection,
|
||||
G_DBUS_PROXY_FLAGS_NONE,
|
||||
NULL,
|
||||
DBUS_SERVICE,
|
||||
DBUS_CONNECTION_PATH,
|
||||
DBUS_CONNECTION_INTERFACE,
|
||||
NULL,
|
||||
&error);
|
||||
if (!connection_proxy)
|
||||
{
|
||||
g_printerr ("Connection proxy failed: %s\n", error->message);
|
||||
g_clear_error (&error);
|
||||
g_object_unref (connection);
|
||||
|
||||
remote_object = dbus_g_proxy_new_for_name (connection,
|
||||
DBUS_SERVICE,
|
||||
DBUS_REMOTE,
|
||||
DBUS_REMOTE_CONNECTION_INTERFACE);
|
||||
if (!dbus_g_proxy_call (remote_object, "Connect",
|
||||
&error,
|
||||
G_TYPE_STRING, argv[0],
|
||||
G_TYPE_STRING, "example",
|
||||
G_TYPE_STRING, "Example of a D-Bus client",
|
||||
G_TYPE_STRING, "1.0",
|
||||
G_TYPE_INVALID,
|
||||
G_TYPE_STRING, &path, G_TYPE_INVALID)) {
|
||||
write_error ("Failed to complete Connect", &error);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
g_object_unref (remote_object);
|
||||
|
||||
if (!call_sync (connection_proxy,
|
||||
"Connect",
|
||||
g_variant_new ("(ssss)", "example", "example", "GDBus example", "1.0"),
|
||||
&connect_result))
|
||||
goto cleanup;
|
||||
remote_object = dbus_g_proxy_new_for_name (connection,
|
||||
DBUS_SERVICE,
|
||||
path,
|
||||
DBUS_REMOTE_PLUGIN_INTERFACE);
|
||||
g_free (path);
|
||||
|
||||
g_variant_get (connect_result, "(&s)", &path_tmp);
|
||||
remote_path = g_strdup (path_tmp);
|
||||
g_variant_unref (connect_result);
|
||||
connect_result = NULL;
|
||||
|
||||
plugin_proxy = g_dbus_proxy_new_sync (connection,
|
||||
G_DBUS_PROXY_FLAGS_NONE,
|
||||
NULL,
|
||||
DBUS_SERVICE,
|
||||
remote_path,
|
||||
DBUS_PLUGIN_INTERFACE,
|
||||
NULL,
|
||||
&error);
|
||||
if (!plugin_proxy)
|
||||
{
|
||||
g_printerr ("Plugin proxy failed: %s\n", error->message);
|
||||
g_clear_error (&error);
|
||||
goto cleanup;
|
||||
if (!dbus_g_proxy_call (remote_object, "HookCommand",
|
||||
&error,
|
||||
G_TYPE_STRING, "test",
|
||||
G_TYPE_INT, 0,
|
||||
G_TYPE_STRING, "Simple D-BUS example",
|
||||
G_TYPE_INT, 1, G_TYPE_INVALID,
|
||||
G_TYPE_UINT, &command_id, G_TYPE_INVALID)) {
|
||||
write_error ("Failed to complete HookCommand", &error);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
g_print ("Command hook id=%d\n", command_id);
|
||||
|
||||
if (argc > 1)
|
||||
command = g_strjoinv (" ", &argv[1]);
|
||||
else
|
||||
command = g_strdup ("gui focus");
|
||||
|
||||
if (!call_sync (plugin_proxy, "Command", g_variant_new ("(s)", command), NULL))
|
||||
{
|
||||
g_object_unref (plugin_proxy);
|
||||
goto cleanup;
|
||||
if (!dbus_g_proxy_call (remote_object, "HookServer",
|
||||
&error,
|
||||
G_TYPE_STRING, "RAW LINE",
|
||||
G_TYPE_INT, 0,
|
||||
G_TYPE_INT, 0, G_TYPE_INVALID,
|
||||
G_TYPE_UINT, &server_id, G_TYPE_INVALID)) {
|
||||
write_error ("Failed to complete HookServer", &error);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
g_print ("Server hook id=%d\n", server_id);
|
||||
|
||||
call_sync (connection_proxy, "Disconnect", g_variant_new ("()"), NULL);
|
||||
status = EXIT_SUCCESS;
|
||||
g_object_unref (plugin_proxy);
|
||||
dbus_g_object_register_marshaller (
|
||||
_zoitechat_marshal_VOID__POINTER_POINTER_UINT_UINT,
|
||||
G_TYPE_NONE,
|
||||
G_TYPE_STRV, G_TYPE_STRV, G_TYPE_UINT, G_TYPE_UINT,
|
||||
G_TYPE_INVALID);
|
||||
|
||||
cleanup:
|
||||
g_free (command);
|
||||
g_free (remote_path);
|
||||
g_object_unref (connection_proxy);
|
||||
g_object_unref (connection);
|
||||
return status;
|
||||
dbus_g_object_register_marshaller (
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE,
|
||||
G_TYPE_INVALID);
|
||||
|
||||
dbus_g_proxy_add_signal (remote_object, "CommandSignal",
|
||||
G_TYPE_STRV,
|
||||
G_TYPE_STRV,
|
||||
G_TYPE_UINT,
|
||||
G_TYPE_UINT,
|
||||
G_TYPE_INVALID);
|
||||
dbus_g_proxy_connect_signal (remote_object, "CommandSignal",
|
||||
G_CALLBACK (test_command_cb),
|
||||
NULL, NULL);
|
||||
|
||||
dbus_g_proxy_add_signal (remote_object, "ServerSignal",
|
||||
G_TYPE_STRV,
|
||||
G_TYPE_STRV,
|
||||
G_TYPE_UINT,
|
||||
G_TYPE_UINT,
|
||||
G_TYPE_INVALID);
|
||||
dbus_g_proxy_connect_signal (remote_object, "ServerSignal",
|
||||
G_CALLBACK (test_server_cb),
|
||||
NULL, NULL);
|
||||
|
||||
dbus_g_proxy_add_signal (remote_object, "UnloadSignal",
|
||||
G_TYPE_INVALID);
|
||||
dbus_g_proxy_connect_signal (remote_object, "UnloadSignal",
|
||||
G_CALLBACK (unload_cb),
|
||||
NULL, NULL);
|
||||
|
||||
/* Now you can write on the ZoiteChat windows: "/test arg1 arg2 ..." */
|
||||
mainloop = g_main_loop_new (NULL, FALSE);
|
||||
g_main_loop_run (mainloop);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
dbus_deps = []
|
||||
dbus_deps = [
|
||||
dbus_glib_dep
|
||||
]
|
||||
|
||||
dbus_sources = [
|
||||
'dbus-plugin.c',
|
||||
@@ -33,8 +35,16 @@ configure_file(
|
||||
install_dir: dbus_service_dir
|
||||
)
|
||||
|
||||
dbus_binding_tool = find_program('dbus-binding-tool')
|
||||
dbus_remote_object = custom_target('remote-object-glue',
|
||||
input: 'remote-object.xml',
|
||||
output: 'remote-object-glue.h',
|
||||
command: [dbus_binding_tool, '--prefix=remote_object', '--mode=glib-server',
|
||||
'--output=@OUTPUT@', '@INPUT@']
|
||||
)
|
||||
|
||||
zoitechat_dbus = static_library('zoitechatdbus',
|
||||
sources: marshal + dbus_sources,
|
||||
sources: [dbus_remote_object, marshal] + dbus_sources,
|
||||
c_args: dbus_cargs,
|
||||
dependencies: common_deps + dbus_deps,
|
||||
include_directories: dbus_includes,
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
|
||||
URLS = (
|
||||
"https://raw.githubusercontent.com/publicsuffix/list/main/public_suffix_list.dat",
|
||||
"https://publicsuffix.org/list/public_suffix_list.dat",
|
||||
)
|
||||
|
||||
|
||||
def parse_rules(text: str):
|
||||
rules = []
|
||||
for raw in text.splitlines():
|
||||
line = raw.strip()
|
||||
if not line or line.startswith("//"):
|
||||
continue
|
||||
if " " in line or "\t" in line:
|
||||
line = line.split()[0]
|
||||
rules.append(line.lower())
|
||||
return sorted(set(rules))
|
||||
|
||||
|
||||
def emit_header(path: str, rules):
|
||||
with open(path, "w", encoding="utf-8", newline="\n") as out:
|
||||
out.write("#pragma once\n")
|
||||
out.write("static const char * const public_suffix_rules[] = {\n")
|
||||
for rule in rules:
|
||||
escaped = rule.replace("\\", "\\\\").replace('"', '\\"')
|
||||
out.write(f'\t"{escaped}",\n')
|
||||
out.write("};\n")
|
||||
out.write(
|
||||
"static const unsigned int public_suffix_rules_len = sizeof(public_suffix_rules) / sizeof(public_suffix_rules[0]);\n"
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) not in (2, 3):
|
||||
raise SystemExit("usage: gen-public-suffix.py <output> [source]")
|
||||
output = Path(sys.argv[1])
|
||||
sources = []
|
||||
if len(sys.argv) == 3:
|
||||
sources.append(Path(sys.argv[2]))
|
||||
sources.extend(
|
||||
[
|
||||
Path(__file__).with_name("public_suffix_list.dat"),
|
||||
Path("/usr/share/publicsuffix/public_suffix_list.dat"),
|
||||
Path("/app/share/publicsuffix/public_suffix_list.dat"),
|
||||
]
|
||||
)
|
||||
data = None
|
||||
for url in URLS:
|
||||
try:
|
||||
with urllib.request.urlopen(url, timeout=30) as resp:
|
||||
data = resp.read().decode("utf-8")
|
||||
break
|
||||
except Exception:
|
||||
pass
|
||||
if data is None:
|
||||
for source in sources:
|
||||
if source.exists():
|
||||
data = source.read_text(encoding="utf-8")
|
||||
break
|
||||
if data is None:
|
||||
raise SystemExit("unable to load public suffix list")
|
||||
rules = parse_rules(data)
|
||||
emit_header(str(output), rules)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1221,94 +1221,6 @@ extract_archive (const char *source, GError **error)
|
||||
#endif
|
||||
}
|
||||
|
||||
static char *
|
||||
path_find_first_file_recursive (const char *root, const char *name, int depth)
|
||||
{
|
||||
GDir *dir;
|
||||
const char *entry;
|
||||
|
||||
if (!root || !name || depth < 0 || !g_file_test (root, G_FILE_TEST_IS_DIR))
|
||||
return NULL;
|
||||
|
||||
{
|
||||
char *candidate = g_build_filename (root, name, NULL);
|
||||
if (g_file_test (candidate, G_FILE_TEST_IS_REGULAR))
|
||||
return candidate;
|
||||
g_free (candidate);
|
||||
}
|
||||
|
||||
if (depth == 0)
|
||||
return NULL;
|
||||
|
||||
dir = g_dir_open (root, 0, NULL);
|
||||
if (!dir)
|
||||
return NULL;
|
||||
|
||||
while ((entry = g_dir_read_name (dir)) != NULL)
|
||||
{
|
||||
char *child = g_build_filename (root, entry, NULL);
|
||||
char *found = NULL;
|
||||
|
||||
if (g_file_test (child, G_FILE_TEST_IS_DIR))
|
||||
found = path_find_first_file_recursive (child, name, depth - 1);
|
||||
g_free (child);
|
||||
if (found)
|
||||
{
|
||||
g_dir_close (dir);
|
||||
return found;
|
||||
}
|
||||
}
|
||||
|
||||
g_dir_close (dir);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gboolean
|
||||
zoitechat_gtk3_theme_service_read_archive_text_file (const char *archive_path, const char *name, char **contents, GError **error)
|
||||
{
|
||||
char *root;
|
||||
char *path;
|
||||
gboolean ok;
|
||||
GError *local_error = NULL;
|
||||
|
||||
if (contents)
|
||||
*contents = NULL;
|
||||
if (!archive_path || !*archive_path)
|
||||
return g_set_error_literal (error, G_FILE_ERROR, G_FILE_ERROR_INVAL, "No archive path provided."), FALSE;
|
||||
if (!name || !*name)
|
||||
return g_set_error_literal (error, G_FILE_ERROR, G_FILE_ERROR_INVAL, "No file name provided."), FALSE;
|
||||
if (!contents)
|
||||
return g_set_error_literal (error, G_FILE_ERROR, G_FILE_ERROR_INVAL, "No output buffer provided."), FALSE;
|
||||
|
||||
root = extract_archive (archive_path, error);
|
||||
if (!root)
|
||||
return FALSE;
|
||||
|
||||
path = path_find_first_file_recursive (root, name, 8);
|
||||
if (!path)
|
||||
{
|
||||
remove_tree (root);
|
||||
g_free (root);
|
||||
return g_set_error_literal (error, G_FILE_ERROR, G_FILE_ERROR_NOENT, "Requested file was not found in archive."), FALSE;
|
||||
}
|
||||
|
||||
ok = g_file_get_contents (path, contents, NULL, &local_error);
|
||||
g_free (path);
|
||||
remove_tree (root);
|
||||
g_free (root);
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
if (error)
|
||||
*error = local_error;
|
||||
else
|
||||
g_clear_error (&local_error);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
zoitechat_gtk3_theme_service_import (const char *source_path, char **imported_id, GError **error)
|
||||
{
|
||||
|
||||
@@ -48,6 +48,5 @@ gboolean zoitechat_gtk3_theme_service_remove_user_theme (const char *theme_id, G
|
||||
char *zoitechat_gtk3_theme_pick_css_dir_for_minor (const char *theme_root, int preferred_minor);
|
||||
char *zoitechat_gtk3_theme_pick_css_dir (const char *theme_root);
|
||||
GPtrArray *zoitechat_gtk3_theme_build_inheritance_chain (const char *theme_root);
|
||||
gboolean zoitechat_gtk3_theme_service_read_archive_text_file (const char *archive_path, const char *name, char **contents, GError **error);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -96,14 +96,6 @@ marshal = [
|
||||
|
||||
make_te = find_program('make-te.py')
|
||||
|
||||
|
||||
python3 = find_program('python3', required: true)
|
||||
|
||||
public_suffix_data = custom_target('public_suffix_data_h',
|
||||
output: 'public_suffix_data.h',
|
||||
command: [python3, files('gen-public-suffix.py'), '@OUTPUT@']
|
||||
)
|
||||
|
||||
textevents = custom_target('textevents',
|
||||
input: 'textevents.in',
|
||||
output: ['textevents.h', 'textenums.h'],
|
||||
@@ -115,7 +107,7 @@ if libssl_dep.found()
|
||||
common_deps += libssl_dep
|
||||
endif
|
||||
|
||||
if dbus_dep.found()
|
||||
if dbus_glib_dep.found()
|
||||
subdir('dbus')
|
||||
common_deps += zoitechat_dbus_dep
|
||||
common_includes += include_directories('dbus')
|
||||
@@ -127,7 +119,7 @@ if get_option('plugin')
|
||||
endif
|
||||
|
||||
zoitechat_common = static_library('zoitechatcommon',
|
||||
sources: [textevents, public_suffix_data] + marshal + common_sources,
|
||||
sources: [textevents] + marshal + common_sources,
|
||||
include_directories: config_h_include,
|
||||
dependencies: common_deps + common_sysinfo_deps,
|
||||
c_args: common_cflags,
|
||||
@@ -135,7 +127,7 @@ zoitechat_common = static_library('zoitechatcommon',
|
||||
)
|
||||
|
||||
zoitechat_common_dep = declare_dependency(
|
||||
sources: [textevents, public_suffix_data] + marshal,
|
||||
sources: [textevents] + marshal,
|
||||
link_with: zoitechat_common,
|
||||
include_directories: common_includes,
|
||||
compile_args: common_cflags,
|
||||
|
||||
@@ -4070,7 +4070,7 @@ const struct commands xc_cmds[] = {
|
||||
{"ME", cmd_me, 0, 0, 1,
|
||||
N_("ME <action>, sends the action to the current channel (actions are written in the 3rd person, like /me jumps)")},
|
||||
{"MENU", cmd_menu, 0, 0, 1, "MENU [-eX] [-i<ICONFILE>] [-k<mod>,<key>] [-m] [-pX] [-r<X,group>] [-tX] {ADD|DEL} <path> [command] [unselect command]\n"
|
||||
" See https://docs.zoitechat.org/en/latest/en/latest/plugins.html#controlling-the-gui for more details."},
|
||||
" See https://docs.zoitechat.zoite.net/en/latest/en/latest/plugins.html#controlling-the-gui for more details."},
|
||||
{"MHOP", cmd_mhop, 1, 1, 1,
|
||||
N_("MHOP, Mass hop's all users in the current channel (needs chanop)")},
|
||||
{"MKICK", cmd_mkick, 1, 1, 1,
|
||||
@@ -4166,10 +4166,10 @@ const struct commands xc_cmds[] = {
|
||||
static int
|
||||
command_compare (const void *a, const void *b)
|
||||
{
|
||||
return g_ascii_strcasecmp (a, ((const struct commands *)b)->name);
|
||||
return g_ascii_strcasecmp (a, ((struct commands *)b)->name);
|
||||
}
|
||||
|
||||
static const struct commands *
|
||||
static struct commands *
|
||||
find_internal_command (char *name)
|
||||
{
|
||||
/* the "-1" is to skip the NULL terminator */
|
||||
@@ -4205,7 +4205,7 @@ usercommand_show_help (session *sess, char *name)
|
||||
static void
|
||||
help (session *sess, char *tbuf, char *helpcmd, int quiet)
|
||||
{
|
||||
const struct commands *cmd;
|
||||
struct commands *cmd;
|
||||
|
||||
if (plugin_show_help (sess, helpcmd))
|
||||
return;
|
||||
@@ -4763,7 +4763,7 @@ handle_command (session *sess, char *cmd, int check_spch)
|
||||
char *word[PDIWORDS+1];
|
||||
char *word_eol[PDIWORDS+1];
|
||||
static int command_level = 0;
|
||||
const struct commands *int_cmd;
|
||||
struct commands *int_cmd;
|
||||
char *pdibuf;
|
||||
char *tbuf;
|
||||
int len;
|
||||
@@ -4883,9 +4883,6 @@ xit:
|
||||
static int
|
||||
handle_user_input (session *sess, char *text, int history, int nocommand)
|
||||
{
|
||||
char cmd_char = prefs.hex_input_command_char[0];
|
||||
unsigned int i;
|
||||
|
||||
if (*text == '\0')
|
||||
return 1;
|
||||
|
||||
@@ -4893,23 +4890,51 @@ handle_user_input (session *sess, char *text, int history, int nocommand)
|
||||
history_add (&sess->history, text);
|
||||
|
||||
/* is it NOT a command, just text? */
|
||||
if (nocommand || text[0] != cmd_char)
|
||||
if (nocommand || text[0] != prefs.hex_input_command_char[0])
|
||||
{
|
||||
handle_say (sess, text, TRUE);
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (i = 1; text[i]; i++)
|
||||
/* check for // */
|
||||
if (text[0] == prefs.hex_input_command_char[0] && text[1] == prefs.hex_input_command_char[0])
|
||||
{
|
||||
if (text[i] == cmd_char)
|
||||
{
|
||||
handle_say (sess, text, TRUE);
|
||||
return 1;
|
||||
}
|
||||
if (text[i] == ' ')
|
||||
break;
|
||||
handle_say (sess, text + 1, TRUE);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0 /* Who would remember all this? */
|
||||
if (prefs.hex_input_command_char[0] == '/')
|
||||
{
|
||||
int i;
|
||||
const char *unix_dirs [] = {
|
||||
"/bin/",
|
||||
"/boot/",
|
||||
"/dev/",
|
||||
"/etc/",
|
||||
"/home/",
|
||||
"/lib/",
|
||||
"/lost+found/",
|
||||
"/mnt/",
|
||||
"/opt/",
|
||||
"/proc/",
|
||||
"/root/",
|
||||
"/sbin/",
|
||||
"/tmp/",
|
||||
"/usr/",
|
||||
"/var/",
|
||||
"/gnome/",
|
||||
NULL
|
||||
};
|
||||
for (i = 0; unix_dirs[i] != NULL; i++)
|
||||
if (strncmp (text, unix_dirs[i], strlen (unix_dirs[i]))==0)
|
||||
{
|
||||
handle_say (sess, text, TRUE);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return handle_command (sess, text + 1, TRUE);
|
||||
}
|
||||
|
||||
|
||||
@@ -493,6 +493,7 @@ plugin_auto_load (session *sess)
|
||||
for_files (lib_dir, "hcperl.dll", plugin_auto_load_cb);
|
||||
for_files (lib_dir, "hcpython3.dll", plugin_auto_load_cb);
|
||||
for_files (lib_dir, "hcupd.dll", plugin_auto_load_cb);
|
||||
for_files (lib_dir, "hcwinamp.dll", plugin_auto_load_cb);
|
||||
for_files (lib_dir, "hcsysinfo.dll", plugin_auto_load_cb);
|
||||
#else
|
||||
for_files (lib_dir, "*."PLUGIN_SUFFIX, plugin_auto_load_cb);
|
||||
|
||||
146
src/common/url.c
@@ -20,14 +20,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <glib.h>
|
||||
#include "zoitechat.h"
|
||||
#include "zoitechatc.h"
|
||||
#include "cfgfiles.h"
|
||||
#include "fe.h"
|
||||
#include "tree.h"
|
||||
#include "url.h"
|
||||
#include "public_suffix_data.h"
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
@@ -37,7 +35,6 @@ GTree *url_btree = NULL;
|
||||
static gboolean regex_match (const GRegex *re, const char *word,
|
||||
int *start, int *end);
|
||||
static const GRegex *re_url (void);
|
||||
static const GRegex *re_url_no_scheme (void);
|
||||
static const GRegex *re_email (void);
|
||||
static const GRegex *re_nick (void);
|
||||
static const GRegex *re_channel (void);
|
||||
@@ -45,8 +42,6 @@ static gboolean match_nick (const char *word, int *start, int *end);
|
||||
static gboolean match_channel (const char *word, int *start, int *end);
|
||||
static gboolean match_url (const char *word, int *start, int *end);
|
||||
static gboolean match_email (const char *word, int *start, int *end);
|
||||
static gboolean host_has_public_suffix (const char *host);
|
||||
static gboolean host_has_public_suffix_range (const char *word, int start, int end);
|
||||
|
||||
static int
|
||||
url_free (char *url, void *data)
|
||||
@@ -271,16 +266,7 @@ match_channel (const char *word, int *start, int *end)
|
||||
static gboolean
|
||||
match_url (const char *word, int *start, int *end)
|
||||
{
|
||||
if (regex_match (re_url (), word, start, end))
|
||||
return TRUE;
|
||||
|
||||
if (!regex_match (re_url_no_scheme (), word, start, end))
|
||||
return FALSE;
|
||||
|
||||
if (*start > 0 && word[*start - 1] == '@')
|
||||
return FALSE;
|
||||
|
||||
return host_has_public_suffix_range (word, *start, *end);
|
||||
return regex_match (re_url (), word, start, end);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -407,114 +393,6 @@ regex_match (const GRegex *re, const char *word, int *start, int *end)
|
||||
return found;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
host_has_public_suffix_range (const char *word, int start, int end)
|
||||
{
|
||||
char *candidate;
|
||||
const char *host_start;
|
||||
const char *host_end;
|
||||
const char *host_colon;
|
||||
gboolean ok;
|
||||
int host_len;
|
||||
char *host;
|
||||
|
||||
candidate = g_strndup (word + start, end - start);
|
||||
host_start = candidate;
|
||||
host_end = candidate + strlen (candidate);
|
||||
if (*host_start == '[')
|
||||
{
|
||||
g_free (candidate);
|
||||
return FALSE;
|
||||
}
|
||||
host_colon = strchr (host_start, ':');
|
||||
if (host_colon)
|
||||
host_end = host_colon;
|
||||
host_colon = strchr (host_start, '/');
|
||||
if (host_colon && host_colon < host_end)
|
||||
host_end = host_colon;
|
||||
host_len = (int)(host_end - host_start);
|
||||
if (host_len <= 0)
|
||||
{
|
||||
g_free (candidate);
|
||||
return FALSE;
|
||||
}
|
||||
host = g_strndup (host_start, host_len);
|
||||
ok = host_has_public_suffix (host);
|
||||
g_free (host);
|
||||
g_free (candidate);
|
||||
return ok;
|
||||
}
|
||||
|
||||
static GHashTable *
|
||||
public_suffix_table (void)
|
||||
{
|
||||
static GHashTable *table = NULL;
|
||||
unsigned int i;
|
||||
|
||||
if (table)
|
||||
return table;
|
||||
|
||||
table = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
for (i = 0; i < public_suffix_rules_len; i++)
|
||||
{
|
||||
g_hash_table_add (table, (gpointer)public_suffix_rules[i]);
|
||||
}
|
||||
return table;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
host_has_public_suffix (const char *host)
|
||||
{
|
||||
GHashTable *table;
|
||||
gchar **labels;
|
||||
int i;
|
||||
int n;
|
||||
gboolean matched = FALSE;
|
||||
|
||||
if (!strchr (host, '.'))
|
||||
return FALSE;
|
||||
|
||||
labels = g_strsplit (host, ".", -1);
|
||||
for (n = 0; labels[n]; n++)
|
||||
{
|
||||
if (labels[n][0] == '\0')
|
||||
{
|
||||
g_strfreev (labels);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
table = public_suffix_table ();
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
char *tail = g_strjoinv (".", &labels[i]);
|
||||
if (g_hash_table_contains (table, tail))
|
||||
matched = TRUE;
|
||||
if (i + 1 < n)
|
||||
{
|
||||
char *tail_wild = g_strjoinv (".", &labels[i + 1]);
|
||||
char *wild = g_strconcat ("*.", tail_wild, NULL);
|
||||
if (g_hash_table_contains (table, wild))
|
||||
matched = TRUE;
|
||||
g_free (tail_wild);
|
||||
g_free (wild);
|
||||
}
|
||||
if (i > 0)
|
||||
{
|
||||
char *exc = g_strconcat ("!", tail, NULL);
|
||||
if (g_hash_table_contains (table, exc))
|
||||
matched = TRUE;
|
||||
g_free (exc);
|
||||
}
|
||||
g_free (tail);
|
||||
if (matched)
|
||||
break;
|
||||
}
|
||||
|
||||
g_strfreev (labels);
|
||||
return matched;
|
||||
}
|
||||
|
||||
/* Miscellaneous description --- */
|
||||
#define DOMAIN_LABEL "[\\pL\\pN](?:[-\\pL\\pN]{0,61}[\\pL\\pN])?"
|
||||
#define DOMAIN DOMAIN_LABEL "(\\." DOMAIN_LABEL ")*"
|
||||
@@ -599,28 +477,6 @@ re_url (void)
|
||||
return url_ret;
|
||||
}
|
||||
|
||||
static const GRegex *
|
||||
re_url_no_scheme (void)
|
||||
{
|
||||
static GRegex *url_ret = NULL;
|
||||
GString *grist_gstr;
|
||||
char *grist;
|
||||
|
||||
if (url_ret) return url_ret;
|
||||
|
||||
grist_gstr = g_string_new (NULL);
|
||||
g_string_append (grist_gstr, "(");
|
||||
g_string_append (grist_gstr, HOST_URL_OPT_TLD OPT_PORT);
|
||||
g_string_append_printf (grist_gstr, "(/" PATH ")?");
|
||||
g_string_append (grist_gstr, ")");
|
||||
|
||||
grist = g_string_free (grist_gstr, FALSE);
|
||||
url_ret = make_re (grist);
|
||||
g_free (grist);
|
||||
|
||||
return url_ret;
|
||||
}
|
||||
|
||||
#define EMAIL_LOCAL_ATOM "[\\pL\\pN!#$%&'*+/=?^_`{|}~-]+"
|
||||
#define EMAIL_LOCAL EMAIL_LOCAL_ATOM "(\\." EMAIL_LOCAL_ATOM ")*"
|
||||
#define EMAIL EMAIL_LOCAL "@" DOMAIN TLD
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
* Copyright (C) 1998-2010 Peter Zelezny.
|
||||
* Copyright (C) 2009-2013 Berke Viktor.
|
||||
*
|
||||
* 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 2
|
||||
* of the License, or (at your option) any later version.
|
||||
* 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 2 of the License, 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
|
||||
@@ -13,8 +13,8 @@
|
||||
* 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, see
|
||||
* <https://www.gnu.org/licenses/>.
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/* You can distribute this header with your plugins for easy compilation */
|
||||
|
||||
@@ -265,7 +265,6 @@ struct zoitechatprefs
|
||||
int hex_gui_search_pos;
|
||||
int hex_gui_slist_select;
|
||||
int hex_gui_tab_layout;
|
||||
int hex_gui_tab_closebuttons;
|
||||
int hex_gui_tab_middleclose;
|
||||
int hex_gui_tab_newtofront;
|
||||
int hex_gui_tab_pos;
|
||||
|
||||
@@ -27,6 +27,8 @@ typedef struct
|
||||
GtkWidget *b2; /* button2 */
|
||||
} tabview;
|
||||
|
||||
#define ICON_CHANVIEW_CLOSE "gtk-close"
|
||||
|
||||
static void chanview_populate (chanview *cv);
|
||||
|
||||
/* ignore "toggled" signal? */
|
||||
@@ -61,19 +63,28 @@ static tab_scroll_animation *tab_right_animation;
|
||||
*/
|
||||
|
||||
static inline gint
|
||||
cv_tabs_get_viewport_size (GtkAdjustment *adj)
|
||||
cv_tabs_get_viewport_size (GdkWindow *parent_win, gboolean vertical)
|
||||
{
|
||||
return (gint) gtk_adjustment_get_page_size (adj);
|
||||
gint viewport_size = 0;
|
||||
|
||||
if (vertical)
|
||||
viewport_size = gdk_window_get_height (parent_win);
|
||||
else
|
||||
viewport_size = gdk_window_get_width (parent_win);
|
||||
|
||||
return viewport_size;
|
||||
}
|
||||
|
||||
static void
|
||||
cv_tabs_sizealloc (GtkWidget *widget, GtkAllocation *allocation, chanview *cv)
|
||||
{
|
||||
GdkWindow *parent_win;
|
||||
GtkAdjustment *adj;
|
||||
GtkWidget *inner;
|
||||
gint viewport_size;
|
||||
|
||||
inner = ((tabview *)cv)->inner;
|
||||
parent_win = gtk_widget_get_window (gtk_widget_get_parent (inner));
|
||||
|
||||
if (cv->vertical)
|
||||
{
|
||||
@@ -83,20 +94,16 @@ cv_tabs_sizealloc (GtkWidget *widget, GtkAllocation *allocation, chanview *cv)
|
||||
adj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (gtk_widget_get_parent (inner)));
|
||||
}
|
||||
|
||||
viewport_size = cv_tabs_get_viewport_size (adj);
|
||||
viewport_size = cv_tabs_get_viewport_size (parent_win, cv->vertical);
|
||||
|
||||
if (gtk_adjustment_get_upper (adj) <= viewport_size)
|
||||
{
|
||||
if (((tabview *)cv)->b1)
|
||||
gtk_widget_hide (((tabview *)cv)->b1);
|
||||
if (((tabview *)cv)->b2)
|
||||
gtk_widget_hide (((tabview *)cv)->b2);
|
||||
gtk_widget_hide (((tabview *)cv)->b1);
|
||||
gtk_widget_hide (((tabview *)cv)->b2);
|
||||
} else
|
||||
{
|
||||
if (((tabview *)cv)->b1)
|
||||
gtk_widget_show (((tabview *)cv)->b1);
|
||||
if (((tabview *)cv)->b2)
|
||||
gtk_widget_show (((tabview *)cv)->b2);
|
||||
gtk_widget_show (((tabview *)cv)->b1);
|
||||
gtk_widget_show (((tabview *)cv)->b2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,8 +243,10 @@ tab_scroll_left_up_clicked (GtkWidget *widget, chanview *cv)
|
||||
gint viewport_size;
|
||||
gfloat new_value;
|
||||
GtkWidget *inner;
|
||||
GdkWindow *parent_win;
|
||||
|
||||
inner = ((tabview *)cv)->inner;
|
||||
parent_win = gtk_widget_get_window (gtk_widget_get_parent (inner));
|
||||
|
||||
if (cv->vertical)
|
||||
{
|
||||
@@ -247,7 +256,7 @@ tab_scroll_left_up_clicked (GtkWidget *widget, chanview *cv)
|
||||
adj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (gtk_widget_get_parent(inner)));
|
||||
}
|
||||
|
||||
viewport_size = cv_tabs_get_viewport_size (adj);
|
||||
viewport_size = cv_tabs_get_viewport_size (parent_win, cv->vertical);
|
||||
|
||||
new_value = tab_search_offset (inner, gtk_adjustment_get_value (adj), 0, cv->vertical);
|
||||
|
||||
@@ -272,8 +281,10 @@ tab_scroll_right_down_clicked (GtkWidget *widget, chanview *cv)
|
||||
gint viewport_size;
|
||||
gfloat new_value;
|
||||
GtkWidget *inner;
|
||||
GdkWindow *parent_win;
|
||||
|
||||
inner = ((tabview *)cv)->inner;
|
||||
parent_win = gtk_widget_get_window (gtk_widget_get_parent (inner));
|
||||
|
||||
if (cv->vertical)
|
||||
{
|
||||
@@ -283,7 +294,7 @@ tab_scroll_right_down_clicked (GtkWidget *widget, chanview *cv)
|
||||
adj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (gtk_widget_get_parent(inner)));
|
||||
}
|
||||
|
||||
viewport_size = cv_tabs_get_viewport_size (adj);
|
||||
viewport_size = cv_tabs_get_viewport_size (parent_win, cv->vertical);
|
||||
|
||||
new_value = tab_search_offset (inner, gtk_adjustment_get_value (adj), 1, cv->vertical);
|
||||
|
||||
@@ -304,39 +315,76 @@ tab_scroll_right_down_clicked (GtkWidget *widget, chanview *cv)
|
||||
static gboolean
|
||||
tab_scroll_cb (GtkWidget *widget, GdkEventScroll *event, gpointer cv)
|
||||
{
|
||||
int direction = cv_scroll_direction (event);
|
||||
|
||||
if (prefs.hex_gui_tab_scrollchans)
|
||||
{
|
||||
if (direction != 0)
|
||||
{
|
||||
mg_switch_page (1, direction);
|
||||
return TRUE;
|
||||
}
|
||||
if (event->direction == GDK_SCROLL_DOWN)
|
||||
mg_switch_page (1, 1);
|
||||
else if (event->direction == GDK_SCROLL_UP)
|
||||
mg_switch_page (1, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (direction < 0)
|
||||
{
|
||||
/* mouse wheel scrolling */
|
||||
if (event->direction == GDK_SCROLL_UP)
|
||||
tab_scroll_left_up_clicked (widget, cv);
|
||||
return TRUE;
|
||||
}
|
||||
else if (direction > 0)
|
||||
{
|
||||
else if (event->direction == GDK_SCROLL_DOWN)
|
||||
tab_scroll_right_down_clicked (widget, cv);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
cv_tabs_xclick_cb (GtkWidget *button, chanview *cv)
|
||||
{
|
||||
cv->cb_xbutton (cv, cv->focused, cv->focused->tag, cv->focused->userdata);
|
||||
}
|
||||
|
||||
/* make a Scroll (arrow) button */
|
||||
|
||||
static GtkWidget *
|
||||
make_sbutton (GtkArrowType type, void *click_cb, void *userdata)
|
||||
{
|
||||
GtkWidget *button, *arrow;
|
||||
const char *icon_name = "pan-end-symbolic";
|
||||
|
||||
button = gtk_button_new ();
|
||||
switch (type)
|
||||
{
|
||||
case GTK_ARROW_UP:
|
||||
icon_name = "pan-up-symbolic";
|
||||
break;
|
||||
case GTK_ARROW_DOWN:
|
||||
icon_name = "pan-down-symbolic";
|
||||
break;
|
||||
case GTK_ARROW_LEFT:
|
||||
icon_name = "pan-start-symbolic";
|
||||
break;
|
||||
case GTK_ARROW_RIGHT:
|
||||
default:
|
||||
icon_name = "pan-end-symbolic";
|
||||
break;
|
||||
}
|
||||
|
||||
arrow = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON);
|
||||
gtk_container_add (GTK_CONTAINER (button), arrow);
|
||||
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
G_CALLBACK (click_cb), userdata);
|
||||
g_signal_connect (G_OBJECT (button), "scroll-event",
|
||||
G_CALLBACK (tab_scroll_cb), userdata);
|
||||
gtk_widget_show (arrow);
|
||||
|
||||
return button;
|
||||
}
|
||||
|
||||
static void
|
||||
cv_tabs_init (chanview *cv)
|
||||
{
|
||||
GtkWidget *box;
|
||||
GtkWidget *box, *hbox = NULL;
|
||||
GtkWidget *viewport;
|
||||
GtkWidget *outer;
|
||||
GtkWidget *button;
|
||||
|
||||
if (cv->vertical)
|
||||
{
|
||||
@@ -351,19 +399,12 @@ cv_tabs_init (chanview *cv)
|
||||
G_CALLBACK (cv_tabs_sizealloc), cv);
|
||||
gtk_widget_show (outer);
|
||||
|
||||
viewport = gtk_scrolled_window_new (0, 0);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (viewport), GTK_SHADOW_NONE);
|
||||
viewport = gtk_viewport_new (0, 0);
|
||||
gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
|
||||
if (cv->vertical)
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (viewport),
|
||||
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
|
||||
gtk_widget_set_size_request (viewport, -1, 1);
|
||||
else
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (viewport),
|
||||
GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER);
|
||||
gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (viewport), 1);
|
||||
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (viewport), 1);
|
||||
gtk_widget_set_hexpand (viewport, TRUE);
|
||||
gtk_widget_set_vexpand (viewport, TRUE);
|
||||
cv_add_scroll_events (viewport);
|
||||
gtk_widget_set_size_request (viewport, 1, -1);
|
||||
g_signal_connect (G_OBJECT (viewport), "scroll-event",
|
||||
G_CALLBACK (tab_scroll_cb), cv);
|
||||
gtk_box_pack_start (GTK_BOX (outer), viewport, 1, 1, 0);
|
||||
@@ -381,6 +422,40 @@ cv_tabs_init (chanview *cv)
|
||||
gtk_container_add (GTK_CONTAINER (viewport), box);
|
||||
gtk_widget_show (box);
|
||||
|
||||
/* if vertical, the buttons can be side by side */
|
||||
if (cv->vertical)
|
||||
{
|
||||
hbox = gtkutil_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (outer), hbox, 0, 0, 0);
|
||||
gtk_widget_show (hbox);
|
||||
}
|
||||
|
||||
/* make the Scroll buttons */
|
||||
((tabview *)cv)->b2 = make_sbutton (cv->vertical ?
|
||||
GTK_ARROW_UP : GTK_ARROW_LEFT,
|
||||
tab_scroll_left_up_clicked,
|
||||
cv);
|
||||
|
||||
((tabview *)cv)->b1 = make_sbutton (cv->vertical ?
|
||||
GTK_ARROW_DOWN : GTK_ARROW_RIGHT,
|
||||
tab_scroll_right_down_clicked,
|
||||
cv);
|
||||
|
||||
if (hbox)
|
||||
{
|
||||
gtk_container_add (GTK_CONTAINER (hbox), ((tabview *)cv)->b2);
|
||||
gtk_container_add (GTK_CONTAINER (hbox), ((tabview *)cv)->b1);
|
||||
} else
|
||||
{
|
||||
gtk_box_pack_start (GTK_BOX (outer), ((tabview *)cv)->b2, 0, 0, 0);
|
||||
gtk_box_pack_start (GTK_BOX (outer), ((tabview *)cv)->b1, 0, 0, 0);
|
||||
}
|
||||
|
||||
button = gtkutil_button (outer, ICON_CHANVIEW_CLOSE, NULL, cv_tabs_xclick_cb,
|
||||
cv, 0);
|
||||
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
|
||||
gtk_widget_set_can_focus (button, FALSE);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (cv->box), outer);
|
||||
}
|
||||
|
||||
@@ -584,135 +659,20 @@ tab_toggled_cb (GtkToggleButton *tab, chan *ch)
|
||||
static gboolean
|
||||
tab_click_cb (GtkWidget *wid, GdkEventButton *event, chan *ch)
|
||||
{
|
||||
GtkWidget *close_button;
|
||||
gint close_x;
|
||||
gint close_y;
|
||||
GtkAllocation close_alloc;
|
||||
|
||||
if (event->button == 1 && event->type == GDK_BUTTON_PRESS)
|
||||
{
|
||||
close_button = g_object_get_data (G_OBJECT (wid), "tab-close-button");
|
||||
if (prefs.hex_gui_tab_closebuttons && close_button &&
|
||||
gtk_widget_translate_coordinates (close_button, wid, 0, 0, &close_x, &close_y))
|
||||
{
|
||||
gtk_widget_get_allocation (close_button, &close_alloc);
|
||||
if (event->x >= close_x && event->x < close_x + close_alloc.width &&
|
||||
event->y >= close_y && event->y < close_y + close_alloc.height)
|
||||
{
|
||||
ch->cv->cb_xbutton (ch->cv, ch, ch->tag, ch->userdata);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ch->cv->cb_contextmenu (ch->cv, ch, ch->tag, ch->userdata, event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
tab_close_motion_cb (GtkWidget *wid, GdkEventMotion *event, chan *ch)
|
||||
{
|
||||
GtkWidget *close_button;
|
||||
gint close_x;
|
||||
gint close_y;
|
||||
GtkAllocation close_alloc;
|
||||
gboolean hover = FALSE;
|
||||
|
||||
close_button = g_object_get_data (G_OBJECT (wid), "tab-close-button");
|
||||
if (prefs.hex_gui_tab_closebuttons && close_button &&
|
||||
gtk_widget_translate_coordinates (close_button, wid, 0, 0, &close_x, &close_y))
|
||||
{
|
||||
gtk_widget_get_allocation (close_button, &close_alloc);
|
||||
hover = event->x >= close_x && event->x < close_x + close_alloc.width &&
|
||||
event->y >= close_y && event->y < close_y + close_alloc.height;
|
||||
}
|
||||
|
||||
if (hover)
|
||||
{
|
||||
GdkCursor *cursor;
|
||||
gtk_widget_set_state_flags (close_button, GTK_STATE_FLAG_PRELIGHT, TRUE);
|
||||
if (gtk_widget_get_window (wid))
|
||||
{
|
||||
cursor = gdk_cursor_new_for_display (gtk_widget_get_display (wid), GDK_HAND2);
|
||||
gdk_window_set_cursor (gtk_widget_get_window (wid), cursor);
|
||||
g_object_unref (cursor);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_unset_state_flags (close_button, GTK_STATE_FLAG_PRELIGHT);
|
||||
if (gtk_widget_get_window (wid))
|
||||
gdk_window_set_cursor (gtk_widget_get_window (wid), NULL);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
tab_close_leave_cb (GtkWidget *wid, GdkEventCrossing *event, chan *ch)
|
||||
{
|
||||
GtkWidget *close_button;
|
||||
|
||||
close_button = g_object_get_data (G_OBJECT (wid), "tab-close-button");
|
||||
if (prefs.hex_gui_tab_closebuttons && close_button)
|
||||
gtk_widget_unset_state_flags (close_button, GTK_STATE_FLAG_PRELIGHT);
|
||||
if (gtk_widget_get_window (wid))
|
||||
gdk_window_set_cursor (gtk_widget_get_window (wid), NULL);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
tab_get_label (GtkWidget *tab)
|
||||
{
|
||||
GtkWidget *label;
|
||||
|
||||
label = g_object_get_data (G_OBJECT (tab), "tab-label");
|
||||
if (label)
|
||||
return label;
|
||||
|
||||
return gtk_bin_get_child (GTK_BIN (tab));
|
||||
}
|
||||
|
||||
static void *
|
||||
cv_tabs_add (chanview *cv, chan *ch, char *name, GtkTreeIter *parent)
|
||||
{
|
||||
GtkWidget *but;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *label;
|
||||
GtkWidget *close_button;
|
||||
GtkWidget *close_icon;
|
||||
|
||||
but = gtk_toggle_button_new ();
|
||||
but = gtk_toggle_button_new_with_label (name);
|
||||
gtk_widget_set_name (but, "zoitechat-tab");
|
||||
gtk_widget_set_size_request (but, -1, 14);
|
||||
gtk_widget_add_events (but, GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK);
|
||||
cv_add_scroll_events (but);
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
|
||||
label = gtk_label_new (name);
|
||||
close_button = gtk_button_new ();
|
||||
cv_add_scroll_events (close_button);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (close_button), "flat");
|
||||
close_icon = gtk_image_new_from_icon_name ("window-close-symbolic", GTK_ICON_SIZE_MENU);
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (close_icon), 8);
|
||||
gtk_button_set_always_show_image (GTK_BUTTON (close_button), TRUE);
|
||||
gtk_widget_set_can_focus (close_button, FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (close_button), close_icon);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (hbox), close_button, FALSE, FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (but), hbox);
|
||||
g_object_set_data (G_OBJECT (but), "tab-label", label);
|
||||
g_object_set_data (G_OBJECT (but), "tab-close-button", close_button);
|
||||
g_object_set_data (G_OBJECT (but), "c", ch);
|
||||
/* used to trap right-clicks */
|
||||
g_signal_connect (G_OBJECT (but), "button-press-event",
|
||||
G_CALLBACK (tab_click_cb), ch);
|
||||
g_signal_connect (G_OBJECT (but), "scroll-event",
|
||||
G_CALLBACK (tab_scroll_cb), cv);
|
||||
g_signal_connect (G_OBJECT (close_button), "scroll-event",
|
||||
G_CALLBACK (tab_scroll_cb), cv);
|
||||
g_signal_connect (G_OBJECT (but), "motion-notify-event",
|
||||
G_CALLBACK (tab_close_motion_cb), ch);
|
||||
g_signal_connect (G_OBJECT (but), "leave-notify-event",
|
||||
G_CALLBACK (tab_close_leave_cb), ch);
|
||||
/* avoid prelights */
|
||||
g_signal_connect (G_OBJECT (but), "enter-notify-event",
|
||||
G_CALLBACK (tab_ignore_cb), NULL);
|
||||
@@ -724,9 +684,6 @@ cv_tabs_add (chanview *cv, chan *ch, char *name, GtkTreeIter *parent)
|
||||
g_signal_connect (G_OBJECT (but), "toggled",
|
||||
G_CALLBACK (tab_toggled_cb), ch);
|
||||
g_object_set_data (G_OBJECT (but), "u", ch->userdata);
|
||||
gtk_widget_show_all (hbox);
|
||||
if (!prefs.hex_gui_tab_closebuttons)
|
||||
gtk_widget_hide (close_button);
|
||||
|
||||
tab_add_real (cv, but, ch);
|
||||
|
||||
@@ -935,7 +892,7 @@ cv_tabs_cleanup (chanview *cv)
|
||||
static void
|
||||
cv_tabs_set_color (chan *ch, PangoAttrList *list)
|
||||
{
|
||||
gtk_label_set_attributes (GTK_LABEL (tab_get_label (ch->impl)), list);
|
||||
gtk_label_set_attributes (GTK_LABEL (gtk_bin_get_child (GTK_BIN (ch->impl))), list);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -944,16 +901,16 @@ cv_tabs_rename (chan *ch, char *name)
|
||||
PangoAttrList *attr;
|
||||
GtkWidget *tab = ch->impl;
|
||||
|
||||
attr = gtk_label_get_attributes (GTK_LABEL (tab_get_label (tab)));
|
||||
attr = gtk_label_get_attributes (GTK_LABEL (gtk_bin_get_child (GTK_BIN (tab))));
|
||||
if (attr)
|
||||
pango_attr_list_ref (attr);
|
||||
|
||||
gtk_label_set_text (GTK_LABEL (tab_get_label (tab)), name);
|
||||
gtk_button_set_label (GTK_BUTTON (tab), name);
|
||||
gtk_widget_queue_resize (gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(tab))));
|
||||
|
||||
if (attr)
|
||||
{
|
||||
gtk_label_set_attributes (GTK_LABEL (tab_get_label (tab)), attr);
|
||||
gtk_label_set_attributes (GTK_LABEL (gtk_bin_get_child (GTK_BIN (tab))), attr);
|
||||
pango_attr_list_unref (attr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,8 +45,6 @@ cv_tree_sel_cb (GtkTreeSelection *sel, chanview *cv)
|
||||
GtkTreeModel *model;
|
||||
GtkTreeIter prev_iter;
|
||||
GtkTreeIter iter;
|
||||
GtkTreePath *path;
|
||||
GtkTreeView *view;
|
||||
chan *ch;
|
||||
chan *prev_ch;
|
||||
gboolean has_prev;
|
||||
@@ -62,20 +60,6 @@ cv_tree_sel_cb (GtkTreeSelection *sel, chanview *cv)
|
||||
if (has_prev)
|
||||
{
|
||||
gtk_tree_model_get (model, &prev_iter, COL_CHAN, &prev_ch, -1);
|
||||
if (prev_ch != ch && gtk_tree_store_is_ancestor (cv->store, &iter, &prev_iter))
|
||||
{
|
||||
view = gtk_tree_selection_get_tree_view (sel);
|
||||
path = gtk_tree_model_get_path (model, &iter);
|
||||
if (path)
|
||||
{
|
||||
if (!gtk_tree_view_row_expanded (view, path))
|
||||
{
|
||||
gtk_tree_path_free (path);
|
||||
return;
|
||||
}
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
}
|
||||
if (prev_ch != ch)
|
||||
gtk_tree_store_set (cv->store, &prev_iter, COL_UNDERLINE, PANGO_UNDERLINE_NONE, -1);
|
||||
}
|
||||
@@ -111,12 +95,12 @@ cv_tree_scroll_event_cb (GtkWidget *widget, GdkEventScroll *event, gpointer user
|
||||
{
|
||||
if (prefs.hex_gui_tab_scrollchans)
|
||||
{
|
||||
int direction = cv_scroll_direction (event);
|
||||
if (event->direction == GDK_SCROLL_DOWN)
|
||||
mg_switch_page (1, 1);
|
||||
else if (event->direction == GDK_SCROLL_UP)
|
||||
mg_switch_page (1, -1);
|
||||
|
||||
if (direction != 0)
|
||||
mg_switch_page (1, direction);
|
||||
|
||||
return direction != 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@@ -141,7 +125,6 @@ cv_tree_init (chanview *cv)
|
||||
win = gtk_scrolled_window_new (0, 0);
|
||||
gtk_widget_set_hexpand (win, TRUE);
|
||||
gtk_widget_set_vexpand (win, TRUE);
|
||||
cv_add_scroll_events (win);
|
||||
|
||||
/*gtk_container_set_border_width (GTK_CONTAINER (win), 1);*/
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (win),
|
||||
@@ -155,7 +138,6 @@ cv_tree_init (chanview *cv)
|
||||
view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (cv->store));
|
||||
gtk_widget_set_hexpand (view, TRUE);
|
||||
gtk_widget_set_vexpand (view, TRUE);
|
||||
cv_add_scroll_events (view);
|
||||
gtk_widget_set_name (view, "zoitechat-tree");
|
||||
{
|
||||
ThemeWidgetStyleValues style_values;
|
||||
|
||||
@@ -95,37 +95,6 @@ static chan *cv_find_chan_by_number (chanview *cv, int num);
|
||||
static int cv_find_number_of_chan (chanview *cv, chan *find_ch);
|
||||
static void cv_find_neighbors_for_removal (chanview *cv, chan *find_ch, chan **left_ch, chan **first_ch);
|
||||
|
||||
static void
|
||||
cv_add_scroll_events (GtkWidget *widget)
|
||||
{
|
||||
gtk_widget_add_events (widget, GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK);
|
||||
}
|
||||
|
||||
static int
|
||||
cv_scroll_direction (GdkEventScroll *event)
|
||||
{
|
||||
gdouble dx;
|
||||
gdouble dy;
|
||||
|
||||
if (event->direction == GDK_SCROLL_SMOOTH && gdk_event_get_scroll_deltas ((GdkEvent *) event, &dx, &dy))
|
||||
{
|
||||
if (dy > 0)
|
||||
return 1;
|
||||
if (dy < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (event->direction)
|
||||
{
|
||||
case GDK_SCROLL_DOWN:
|
||||
return 1;
|
||||
case GDK_SCROLL_UP:
|
||||
return -1;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ======= TABS ======= */
|
||||
|
||||
|
||||
@@ -1308,38 +1308,17 @@ maybe_escape_uri (const char *uri)
|
||||
return g_strdup (uri);
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
static gchar **
|
||||
fe_open_url_env_sanitized (void)
|
||||
{
|
||||
gchar **env = g_get_environ ();
|
||||
const char *vars[] = {"LD_LIBRARY_PATH", "LD_PRELOAD", "APPDIR", "APPIMAGE", "ARGV0", NULL};
|
||||
int i;
|
||||
|
||||
for (i = 0; vars[i]; i++)
|
||||
{
|
||||
gchar **tmp_env = env;
|
||||
env = g_environ_unsetenv (tmp_env, vars[i]);
|
||||
if (env != tmp_env)
|
||||
g_strfreev (tmp_env);
|
||||
}
|
||||
|
||||
return env;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
fe_open_url_inner (const char *url)
|
||||
{
|
||||
GError *error = NULL;
|
||||
char *escaped_url = maybe_escape_uri (url);
|
||||
gboolean opened = FALSE;
|
||||
gboolean opened = g_app_info_launch_default_for_uri (escaped_url, NULL, &error);
|
||||
|
||||
#ifdef WIN32
|
||||
opened = g_app_info_launch_default_for_uri (escaped_url, NULL, &error);
|
||||
if (!opened)
|
||||
{
|
||||
g_clear_error (&error);
|
||||
#ifdef WIN32
|
||||
gunichar2 *url_utf16 = g_utf8_to_utf16 (escaped_url, -1, NULL, NULL, NULL);
|
||||
|
||||
if (url_utf16 != NULL)
|
||||
@@ -1347,11 +1326,22 @@ fe_open_url_inner (const char *url)
|
||||
opened = ((INT_PTR) ShellExecuteW (0, L"open", url_utf16, NULL, NULL, SW_SHOWNORMAL)) > 32;
|
||||
g_free (url_utf16);
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
gchar *xdg_open_argv[] = {(gchar *) "xdg-open", escaped_url, NULL};
|
||||
gchar **spawn_env = fe_open_url_env_sanitized ();
|
||||
gchar **spawn_env = NULL;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if (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,
|
||||
@@ -1364,25 +1354,18 @@ fe_open_url_inner (const char *url)
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
g_strfreev (spawn_env);
|
||||
}
|
||||
|
||||
if (!opened)
|
||||
{
|
||||
opened = g_app_info_launch_default_for_uri (escaped_url, NULL, &error);
|
||||
if (!opened)
|
||||
if (!opened && gtk_show_uri_on_window (NULL, escaped_url, GDK_CURRENT_TIME, &error))
|
||||
{
|
||||
opened = TRUE;
|
||||
}
|
||||
else if (!opened)
|
||||
{
|
||||
g_clear_error (&error);
|
||||
}
|
||||
}
|
||||
|
||||
if (!opened && gtk_show_uri_on_window (NULL, escaped_url, GDK_CURRENT_TIME, &error))
|
||||
{
|
||||
opened = TRUE;
|
||||
}
|
||||
else if (!opened)
|
||||
{
|
||||
g_clear_error (&error);
|
||||
}
|
||||
g_strfreev (spawn_env);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!opened)
|
||||
{
|
||||
|
||||
@@ -443,27 +443,6 @@ key_handle_key_press (GtkWidget *wid, GdkEventKey *evt, session *sess)
|
||||
if (!list)
|
||||
return FALSE;
|
||||
current_sess = sess;
|
||||
if ((evt->state & GDK_CONTROL_MASK) &&
|
||||
!(evt->state & (GDK_MOD1_MASK | GDK_META_MASK)))
|
||||
{
|
||||
if (!(evt->state & GDK_SHIFT_MASK) &&
|
||||
(evt->keyval == GDK_KEY_w || evt->keyval == GDK_KEY_W))
|
||||
{
|
||||
if (sess->type == SESS_CHANNEL)
|
||||
{
|
||||
fe_close_window (sess);
|
||||
g_signal_stop_emission_by_name (G_OBJECT (wid), "key-press-event");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if ((evt->state & GDK_SHIFT_MASK) &&
|
||||
(evt->keyval == GDK_KEY_t || evt->keyval == GDK_KEY_T))
|
||||
{
|
||||
mg_reopen_closed_channel_tab ();
|
||||
g_signal_stop_emission_by_name (G_OBJECT (wid), "key-press-event");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (plugin_emit_keypress (sess, evt->state, evt->keyval, gdk_keyval_to_unicode (evt->keyval)))
|
||||
return 1;
|
||||
@@ -1973,37 +1952,8 @@ replace_handle (GtkWidget *t)
|
||||
{
|
||||
ptrdiff_t found_offset = found - text;
|
||||
ptrdiff_t found_end_offset = found_offset + (ptrdiff_t) pop_len;
|
||||
gboolean start_ok;
|
||||
gboolean end_ok;
|
||||
int rank;
|
||||
ptrdiff_t distance;
|
||||
const char *before = found;
|
||||
const char *after = found + pop_len;
|
||||
|
||||
if (before > text)
|
||||
{
|
||||
before = g_utf8_find_prev_char (text, before);
|
||||
start_ok = !before || (!g_unichar_isalnum (g_utf8_get_char (before)) && g_utf8_get_char (before) != '_');
|
||||
}
|
||||
else
|
||||
{
|
||||
start_ok = TRUE;
|
||||
}
|
||||
|
||||
if (*after != '\0')
|
||||
{
|
||||
end_ok = !g_unichar_isalnum (g_utf8_get_char (after)) && g_utf8_get_char (after) != '_';
|
||||
}
|
||||
else
|
||||
{
|
||||
end_ok = TRUE;
|
||||
}
|
||||
|
||||
if (!start_ok || !end_ok)
|
||||
{
|
||||
found++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cursor_byte_offset >= found_offset && cursor_byte_offset <= found_end_offset)
|
||||
{
|
||||
|
||||
@@ -468,14 +468,6 @@ static session_gui static_mg_gui;
|
||||
static session_gui *mg_gui = NULL; /* the shared irc tab */
|
||||
static int ignore_chanmode = FALSE;
|
||||
static const char chan_flags[] = { 'c', 'n', 't', 'i', 'm', 'l', 'k' };
|
||||
typedef struct
|
||||
{
|
||||
int server_id;
|
||||
char channel[CHANLEN];
|
||||
char key[64];
|
||||
}
|
||||
mg_closed_channel_tab;
|
||||
static GSList *mg_closed_channel_tabs;
|
||||
|
||||
static chan *active_tab = NULL; /* active tab */
|
||||
GtkWidget *parent_window = NULL; /* the master window */
|
||||
@@ -870,34 +862,12 @@ fe_set_title (session *sess)
|
||||
gtk_window_set_title (GTK_WINDOW (sess->gui->window), tbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
mg_topicbar_update_height (GtkWidget *topic);
|
||||
|
||||
static session *
|
||||
mg_session_from_window (GtkWidget *wid)
|
||||
{
|
||||
GSList *list;
|
||||
session *sess;
|
||||
|
||||
list = sess_list;
|
||||
while (list)
|
||||
{
|
||||
sess = list->data;
|
||||
if (sess && sess->gui && sess->gui->window == wid)
|
||||
return sess;
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
return current_sess;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata)
|
||||
{
|
||||
guint win_state;
|
||||
guint win_fullscreen;
|
||||
gboolean changed = FALSE;
|
||||
session *sess;
|
||||
|
||||
if ((event->changed_mask & GDK_WINDOW_STATE_ICONIFIED) &&
|
||||
(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED) &&
|
||||
@@ -933,20 +903,6 @@ mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata
|
||||
mg_schedule_config_save ();
|
||||
}
|
||||
|
||||
sess = mg_session_from_window (GTK_WIDGET (wid));
|
||||
if (sess && sess->gui && GTK_IS_WIDGET (sess->gui->topic_entry))
|
||||
{
|
||||
mg_topicbar_update_height (sess->gui->topic_entry);
|
||||
gtk_widget_queue_draw (sess->gui->topic_entry);
|
||||
}
|
||||
if (sess && sess->gui && GTK_IS_XTEXT (sess->gui->xtext))
|
||||
{
|
||||
gtk_xtext_refresh (GTK_XTEXT (sess->gui->xtext));
|
||||
gtk_widget_queue_draw (sess->gui->xtext);
|
||||
}
|
||||
if (sess && sess->gui && GTK_IS_WIDGET (sess->gui->window))
|
||||
gtk_widget_queue_draw (sess->gui->window);
|
||||
|
||||
menu_set_fullscreen (current_sess->gui, prefs.hex_gui_win_fullscreen);
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
@@ -960,7 +916,6 @@ static gboolean
|
||||
mg_configure_cb (GtkWidget *wid, GdkEventConfigure *event, session *sess)
|
||||
{
|
||||
gboolean changed = FALSE;
|
||||
session *target_sess;
|
||||
|
||||
if (sess == NULL)
|
||||
{
|
||||
@@ -1043,23 +998,6 @@ mg_configure_cb (GtkWidget *wid, GdkEventConfigure *event, session *sess)
|
||||
mg_schedule_config_save ();
|
||||
}
|
||||
|
||||
target_sess = mg_session_from_window (wid);
|
||||
if (target_sess && target_sess->gui)
|
||||
{
|
||||
if (GTK_IS_WIDGET (target_sess->gui->topic_entry))
|
||||
{
|
||||
mg_topicbar_update_height (target_sess->gui->topic_entry);
|
||||
gtk_widget_queue_draw (target_sess->gui->topic_entry);
|
||||
}
|
||||
if (GTK_IS_XTEXT (target_sess->gui->xtext))
|
||||
{
|
||||
gtk_xtext_refresh (GTK_XTEXT (target_sess->gui->xtext));
|
||||
gtk_widget_queue_draw (target_sess->gui->xtext);
|
||||
}
|
||||
if (GTK_IS_WIDGET (target_sess->gui->window))
|
||||
gtk_widget_queue_draw (target_sess->gui->window);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1651,71 +1589,6 @@ mg_tab_close_cb (GtkWidget *dialog, gint arg1, session *sess)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
mg_closed_channel_tabs_add (session *sess)
|
||||
{
|
||||
mg_closed_channel_tab *item;
|
||||
GSList *last;
|
||||
|
||||
if (!sess || sess->type != SESS_CHANNEL || !sess->channel[0])
|
||||
return;
|
||||
|
||||
item = g_new0 (mg_closed_channel_tab, 1);
|
||||
item->server_id = sess->server->id;
|
||||
g_strlcpy (item->channel, sess->channel, sizeof (item->channel));
|
||||
g_strlcpy (item->key, sess->channelkey, sizeof (item->key));
|
||||
mg_closed_channel_tabs = g_slist_prepend (mg_closed_channel_tabs, item);
|
||||
if (g_slist_length (mg_closed_channel_tabs) > 20)
|
||||
{
|
||||
last = g_slist_last (mg_closed_channel_tabs);
|
||||
g_free (last->data);
|
||||
mg_closed_channel_tabs = g_slist_delete_link (mg_closed_channel_tabs, last);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
mg_reopen_closed_channel_tab (void)
|
||||
{
|
||||
mg_closed_channel_tab *item;
|
||||
GSList *head;
|
||||
GSList *list;
|
||||
server *serv;
|
||||
session *sess;
|
||||
|
||||
if (!mg_closed_channel_tabs)
|
||||
return;
|
||||
|
||||
head = mg_closed_channel_tabs;
|
||||
item = head->data;
|
||||
mg_closed_channel_tabs = g_slist_delete_link (mg_closed_channel_tabs, head);
|
||||
if (!item)
|
||||
return;
|
||||
|
||||
serv = NULL;
|
||||
for (list = serv_list; list; list = list->next)
|
||||
{
|
||||
server *candidate = list->data;
|
||||
if (candidate->id == item->server_id)
|
||||
{
|
||||
serv = candidate;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (serv && serv->connected && item->channel[0])
|
||||
{
|
||||
sess = find_channel (serv, item->channel);
|
||||
if (sess)
|
||||
fe_ctrl_gui (sess, 2, 0);
|
||||
else
|
||||
{
|
||||
new_ircwindow (serv, item->channel, SESS_CHANNEL, 1);
|
||||
serv->p_join (serv, item->channel, item->key);
|
||||
}
|
||||
}
|
||||
|
||||
g_free (item);
|
||||
}
|
||||
|
||||
void
|
||||
mg_tab_close (session *sess)
|
||||
{
|
||||
@@ -1723,12 +1596,11 @@ mg_tab_close (session *sess)
|
||||
GSList *list;
|
||||
int i;
|
||||
|
||||
if (chan_remove (sess->res->tab, FALSE))
|
||||
{
|
||||
mg_closed_channel_tabs_add (sess);
|
||||
sess->res->tab = NULL;
|
||||
mg_ircdestroy (sess);
|
||||
}
|
||||
if (chan_remove (sess->res->tab, FALSE))
|
||||
{
|
||||
sess->res->tab = NULL;
|
||||
mg_ircdestroy (sess);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0, list = sess_list; list; list = list->next)
|
||||
@@ -2412,9 +2284,9 @@ mg_userlist_button (GtkWidget * box, char *label, char *cmd,
|
||||
g_signal_connect (G_OBJECT (wid), "clicked",
|
||||
G_CALLBACK (userlist_button_cb), cmd);
|
||||
gtk_widget_set_hexpand (wid, TRUE);
|
||||
gtk_widget_set_vexpand (wid, FALSE);
|
||||
gtk_widget_set_vexpand (wid, TRUE);
|
||||
gtk_widget_set_halign (wid, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (wid, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (wid, GTK_ALIGN_FILL);
|
||||
gtk_grid_attach (GTK_GRID (box), wid, a, c, b - a, d - c);
|
||||
show_and_unfocus (wid);
|
||||
}
|
||||
@@ -2571,7 +2443,6 @@ mg_topic_word_is_clickable (const char *word, int word_pos)
|
||||
{
|
||||
int start;
|
||||
int end;
|
||||
int word_type;
|
||||
|
||||
if (!word || word[0] == 0)
|
||||
return FALSE;
|
||||
@@ -2579,8 +2450,7 @@ mg_topic_word_is_clickable (const char *word, int word_pos)
|
||||
if (strcmp (word, "/") == 0)
|
||||
return FALSE;
|
||||
|
||||
word_type = url_check_word (word);
|
||||
if (word_type != WORD_URL && word_type != WORD_HOST && word_type != WORD_HOST6)
|
||||
if (url_check_word (word) == 0)
|
||||
return FALSE;
|
||||
|
||||
url_last (&start, &end);
|
||||
@@ -2629,8 +2499,7 @@ mg_topic_button_release_cb (GtkWidget *entry, GdkEventButton *event, gpointer us
|
||||
if (!word)
|
||||
return FALSE;
|
||||
|
||||
if ((event->state & 13) == prefs.hex_gui_url_mod &&
|
||||
mg_topic_word_is_clickable (word, word_pos))
|
||||
if (mg_topic_word_is_clickable (word, word_pos))
|
||||
{
|
||||
url_last (&start, &end);
|
||||
word[end] = 0;
|
||||
@@ -3099,116 +2968,6 @@ mg_create_dialogbuttons (GtkWidget *box)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
mg_topicbar_update_height (GtkWidget *topic)
|
||||
{
|
||||
GtkWidget *scroller;
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter start;
|
||||
GtkTextIter end;
|
||||
PangoLayout *layout;
|
||||
char *text;
|
||||
int width;
|
||||
int line_height;
|
||||
int line_count;
|
||||
int target_height;
|
||||
PangoContext *context;
|
||||
PangoFontMetrics *metrics;
|
||||
|
||||
if (!topic || !GTK_IS_TEXT_VIEW (topic))
|
||||
return;
|
||||
|
||||
scroller = gtk_widget_get_parent (topic);
|
||||
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (topic));
|
||||
gtk_text_buffer_get_bounds (buffer, &start, &end);
|
||||
text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
|
||||
layout = gtk_widget_create_pango_layout (topic, text && text[0] ? text : " ");
|
||||
g_free (text);
|
||||
|
||||
width = gtk_widget_get_allocated_width (topic) - 8;
|
||||
if (width > 0)
|
||||
pango_layout_set_width (layout, width * PANGO_SCALE);
|
||||
pango_layout_set_wrap (layout, PANGO_WRAP_WORD_CHAR);
|
||||
|
||||
context = gtk_widget_get_pango_context (topic);
|
||||
metrics = pango_context_get_metrics (context,
|
||||
pango_context_get_font_description (context),
|
||||
pango_context_get_language (context));
|
||||
line_height = PANGO_PIXELS (pango_font_metrics_get_ascent (metrics) +
|
||||
pango_font_metrics_get_descent (metrics));
|
||||
pango_font_metrics_unref (metrics);
|
||||
if (line_height <= 0)
|
||||
line_height = 16;
|
||||
line_count = pango_layout_get_line_count (layout);
|
||||
if (line_count <= 0)
|
||||
line_count = 1;
|
||||
target_height = line_height * line_count;
|
||||
if (target_height < line_height)
|
||||
target_height = line_height;
|
||||
|
||||
gtk_widget_set_size_request (topic, -1, target_height);
|
||||
if (scroller && GTK_IS_SCROLLED_WINDOW (scroller))
|
||||
{
|
||||
gtk_scrolled_window_set_max_content_height (GTK_SCROLLED_WINDOW (scroller), -1);
|
||||
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (scroller), -1);
|
||||
gtk_scrolled_window_set_max_content_height (GTK_SCROLLED_WINDOW (scroller), target_height);
|
||||
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (scroller), target_height);
|
||||
gtk_widget_set_size_request (scroller, -1, target_height);
|
||||
gtk_widget_queue_resize (scroller);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_queue_resize (topic);
|
||||
}
|
||||
gtk_widget_queue_draw (topic);
|
||||
g_object_unref (layout);
|
||||
}
|
||||
|
||||
static void
|
||||
mg_topicbar_buffer_changed_cb (GtkTextBuffer *buffer, gpointer userdata)
|
||||
{
|
||||
(void) buffer;
|
||||
mg_topicbar_update_height (GTK_WIDGET (userdata));
|
||||
}
|
||||
|
||||
static void
|
||||
mg_topicbar_size_allocate_cb (GtkWidget *widget, GtkAllocation *allocation, gpointer userdata)
|
||||
{
|
||||
(void) allocation;
|
||||
(void) userdata;
|
||||
mg_topicbar_update_height (widget);
|
||||
}
|
||||
|
||||
void
|
||||
mg_apply_session_font_prefs (session_gui *gui)
|
||||
{
|
||||
const PangoFontDescription *font = NULL;
|
||||
|
||||
if (!gui)
|
||||
return;
|
||||
|
||||
if (input_style)
|
||||
font = input_style->font_desc;
|
||||
|
||||
if (gui->topic_entry)
|
||||
{
|
||||
theme_manager_apply_entry_palette (gui->topic_entry, font);
|
||||
mg_topicbar_update_height (gui->topic_entry);
|
||||
}
|
||||
|
||||
if (gui->input_box && prefs.hex_gui_input_style)
|
||||
theme_manager_apply_entry_palette (gui->input_box, font);
|
||||
|
||||
if (gui->chanview)
|
||||
chanview_apply_theme (gui->chanview);
|
||||
|
||||
if (gui->user_tree)
|
||||
theme_manager_apply_userlist_style (gui->user_tree,
|
||||
theme_manager_get_userlist_palette_behavior (font));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mg_create_topicbar (session *sess, GtkWidget *box)
|
||||
{
|
||||
@@ -3225,22 +2984,12 @@ mg_create_topicbar (session *sess, GtkWidget *box)
|
||||
sess->res->tab = NULL;
|
||||
|
||||
gui->topic_entry = topic = gtk_text_view_new ();
|
||||
gtk_widget_set_name (topic, "zoitechat-topicbox");
|
||||
gtk_widget_set_name (topic, "zoitechat-inputbox");
|
||||
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (topic), GTK_WRAP_WORD_CHAR);
|
||||
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (topic), 4);
|
||||
gtk_text_view_set_right_margin (GTK_TEXT_VIEW (topic), 4);
|
||||
gtk_text_view_set_top_margin (GTK_TEXT_VIEW (topic), 4);
|
||||
gtk_text_view_set_bottom_margin (GTK_TEXT_VIEW (topic), 4);
|
||||
gtk_text_view_set_pixels_above_lines (GTK_TEXT_VIEW (topic), 0);
|
||||
gtk_text_view_set_pixels_below_lines (GTK_TEXT_VIEW (topic), 0);
|
||||
gtk_text_view_set_pixels_inside_wrap (GTK_TEXT_VIEW (topic), 0);
|
||||
theme_manager_apply_entry_palette (topic, input_style ? input_style->font_desc : NULL);
|
||||
g_signal_connect (gtk_text_view_get_buffer (GTK_TEXT_VIEW (topic)), "changed",
|
||||
G_CALLBACK (mg_topicbar_buffer_changed_cb), topic);
|
||||
g_signal_connect (G_OBJECT (topic), "size-allocate",
|
||||
G_CALLBACK (mg_topicbar_size_allocate_cb), NULL);
|
||||
mg_topicbar_update_height (topic);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), topic, TRUE, TRUE, 0);
|
||||
mg_apply_emoji_fallback_widget (topic);
|
||||
gtk_widget_add_events (topic, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
|
||||
GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK);
|
||||
g_signal_connect (G_OBJECT (topic), "key-press-event",
|
||||
@@ -3413,13 +3162,8 @@ mg_create_textarea (session *sess, GtkWidget *box)
|
||||
inbox = mg_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 2);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), inbox, TRUE, TRUE, 0);
|
||||
|
||||
frame = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_widget_set_hexpand (frame, TRUE);
|
||||
gtk_widget_set_vexpand (frame, TRUE);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (frame),
|
||||
GTK_SHADOW_IN);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (frame),
|
||||
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_box_pack_start (GTK_BOX (inbox), frame, TRUE, TRUE, 0);
|
||||
|
||||
theme_get_xtext_colors_for_widget (frame, xtext_palette, XTEXT_COLS);
|
||||
@@ -3436,7 +3180,9 @@ mg_create_textarea (session *sess, GtkWidget *box)
|
||||
g_signal_connect (G_OBJECT (xtext), "word_click",
|
||||
G_CALLBACK (mg_word_clicked), NULL);
|
||||
|
||||
gui->vscrollbar = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (frame));
|
||||
gui->vscrollbar = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL,
|
||||
GTK_XTEXT (xtext)->adj);
|
||||
gtk_box_pack_start (GTK_BOX (inbox), gui->vscrollbar, FALSE, TRUE, 0);
|
||||
|
||||
gtk_drag_dest_set (gui->vscrollbar, 5, dnd_dest_targets, 2,
|
||||
GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK);
|
||||
@@ -3479,7 +3225,7 @@ mg_create_meters (session_gui *gui, GtkWidget *parent_box)
|
||||
GtkWidget *infbox, *wid, *box;
|
||||
|
||||
gui->meter_box = infbox = box = mg_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 1);
|
||||
gtk_box_pack_end (GTK_BOX (parent_box), box, 0, 0, 0);
|
||||
gtk_box_pack_start (GTK_BOX (parent_box), box, 0, 0, 0);
|
||||
|
||||
if ((prefs.hex_gui_lagometer & 2) || (prefs.hex_gui_throttlemeter & 2))
|
||||
{
|
||||
@@ -3569,44 +3315,6 @@ mg_theme_userlist_changed (const ThemeChangedEvent *event, gpointer userdata)
|
||||
mg_theme_apply_userlist_style (gui);
|
||||
}
|
||||
|
||||
static void
|
||||
mg_theme_refresh_menu_widget (GtkWidget *widget)
|
||||
{
|
||||
GtkRequisition minimum;
|
||||
GtkRequisition natural;
|
||||
|
||||
if (!widget)
|
||||
return;
|
||||
|
||||
gtk_widget_queue_resize (widget);
|
||||
gtk_widget_get_preferred_size (widget, &minimum, &natural);
|
||||
}
|
||||
|
||||
static void
|
||||
mg_theme_refresh_menu_tree (GtkWidget *menu)
|
||||
{
|
||||
GList *children;
|
||||
GList *node;
|
||||
|
||||
if (!menu || !GTK_IS_MENU_SHELL (menu))
|
||||
return;
|
||||
|
||||
children = gtk_container_get_children (GTK_CONTAINER (menu));
|
||||
for (node = children; node; node = node->next)
|
||||
{
|
||||
GtkWidget *item = GTK_WIDGET (node->data);
|
||||
GtkWidget *submenu = NULL;
|
||||
|
||||
if (GTK_IS_MENU_ITEM (item))
|
||||
submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (item));
|
||||
if (submenu)
|
||||
mg_theme_refresh_menu_tree (submenu);
|
||||
mg_theme_refresh_menu_widget (item);
|
||||
}
|
||||
g_list_free (children);
|
||||
mg_theme_refresh_menu_widget (menu);
|
||||
}
|
||||
|
||||
static void
|
||||
mg_theme_window_changed (const ThemeChangedEvent *event, gpointer userdata)
|
||||
{
|
||||
@@ -3617,11 +3325,8 @@ mg_theme_window_changed (const ThemeChangedEvent *event, gpointer userdata)
|
||||
!theme_changed_event_has_reason (event, THEME_CHANGED_REASON_WIDGET_STYLE))
|
||||
return;
|
||||
|
||||
if (!gui)
|
||||
return;
|
||||
|
||||
theme_manager_apply_to_window (gui->window);
|
||||
mg_theme_refresh_menu_tree (gui->menu);
|
||||
if (gui)
|
||||
theme_manager_apply_to_window (gui->window);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3664,14 +3369,8 @@ mg_create_userlist (session_gui *gui, GtkWidget *box)
|
||||
gtk_box_pack_start (GTK_BOX (box), vbox, TRUE, TRUE, 0);
|
||||
|
||||
gui->namelistinfo = gtk_label_new (NULL);
|
||||
gtk_label_set_xalign (GTK_LABEL (gui->namelistinfo), 0.5f);
|
||||
gtk_label_set_justify (GTK_LABEL (gui->namelistinfo), GTK_JUSTIFY_CENTER);
|
||||
gtk_label_set_ellipsize (GTK_LABEL (gui->namelistinfo), PANGO_ELLIPSIZE_END);
|
||||
gtk_label_set_width_chars (GTK_LABEL (gui->namelistinfo), 1);
|
||||
gtk_widget_set_margin_start (gui->namelistinfo, 0);
|
||||
gtk_widget_set_margin_end (gui->namelistinfo, 0);
|
||||
gtk_widget_set_hexpand (gui->namelistinfo, TRUE);
|
||||
gtk_widget_set_halign (gui->namelistinfo, GTK_ALIGN_FILL);
|
||||
gtk_label_set_xalign (GTK_LABEL (gui->namelistinfo), 0.0f);
|
||||
gtk_widget_set_halign (gui->namelistinfo, GTK_ALIGN_START);
|
||||
if (prefs.hex_gui_ulist_count)
|
||||
gtk_box_pack_start (GTK_BOX (vbox), gui->namelistinfo, 0, 0, 0);
|
||||
|
||||
|
||||
@@ -37,10 +37,8 @@ GtkWidget *mg_create_generic_tab (char *name, char *title, int force_toplevel, i
|
||||
void mg_set_title (GtkWidget *button, char *title);
|
||||
void mg_set_access_icon (session_gui *gui, GdkPixbuf *pix, gboolean away);
|
||||
void mg_apply_setup (void);
|
||||
void mg_apply_session_font_prefs (session_gui *gui);
|
||||
void mg_close_sess (session *);
|
||||
void mg_tab_close (session *sess);
|
||||
void mg_reopen_closed_channel_tab (void);
|
||||
void mg_detach (session *sess, int mode);
|
||||
void mg_progressbar_create (session_gui *gui);
|
||||
void mg_progressbar_destroy (session_gui *gui);
|
||||
|
||||
@@ -1717,7 +1717,7 @@ menu_ctcpguiopen (void)
|
||||
static void
|
||||
menu_docs (GtkWidget *wid, gpointer none)
|
||||
{
|
||||
fe_open_url ("https://docs.zoitechat.org/en/latest/");
|
||||
fe_open_url ("https://docs.zoitechat.zoite.net/en/latest/");
|
||||
}
|
||||
|
||||
/*static void
|
||||
@@ -1862,7 +1862,7 @@ about_dialog_response (GtkDialog *dialog, int response, gpointer data)
|
||||
{
|
||||
if (response == GTK_RESPONSE_HELP)
|
||||
{
|
||||
fe_open_url ("http://zoitechat.org");
|
||||
fe_open_url ("http://zoitechat.zoite.net");
|
||||
return;
|
||||
}
|
||||
if (response == GTK_RESPONSE_APPLY)
|
||||
@@ -1915,7 +1915,14 @@ menu_about (GtkWidget *wid, gpointer sess)
|
||||
gtk_about_dialog_set_website_label (dialog, NULL);
|
||||
gtk_about_dialog_set_license (dialog, NULL);
|
||||
gtk_about_dialog_set_wrap_license (dialog, FALSE);
|
||||
gtk_about_dialog_set_logo (dialog, pix_zoitechat);
|
||||
GdkPixbuf *about_logo;
|
||||
|
||||
about_logo = gdk_pixbuf_new_from_resource_at_scale ("/icons/zoitechat.svg", 48, 48, TRUE, NULL);
|
||||
if (!about_logo && pix_zoitechat)
|
||||
about_logo = gdk_pixbuf_scale_simple (pix_zoitechat, 48, 48, GDK_INTERP_BILINEAR);
|
||||
gtk_about_dialog_set_logo (dialog, about_logo ? about_logo : pix_zoitechat);
|
||||
if (about_logo)
|
||||
g_object_unref (about_logo);
|
||||
gtk_about_dialog_set_copyright (dialog, "\302\251 1998-2010 Peter \305\275elezn\303\275\n\302\251 2009-2014 Berke Viktor\n\302\251 2015-2025 Patrick Griffis\n\302\251 2026 deepend");
|
||||
gtk_about_dialog_set_comments (dialog, comment);
|
||||
actions = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
|
||||
|
||||
@@ -117,9 +117,29 @@ if get_option('plugin')
|
||||
zoitechat_gtk_sources += 'plugingui.c'
|
||||
endif
|
||||
|
||||
find_program('magick', required: true)
|
||||
|
||||
zoitechat_png_generated = custom_target('zoitechat_resource_png',
|
||||
input: '../../data/icons/zoitechat.svg',
|
||||
output: 'zoitechat.png',
|
||||
command: [find_program('../../data/icons/generate_icons.py'), '@INPUT@', '@OUTPUT@', '--size', '256'],
|
||||
)
|
||||
|
||||
zoitechat_gresource_conf = configuration_data()
|
||||
zoitechat_gresource_conf.set('ZOITECHAT_PNG', 'zoitechat.png')
|
||||
zoitechat_gresource_xml = configure_file(
|
||||
input: '../../data/zoitechat.gresource.xml.in',
|
||||
output: 'zoitechat.gresource.xml',
|
||||
configuration: zoitechat_gresource_conf,
|
||||
)
|
||||
|
||||
resources = gnome.compile_resources('resources',
|
||||
'../../data/zoitechat.gresource.xml',
|
||||
source_dir: '../../data',
|
||||
zoitechat_gresource_xml,
|
||||
source_dir: [
|
||||
meson.current_build_dir(),
|
||||
'../../data',
|
||||
],
|
||||
dependencies: [zoitechat_png_generated],
|
||||
c_name: 'zoitechat',
|
||||
extra_args: ['--manual-register']
|
||||
)
|
||||
|
||||
@@ -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", "io.github.Hexchat"); /* 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 ("io.github.Hexchat"));
|
||||
g_variant_builder_close (¶ms);
|
||||
g_variant_builder_close (¶ms);
|
||||
|
||||
|
||||
@@ -91,7 +91,6 @@ static GtkWidget *edit_label_real;
|
||||
static GtkWidget *edit_label_user;
|
||||
static GtkWidget *edit_trees[N_TREES];
|
||||
static GtkWidget *edit_button_cert_generate;
|
||||
static GtkWidget *edit_button_cert_import;
|
||||
static GtkWidget *edit_button_cert_info;
|
||||
static GtkWidget *edit_button_cert_delete;
|
||||
|
||||
@@ -136,98 +135,12 @@ servlist_update_cert_buttons (ircnet *net)
|
||||
|
||||
if (edit_button_cert_generate)
|
||||
gtk_widget_set_visible (edit_button_cert_generate, !has_cert);
|
||||
if (edit_button_cert_import)
|
||||
gtk_widget_set_visible (edit_button_cert_import, !has_cert);
|
||||
if (edit_button_cert_info)
|
||||
gtk_widget_set_visible (edit_button_cert_info, has_cert);
|
||||
if (edit_button_cert_delete)
|
||||
gtk_widget_set_visible (edit_button_cert_delete, has_cert);
|
||||
}
|
||||
|
||||
static void
|
||||
servlist_import_client_cert_cb (GtkWidget *button, gpointer userdata)
|
||||
{
|
||||
ircnet *net = (ircnet *)userdata;
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *message;
|
||||
GtkFileFilter *filter;
|
||||
char *cert_dir;
|
||||
char *cert_file;
|
||||
char *source_file;
|
||||
char *contents;
|
||||
gsize length;
|
||||
|
||||
if (!net || !net->name || !net->name[0])
|
||||
return;
|
||||
|
||||
dialog = gtk_file_chooser_dialog_new (_("Import Client Certificate"),
|
||||
GTK_WINDOW (edit_win),
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
_("_Cancel"), GTK_RESPONSE_CANCEL,
|
||||
_("_Open"), GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
filter = gtk_file_filter_new ();
|
||||
gtk_file_filter_set_name (filter, _("Certificate files"));
|
||||
gtk_file_filter_add_pattern (filter, "*.pem");
|
||||
gtk_file_filter_add_pattern (filter, "*.crt");
|
||||
gtk_file_filter_add_pattern (filter, "*.cer");
|
||||
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
|
||||
filter = gtk_file_filter_new ();
|
||||
gtk_file_filter_set_name (filter, _("All files"));
|
||||
gtk_file_filter_add_pattern (filter, "*");
|
||||
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
|
||||
theme_manager_attach_window (dialog);
|
||||
|
||||
if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_ACCEPT)
|
||||
{
|
||||
gtk_widget_destroy (dialog);
|
||||
return;
|
||||
}
|
||||
|
||||
source_file = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
if (!source_file)
|
||||
return;
|
||||
|
||||
cert_dir = g_build_filename (get_xdir (), "certs", NULL);
|
||||
cert_file = servlist_get_cert_file (net);
|
||||
contents = NULL;
|
||||
length = 0;
|
||||
|
||||
if (cert_file &&
|
||||
g_mkdir_with_parents (cert_dir, 0700) == 0 &&
|
||||
g_file_get_contents (source_file, &contents, &length, NULL) &&
|
||||
g_file_set_contents (cert_file, contents, length, NULL))
|
||||
{
|
||||
chmod (cert_file, 0600);
|
||||
servlist_update_cert_buttons (net);
|
||||
message = gtk_message_dialog_new (GTK_WINDOW (edit_win),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
_("Client certificate imported for \"%s\"."),
|
||||
net->name);
|
||||
}
|
||||
else
|
||||
{
|
||||
message = gtk_message_dialog_new (GTK_WINDOW (edit_win),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
_("Failed to import client certificate for \"%s\"."),
|
||||
net->name);
|
||||
}
|
||||
|
||||
theme_manager_attach_window (message);
|
||||
g_signal_connect_swapped (message, "response", G_CALLBACK (gtk_widget_destroy), message);
|
||||
gtk_widget_show (message);
|
||||
|
||||
g_free (contents);
|
||||
g_free (cert_file);
|
||||
g_free (cert_dir);
|
||||
g_free (source_file);
|
||||
}
|
||||
|
||||
static void
|
||||
servlist_generate_client_cert_cb (GtkWidget *button, gpointer userdata)
|
||||
{
|
||||
@@ -252,7 +165,6 @@ servlist_generate_client_cert_cb (GtkWidget *button, gpointer userdata)
|
||||
gboolean success;
|
||||
gint status;
|
||||
char *argv[20];
|
||||
char **envp;
|
||||
|
||||
if (!net || !net->name || !net->name[0])
|
||||
return;
|
||||
@@ -275,7 +187,6 @@ servlist_generate_client_cert_cb (GtkWidget *button, gpointer userdata)
|
||||
crt_len = 0;
|
||||
success = FALSE;
|
||||
status = 0;
|
||||
envp = g_environ_unsetenv (g_get_environ (), "LD_LIBRARY_PATH");
|
||||
|
||||
if (g_mkdir_with_parents (cert_dir, 0700) == 0 &&
|
||||
g_file_set_contents (openssl_conf, conf_data, -1, NULL))
|
||||
@@ -301,7 +212,7 @@ servlist_generate_client_cert_cb (GtkWidget *button, gpointer userdata)
|
||||
argv[18] = subject;
|
||||
argv[19] = NULL;
|
||||
|
||||
spawned = g_spawn_sync (NULL, argv, envp, G_SPAWN_SEARCH_PATH, NULL, NULL,
|
||||
spawned = g_spawn_sync (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL,
|
||||
&stdout_data, &stderr_data, &status, NULL);
|
||||
if (spawned && g_spawn_check_exit_status (status, NULL) &&
|
||||
g_file_get_contents (key_file, &key_data, &key_len, NULL) &&
|
||||
@@ -356,7 +267,6 @@ servlist_generate_client_cert_cb (GtkWidget *button, gpointer userdata)
|
||||
g_free (openssl_conf);
|
||||
g_free (cert_file);
|
||||
g_free (cert_dir);
|
||||
g_strfreev (envp);
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
@@ -374,7 +284,6 @@ servlist_cert_info_cb (GtkWidget *button, gpointer userdata)
|
||||
gboolean spawned;
|
||||
gint status;
|
||||
char *argv[12];
|
||||
char **envp;
|
||||
|
||||
cert_file = servlist_get_cert_file (net);
|
||||
if (!cert_file)
|
||||
@@ -383,7 +292,6 @@ servlist_cert_info_cb (GtkWidget *button, gpointer userdata)
|
||||
stdout_data = NULL;
|
||||
stderr_data = NULL;
|
||||
status = 0;
|
||||
envp = g_environ_unsetenv (g_get_environ (), "LD_LIBRARY_PATH");
|
||||
argv[0] = "openssl";
|
||||
argv[1] = "x509";
|
||||
argv[2] = "-in";
|
||||
@@ -397,7 +305,7 @@ servlist_cert_info_cb (GtkWidget *button, gpointer userdata)
|
||||
argv[10] = "-sha256";
|
||||
argv[11] = NULL;
|
||||
|
||||
spawned = g_spawn_sync (NULL, argv, envp, G_SPAWN_SEARCH_PATH, NULL, NULL,
|
||||
spawned = g_spawn_sync (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL,
|
||||
&stdout_data, &stderr_data, &status, NULL);
|
||||
|
||||
if (spawned && g_spawn_check_exit_status (status, NULL) && stdout_data && stdout_data[0])
|
||||
@@ -428,7 +336,6 @@ servlist_cert_info_cb (GtkWidget *button, gpointer userdata)
|
||||
g_free (stdout_data);
|
||||
g_free (stderr_data);
|
||||
g_free (cert_file);
|
||||
g_strfreev (envp);
|
||||
#else
|
||||
return;
|
||||
#endif
|
||||
@@ -2378,11 +2285,6 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
|
||||
G_CALLBACK (servlist_generate_client_cert_cb), net);
|
||||
gtk_box_pack_start (GTK_BOX (hbox_cert_buttons), edit_button_cert_generate, FALSE, FALSE, 0);
|
||||
|
||||
edit_button_cert_import = gtk_button_new_with_mnemonic (_("Import client SSL cert"));
|
||||
g_signal_connect (G_OBJECT (edit_button_cert_import), "clicked",
|
||||
G_CALLBACK (servlist_import_client_cert_cb), net);
|
||||
gtk_box_pack_start (GTK_BOX (hbox_cert_buttons), edit_button_cert_import, FALSE, FALSE, 0);
|
||||
|
||||
edit_button_cert_info = gtk_button_new_with_mnemonic (_("Client SSL cert info"));
|
||||
g_signal_connect (G_OBJECT (edit_button_cert_info), "clicked",
|
||||
G_CALLBACK (servlist_cert_info_cb), net);
|
||||
|
||||
@@ -330,7 +330,6 @@ static const setting tabs_settings[] =
|
||||
{ST_TOGGLE, N_("Show icons in the channel tree"), P_OFFINTNL(hex_gui_tab_icons), 0, 0, 0},
|
||||
{ST_TOGGLE, N_("Show dotted lines in the channel tree"), P_OFFINTNL(hex_gui_tab_dots), 0, 0, 0},
|
||||
{ST_TOGGLE, N_("Scroll mouse-wheel to change tabs"), P_OFFINTNL (hex_gui_tab_scrollchans), 0, 0, 0},
|
||||
{ST_TOGGLE, N_("Show close button on tabs"), P_OFFINTNL(hex_gui_tab_closebuttons), 0, 0, 0},
|
||||
{ST_TOGGLE, N_("Middle click to close tab"), P_OFFINTNL(hex_gui_tab_middleclose), 0, 0, 0},
|
||||
{ST_TOGGLE, N_("Smaller text"), P_OFFINTNL(hex_gui_tab_small), 0, 0, 0},
|
||||
{ST_MENU, N_("Focus new tabs:"), P_OFFINTNL(hex_gui_tab_newtofront), 0, focusnewtabsmenu, 0},
|
||||
@@ -367,7 +366,7 @@ static const setting filexfer_settings[] =
|
||||
{ST_TOGGLE, N_("Receive window"), P_OFFINTNL(hex_gui_autoopen_recv), 0, 0, 0},
|
||||
{ST_TOGGLE, N_("Chat window"), P_OFFINTNL(hex_gui_autoopen_chat), 0, 0, 0},
|
||||
|
||||
{ST_HEADER, N_("Maximum File Transfer Speeds (KiB/s or MiB/s)"), 0, 0, 0},
|
||||
{ST_HEADER, N_("Maximum File Transfer Speeds (Byte per Second)"), 0, 0, 0},
|
||||
{ST_NUMBER, N_("One upload:"), P_OFFINTNL(hex_dcc_max_send_cps),
|
||||
N_("Maximum speed for one transfer"), 0, 10000000},
|
||||
{ST_NUMBER, N_("One download:"), P_OFFINTNL(hex_dcc_max_get_cps),
|
||||
@@ -873,67 +872,6 @@ setup_create_italic_label (char *text)
|
||||
return label;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const setting *set;
|
||||
GtkSpinButton *spin;
|
||||
GtkComboBox *unit;
|
||||
} setup_dcc_speed_data;
|
||||
|
||||
static gboolean
|
||||
setup_is_dcc_speed_setting (const setting *set)
|
||||
{
|
||||
return set->offset == P_OFFINTNL (hex_dcc_max_send_cps)
|
||||
|| set->offset == P_OFFINTNL (hex_dcc_max_get_cps)
|
||||
|| set->offset == P_OFFINTNL (hex_dcc_global_max_send_cps)
|
||||
|| set->offset == P_OFFINTNL (hex_dcc_global_max_get_cps);
|
||||
}
|
||||
|
||||
static int
|
||||
setup_dcc_speed_multiplier (GtkComboBox *combo)
|
||||
{
|
||||
return gtk_combo_box_get_active (combo) == 1 ? 1024 * 1024 : 1024;
|
||||
}
|
||||
|
||||
static void
|
||||
setup_dcc_speed_spin_range (setup_dcc_speed_data *data)
|
||||
{
|
||||
int max = data->set->extra / setup_dcc_speed_multiplier (data->unit);
|
||||
gtk_spin_button_set_range (data->spin, 0, max > 0 ? max : 0);
|
||||
}
|
||||
|
||||
static void
|
||||
setup_dcc_speed_store (setup_dcc_speed_data *data)
|
||||
{
|
||||
int value = gtk_spin_button_get_value_as_int (data->spin);
|
||||
int speed = value * setup_dcc_speed_multiplier (data->unit);
|
||||
if (speed > data->set->extra)
|
||||
speed = data->set->extra;
|
||||
setup_set_int (&setup_prefs, data->set, speed);
|
||||
}
|
||||
|
||||
static void
|
||||
setup_dcc_speed_spin_cb (GtkSpinButton *spin, setup_dcc_speed_data *data)
|
||||
{
|
||||
(void)spin;
|
||||
setup_dcc_speed_store (data);
|
||||
}
|
||||
|
||||
static void
|
||||
setup_dcc_speed_unit_cb (GtkComboBox *combo, setup_dcc_speed_data *data)
|
||||
{
|
||||
int speed = setup_get_int (&setup_prefs, data->set);
|
||||
int multiplier;
|
||||
int value;
|
||||
|
||||
(void)combo;
|
||||
setup_dcc_speed_spin_range (data);
|
||||
multiplier = setup_dcc_speed_multiplier (data->unit);
|
||||
value = (speed + (multiplier / 2)) / multiplier;
|
||||
gtk_spin_button_set_value (data->spin, value);
|
||||
setup_dcc_speed_store (data);
|
||||
}
|
||||
|
||||
static void
|
||||
setup_spin_cb (GtkSpinButton *spin, const setting *set)
|
||||
{
|
||||
@@ -963,43 +901,11 @@ setup_create_spin (GtkWidget *table, int row, const setting *set)
|
||||
g_object_set_data (G_OBJECT (wid), "lbl", label);
|
||||
if (set->tooltip)
|
||||
gtk_widget_set_tooltip_text (wid, _(set->tooltip));
|
||||
if (setup_is_dcc_speed_setting (set))
|
||||
{
|
||||
GtkWidget *unit;
|
||||
setup_dcc_speed_data *data = g_new0 (setup_dcc_speed_data, 1);
|
||||
int speed = setup_get_int (&setup_prefs, set);
|
||||
int use_mib = speed >= (1024 * 1024) && speed % (1024 * 1024) == 0;
|
||||
int multiplier;
|
||||
|
||||
data->set = set;
|
||||
data->spin = GTK_SPIN_BUTTON (wid);
|
||||
|
||||
unit = gtk_combo_box_text_new ();
|
||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (unit), _("KiB/s"));
|
||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (unit), _("MiB/s"));
|
||||
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (unit), 1);
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (unit), use_mib ? 1 : 0);
|
||||
data->unit = GTK_COMBO_BOX (unit);
|
||||
|
||||
setup_dcc_speed_spin_range (data);
|
||||
multiplier = setup_dcc_speed_multiplier (data->unit);
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (wid), (speed + (multiplier / 2)) / multiplier);
|
||||
|
||||
g_signal_connect (G_OBJECT (wid), "value-changed",
|
||||
G_CALLBACK (setup_dcc_speed_spin_cb), data);
|
||||
g_signal_connect (G_OBJECT (unit), "changed",
|
||||
G_CALLBACK (setup_dcc_speed_unit_cb), data);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (rbox), wid, 0, 0, 0);
|
||||
gtk_box_pack_start (GTK_BOX (rbox), unit, 0, 0, 6);
|
||||
} else
|
||||
{
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (wid),
|
||||
gtk_spin_button_set_value (GTK_SPIN_BUTTON (wid),
|
||||
setup_get_int (&setup_prefs, set));
|
||||
g_signal_connect (G_OBJECT (wid), "value-changed",
|
||||
g_signal_connect (G_OBJECT (wid), "value-changed",
|
||||
G_CALLBACK (setup_spin_cb), (gpointer)set);
|
||||
gtk_box_pack_start (GTK_BOX (rbox), wid, 0, 0, 0);
|
||||
}
|
||||
gtk_box_pack_start (GTK_BOX (rbox), wid, 0, 0, 0);
|
||||
|
||||
if (set->list)
|
||||
{
|
||||
@@ -2160,7 +2066,7 @@ setup_apply_to_sess (session_gui *gui)
|
||||
{
|
||||
mg_update_xtext (gui->xtext);
|
||||
|
||||
mg_apply_session_font_prefs (gui);
|
||||
theme_preferences_apply_to_session (gui, input_style);
|
||||
|
||||
if (prefs.hex_gui_ulist_buttons)
|
||||
gtk_widget_show (gui->button_box);
|
||||
@@ -2280,8 +2186,6 @@ setup_apply (struct zoitechatprefs *pr)
|
||||
noapply = TRUE;
|
||||
if (DIFF (hex_gui_tab_icons))
|
||||
noapply = TRUE;
|
||||
if (DIFF (hex_gui_tab_closebuttons))
|
||||
noapply = TRUE;
|
||||
if (DIFF (hex_gui_tab_server))
|
||||
noapply = TRUE;
|
||||
if (DIFF (hex_gui_tab_small))
|
||||
|
||||
@@ -59,17 +59,6 @@ fe_open_url (const char *url)
|
||||
(void)url;
|
||||
}
|
||||
|
||||
char *
|
||||
get_xdir (void)
|
||||
{
|
||||
return (char *)"/tmp";
|
||||
}
|
||||
|
||||
void
|
||||
load_text_events (void)
|
||||
{
|
||||
}
|
||||
|
||||
gboolean
|
||||
theme_get_color (ThemeSemanticToken token, GdkRGBA *color)
|
||||
{
|
||||
@@ -199,16 +188,6 @@ zoitechat_gtk3_theme_service_import (const char *source_path, char **imported_id
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
zoitechat_gtk3_theme_service_read_archive_text_file (const char *archive_path, const char *name, char **contents, GError **error)
|
||||
{
|
||||
(void)archive_path;
|
||||
(void)name;
|
||||
(void)contents;
|
||||
(void)error;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
zoitechat_gtk3_theme_service_remove_user_theme (const char *theme_id, GError **error)
|
||||
{
|
||||
|
||||
@@ -82,36 +82,6 @@ theme_token_to_rgb16 (ThemeSemanticToken token, guint16 *red, guint16 *green, gu
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GtkStateFlags
|
||||
theme_access_state_with_base (GtkStyleContext *context, GtkStateFlags state)
|
||||
{
|
||||
GtkStateFlags base_state;
|
||||
|
||||
base_state = gtk_style_context_get_state (context);
|
||||
base_state &= (GTK_STATE_FLAG_DIR_LTR | GTK_STATE_FLAG_DIR_RTL | GTK_STATE_FLAG_BACKDROP | GTK_STATE_FLAG_FOCUSED);
|
||||
return base_state | state;
|
||||
}
|
||||
|
||||
static void
|
||||
theme_access_context_get_color (GtkStyleContext *context, GtkStateFlags state, GdkRGBA *out_color)
|
||||
{
|
||||
gtk_style_context_save (context);
|
||||
gtk_style_context_set_state (context, theme_access_state_with_base (context, state));
|
||||
gtk_style_context_get_color (context, gtk_style_context_get_state (context), out_color);
|
||||
gtk_style_context_restore (context);
|
||||
}
|
||||
|
||||
static void
|
||||
theme_access_context_get_background_color (GtkStyleContext *context, GtkStateFlags state, GdkRGBA *out_color)
|
||||
{
|
||||
gtk_style_context_save (context);
|
||||
gtk_style_context_set_state (context, theme_access_state_with_base (context, state));
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_style_context_get_background_color (context, gtk_style_context_get_state (context), out_color);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
gtk_style_context_restore (context);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
theme_access_get_gtk_palette_map (GtkWidget *widget, ThemeGtkPaletteMap *out_map)
|
||||
{
|
||||
@@ -126,11 +96,13 @@ theme_access_get_gtk_palette_map (GtkWidget *widget, ThemeGtkPaletteMap *out_map
|
||||
if (context == NULL)
|
||||
return FALSE;
|
||||
|
||||
theme_access_context_get_color (context, GTK_STATE_FLAG_NORMAL, &out_map->text_foreground);
|
||||
theme_access_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &out_map->text_background);
|
||||
theme_access_context_get_color (context, GTK_STATE_FLAG_SELECTED, &out_map->selection_foreground);
|
||||
theme_access_context_get_background_color (context, GTK_STATE_FLAG_SELECTED, &out_map->selection_background);
|
||||
theme_access_context_get_color (context, GTK_STATE_FLAG_LINK, &accent);
|
||||
gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &out_map->text_foreground);
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &out_map->text_background);
|
||||
gtk_style_context_get_color (context, GTK_STATE_FLAG_SELECTED, &out_map->selection_foreground);
|
||||
gtk_style_context_get_background_color (context, GTK_STATE_FLAG_SELECTED, &out_map->selection_background);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
gtk_style_context_get_color (context, GTK_STATE_FLAG_LINK, &accent);
|
||||
if (accent.alpha <= 0.0)
|
||||
accent = out_map->selection_background;
|
||||
out_map->accent = accent;
|
||||
|
||||
@@ -33,10 +33,6 @@ static const char *theme_css_selector_dark_class = "zoitechat-dark";
|
||||
static const char *theme_css_selector_light_class = "zoitechat-light";
|
||||
static const char *theme_css_palette_provider_key = "zoitechat-palette-provider";
|
||||
static const guint theme_css_provider_priority = GTK_STYLE_PROVIDER_PRIORITY_USER;
|
||||
static const char *theme_css_palette_scope_selectors =
|
||||
".zoitechat-palette, .zoitechat-palette *, .zoitechat-palette box, .zoitechat-palette grid, .zoitechat-palette stack, .zoitechat-palette frame, .zoitechat-palette paned, .zoitechat-palette paned > separator, .zoitechat-palette separator, .zoitechat-palette viewport, .zoitechat-palette overlay, .zoitechat-palette revealer, .zoitechat-palette notebook, .zoitechat-palette notebook > header, .zoitechat-palette notebook > header > tabs, .zoitechat-palette notebook > header > tabs > tab, .zoitechat-palette scrolledwindow, .zoitechat-palette scrollbar, .zoitechat-palette scrollbar slider, .zoitechat-palette scrollbar trough, .zoitechat-palette treeview, .zoitechat-palette treeview.view, .zoitechat-palette treeview.view text, .zoitechat-palette treeview.view cell, .zoitechat-palette treeview.view row, .zoitechat-palette treeview header, .zoitechat-palette treeview header button, .zoitechat-palette list, .zoitechat-palette list row, .zoitechat-palette row, .zoitechat-palette textview, .zoitechat-palette textview text, .zoitechat-palette text, .zoitechat-palette entry, .zoitechat-palette entry text, .zoitechat-palette button, .zoitechat-palette button label, .zoitechat-palette check, .zoitechat-palette switch, .zoitechat-palette slider, .zoitechat-palette scale, .zoitechat-palette scale trough, .zoitechat-palette scale highlight, .zoitechat-palette spinbutton, .zoitechat-palette combobox, .zoitechat-palette combobox box, .zoitechat-palette progressbar, .zoitechat-palette progressbar trough, .zoitechat-palette levelbar, .zoitechat-palette levelbar trough, .zoitechat-palette menubar, .zoitechat-palette menu, .zoitechat-palette menuitem, .zoitechat-palette menuitem label, .zoitechat-palette toolbar, .zoitechat-palette headerbar, .zoitechat-palette label, .zoitechat-palette link, .zoitechat-palette infobar, .zoitechat-palette statusbar, .zoitechat-palette statusbar frame, .zoitechat-palette tooltip, .zoitechat-palette tooltip label";
|
||||
static const char *theme_css_palette_selection_selectors =
|
||||
".zoitechat-palette *:selected, .zoitechat-palette *:selected:focus, .zoitechat-palette *:selected:hover, .zoitechat-palette treeview.view:selected, .zoitechat-palette treeview.view:selected:focus, .zoitechat-palette treeview.view:selected:hover, .zoitechat-palette row:selected, .zoitechat-palette row:selected:focus, .zoitechat-palette row:selected:hover, .zoitechat-palette selection, .zoitechat-palette text selection, .zoitechat-palette entry selection, .zoitechat-palette entry text selection, .zoitechat-palette button:selected, .zoitechat-palette button:checked, .zoitechat-palette check:checked, .zoitechat-palette switch:checked, .zoitechat-palette slider:active, .zoitechat-palette menuitem:selected, .zoitechat-palette menuitem:hover, .zoitechat-palette notebook > header > tabs > tab:checked, .zoitechat-palette notebook > header > tabs > tab:hover, .zoitechat-palette treeview header button:hover, .zoitechat-palette treeview header button:active, .zoitechat-palette progressbar progress, .zoitechat-palette levelbar block.filled, .zoitechat-palette:focus selection, .zoitechat-palette:focus text selection";
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -327,16 +323,13 @@ theme_css_apply_palette_widget (GtkWidget *widget, const GdkRGBA *bg, const GdkR
|
||||
}
|
||||
gtkutil_append_font_css (css, font_desc);
|
||||
g_string_append (css, " }");
|
||||
g_string_append_printf (css, "%s {", theme_css_palette_scope_selectors);
|
||||
g_string_append_printf (css, ".%s, .%s *, .%s treeview, .%s treeview.view, .%s treeview.view text, .%s treeview.view cell, .%s treeview.view row, .%s list, .%s list row, .%s text {", theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class);
|
||||
if (bg)
|
||||
g_string_append_printf (css, " background-color: %s;", bg_color);
|
||||
if (fg)
|
||||
{
|
||||
g_string_append_printf (css, " color: %s;", fg_color);
|
||||
g_string_append_printf (css, " caret-color: %s;", fg_color);
|
||||
}
|
||||
g_string_append (css, " }");
|
||||
g_string_append_printf (css, "%s {", theme_css_palette_selection_selectors);
|
||||
g_string_append_printf (css, ".%s *:selected, .%s *:selected:focus, .%s *:selected:hover, .%s treeview.view:selected, .%s treeview.view:selected:focus, .%s treeview.view:selected:hover, .%s row:selected, .%s row:selected:focus, .%s row:selected:hover, .%s selection, .%s text selection, .%s entry selection, .%s entry text selection, .%s:focus selection, .%s:focus text selection {", theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class, theme_css_selector_palette_class);
|
||||
if (sel_bg_color)
|
||||
g_string_append_printf (css, " background-color: %s;", sel_bg_color);
|
||||
else if (bg)
|
||||
@@ -374,12 +367,6 @@ theme_css_build_toplevel_classes (void)
|
||||
"color: @theme_fg_color;"
|
||||
"border-color: @theme_bg_color;"
|
||||
"}"
|
||||
"window.%s menuitem:hover, window.%s menuitem:selected {"
|
||||
"background-color: @theme_selected_bg_color;"
|
||||
"background-image: none;"
|
||||
"color: @theme_selected_fg_color;"
|
||||
"border-color: @theme_selected_bg_color;"
|
||||
"}"
|
||||
"window.%s, window.%s:backdrop, .%s {"
|
||||
"background-color: #f6f6f6;"
|
||||
"color: #101010;"
|
||||
@@ -390,12 +377,6 @@ theme_css_build_toplevel_classes (void)
|
||||
"background-image: none;"
|
||||
"color: @theme_fg_color;"
|
||||
"border-color: @theme_bg_color;"
|
||||
"}"
|
||||
"window.%s menuitem:hover, window.%s menuitem:selected {"
|
||||
"background-color: @theme_selected_bg_color;"
|
||||
"background-image: none;"
|
||||
"color: @theme_selected_fg_color;"
|
||||
"border-color: @theme_selected_bg_color;"
|
||||
"}",
|
||||
theme_css_selector_dark_class,
|
||||
theme_css_selector_dark_class,
|
||||
@@ -406,10 +387,6 @@ theme_css_build_toplevel_classes (void)
|
||||
theme_css_selector_dark_class,
|
||||
theme_css_selector_dark_class,
|
||||
theme_css_selector_dark_class,
|
||||
theme_css_selector_dark_class,
|
||||
theme_css_selector_dark_class,
|
||||
theme_css_selector_light_class,
|
||||
theme_css_selector_light_class,
|
||||
theme_css_selector_light_class,
|
||||
theme_css_selector_light_class,
|
||||
theme_css_selector_light_class,
|
||||
|
||||
@@ -415,24 +415,6 @@ theme_manager_is_kde_wayland (void)
|
||||
return is_kde;
|
||||
}
|
||||
|
||||
static gint
|
||||
theme_manager_get_system_headerbar_height (void)
|
||||
{
|
||||
GtkWidget *probe;
|
||||
gint minimum;
|
||||
gint natural;
|
||||
|
||||
probe = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (probe), TRUE);
|
||||
gtk_header_bar_set_decoration_layout (GTK_HEADER_BAR (probe), "menu:minimize,maximize,close");
|
||||
gtk_widget_show (probe);
|
||||
gtk_widget_get_preferred_height (probe, &minimum, &natural);
|
||||
gtk_widget_destroy (probe);
|
||||
if (natural > 0)
|
||||
return natural;
|
||||
return minimum;
|
||||
}
|
||||
|
||||
static void
|
||||
theme_manager_apply_wayland_kde_csd (GtkWidget *window)
|
||||
{
|
||||
@@ -460,16 +442,10 @@ theme_manager_apply_wayland_kde_csd (GtkWidget *window)
|
||||
headerbar = gtk_header_bar_new ();
|
||||
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (headerbar), TRUE);
|
||||
gtk_header_bar_set_decoration_layout (GTK_HEADER_BAR (headerbar), "menu:minimize,maximize,close");
|
||||
g_object_set (G_OBJECT (headerbar), "spacing", 0, NULL);
|
||||
gtk_widget_set_size_request (headerbar, -1, theme_manager_get_system_headerbar_height ());
|
||||
icon_pixbuf = gdk_pixbuf_new_from_resource_at_scale ("/icons/zoitechat.svg", 24, 24, TRUE, NULL);
|
||||
icon_pixbuf = gdk_pixbuf_new_from_resource_at_scale ("/icons/zoitechat.svg", 32, 32, TRUE, NULL);
|
||||
if (!icon_pixbuf)
|
||||
icon_pixbuf = gdk_pixbuf_new_from_resource_at_scale ("/icons/zoitechat.png", 24, 24, TRUE, NULL);
|
||||
icon_pixbuf = gdk_pixbuf_new_from_resource_at_scale ("/icons/zoitechat.png", 32, 32, TRUE, NULL);
|
||||
icon_image = icon_pixbuf ? gtk_image_new_from_pixbuf (icon_pixbuf) : gtk_image_new_from_resource ("/icons/zoitechat.png");
|
||||
gtk_widget_set_margin_start (icon_image, 0);
|
||||
gtk_widget_set_margin_end (icon_image, 0);
|
||||
gtk_widget_set_margin_top (icon_image, 0);
|
||||
gtk_widget_set_margin_bottom (icon_image, 0);
|
||||
if (icon_pixbuf)
|
||||
g_object_unref (icon_pixbuf);
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (headerbar), icon_image);
|
||||
|
||||
@@ -29,15 +29,12 @@
|
||||
|
||||
#include "../gtkutil.h"
|
||||
#include "../../common/fe.h"
|
||||
#include "../../common/cfgfiles.h"
|
||||
#include "../../common/util.h"
|
||||
#include "../../common/gtk3-theme-service.h"
|
||||
#include "theme-gtk3.h"
|
||||
#include "theme-manager.h"
|
||||
#include "theme-preferences.h"
|
||||
|
||||
extern void load_text_events (void);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GtkWindow *parent;
|
||||
@@ -935,21 +932,6 @@ theme_preferences_show_import_error (GtkWidget *button, const char *message)
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
theme_preferences_show_import_info (GtkWidget *button, const char *message)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_message_dialog_new (GTK_WINDOW (gtk_widget_get_toplevel (button)),
|
||||
GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"%s",
|
||||
message);
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
theme_preferences_parse_cfg_color (const char *cfg,
|
||||
const char *key,
|
||||
@@ -1056,77 +1038,40 @@ static void
|
||||
theme_preferences_import_colors_conf_cb (GtkWidget *button, gpointer user_data)
|
||||
{
|
||||
gboolean *color_change_flag = user_data;
|
||||
GtkFileChooserNative *dialog;
|
||||
GtkWidget *dialog;
|
||||
char *path;
|
||||
char *lower_path;
|
||||
char *cfg;
|
||||
char *pevents_cfg = NULL;
|
||||
GError *error = NULL;
|
||||
gboolean any_imported = FALSE;
|
||||
gboolean imported_from_hct = FALSE;
|
||||
gboolean imported_pevents = FALSE;
|
||||
ThemeSemanticToken token;
|
||||
GtkFileFilter *filter;
|
||||
|
||||
dialog = gtk_file_chooser_native_new (_("Import colors.conf colors"),
|
||||
dialog = gtk_file_chooser_dialog_new (_("Import colors.conf colors"),
|
||||
GTK_WINDOW (gtk_widget_get_toplevel (button)),
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
_("_Import"),
|
||||
_("_Cancel"));
|
||||
_("_Cancel"), GTK_RESPONSE_CANCEL,
|
||||
_("_Import"), GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (dialog), TRUE);
|
||||
gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (dialog), FALSE);
|
||||
filter = gtk_file_filter_new ();
|
||||
gtk_file_filter_set_name (filter, _("Theme colors (*.conf, *.hct)"));
|
||||
gtk_file_filter_add_pattern (filter, "*.conf");
|
||||
gtk_file_filter_add_pattern (filter, "*.hct");
|
||||
gtk_file_filter_add_pattern (filter, "*.HCT");
|
||||
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
|
||||
|
||||
if (gtk_native_dialog_run (GTK_NATIVE_DIALOG (dialog)) != GTK_RESPONSE_ACCEPT)
|
||||
if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_ACCEPT)
|
||||
{
|
||||
g_object_unref (dialog);
|
||||
gtk_widget_destroy (dialog);
|
||||
return;
|
||||
}
|
||||
|
||||
path = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
|
||||
g_object_unref (dialog);
|
||||
gtk_widget_destroy (dialog);
|
||||
if (!path)
|
||||
return;
|
||||
|
||||
lower_path = g_ascii_strdown (path, -1);
|
||||
if (g_str_has_suffix (lower_path, ".hct"))
|
||||
{
|
||||
imported_from_hct = TRUE;
|
||||
if (!zoitechat_gtk3_theme_service_read_archive_text_file (path, "colors.conf", &cfg, &error))
|
||||
{
|
||||
theme_preferences_show_import_error (button, _("Failed to read colors.conf from .hct file."));
|
||||
g_clear_error (&error);
|
||||
g_free (lower_path);
|
||||
g_free (path);
|
||||
return;
|
||||
}
|
||||
if (zoitechat_gtk3_theme_service_read_archive_text_file (path, "pevents.conf", &pevents_cfg, &error))
|
||||
{
|
||||
char *pevents_path = g_build_filename (get_xdir (), "pevents.conf", NULL);
|
||||
if (g_file_set_contents (pevents_path, pevents_cfg, -1, &error))
|
||||
{
|
||||
load_text_events ();
|
||||
imported_pevents = TRUE;
|
||||
}
|
||||
g_free (pevents_path);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
else
|
||||
g_clear_error (&error);
|
||||
}
|
||||
else if (!g_file_get_contents (path, &cfg, NULL, &error))
|
||||
if (!g_file_get_contents (path, &cfg, NULL, &error))
|
||||
{
|
||||
theme_preferences_show_import_error (button, _("Failed to read colors.conf file."));
|
||||
g_clear_error (&error);
|
||||
g_free (lower_path);
|
||||
g_free (path);
|
||||
return;
|
||||
}
|
||||
g_free (lower_path);
|
||||
|
||||
for (token = THEME_TOKEN_MIRC_0; token < THEME_TOKEN_COUNT; token++)
|
||||
{
|
||||
@@ -1141,22 +1086,9 @@ theme_preferences_import_colors_conf_cb (GtkWidget *button, gpointer user_data)
|
||||
|
||||
if (!any_imported)
|
||||
theme_preferences_show_import_error (button, _("No importable colors were found in that colors.conf file."));
|
||||
else if (imported_from_hct)
|
||||
{
|
||||
char *message = g_strdup_printf (imported_pevents ?
|
||||
_("Imported colors.conf and pevents.conf from %s.") :
|
||||
_("Imported colors.conf from %s."),
|
||||
path);
|
||||
theme_preferences_show_import_info (button, message);
|
||||
g_free (message);
|
||||
}
|
||||
else if (color_change_flag)
|
||||
*color_change_flag = theme_preferences_stage.active ? theme_preferences_stage.changed : *color_change_flag;
|
||||
|
||||
if (any_imported && color_change_flag)
|
||||
*color_change_flag = theme_preferences_stage.active ? theme_preferences_stage.changed : *color_change_flag;
|
||||
|
||||
g_free (pevents_cfg);
|
||||
g_free (cfg);
|
||||
g_free (path);
|
||||
}
|
||||
|
||||
@@ -93,14 +93,23 @@ userlist_apply_saved_column_width (GtkTreeViewColumn *column, int width)
|
||||
static void
|
||||
userlist_update_min_width (session *sess)
|
||||
{
|
||||
GtkRequisition minimum;
|
||||
GtkRequisition natural;
|
||||
GtkWidget *scrolled_window;
|
||||
int width;
|
||||
|
||||
if (!sess || !sess->gui || !sess->gui->user_tree)
|
||||
if (!sess || !sess->gui || !sess->gui->user_box || !sess->gui->namelistinfo || !sess->gui->user_tree)
|
||||
return;
|
||||
|
||||
gtk_widget_get_preferred_size (sess->gui->namelistinfo, &minimum, &natural);
|
||||
width = MAX (minimum.width, natural.width);
|
||||
if (width < 1)
|
||||
width = 1;
|
||||
|
||||
scrolled_window = gtk_widget_get_parent (sess->gui->user_tree);
|
||||
if (GTK_IS_SCROLLED_WINDOW (scrolled_window))
|
||||
gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (scrolled_window), 1);
|
||||
gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (scrolled_window), width);
|
||||
gtk_widget_set_size_request (sess->gui->user_box, width, -1);
|
||||
}
|
||||
|
||||
GdkPixbuf *
|
||||
@@ -541,9 +550,9 @@ fe_userlist_insert (session *sess, struct User *newuser, gboolean sel)
|
||||
prefix_escaped = g_markup_escape_text (prefix_text, -1);
|
||||
prefix_color = userlist_prefix_color (newuser->prefix[0]);
|
||||
if (prefix_color)
|
||||
prefix = g_strdup_printf ("<span foreground=\"%s\">%s</span>", prefix_color, prefix_escaped);
|
||||
prefix = g_strdup_printf ("<b><span foreground=\"%s\">%s</span></b>", prefix_color, prefix_escaped);
|
||||
else
|
||||
prefix = g_strdup (prefix_escaped);
|
||||
prefix = g_strdup_printf ("<b>%s</b>", prefix_escaped);
|
||||
g_free (prefix_escaped);
|
||||
}
|
||||
pix = NULL;
|
||||
@@ -900,19 +909,17 @@ userlist_create (GtkWidget *box)
|
||||
};
|
||||
|
||||
sw = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_widget_set_hexpand (sw, TRUE);
|
||||
gtk_widget_set_vexpand (sw, TRUE);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_SHADOW_IN);
|
||||
GTK_SHADOW_ETCHED_IN);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
||||
gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (sw), 1);
|
||||
prefs.hex_gui_ulist_show_hosts ?
|
||||
GTK_POLICY_AUTOMATIC :
|
||||
GTK_POLICY_NEVER,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_box_pack_start (GTK_BOX (box), sw, TRUE, TRUE, 0);
|
||||
gtk_widget_show (sw);
|
||||
|
||||
treeview = gtk_tree_view_new ();
|
||||
gtk_widget_set_hexpand (treeview, TRUE);
|
||||
gtk_widget_set_vexpand (treeview, TRUE);
|
||||
gtk_widget_set_name (treeview, "zoitechat-userlist");
|
||||
gtk_widget_set_can_focus (treeview, TRUE);
|
||||
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE);
|
||||
|
||||
@@ -110,15 +110,6 @@ enum
|
||||
TARGET_COMPOUND_TEXT
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_HADJUSTMENT,
|
||||
PROP_VADJUSTMENT,
|
||||
PROP_HSCROLL_POLICY,
|
||||
PROP_VSCROLL_POLICY
|
||||
};
|
||||
|
||||
|
||||
/* Selection targets for PRIMARY selection / copy-paste.
|
||||
*
|
||||
@@ -167,8 +158,7 @@ gtk_xtext_install_selection_targets (GtkWidget *widget)
|
||||
|
||||
static guint xtext_signals[LAST_SIGNAL];
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkXText, gtk_xtext, GTK_TYPE_WIDGET,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL))
|
||||
G_DEFINE_TYPE (GtkXText, gtk_xtext, GTK_TYPE_WIDGET)
|
||||
|
||||
char *nocasestrstr (const char *text, const char *tofind); /* util.c */
|
||||
int xtext_get_stamp_str (time_t, char **);
|
||||
@@ -178,13 +168,9 @@ static gboolean gtk_xtext_is_selecting (GtkXText *xtext);
|
||||
static char *gtk_xtext_selection_get_text (GtkXText *xtext, int *len_ret);
|
||||
static textentry *gtk_xtext_nth (GtkXText *xtext, int line, int *subline);
|
||||
static void gtk_xtext_adjustment_changed (GtkAdjustment * adj,
|
||||
GtkXText * xtext);
|
||||
GtkXText * xtext);
|
||||
static void gtk_xtext_scroll_adjustments (GtkXText *xtext, GtkAdjustment *hadj,
|
||||
GtkAdjustment *vadj);
|
||||
static void gtk_xtext_set_property (GObject *object, guint prop_id,
|
||||
const GValue *value, GParamSpec *pspec);
|
||||
static void gtk_xtext_get_property (GObject *object, guint prop_id,
|
||||
GValue *value, GParamSpec *pspec);
|
||||
static int gtk_xtext_render_ents (GtkXText * xtext, textentry *, textentry *);
|
||||
static void gtk_xtext_recalc_widths (xtext_buffer *buf, int);
|
||||
static void gtk_xtext_fix_indent (xtext_buffer *buf);
|
||||
@@ -808,9 +794,6 @@ gtk_xtext_init (GtkXText * xtext)
|
||||
xtext->recycle = FALSE;
|
||||
xtext->dont_render = FALSE;
|
||||
xtext->dont_render2 = FALSE;
|
||||
xtext->hadj = NULL;
|
||||
xtext->hscroll_policy = GTK_SCROLL_MINIMUM;
|
||||
xtext->vscroll_policy = GTK_SCROLL_MINIMUM;
|
||||
gtk_xtext_scroll_adjustments (xtext, NULL, NULL);
|
||||
|
||||
gtk_xtext_install_selection_targets (GTK_WIDGET (xtext));
|
||||
@@ -903,66 +886,6 @@ gtk_xtext_adjustment_changed (GtkAdjustment * adj, GtkXText * xtext)
|
||||
xtext->buffer->old_value = xtext_adj_get_value (adj);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_xtext_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
GtkXText *xtext = GTK_XTEXT (object);
|
||||
GtkAdjustment *adj;
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_HADJUSTMENT:
|
||||
adj = g_value_get_object (value);
|
||||
if (xtext->hadj == adj)
|
||||
break;
|
||||
if (xtext->hadj)
|
||||
g_object_unref (xtext->hadj);
|
||||
xtext->hadj = adj ? g_object_ref (adj) : NULL;
|
||||
g_object_notify (object, "hadjustment");
|
||||
break;
|
||||
case PROP_VADJUSTMENT:
|
||||
gtk_xtext_scroll_adjustments (xtext, NULL, g_value_get_object (value));
|
||||
g_object_notify (object, "vadjustment");
|
||||
break;
|
||||
case PROP_HSCROLL_POLICY:
|
||||
xtext->hscroll_policy = g_value_get_enum (value);
|
||||
g_object_notify (object, "hscroll-policy");
|
||||
break;
|
||||
case PROP_VSCROLL_POLICY:
|
||||
xtext->vscroll_policy = g_value_get_enum (value);
|
||||
g_object_notify (object, "vscroll-policy");
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_xtext_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
GtkXText *xtext = GTK_XTEXT (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_HADJUSTMENT:
|
||||
g_value_set_object (value, xtext->hadj);
|
||||
break;
|
||||
case PROP_VADJUSTMENT:
|
||||
g_value_set_object (value, xtext->adj);
|
||||
break;
|
||||
case PROP_HSCROLL_POLICY:
|
||||
g_value_set_enum (value, xtext->hscroll_policy);
|
||||
break;
|
||||
case PROP_VSCROLL_POLICY:
|
||||
g_value_set_enum (value, xtext->vscroll_policy);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gtk_xtext_new (const XTextColor *palette, int separator)
|
||||
{
|
||||
@@ -1029,11 +952,6 @@ gtk_xtext_cleanup (GtkXText *xtext)
|
||||
xtext->adj = NULL;
|
||||
}
|
||||
|
||||
if (xtext->hadj)
|
||||
{
|
||||
g_object_unref (G_OBJECT (xtext->hadj));
|
||||
xtext->hadj = NULL;
|
||||
}
|
||||
|
||||
if (xtext->hand_cursor)
|
||||
{
|
||||
@@ -3006,13 +2924,6 @@ gtk_xtext_class_init (GtkXTextClass * class)
|
||||
widget_class = (GtkWidgetClass *) class;
|
||||
xtext_class = (GtkXTextClass *) class;
|
||||
|
||||
object_class->set_property = gtk_xtext_set_property;
|
||||
object_class->get_property = gtk_xtext_get_property;
|
||||
g_object_class_override_property (object_class, PROP_HADJUSTMENT, "hadjustment");
|
||||
g_object_class_override_property (object_class, PROP_VADJUSTMENT, "vadjustment");
|
||||
g_object_class_override_property (object_class, PROP_HSCROLL_POLICY, "hscroll-policy");
|
||||
g_object_class_override_property (object_class, PROP_VSCROLL_POLICY, "vscroll-policy");
|
||||
|
||||
xtext_signals[WORD_CLICK] =
|
||||
g_signal_new ("word_click",
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
@@ -4919,12 +4830,13 @@ gtk_xtext_check_marker_visibility (GtkXText * xtext)
|
||||
static void
|
||||
gtk_xtext_unstrip_color (gint start, gint end, GSList *slp, GList **gl, gint maxo)
|
||||
{
|
||||
gint off1, off2;
|
||||
gint off1, off2, curlen;
|
||||
GSList *cursl;
|
||||
offsets_t marks;
|
||||
offlen_t *meta;
|
||||
|
||||
off1 = 0;
|
||||
curlen = 0;
|
||||
cursl = slp;
|
||||
while (cursl)
|
||||
{
|
||||
@@ -4934,6 +4846,7 @@ gtk_xtext_unstrip_color (gint start, gint end, GSList *slp, GList **gl, gint max
|
||||
off1 = meta->off + start;
|
||||
break;
|
||||
}
|
||||
curlen += meta->len;
|
||||
start -= meta->len;
|
||||
end -= meta->len;
|
||||
cursl = g_slist_next (cursl);
|
||||
@@ -4948,6 +4861,7 @@ gtk_xtext_unstrip_color (gint start, gint end, GSList *slp, GList **gl, gint max
|
||||
off2 = meta->off + end;
|
||||
break;
|
||||
}
|
||||
curlen += meta->len;
|
||||
end -= meta->len;
|
||||
cursl = g_slist_next (cursl);
|
||||
}
|
||||
|
||||
@@ -134,9 +134,6 @@ struct _GtkXText
|
||||
xtext_buffer *selection_buffer;
|
||||
|
||||
GtkAdjustment *adj;
|
||||
GtkAdjustment *hadj;
|
||||
GtkScrollablePolicy hscroll_policy;
|
||||
GtkScrollablePolicy vscroll_policy;
|
||||
cairo_surface_t *background_surface; /* 0 = use palette[19] */
|
||||
cairo_surface_t *background_clip_surface;
|
||||
GdkWindow *draw_window; /* points to ->window */
|
||||
|
||||
|
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 151 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 9.1 KiB |
@@ -9,10 +9,10 @@ AppName=ZoiteChat
|
||||
AppVersion={#APPVER}
|
||||
AppVerName=ZoiteChat {#APPVER}
|
||||
AppPublisher=ZoiteChat
|
||||
AppPublisherURL=http://zoitechat.org
|
||||
AppPublisherURL=http://zoitechat.zoite.net
|
||||
AppCopyright=Copyright (C) 1998-2010 Peter Zelezny
|
||||
AppSupportURL=https://github.com/zoitechat/zoitechat/issues
|
||||
AppUpdatesURL=http://zoitechat.org/downloads.html
|
||||
AppUpdatesURL=http://zoitechat.zoite.net/downloads.html
|
||||
LicenseFile=share\doc\zoitechat\COPYING
|
||||
UninstallDisplayIcon={app}\zoitechat.exe
|
||||
UninstallDisplayName=ZoiteChat
|
||||
@@ -56,13 +56,11 @@ Name: "plugins\exec"; Description: "Exec"; Types: custom; Flags: disablenouninst
|
||||
Name: "plugins\fishlim"; Description: "FiSHLiM"; Types: custom; Flags: disablenouninstallwarning
|
||||
Name: "plugins\sysinfo"; Description: "SysInfo"; Types: custom; Flags: disablenouninstallwarning
|
||||
Name: "plugins\upd"; Description: "Update Checker"; Types: normal custom; Flags: disablenouninstallwarning
|
||||
Name: "plugins\winamp"; Description: "Winamp"; Types: custom; Flags: disablenouninstallwarning
|
||||
Name: "langs"; Description: "Language Interfaces"; Types: custom; Flags: disablenouninstallwarning
|
||||
Name: "langs\lua"; Description: "Lua (LuaJIT 2.1)"; Types: normal custom; Flags: disablenouninstallwarning
|
||||
Name: "langs\perl"; Description: "Perl (Strawberry Perl 5.42.0.1)"; Types: custom; Flags: disablenouninstallwarning
|
||||
Name: "langs\python"; Description: "Python (Python 3.14.3)"; Types: custom; Flags: disablenouninstallwarning
|
||||
Name: "themes"; Description: "GTK3 Themes"; Types: normal minimal custom; Flags: disablenouninstallwarning
|
||||
Name: "themes\windows10"; Description: "Windows 10"; Types: normal minimal custom; Flags: disablenouninstallwarning
|
||||
Name: "themes\windows10dark"; Description: "Windows 10 Dark"; Types: normal minimal custom; Flags: disablenouninstallwarning
|
||||
Name: "langs\lua"; Description: "Lua"; Types: normal custom; Flags: disablenouninstallwarning
|
||||
Name: "langs\perl"; Description: "Perl (requires Perl 5.42)"; Types: custom; Flags: disablenouninstallwarning
|
||||
Name: "langs\python"; Description: "Python (requires Python 3.14.3)"; Types: custom; Flags: disablenouninstallwarning
|
||||
Name: "deps"; Description: "Dependencies"; Types: custom; Flags: disablenouninstallwarning
|
||||
Name: "deps\vcredist2015"; Description: "Visual C++ Redistributable 2015"; Types: normal minimal custom; Flags: disablenouninstallwarning
|
||||
|
||||
@@ -90,11 +88,6 @@ Filename: "{tmp}\perl.msi"; StatusMsg: "Installing Perl"; Components: langs\perl
|
||||
Filename: "{tmp}\python.msi"; StatusMsg: "Installing Python"; Components: langs\python; Flags: shellexec skipifdoesntexist; Tasks: not portable
|
||||
Filename: "{tmp}\python.exe"; Parameters: "InstallAllUsers=1 PrependPath=1"; StatusMsg: "Installing Python"; Components: langs\python; Flags: shellexec skipifdoesntexist; Tasks: not portable
|
||||
Filename: "{tmp}\spelling-dicts.exe"; Parameters: "/verysilent"; StatusMsg: "Installing Spelling Dictionaries"; Components: spell; Flags: skipifdoesntexist; Tasks: not portable
|
||||
Filename: "{sys}\WindowsPowerShell\v1.0\powershell.exe"; Parameters: "-NoProfile -ExecutionPolicy Bypass -Command ""Expand-Archive -LiteralPath '{tmp}\Windows-10-3.2.1.zip' -DestinationPath '{userappdata}\ZoiteChat\gtk3-themes' -Force"""; StatusMsg: "Installing GTK3 Theme: Windows 10"; Components: themes\windows10; Flags: runhidden waituntilterminated skipifdoesntexist
|
||||
Filename: "{sys}\WindowsPowerShell\v1.0\powershell.exe"; Parameters: "-NoProfile -ExecutionPolicy Bypass -Command ""Expand-Archive -LiteralPath '{tmp}\Windows-10-Dark-3.2.1-dark.zip' -DestinationPath '{userappdata}\ZoiteChat\gtk3-themes' -Force"""; StatusMsg: "Installing GTK3 Theme: Windows 10 Dark"; Components: themes\windows10dark; Flags: runhidden waituntilterminated skipifdoesntexist
|
||||
|
||||
[Dirs]
|
||||
Name: "{userappdata}\ZoiteChat\gtk3-themes"; Components: themes
|
||||
|
||||
[Files]
|
||||
Source: "portable-mode"; DestDir: "{app}"; Tasks: portable
|
||||
@@ -172,9 +165,11 @@ Source: "plugins\hcexec.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Co
|
||||
Source: "plugins\hcfishlim.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\fishlim
|
||||
Source: "share\gtkpref.png"; DestDir: "{app}\share"; Flags: ignoreversion; Components: libs
|
||||
Source: "share\adwaita-icons-attribution.txt"; DestDir: "{app}\share"; Flags: ignoreversion; Components: libs
|
||||
Source: "share\music.png"; DestDir: "{app}\share"; Flags: ignoreversion; Components: plugins\winamp
|
||||
Source: "share\download.png"; DestDir: "{app}\share"; Flags: ignoreversion; Components: plugins\upd
|
||||
Source: "plugins\hcupd.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\upd
|
||||
Source: "WinSparkle.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: plugins\upd
|
||||
Source: "plugins\hcwinamp.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\winamp
|
||||
Source: "share\system.png"; DestDir: "{app}\share"; Flags: ignoreversion; Components: plugins\sysinfo
|
||||
Source: "plugins\hcsysinfo.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\sysinfo
|
||||
Source: "plugins\hcperl.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: langs\perl
|
||||
@@ -201,10 +196,6 @@ Name: "{commonappdata}\Microsoft\Internet Explorer\Quick Launch\ZoiteChat"; File
|
||||
[Messages]
|
||||
BeveledLabel= {#APPNAM}
|
||||
|
||||
[UninstallDelete]
|
||||
Type: filesandordirs; Name: "{userappdata}\ZoiteChat\gtk3-themes\Windows-10-3.2.1"; Components: themes\windows10
|
||||
Type: filesandordirs; Name: "{userappdata}\ZoiteChat\gtk3-themes\Windows-10-Dark-3.2.1-dark"; Components: themes\windows10dark
|
||||
|
||||
[Code]
|
||||
#ifndef USE_INNO_DOWNLOAD_PLUGIN
|
||||
var
|
||||
@@ -345,12 +336,6 @@ begin
|
||||
begin
|
||||
idpClearFiles;
|
||||
|
||||
if IsComponentSelected('themes\windows10') then
|
||||
idpAddFile('https://dl.zoitechat.zoite.net/themes/GTK3Themes/Windows-10-3.2.1.zip', ExpandConstant('{tmp}\Windows-10-3.2.1.zip'));
|
||||
|
||||
if IsComponentSelected('themes\windows10dark') then
|
||||
idpAddFile('https://dl.zoitechat.zoite.net/themes/GTK3Themes/Windows-10-Dark-3.2.1-dark.zip', ExpandConstant('{tmp}\Windows-10-Dark-3.2.1-dark.zip'));
|
||||
|
||||
if not IsTaskSelected('portable') then
|
||||
begin
|
||||
|
||||
@@ -404,28 +389,12 @@ begin
|
||||
end;
|
||||
|
||||
if CurPageID = wpReady then
|
||||
begin
|
||||
if IsComponentSelected('themes\windows10') and not FileExists(ExpandConstant('{tmp}\Windows-10-3.2.1.zip')) then
|
||||
begin
|
||||
MsgBox('Windows 10 GTK3 theme could not be downloaded. Please retry setup and rerun setup.', mbError, MB_OK);
|
||||
Result := False;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if IsComponentSelected('themes\windows10dark') and not FileExists(ExpandConstant('{tmp}\Windows-10-Dark-3.2.1-dark.zip')) then
|
||||
begin
|
||||
MsgBox('Windows 10 Dark GTK3 theme could not be downloaded. Please retry setup and rerun setup.', mbError, MB_OK);
|
||||
Result := False;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if IsComponentSelected('deps\vcredist2015') and not CheckVCInstall() and not FileExists(ExpandConstant('{tmp}\vcredist.exe')) then
|
||||
begin
|
||||
MsgBox('Visual C++ Redistributable could not be downloaded. Please retry setup or install it manually and rerun setup.', mbError, MB_OK);
|
||||
Result := False;
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1 +1 @@
|
||||
2.18.0
|
||||
2.18.0~pre5
|
||||
|
||||
@@ -40,6 +40,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "upd", "..\plugins\upd\upd.v
|
||||
{87554B59-006C-4D94-9714-897B27067BA3} = {87554B59-006C-4D94-9714-897B27067BA3}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winamp", "..\plugins\winamp\winamp.vcxproj", "{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{87554B59-006C-4D94-9714-897B27067BA3} = {87554B59-006C-4D94-9714-897B27067BA3}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sysinfo", "..\plugins\sysinfo\sysinfo.vcxproj", "{6C0CA980-97C5-427A-BE61-5BCECAFABBDA}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{87554B59-006C-4D94-9714-897B27067BA3} = {87554B59-006C-4D94-9714-897B27067BA3}
|
||||
@@ -68,6 +73,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "installer", "installer\inst
|
||||
{E93E1255-95D1-4B08-8FDF-B53CC6A21280} = {E93E1255-95D1-4B08-8FDF-B53CC6A21280}
|
||||
{5EF7F47D-D09C-43C4-BF64-B28B11A0FF91} = {5EF7F47D-D09C-43C4-BF64-B28B11A0FF91}
|
||||
{6C0CA980-97C5-427A-BE61-5BCECAFABBDA} = {6C0CA980-97C5-427A-BE61-5BCECAFABBDA}
|
||||
{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE} = {E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE}
|
||||
{E4BDB4C8-2335-415A-ACEE-BA88B19BFE82} = {E4BDB4C8-2335-415A-ACEE-BA88B19BFE82}
|
||||
{C53145CC-D021-40C9-B97C-0249AB9A43C9} = {C53145CC-D021-40C9-B97C-0249AB9A43C9}
|
||||
{D90BC3E3-1341-4849-9354-5F40489D39D1} = {D90BC3E3-1341-4849-9354-5F40489D39D1}
|
||||
@@ -115,6 +121,8 @@ Global
|
||||
{3C4F42FC-292A-420B-B63D-C03DFBDD8E4E}.Release|x64.Build.0 = Release|x64
|
||||
{461DC24A-A410-4171-8C02-CCDBF3702C2A}.Release|x64.ActiveCfg = Release|x64
|
||||
{461DC24A-A410-4171-8C02-CCDBF3702C2A}.Release|x64.Build.0 = Release|x64
|
||||
{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE}.Release|x64.ActiveCfg = Release|x64
|
||||
{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE}.Release|x64.Build.0 = Release|x64
|
||||
{6C0CA980-97C5-427A-BE61-5BCECAFABBDA}.Release|x64.ActiveCfg = Release|x64
|
||||
{6C0CA980-97C5-427A-BE61-5BCECAFABBDA}.Release|x64.Build.0 = Release|x64
|
||||
{B10A2C41-344C-43E0-A32D-B9587C198D8B}.Release|x64.ActiveCfg = Release|x64
|
||||
@@ -145,6 +153,7 @@ Global
|
||||
{17E4BE39-76F7-4A06-AD21-EFD0C5091F76} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
|
||||
{3C4F42FC-292A-420B-B63D-C03DFBDD8E4E} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
|
||||
{461DC24A-A410-4171-8C02-CCDBF3702C2A} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
|
||||
{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
|
||||
{6C0CA980-97C5-427A-BE61-5BCECAFABBDA} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
|
||||
{B10A2C41-344C-43E0-A32D-B9587C198D8B} = {0FD996A7-464F-4981-8380-3DCA3A244A13}
|
||||
{C9B735E4-75BC-45AC-A5E3-39A6D076F912} = {0FD996A7-464F-4981-8380-3DCA3A244A13}
|
||||
|
||||