mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-23 22:10:18 +00:00
Compare commits
12 Commits
theme-fixe
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 65707f53b7 | |||
| 21c73e699b | |||
| 63226a7267 | |||
| fb37810367 | |||
|
|
2b66734fa6 | ||
| 380aae139f | |||
|
|
e4e823c4d6 | ||
| d4b16d5866 | |||
| b9cfd9a9f9 | |||
| 664aa150fb | |||
| aead92d9e4 | |||
|
|
7cc5d14045 |
@@ -1,6 +1,28 @@
|
||||
ZoiteChat ChangeLog
|
||||
=================
|
||||
|
||||
2.18.0~pre5 (2026-03-22)
|
||||
------------------------
|
||||
- Overhauled preferences/config saving: fully staged and transactional, debounced
|
||||
with flush on close, write failures now surfaced.
|
||||
- Overhauled GTK theme handling: live preview, correct colour reset persistence,
|
||||
proper file:// import paths, consistent menubar CSS.
|
||||
- Fixed GTK entry scroll artifact in the input box.
|
||||
- Hardened tray menu lifetime; fixed stale pointer crash on menu destruction.
|
||||
- Fixed AppIndicator tray init for Wayland/source builds; skip redundant X11
|
||||
tray probe for AppIndicator builds.
|
||||
- Split topic/mode rows in channel bar, tighten spacing, persist userlist column widths.
|
||||
- Preserve saved right-pane size on first layout.
|
||||
- Fixed sounds prefs section.
|
||||
- Fixed chanview tree layout and header alignment; tighten topic URL hit-testing.
|
||||
- Dropped realpath() in favour of GLib-only absolute path build.
|
||||
- Made About dialog links explicit; added GPL licence URL.
|
||||
- Added licence headers to new source files.
|
||||
- Windows installer: fixed VC++ redist URL, added non-plugin download fallback,
|
||||
switched to registry-based runtime detection.
|
||||
- Made libayatana-appindicator a required dep in PKGBUILD.
|
||||
- Cleaned up Meson libperl detection.
|
||||
|
||||
2.18.0~pre4 (2026-03-15)
|
||||
------------------------
|
||||
|
||||
|
||||
@@ -29,6 +29,45 @@
|
||||
<id>zoitechat.desktop</id>
|
||||
</provides>
|
||||
<releases>
|
||||
<release date="2026-03-22" version="2.18.0~pre5">
|
||||
<description>
|
||||
<p>Preferences and config saving:</p>
|
||||
<ul>
|
||||
<li>Overhauled preferences/config saving: fully staged and transactional, debounced with flush on close, write failures now surfaced.</li>
|
||||
</ul>
|
||||
<p>GTK theme and UI:</p>
|
||||
<ul>
|
||||
<li>Overhauled GTK theme handling: live preview, correct colour reset persistence, proper <code>file://</code> import paths, consistent menubar CSS.</li>
|
||||
<li>Fixed GTK entry scroll artifact in the input box.</li>
|
||||
<li>Split topic/mode rows in channel bar, tighten spacing, persist userlist column widths.</li>
|
||||
<li>Preserve saved right-pane size on first layout.</li>
|
||||
<li>Fixed sounds prefs section.</li>
|
||||
<li>Fixed chanview tree layout and header alignment; tighten topic URL hit-testing.</li>
|
||||
</ul>
|
||||
<p>Tray:</p>
|
||||
<ul>
|
||||
<li>Hardened tray menu lifetime; fixed stale pointer crash on menu destruction.</li>
|
||||
<li>Fixed AppIndicator tray init for Wayland/source builds; skip redundant X11 tray probe for AppIndicator builds.</li>
|
||||
</ul>
|
||||
<p>Build and packaging:</p>
|
||||
<ul>
|
||||
<li>Dropped <code>realpath()</code> in favour of GLib-only absolute path build.</li>
|
||||
<li>Made About dialog links explicit; added GPL licence URL.</li>
|
||||
<li>Added licence headers to new source files.</li>
|
||||
<li>Windows installer: fixed VC++ redist URL, added non-plugin download fallback, switched to registry-based runtime detection.</li>
|
||||
<li>Made <code>libayatana-appindicator</code> a required dep in PKGBUILD.</li>
|
||||
<li>Cleaned up Meson libperl detection.</li>
|
||||
</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>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
project('zoitechat', 'c',
|
||||
version: '2.18.0~pre4',
|
||||
version: '2.18.0~pre5',
|
||||
meson_version: '>= 0.55.0',
|
||||
default_options: [
|
||||
'c_std=c17',
|
||||
|
||||
@@ -19,7 +19,7 @@ else:
|
||||
if not hasattr(sys, 'argv'):
|
||||
sys.argv = ['<zoitechat>']
|
||||
|
||||
VERSION = b'2.18.0~pre4'
|
||||
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)
|
||||
|
||||
2
po/de.po
2
po/de.po
@@ -1325,7 +1325,7 @@ msgstr "%C29*%O$t%C29MOTD übersprungen%O"
|
||||
|
||||
#: src/common/textevents.h:277
|
||||
msgid "%C23*%O$t%C28$1%C is already in use. Retrying with %C18$2%O..."
|
||||
msgstr "%C23*%O$t%C28$1%C wird bereits verwendet. Erneurter Versuch mit %C18$2%O …"
|
||||
msgstr "%C23*%O$t%C28$1%C wird bereits verwendet. Erneuter Versuch mit %C18$2%O …"
|
||||
|
||||
#: src/common/textevents.h:280
|
||||
msgid "%C23*%O$t%C28$1%C is erroneous. Retrying with %C18$2%O..."
|
||||
|
||||
@@ -44,6 +44,7 @@ For more information on ZoiteChat please read our [documentation](https://docs.z
|
||||
<sub>
|
||||
X-Chat ("xchat") Copyright (c) 1998-2010 By Peter Zelezny.
|
||||
HexChat ("hexchat") Copyright (c) 2009-2014 By Berke Viktor.
|
||||
Hexchat ("hexchat") Copyright (c) 2015-2025 By Patrick Griffis.
|
||||
ZoiteChat ("zoitechat") Copyright (c) 2026 By deepend.
|
||||
</sub>
|
||||
|
||||
|
||||
@@ -411,6 +411,7 @@ const struct prefs vars[] =
|
||||
{"gui_chanlist_width_topic", P_OFFINT (hex_gui_chanlist_width_topic), TYPE_INT},
|
||||
{"gui_chanlist_width_users", P_OFFINT (hex_gui_chanlist_width_users), TYPE_INT},
|
||||
{"gui_compact", P_OFFINT (hex_gui_compact), TYPE_BOOL},
|
||||
{"gui_ctrlq_quit", P_OFFINT (hex_gui_ctrlq_quit), TYPE_BOOL},
|
||||
{"gui_dialog_height", P_OFFINT (hex_gui_dialog_height), TYPE_INT},
|
||||
{"gui_dialog_left", P_OFFINT (hex_gui_dialog_left), TYPE_INT},
|
||||
{"gui_dialog_top", P_OFFINT (hex_gui_dialog_top), TYPE_INT},
|
||||
@@ -765,6 +766,7 @@ load_default_config(void)
|
||||
#ifdef HAVE_GTK_MAC
|
||||
prefs.hex_gui_hide_menu = 1;
|
||||
#endif
|
||||
prefs.hex_gui_ctrlq_quit = 1;
|
||||
prefs.hex_gui_input_attr = 1;
|
||||
prefs.hex_gui_input_icon = 1;
|
||||
prefs.hex_gui_input_nick = 1;
|
||||
|
||||
217
src/common/url.c
217
src/common/url.c
@@ -35,20 +35,11 @@ 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_host (void);
|
||||
static const GRegex *re_host6 (void);
|
||||
static const GRegex *re_email (void);
|
||||
static const GRegex *re_nick (void);
|
||||
static const GRegex *re_channel (void);
|
||||
static const GRegex *re_path (void);
|
||||
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_email (const char *word, int *start, int *end);
|
||||
static gboolean match_url (const char *word, int *start, int *end);
|
||||
static gboolean match_host (const char *word, int *start, int *end);
|
||||
static gboolean match_host6 (const char *word, int *start, int *end);
|
||||
static gboolean match_path (const char *word, int *start, int *end);
|
||||
|
||||
static int
|
||||
url_free (char *url, void *data)
|
||||
@@ -191,11 +182,7 @@ url_check_word (const char *word)
|
||||
int type;
|
||||
} m[] = {
|
||||
{ match_url, WORD_URL },
|
||||
{ match_email, WORD_EMAIL },
|
||||
{ match_channel, WORD_CHANNEL },
|
||||
{ match_host6, WORD_HOST6 },
|
||||
{ match_host, WORD_HOST },
|
||||
{ match_path, WORD_PATH },
|
||||
{ match_nick, WORD_NICK },
|
||||
{ NULL, 0}
|
||||
};
|
||||
@@ -268,43 +255,10 @@ match_channel (const char *word, int *start, int *end)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
match_email (const char *word, int *start, int *end)
|
||||
{
|
||||
return regex_match (re_email (), word, start, end);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
match_url (const char *word, int *start, int *end)
|
||||
{
|
||||
if (regex_match (re_url (), word, start, end))
|
||||
return TRUE;
|
||||
|
||||
return regex_match (re_url_no_scheme (), word, start, end);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
match_host (const char *word, int *start, int *end)
|
||||
{
|
||||
return regex_match (re_host (), word, start, end);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
match_host6 (const char *word, int *start, int *end)
|
||||
{
|
||||
if (!regex_match (re_host6 (), word, start, end))
|
||||
return FALSE;
|
||||
|
||||
if (word[*start] != '[')
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
match_path (const char *word, int *start, int *end)
|
||||
{
|
||||
return regex_match (re_path (), word, start, end);
|
||||
return regex_match (re_url (), word, start, end);
|
||||
}
|
||||
|
||||
/* List of IRC commands for which contents (and thus possible URLs)
|
||||
@@ -451,34 +405,7 @@ make_re (const char *grist)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* HOST description --- */
|
||||
/* (see miscellaneous above) */
|
||||
static const GRegex *
|
||||
re_host (void)
|
||||
{
|
||||
static GRegex *host_ret;
|
||||
|
||||
if (host_ret) return host_ret;
|
||||
|
||||
host_ret = make_re ("(" "(" HOST_URL PORT ")|(" HOST ")" ")");
|
||||
|
||||
return host_ret;
|
||||
}
|
||||
|
||||
static const GRegex *
|
||||
re_host6 (void)
|
||||
{
|
||||
static GRegex *host6_ret;
|
||||
|
||||
if (host6_ret) return host6_ret;
|
||||
|
||||
host6_ret = make_re ("(" "(" IPV6ADDR ")|(" "\\[" IPV6ADDR "\\]" PORT ")" ")");
|
||||
|
||||
return host6_ret;
|
||||
}
|
||||
|
||||
/* URL description --- */
|
||||
#define SCHEME "(%s)"
|
||||
#define LPAR "\\("
|
||||
#define RPAR "\\)"
|
||||
#define NOPARENS "[^() \t]*"
|
||||
@@ -489,86 +416,18 @@ re_host6 (void)
|
||||
"(" NOPARENS ")" \
|
||||
")*" /* Zero or more occurrences of either of these */ \
|
||||
"(?<![.,?!\\]])" /* Not allowed to end with these */
|
||||
#define USERINFO "([-a-z0-9._~%]+(:[-a-z0-9._~%]*)?@)"
|
||||
|
||||
/* Flags used to describe URIs (RFC 3986)
|
||||
*
|
||||
* Bellow is an example of what the flags match.
|
||||
*
|
||||
* URI_AUTHORITY - http://example.org:80/foo/bar
|
||||
* ^^^^^^^^^^^^^^^^
|
||||
* URI_USERINFO/URI_OPT_USERINFO - http://user@example.org:80/foo/bar
|
||||
* ^^^^^
|
||||
* URI_PATH - http://example.org:80/foo/bar
|
||||
* ^^^^^^^^
|
||||
*/
|
||||
#define URI_AUTHORITY (1 << 0)
|
||||
#define URI_OPT_USERINFO (1 << 1)
|
||||
#define URI_USERINFO (1 << 2)
|
||||
#define URI_PATH (1 << 3)
|
||||
|
||||
struct
|
||||
{
|
||||
const char *scheme; /* scheme name. e.g. http */
|
||||
const char *path_sep; /* string that begins the path */
|
||||
int flags; /* see above (flag macros) */
|
||||
const char *scheme;
|
||||
} uri[] = {
|
||||
{ "irc", "/", URI_PATH },
|
||||
{ "ircs", "/", URI_PATH },
|
||||
{ "rtsp", "/", URI_AUTHORITY | URI_PATH },
|
||||
{ "feed", "/", URI_AUTHORITY | URI_PATH },
|
||||
{ "teamspeak", "?", URI_AUTHORITY | URI_PATH },
|
||||
{ "ftp", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "sftp", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "ftps", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "http", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "https", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "cvs", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "svn", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "git", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "bzr", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "rsync", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "mumble", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "ventrilo", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "xmpp", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "h323", ";", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "imap", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "pop", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "nfs", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "smb", "/", URI_AUTHORITY | URI_OPT_USERINFO | URI_PATH },
|
||||
{ "gopher", "/", URI_AUTHORITY | URI_PATH },
|
||||
{ "gemini", "/", URI_AUTHORITY | URI_PATH },
|
||||
{ "ssh", "", URI_AUTHORITY | URI_OPT_USERINFO },
|
||||
{ "sip", "", URI_AUTHORITY | URI_USERINFO },
|
||||
{ "sips", "", URI_AUTHORITY | URI_USERINFO },
|
||||
{ "magnet", "?", URI_PATH },
|
||||
{ "mailto", "", URI_PATH },
|
||||
{ "bitcoin", "", URI_PATH },
|
||||
{ "gtalk", "", URI_PATH },
|
||||
{ "steam", "", URI_PATH },
|
||||
{ "file", "/", URI_PATH },
|
||||
{ "callto", "", URI_PATH },
|
||||
{ "skype", "", URI_PATH },
|
||||
{ "geo", "", URI_PATH },
|
||||
{ "spotify", "", URI_PATH },
|
||||
{ "lastfm", "/", URI_PATH },
|
||||
{ "xfire", "", URI_PATH },
|
||||
{ "ts3server", "", URI_PATH },
|
||||
{ NULL, "", 0}
|
||||
{ "http" },
|
||||
{ "https" },
|
||||
{ "ftp" },
|
||||
{ "gopher" },
|
||||
{ "gemini" },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static const GRegex *
|
||||
re_url_no_scheme (void)
|
||||
{
|
||||
static GRegex *url_ret = NULL;
|
||||
|
||||
if (url_ret) return url_ret;
|
||||
|
||||
url_ret = make_re ("(" HOST_URL OPT_PORT "/" "(" PATH ")?" ")");
|
||||
|
||||
return url_ret;
|
||||
}
|
||||
|
||||
static const GRegex *
|
||||
re_url (void)
|
||||
{
|
||||
@@ -587,27 +446,9 @@ re_url (void)
|
||||
g_string_append (grist_gstr, "|");
|
||||
|
||||
g_string_append (grist_gstr, "(");
|
||||
g_string_append_printf (grist_gstr, "%s:", uri[i].scheme);
|
||||
|
||||
if (uri[i].flags & URI_AUTHORITY)
|
||||
g_string_append (grist_gstr, "//");
|
||||
|
||||
if (uri[i].flags & URI_USERINFO)
|
||||
g_string_append (grist_gstr, USERINFO);
|
||||
else if (uri[i].flags & URI_OPT_USERINFO)
|
||||
g_string_append (grist_gstr, USERINFO "?");
|
||||
|
||||
if (uri[i].flags & URI_AUTHORITY)
|
||||
g_string_append (grist_gstr, HOST_URL_OPT_TLD OPT_PORT);
|
||||
|
||||
if (uri[i].flags & URI_PATH)
|
||||
{
|
||||
char *sep_escaped = g_regex_escape_string (uri[i].path_sep, strlen(uri[i].path_sep));
|
||||
|
||||
g_string_append_printf (grist_gstr, "(" "%s" PATH ")?", sep_escaped);
|
||||
|
||||
g_free (sep_escaped);
|
||||
}
|
||||
g_string_append_printf (grist_gstr, "%s://", uri[i].scheme);
|
||||
g_string_append (grist_gstr, HOST_URL_OPT_TLD OPT_PORT);
|
||||
g_string_append_printf (grist_gstr, "(/" PATH ")?");
|
||||
|
||||
g_string_append (grist_gstr, ")");
|
||||
}
|
||||
@@ -620,21 +461,6 @@ re_url (void)
|
||||
return url_ret;
|
||||
}
|
||||
|
||||
/* EMAIL description --- */
|
||||
#define EMAIL "[a-z0-9][._%+-a-z0-9]+@" "(" HOST_URL ")"
|
||||
|
||||
static const GRegex *
|
||||
re_email (void)
|
||||
{
|
||||
static GRegex *email_ret;
|
||||
|
||||
if (email_ret) return email_ret;
|
||||
|
||||
email_ret = make_re ("(" EMAIL ")");
|
||||
|
||||
return email_ret;
|
||||
}
|
||||
|
||||
/* NICK description --- */
|
||||
/* For NICKPRE see before url_check_word() */
|
||||
#define NICKHYP "-"
|
||||
@@ -680,24 +506,3 @@ re_channel (void)
|
||||
|
||||
return channel_ret;
|
||||
}
|
||||
|
||||
/* PATH description --- */
|
||||
#ifdef WIN32
|
||||
/* Windows path can be .\ ..\ or C: D: etc */
|
||||
#define FS_PATH "^(\\.{1,2}\\\\|[a-z]:).*"
|
||||
#else
|
||||
/* Linux path can be / or ./ or ../ etc */
|
||||
#define FS_PATH "^(/|\\./|\\.\\./).*"
|
||||
#endif
|
||||
|
||||
static const GRegex *
|
||||
re_path (void)
|
||||
{
|
||||
static GRegex *path_ret;
|
||||
|
||||
if (path_ret) return path_ret;
|
||||
|
||||
path_ret = make_re ("(" FS_PATH ")");
|
||||
|
||||
return path_ret;
|
||||
}
|
||||
|
||||
@@ -122,6 +122,7 @@ struct zoitechatprefs
|
||||
unsigned int hex_gui_autoopen_recv;
|
||||
unsigned int hex_gui_autoopen_send;
|
||||
unsigned int hex_gui_compact;
|
||||
unsigned int hex_gui_ctrlq_quit;
|
||||
unsigned int hex_gui_filesize_iec;
|
||||
unsigned int hex_gui_focus_omitalerts;
|
||||
unsigned int hex_gui_hide_menu;
|
||||
|
||||
@@ -170,7 +170,7 @@ typedef struct session_gui
|
||||
GtkWidget *shbox, *shentry; /* search bar hbox */
|
||||
gulong search_changed_signal; /* hook for search change event so blanking the box doesn't suck */
|
||||
|
||||
#define MENU_ID_NUM 14
|
||||
#define MENU_ID_NUM 15
|
||||
GtkWidget *menu_item[MENU_ID_NUM+1]; /* some items we may change state of */
|
||||
|
||||
void *chanview; /* chanview.h */
|
||||
|
||||
@@ -1802,6 +1802,44 @@ menu_change_layout (void)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
menu_update_quit_accel (void)
|
||||
{
|
||||
GSList *list;
|
||||
|
||||
list = sess_list;
|
||||
while (list)
|
||||
{
|
||||
session *sess = list->data;
|
||||
session_gui *gui = sess->gui;
|
||||
GtkWidget *item;
|
||||
GtkAccelGroup *accel_group;
|
||||
int enabled;
|
||||
|
||||
list = list->next;
|
||||
if (!gui)
|
||||
continue;
|
||||
|
||||
item = gui->menu_item[MENU_ID_QUIT];
|
||||
if (!item)
|
||||
continue;
|
||||
|
||||
enabled = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "zc-ctrlq-enabled"));
|
||||
if (enabled == (int)prefs.hex_gui_ctrlq_quit)
|
||||
continue;
|
||||
|
||||
accel_group = g_object_get_data (G_OBJECT (item), "zc-quit-accel-group");
|
||||
if (!accel_group)
|
||||
continue;
|
||||
|
||||
if (prefs.hex_gui_ctrlq_quit)
|
||||
gtk_widget_add_accelerator (item, "activate", accel_group, GDK_KEY_q, STATE_CTRL, GTK_ACCEL_VISIBLE);
|
||||
else
|
||||
gtk_widget_remove_accelerator (item, accel_group, GDK_KEY_q, STATE_CTRL);
|
||||
g_object_set_data (G_OBJECT (item), "zc-ctrlq-enabled", GINT_TO_POINTER (prefs.hex_gui_ctrlq_quit));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
menu_layout_cb (GtkWidget *item, gpointer none)
|
||||
{
|
||||
@@ -1879,25 +1917,46 @@ about_dialog_openurl (GtkAboutDialog *dialog, char *uri, gpointer data)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
about_dialog_button_openurl (GtkButton *button, gpointer data)
|
||||
{
|
||||
fe_open_url ((const char *)data);
|
||||
}
|
||||
|
||||
static void
|
||||
about_dialog_add_links (GtkAboutDialog *dialog)
|
||||
{
|
||||
GtkWidget *content = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
|
||||
GtkWidget *row = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
|
||||
GtkWidget *website = gtk_link_button_new_with_label ("http://zoitechat.zoite.net", "Website");
|
||||
GtkWidget *license = gtk_link_button_new_with_label ("https://www.gnu.org/licenses/old-licenses/gpl-2.0.html", "License");
|
||||
gtk_button_set_relief (GTK_BUTTON (website), GTK_RELIEF_NONE);
|
||||
gtk_button_set_relief (GTK_BUTTON (license), GTK_RELIEF_NONE);
|
||||
gtk_box_pack_start (GTK_BOX (row), website, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (row), license, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (content), row, FALSE, FALSE, 0);
|
||||
gtk_widget_show_all (row);
|
||||
GtkWidget *actions = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
|
||||
GtkWidget *website = gtk_button_new_with_label ("Website");
|
||||
GtkWidget *license = gtk_button_new_with_label ("License");
|
||||
|
||||
g_signal_connect (G_OBJECT (website), "clicked", G_CALLBACK (about_dialog_button_openurl), "http://zoitechat.zoite.net");
|
||||
g_signal_connect (G_OBJECT (license), "clicked", G_CALLBACK (about_dialog_button_openurl), "https://www.gnu.org/licenses/old-licenses/gpl-2.0.html");
|
||||
gtk_box_pack_start (GTK_BOX (actions), website, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (actions), license, FALSE, FALSE, 0);
|
||||
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (actions), website, TRUE);
|
||||
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (actions), license, TRUE);
|
||||
gtk_widget_show_all (actions);
|
||||
}
|
||||
|
||||
static void
|
||||
about_dialog_strip_actions (GtkDialog *dialog)
|
||||
{
|
||||
GtkWidget *area = gtk_dialog_get_action_area (dialog);
|
||||
GList *children = gtk_container_get_children (GTK_CONTAINER (area));
|
||||
GList *node;
|
||||
|
||||
for (node = children; node != NULL; node = node->next)
|
||||
gtk_widget_destroy (GTK_WIDGET (node->data));
|
||||
|
||||
g_list_free (children);
|
||||
}
|
||||
|
||||
static void
|
||||
menu_about (GtkWidget *wid, gpointer sess)
|
||||
{
|
||||
GtkAboutDialog *dialog = GTK_ABOUT_DIALOG(gtk_about_dialog_new());
|
||||
static const gchar *empty_people[] = { NULL };
|
||||
theme_manager_attach_window (GTK_WIDGET (dialog));
|
||||
char comment[512];
|
||||
g_snprintf (comment, sizeof(comment), ""
|
||||
@@ -1914,14 +1973,20 @@ menu_about (GtkWidget *wid, gpointer sess)
|
||||
|
||||
gtk_about_dialog_set_program_name (dialog, _(DISPLAY_NAME));
|
||||
gtk_about_dialog_set_version (dialog, PACKAGE_VERSION);
|
||||
gtk_about_dialog_set_authors (dialog, NULL);
|
||||
gtk_about_dialog_set_documenters (dialog, NULL);
|
||||
gtk_about_dialog_set_artists (dialog, NULL);
|
||||
gtk_about_dialog_set_translator_credits (dialog, NULL);
|
||||
gtk_about_dialog_set_authors (dialog, empty_people);
|
||||
gtk_about_dialog_set_documenters (dialog, empty_people);
|
||||
gtk_about_dialog_set_artists (dialog, empty_people);
|
||||
gtk_about_dialog_set_translator_credits (dialog, "");
|
||||
gtk_about_dialog_set_website (dialog, NULL);
|
||||
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);
|
||||
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 2026 deepend");
|
||||
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);
|
||||
about_dialog_strip_actions (GTK_DIALOG (dialog));
|
||||
about_dialog_add_links (dialog);
|
||||
gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Close"), GTK_RESPONSE_CLOSE);
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(parent_window));
|
||||
g_signal_connect (G_OBJECT(dialog), "response", G_CALLBACK(about_dialog_close), NULL);
|
||||
@@ -1950,7 +2015,7 @@ static struct mymenu mymenu[] = {
|
||||
#define CLOSE_OFFSET (13)
|
||||
{0, menu_close, 0, M_MENUITEM, 0, 0, 1},
|
||||
{0, 0, 0, M_SEP, 0, 0, 0},
|
||||
{N_("_Quit"), menu_quit, 0, M_MENUITEM, 0, 0, 1, GDK_KEY_q}, /* 15 */
|
||||
{N_("_Quit"), menu_quit, 0, M_MENUITEM, MENU_ID_QUIT, 0, 1, GDK_KEY_q}, /* 15 */
|
||||
|
||||
{N_("_View"), 0, 0, M_NEWMENU, 0, 0, 1},
|
||||
#define MENUBAR_OFFSET (17)
|
||||
@@ -2634,7 +2699,7 @@ menu_create_main (void *accel_group, int bar, int away, int toplevel,
|
||||
case M_MENUITEM:
|
||||
item = gtk_menu_item_new_with_mnemonic (_(mymenu[i].text));
|
||||
normalitem:
|
||||
if (mymenu[i].key != 0)
|
||||
if (mymenu[i].key != 0 && !(mymenu[i].id == MENU_ID_QUIT && !prefs.hex_gui_ctrlq_quit))
|
||||
gtk_widget_add_accelerator (item, "activate", accel_group,
|
||||
mymenu[i].key,
|
||||
mymenu[i].key == GDK_KEY_F1 ? 0 :
|
||||
@@ -2644,6 +2709,11 @@ normalitem:
|
||||
STATE_SHIFT | STATE_CTRL :
|
||||
STATE_CTRL,
|
||||
GTK_ACCEL_VISIBLE);
|
||||
if (mymenu[i].id == MENU_ID_QUIT)
|
||||
{
|
||||
g_object_set_data (G_OBJECT (item), "zc-quit-accel-group", accel_group);
|
||||
g_object_set_data (G_OBJECT (item), "zc-ctrlq-enabled", GINT_TO_POINTER (prefs.hex_gui_ctrlq_quit));
|
||||
}
|
||||
if (mymenu[i].callback)
|
||||
g_signal_connect (G_OBJECT (item), "activate",
|
||||
G_CALLBACK (mymenu[i].callback), 0);
|
||||
@@ -2685,9 +2755,11 @@ togitem:
|
||||
goto togitem;
|
||||
|
||||
case M_SEP:
|
||||
item = gtk_menu_item_new ();
|
||||
gtk_widget_set_sensitive (item, FALSE);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||
item = gtk_separator_menu_item_new ();
|
||||
if (submenu)
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item);
|
||||
else
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
|
||||
gtk_widget_show (item);
|
||||
break;
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ void menu_create (GtkWidget *menu, GSList *list, char *target, int check_path);
|
||||
void menu_bar_toggle (void);
|
||||
void menu_add_plugin_items (GtkWidget *menu, char *root, char *target);
|
||||
void menu_change_layout (void);
|
||||
void menu_update_quit_accel (void);
|
||||
|
||||
void menu_set_away (session_gui *gui, int away);
|
||||
void menu_set_fullscreen (session_gui *gui, int fullscreen);
|
||||
@@ -63,8 +64,9 @@ void menu_set_fullscreen (session_gui *gui, int fullscreen);
|
||||
#define MENU_ID_USERMENU 12
|
||||
#define MENU_ID_FULLSCREEN 13
|
||||
#define MENU_ID_ZOITECHAT 14
|
||||
#define MENU_ID_QUIT 15
|
||||
|
||||
#if (MENU_ID_NUM < MENU_ID_ZOITECHAT)
|
||||
#if (MENU_ID_NUM < MENU_ID_QUIT)
|
||||
#error MENU_ID_NUM is set wrong
|
||||
#endif
|
||||
|
||||
|
||||
@@ -536,6 +536,7 @@ static const setting general_settings[] =
|
||||
{ST_TOGGLE, N_("WHOIS on notify"), P_OFFINTNL(hex_notify_whois_online), N_("Sends a /WHOIS when a user comes online in your notify list."), 0, 0},
|
||||
{ST_TOGGLE, N_("Hide join and part messages"), P_OFFINTNL(hex_irc_conf_mode), N_("Hide channel join/part messages by default."), 0, 0},
|
||||
{ST_TOGGLE, N_("Hide nick change messages"), P_OFFINTNL(hex_irc_hide_nickchange), 0, 0, 0},
|
||||
{ST_TOGGLE, N_("Enable Ctrl+Q to quit"), P_OFFINTNL(hex_gui_ctrlq_quit), 0, 0, 0},
|
||||
|
||||
{ST_END, 0, 0, 0, 0, 0}
|
||||
};
|
||||
@@ -2070,6 +2071,7 @@ setup_apply_real (const ThemeChangedEvent *event)
|
||||
}
|
||||
|
||||
mg_apply_setup ();
|
||||
menu_update_quit_accel ();
|
||||
tray_apply_setup ();
|
||||
zoitechat_reinit_timers ();
|
||||
|
||||
|
||||
@@ -44,14 +44,29 @@
|
||||
enum
|
||||
{
|
||||
COL_PIX=0, /* GdkPixbuf * */
|
||||
COL_NICK=1, /* char * */
|
||||
COL_HOST=2, /* char * */
|
||||
COL_USER=3, /* struct User * */
|
||||
COL_GDKCOLOR=4 /* GdkRGBA */
|
||||
COL_PREFIX=1, /* char * */
|
||||
COL_NICK=2, /* char * */
|
||||
COL_HOST=3, /* char * */
|
||||
COL_USER=4, /* struct User * */
|
||||
COL_GDKCOLOR=5 /* GdkRGBA */
|
||||
};
|
||||
|
||||
static void userlist_store_color (GtkListStore *store, GtkTreeIter *iter, ThemeSemanticToken token, gboolean has_token);
|
||||
|
||||
static const char *
|
||||
userlist_prefix_color (char prefix)
|
||||
{
|
||||
switch (prefix)
|
||||
{
|
||||
case '~': return "#d46a6a";
|
||||
case '@': return "#5ea36a";
|
||||
case '%': return "#d39a5f";
|
||||
case '&': return "#79aecd";
|
||||
case '+': return "#d2bf6a";
|
||||
default: return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
userlist_column_width_notify_cb (GtkTreeViewColumn *column, GParamSpec *pspec, gpointer userdata)
|
||||
{
|
||||
@@ -500,6 +515,11 @@ fe_userlist_insert (session *sess, struct User *newuser, gboolean sel)
|
||||
GdkPixbuf *pix = get_user_icon (sess->server, newuser);
|
||||
GtkTreeIter iter;
|
||||
char *nick;
|
||||
char *nick_escaped;
|
||||
char *prefix = NULL;
|
||||
char *prefix_escaped;
|
||||
char prefix_text[2];
|
||||
const char *prefix_color;
|
||||
ThemeSemanticToken nick_token = THEME_TOKEN_TEXT_FOREGROUND;
|
||||
gboolean have_nick_token = FALSE;
|
||||
|
||||
@@ -519,30 +539,36 @@ fe_userlist_insert (session *sess, struct User *newuser, gboolean sel)
|
||||
}
|
||||
}
|
||||
|
||||
nick = newuser->nick;
|
||||
nick_escaped = g_markup_escape_text (newuser->nick, -1);
|
||||
nick = nick_escaped;
|
||||
if (!prefs.hex_gui_ulist_icons)
|
||||
{
|
||||
nick = g_malloc (strlen (newuser->nick) + 2);
|
||||
nick[0] = newuser->prefix[0];
|
||||
if (nick[0] == '\0' || nick[0] == ' ')
|
||||
strcpy (nick, newuser->nick);
|
||||
else
|
||||
strcpy (nick + 1, newuser->nick);
|
||||
if (newuser->prefix[0] != '\0' && newuser->prefix[0] != ' ')
|
||||
{
|
||||
prefix_text[0] = newuser->prefix[0];
|
||||
prefix_text[1] = '\0';
|
||||
prefix_escaped = g_markup_escape_text (prefix_text, -1);
|
||||
prefix_color = userlist_prefix_color (newuser->prefix[0]);
|
||||
if (prefix_color)
|
||||
prefix = g_strdup_printf ("<b><span foreground=\"%s\">%s</span></b>", prefix_color, prefix_escaped);
|
||||
else
|
||||
prefix = g_strdup_printf ("<b>%s</b>", prefix_escaped);
|
||||
g_free (prefix_escaped);
|
||||
}
|
||||
pix = NULL;
|
||||
}
|
||||
|
||||
gtk_list_store_insert_with_values (GTK_LIST_STORE (model), &iter, 0,
|
||||
COL_PIX, pix,
|
||||
COL_PREFIX, prefix,
|
||||
COL_NICK, nick,
|
||||
COL_HOST, newuser->hostname,
|
||||
COL_USER, newuser,
|
||||
-1);
|
||||
userlist_store_color (GTK_LIST_STORE (model), &iter, nick_token, have_nick_token);
|
||||
|
||||
if (!prefs.hex_gui_ulist_icons)
|
||||
{
|
||||
g_free (nick);
|
||||
}
|
||||
g_free (prefix);
|
||||
g_free (nick_escaped);
|
||||
|
||||
userlist_row_map_set (sess, model, newuser, &iter);
|
||||
|
||||
@@ -671,8 +697,8 @@ userlist_create_model (session *sess)
|
||||
GtkTreeIterCompareFunc cmp_func;
|
||||
GtkSortType sort_type;
|
||||
|
||||
store = gtk_list_store_new (5, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING,
|
||||
G_TYPE_POINTER, THEME_GTK_COLOR_TYPE);
|
||||
store = gtk_list_store_new (6, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING,
|
||||
G_TYPE_STRING, G_TYPE_POINTER, THEME_GTK_COLOR_TYPE);
|
||||
|
||||
switch (prefs.hex_gui_ulist_sort)
|
||||
{
|
||||
@@ -717,19 +743,29 @@ userlist_add_columns (GtkTreeView * treeview)
|
||||
g_object_set (G_OBJECT (renderer), "ypad", 0, NULL);
|
||||
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview),
|
||||
-1, NULL, renderer,
|
||||
"pixbuf", 0, NULL);
|
||||
"pixbuf", COL_PIX, NULL);
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), 0);
|
||||
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
|
||||
|
||||
/* nick column */
|
||||
column = gtk_tree_view_column_new ();
|
||||
gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
|
||||
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
if (prefs.hex_gui_compact)
|
||||
g_object_set (G_OBJECT (renderer), "ypad", 0, NULL);
|
||||
gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer), 1);
|
||||
gtk_tree_view_column_pack_start (column, renderer, FALSE);
|
||||
gtk_tree_view_column_add_attribute (column, renderer, "markup", COL_PREFIX);
|
||||
|
||||
renderer = gtk_cell_renderer_text_new ();
|
||||
if (prefs.hex_gui_compact)
|
||||
g_object_set (G_OBJECT (renderer), "ypad", 0, NULL);
|
||||
g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
|
||||
gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer), 1);
|
||||
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview),
|
||||
-1, NULL, renderer,
|
||||
"text", 1, THEME_GTK_FOREGROUND_PROPERTY, 4, NULL);
|
||||
gtk_tree_view_column_pack_start (column, renderer, TRUE);
|
||||
gtk_tree_view_column_add_attribute (column, renderer, "markup", COL_NICK);
|
||||
gtk_tree_view_column_add_attribute (column, renderer, THEME_GTK_FOREGROUND_PROPERTY, COL_GDKCOLOR);
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), 1);
|
||||
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
|
||||
gtk_tree_view_column_set_expand (column, TRUE);
|
||||
@@ -750,7 +786,7 @@ userlist_add_columns (GtkTreeView * treeview)
|
||||
gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer), 1);
|
||||
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview),
|
||||
-1, NULL, renderer,
|
||||
"text", 2, NULL);
|
||||
"text", COL_HOST, NULL);
|
||||
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), 2);
|
||||
gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
|
||||
gtk_tree_view_column_set_expand (column, TRUE);
|
||||
|
||||
@@ -1 +1 @@
|
||||
2.18.0~pre4
|
||||
2.18.0~pre5
|
||||
|
||||
Reference in New Issue
Block a user