Skip to content
Commits on Source (24)
*.pot
*.sw?
*.tar.xz
.buildconfig
.flatpak-builder
*~
......@@ -45,14 +45,14 @@ workflow:
- if: '$CI_COMMIT_BRANCH =~ /^gnome-[0-9-]+$/'
- when: 'manual'
.polari.fedora:35:
.polari.fedora:
variables:
FDO_DISTRIBUTION_VERSION: 35
FDO_DISTRIBUTION_TAG: '2022-02-18.0'
FDO_DISTRIBUTION_VERSION: 37
FDO_DISTRIBUTION_TAG: '2022-09-27.0'
FDO_DISTRIBUTION_PACKAGES: >
meson gcc g++ pkgconf git gettext itstool
desktop-file-utils */appstream-util */json-glib-validate
mozjs91-devel nodejs npm
nodejs npm
pkgconfig(gtk+-3.0) pkgconfig(gjs-1.0)
pkgconfig(gobject-introspection-1.0)
pkgconfig(telepathy-glib)
......@@ -60,11 +60,6 @@ workflow:
# For static analysis with eslint
npm install -g eslint eslint-plugin-jsdoc &&
./.gitlab-ci/install-meson-project.sh \
-Dskip_dbus_tests=true \
https://gitlab.gnome.org/GNOME/gjs.git \
1.71.1 . &&
./.gitlab-ci/install-meson-project.sh \
https://gitlab.gnome.org/fmuellner/gjs-ci-tools.git \
main .
......@@ -115,14 +110,14 @@ check-merge-request:
build-fedora-container:
extends:
- .fdo.container-build@fedora@x86_64
- .polari.fedora:35
- .polari.fedora
stage: prepare
<<: *prereview_req
eslint:
extends:
- .fdo.distribution-image@fedora
- .polari.fedora:35
- .polari.fedora
stage: review
needs:
- build-fedora-container
......@@ -137,7 +132,7 @@ eslint:
js-check:
extends:
- .fdo.distribution-image@fedora
- .polari.fedora:35
- .polari.fedora
stage: review
needs:
- build-fedora-container
......@@ -170,13 +165,11 @@ nightly:
extends: '.publish_nightly'
needs:
- flatpak-main
variables:
BUNDLES: '$BUNDLE'
fedora-build:
extends:
- .fdo.distribution-image@fedora
- .polari.fedora:35
- .polari.fedora
stage: build
needs:
- build-fedora-container
......@@ -192,7 +185,7 @@ fedora-build:
fedora-dist:
extends:
- .fdo.distribution-image@fedora
- .polari.fedora:35
- .polari.fedora
stage: deploy
needs:
- fedora-build
......
43.0 — “Hi.”
============
* Move more UI to libadwaita [Florian; !256, !258]
* Misc. bug fixes and cleanups [Florian; !257, !260, !262, !261]
Contributors:
Hugo Carvalho, Zurab Kargareteli, Florian Müllner
Translators:
Zurab Kargareteli [ka], Sabri Ünal [tr], Goran Vidović [hr],
Anders Jonsson [sv], Quentin PAGÈS [oc]
42.1 — “I Hear You, Mama”
=========================
* Fix showing notification for initial message [Florian; !254]
......
......@@ -61,17 +61,10 @@
</requires>
<translation type="gettext">polari</translation>
<releases>
<release version="42.1" date="2022-07-04">
<release version="43.0" date="2022-09-29">
<description>
<p>
This release fixes showing notifications for initial messages.
</p>
</description>
</release>
<release version="42.0" date="2022-03-19">
<description>
<p>
Slight modernize the appearance and support the new dark mode.
Adapt to new UI patterns.
</p>
</description>
</release>
......
......@@ -14,30 +14,15 @@
bind-property="has-service"
bind-flags="invert-boolean|sync-create"/>
<child>
<object class="AdwActionRow">
<object class="AdwEntryRow" id="serverRow">
<property name="title" translatable="yes">_Server Address</property>
<property name="use-underline">True</property>
<property name="activatable-widget">serverEntry</property>
<child type="suffix">
<object class="GtkEntry" id="serverEntry">
<property name="valign">center</property>
<property name="activates-default">True</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwActionRow">
<object class="AdwEntryRow" id="nameRow">
<property name="title" translatable="yes">Net_work Name</property>
<property name="use-underline">True</property>
<property name="activatable-widget">nameEntry</property>
<child type="suffix">
<object class="GtkEntry" id="nameEntry">
<property name="valign">center</property>
<property name="activates-default">True</property>
<property name="placeholder-text" translatable="yes">optional</property>
</object>
</child>
</object>
</child>
<child>
......@@ -58,30 +43,15 @@
<object class="AdwPreferencesGroup">
<property name="hexpand">True</property>
<child>
<object class="AdwActionRow">
<object class="AdwEntryRow" id="nickRow">
<property name="title" translatable="yes">_Nickname</property>
<property name="use-underline">True</property>
<property name="activatable-widget">nickEntry</property>
<child type="suffix">
<object class="GtkEntry" id="nickEntry">
<property name="valign">center</property>
<property name="activates-default">True</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwActionRow">
<object class="AdwEntryRow" id="realnameRow">
<property name="title" translatable="yes">_Real Name</property>
<property name="use-underline">True</property>
<property name="activatable-widget">realnameEntry</property>
<child type="suffix">
<object class="GtkEntry" id="realnameEntry">
<property name="valign">center</property>
<property name="activates-default">True</property>
<property name="placeholder-text" translatable="yes">optional</property>
</object>
</child>
</object>
</child>
</object>
......
......@@ -10,6 +10,7 @@ hu
id
nl
pl
pt
pt_BR
ru
sv
......
This diff is collapsed.
project('polari', 'c',
version: '42.1',
version: '43.0',
meson_version: '>= 0.59.0',
license: 'GPL2+'
)
......@@ -35,7 +35,7 @@ check_version = find_program('meson/check-version.py')
gio = dependency('gio-2.0', version: '>= 2.43.4')
telepathy_glib = dependency('telepathy-glib')
girepository = dependency('gobject-introspection-1.0')
gjs = dependency('gjs-1.0', version: '>= 1.69.2')
gjs = dependency('gjs-1.0', version: '>= 1.73.1')
conf = configuration_data()
......
......@@ -26,6 +26,7 @@ hu
id
it
ja
ka
kk
ko
lo
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -217,74 +217,72 @@ class Application extends Adw.Application {
vfunc_startup() {
super.vfunc_startup();
let actionEntries = [{
const actionEntries = [{
name: 'show-join-dialog',
activate: this._onShowJoinDialog.bind(this),
accels: ['<Primary>n'],
}, {
name: 'join-room',
activate: this._onJoinRoom.bind(this),
parameter_type: GLib.VariantType.new('(ssb)'),
parameter_type: '(ssb)',
}, {
name: 'message-user',
activate: this._onMessageUser.bind(this),
parameter_type: GLib.VariantType.new('(sssb)'),
parameter_type: '(sssb)',
}, {
name: 'leave-room',
parameter_type: GLib.VariantType.new('(ss)'),
parameter_type: '(ss)',
}, {
name: 'leave-current-room',
activate: this._onLeaveCurrentRoom.bind(this),
create_hook: a => (a.enabled = false),
accels: ['<Primary>w'],
}, {
name: 'reconnect-room',
parameter_type: GLib.VariantType.new('s'),
parameter_type: 's',
}, {
name: 'authenticate-account',
parameter_type: GLib.VariantType.new('(os)'),
parameter_type: '(os)',
}, {
name: 'connect-account',
activate: this._onConnectAccount.bind(this),
parameter_type: GLib.VariantType.new('o'),
parameter_type: 'o',
}, {
name: 'disconnect-account',
activate: this._onConnectAccount.bind(this),
parameter_type: GLib.VariantType.new('o'),
parameter_type: 'o',
}, {
name: 'reconnect-account',
activate: this._onConnectAccount.bind(this),
parameter_type: GLib.VariantType.new('o'),
parameter_type: 'o',
}, {
name: 'mute-nick',
parameter_type: GLib.VariantType.new('(ss)'),
parameter_type: '(ss)',
}, {
name: 'unmute-nick',
parameter_type: GLib.VariantType.new('(ss)'),
parameter_type: '(ss)',
}, {
name: 'user-list',
activate: this._onToggleAction.bind(this),
create_hook: this._userListCreateHook.bind(this),
state: GLib.Variant.new('b', false),
state: 'false',
accels: ['F9', '<Primary>u'],
}, {
name: 'remove-connection',
activate: this._onRemoveConnection.bind(this),
parameter_type: GLib.VariantType.new('o'),
parameter_type: 'o',
}, {
name: 'undo-remove-connection',
activate: this._onUndoRemoveConnection.bind(this),
parameter_type: GLib.VariantType.new('o'),
parameter_type: 'o',
}, {
name: 'edit-connection',
activate: this._onEditConnection.bind(this),
parameter_type: GLib.VariantType.new('o'),
parameter_type: 'o',
}, {
name: 'save-identify-password',
parameter_type: GLib.VariantType.new('o'),
parameter_type: 'o',
}, {
name: 'discard-identify-password',
parameter_type: GLib.VariantType.new('o'),
parameter_type: 'o',
}, {
name: 'show-emoji-picker',
accels: ['<Primary>e'],
......@@ -316,7 +314,7 @@ class Application extends Adw.Application {
accels: ['<Primary>End'],
}, {
name: 'nth-room',
parameter_type: GLib.VariantType.new('i'),
parameter_type: 'i',
}, {
name: 'next-pending-room',
accels: ['<Alt><Shift>Down', '<Primary><Shift>Page_Down'],
......@@ -324,31 +322,27 @@ class Application extends Adw.Application {
name: 'previous-pending-room',
accels: ['<Alt><Shift>Up', '<Primary><Shift>Page_Up'],
}];
actionEntries.forEach(actionEntry => {
let props = {};
['name', 'state', 'parameter_type'].forEach(prop => {
if (actionEntry[prop])
props[prop] = actionEntry[prop];
});
let action = new Gio.SimpleAction(props);
if (actionEntry.create_hook)
actionEntry.create_hook(action);
if (actionEntry.activate)
action.connect('activate', actionEntry.activate);
if (actionEntry.change_state)
action.connect('change-state', actionEntry.change_state);
if (actionEntry.accels) {
this.set_accels_for_action(
`app.${actionEntry.name}`,
actionEntry.accels);
}
this.add_action(action);
});
this.add_action_entries(actionEntries);
this._settings = new Gio.Settings({ schema_id: 'org.gnome.Polari' });
let action = this._settings.create_action('run-in-background');
this.add_action(action);
action = this.lookup_action('user-list');
action.connect('notify::enabled', () => {
if (!action.enabled)
action.change_state(GLib.Variant.new('b', false));
});
action.enabled = false;
action = this.lookup_action('leave-current-room');
action.enabled = false;
for (const { name, accels } of actionEntries) {
if (accels)
this.set_accels_for_action(`app.${name}`, accels);
}
for (let i = 1; i < 10; i++)
this.set_accels_for_action(`app.nth-room(${i})`, [`<Alt>${i}`]);
......@@ -567,14 +561,6 @@ class Application extends Adw.Application {
action.enabled = room && room.type === Tp.HandleType.ROOM && room.channel;
}
_userListCreateHook(action) {
action.connect('notify::enabled', () => {
if (!action.enabled)
action.change_state(GLib.Variant.new('b', false));
});
action.enabled = false;
}
_onShowJoinDialog() {
this.active_window.showJoinRoomDialog();
}
......@@ -824,7 +810,7 @@ class Application extends Adw.Application {
_onShowAbout() {
let aboutParams = {
authors: [
developers: [
'Florian Müllner <fmuellner@gnome.org>',
'William Jon McCann <william.jon.mccann@gmail.com>',
'Carlos Soriano <carlos.soriano89@gmail.com>',
......@@ -849,20 +835,24 @@ class Application extends Adw.Application {
'Lapo Calamandrei <calamandrei@gmail.com>',
'Tobias Bernard <tbernard@gnome.org>',
],
designers: [
'William Jon McCann <william.jon.mccann@gmail.com>',
'Bastian Ilsø <bastianilso@gnome.org>',
'Allan Day <allanpday@gmail.com>',
],
translator_credits: _('translator-credits'),
comments: _('An Internet Relay Chat Client for GNOME'),
copyright: 'Copyright © 2013-2018 The Polari authors',
license_type: Gtk.License.GPL_2_0,
logo_icon_name: 'org.gnome.Polari',
application_icon: 'org.gnome.Polari',
version: pkg.version,
website_label: _('Learn more about Polari'),
issue_url: 'https://gitlab.gnome.org/GNOME/polari/-/issues',
website: 'https://wiki.gnome.org/Apps/Polari',
transient_for: this.active_window,
modal: true,
};
const aboutDialog = new Gtk.AboutDialog(aboutParams);
const aboutDialog = new Adw.AboutWindow(aboutParams);
aboutDialog.show();
}
......
......@@ -250,10 +250,10 @@ export const ConnectionDetails = GObject.registerClass(
class ConnectionDetails extends Gtk.Box {
static [Gtk.template] = 'resource:///org/gnome/Polari/ui/connection-details.ui';
static [Gtk.internalChildren] = [
'nameEntry',
'serverEntry',
'nickEntry',
'realnameEntry',
'nameRow',
'serverRow',
'nickRow',
'realnameRow',
'sslSwitch',
];
......@@ -286,47 +286,54 @@ class ConnectionDetails extends Gtk.Box {
this._networksManager.disconnect(id);
});
this._nameEntry.connect('changed',
this._onCanConfirmChanged.bind(this));
this._serverEntry.connect('changed',
this._onCanConfirmChanged.bind(this));
this._nickEntry.connect('changed',
this._onCanConfirmChanged.bind(this));
this._realnameEntry.connect('changed',
this._onCanConfirmChanged.bind(this));
const rows = [
this._nameRow, this._serverRow, this._nickRow, this._realnameRow,
];
for (const row of rows) {
row.connect('changed', this._onCanConfirmChanged.bind(this));
row.get_delegate().activates_default = true;
}
this._sslSwitch.connect('notify::active',
this._onCanConfirmChanged.bind(this));
let realnameStore = new Gtk.ListStore();
realnameStore.set_column_types([GObject.TYPE_STRING]);
realnameStore.insert_with_values(-1, [0], [GLib.get_real_name()]);
const buffer = this._realnameRow.get_delegate().get_buffer();
const insertedTextId = buffer.connect('inserted-text', () => {
const text = this._realnameRow.get_text();
const realname = GLib.get_real_name();
if (!realname.startsWith(text))
return;
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
buffer.block_signal_handler(insertedTextId);
let completion = new Gtk.EntryCompletion({
model: realnameStore,
text_column: 0,
inline_completion: true,
popup_completion: false,
const startPos = GLib.utf8_strlen(text, -1);
this._realnameRow.insert_text(
realname.substring(text.length), -1, startPos);
this._realnameRow.select_region(startPos, -1);
buffer.unblock_signal_handler(insertedTextId);
return GLib.SOURCE_REMOVE;
});
});
this._realnameEntry.set_completion(completion);
this.reset();
}
setErrorHint(hint) {
if (hint === ErrorHint.SERVER)
this._serverEntry.add_css_class('error');
this._serverRow.add_css_class('error');
else
this._serverEntry.remove_css_class('error');
this._serverRow.remove_css_class('error');
if (hint === ErrorHint.NICK)
this._nickEntry.add_css_class('error');
this._nickRow.add_css_class('error');
else
this._nickEntry.remove_css_class('error');
this._nickRow.remove_css_class('error');
}
_getParams() {
let nameText = this._nameEntry.text.trim();
let serverText = this._serverEntry.text.trim();
let nameText = this._nameRow.text.trim();
let serverText = this._serverRow.text.trim();
let serverRegEx = /(.*?)(?::(\d{1,5}))?$/;
let [, server, port] = serverText.match(serverRegEx);
......@@ -334,11 +341,11 @@ class ConnectionDetails extends Gtk.Box {
let params = {
name: nameText.length ? nameText : server,
server,
account: this._nickEntry.text.trim(),
account: this._nickRow.text.trim(),
};
if (this._realnameEntry.text)
params.fullname = this._realnameEntry.text.trim();
if (this._realnameRow.text)
params.fullname = this._realnameRow.text.trim();
if (this._sslSwitch.active)
params.use_ssl = true;
if (port)
......@@ -356,16 +363,16 @@ class ConnectionDetails extends Gtk.Box {
this._savedRealname = '';
this._savedSSL = false;
this._nameEntry.text = this._savedName;
this._serverEntry.text = this._savedServer;
this._nickEntry.text = this._savedNick;
this._realnameEntry.text = this._savedRealname;
this._nameRow.text = this._savedName;
this._serverRow.text = this._savedServer;
this._nickRow.text = this._savedNick;
this._realnameRow.text = this._savedRealname;
this._sslSwitch.active = this._savedSSL;
if (this._serverEntry.visible)
this._serverEntry.grab_focus();
if (this._serverRow.visible)
this._serverRow.grab_focus();
else
this._nickEntry.grab_focus();
this._nickRow.grab_focus();
}
_onCanConfirmChanged() {
......@@ -388,23 +395,23 @@ class ConnectionDetails extends Gtk.Box {
if (this._savedServer !== account.display_name)
this._savedName = account.display_name;
this._serverEntry.text = this._savedServer;
this._nickEntry.text = this._savedNick;
this._realnameEntry.text = this._savedRealname;
this._nameEntry.text = this._savedName;
this._serverRow.text = this._savedServer;
this._nickRow.text = this._savedNick;
this._realnameRow.text = this._savedRealname;
this._nameRow.text = this._savedName;
this._sslSwitch.active = this._savedSSL;
}
// eslint-disable-next-line camelcase
get can_confirm() {
let paramsChanged = this._nameEntry.text !== this._savedName ||
this._serverEntry.text !== this._savedServer ||
this._nickEntry.text !== this._savedNick ||
this._realnameEntry.text !== this._savedRealname ||
let paramsChanged = this._nameRow.text !== this._savedName ||
this._serverRow.text !== this._savedServer ||
this._nickRow.text !== this._savedNick ||
this._realnameRow.text !== this._savedRealname ||
this._sslSwitch.active !== this._savedSSL;
return this._serverEntry.get_text_length() > 0 &&
this._nickEntry.get_text_length() > 0 &&
return this._serverRow.text.length > 0 &&
this._nickRow.text.length > 0 &&
paramsChanged;
}
......
......@@ -29,6 +29,7 @@ pkg.require({
});
pkg.requireSymbol('Gio', '2.0', 'Application.send_notification');
pkg.requireSymbol('GLib', '2.0', 'log_variant');
pkg.requireSymbol('Adw', '1', 'EntryRow');
if (!pkg.checkSymbol('Soup', '3.0'))
pkg.requireSymbol('Soup', '2.4');
......
......@@ -80,13 +80,18 @@ class SASLAuthHandler {
let account = this._channel.connection.get_account();
try {
const password = await Utils.lookupAccountPassword(account);
this._proxy.StartMechanismWithDataRemote(
await this._proxy.StartMechanismWithDataAsync(
'X-TELEPATHY-PASSWORD', password);
} catch (e) {
this._proxy.AbortSASLRemote(
await this._proxy.AbortSASLAsync(
SASLAbortReason.USER_ABORT,
'Password not available',
this._resetPrompt.bind(this));
'Password not available');
let prompt = new GLib.Variant('b', false);
let params = new GLib.Variant('a{sv}', { 'password-prompt': prompt });
await account.update_parameters_vardict_async(params, []);
await account.request_presence_async(Tp.ConnectionPresenceType.AVAILABLE,
'available', '', null);
}
}
......@@ -102,7 +107,7 @@ class SASLAuthHandler {
break;
case SASLStatus.SERVER_SUCCEEDED:
this._proxy.AcceptSASLRemote();
this._proxy.AcceptSASLAsync();
break;
case SASLStatus.SUCCEEDED:
......@@ -112,15 +117,6 @@ class SASLAuthHandler {
break;
}
}
async _resetPrompt() {
let account = this._channel.connection.get_account();
let prompt = new GLib.Variant('b', false);
let params = new GLib.Variant('a{sv}', { 'password-prompt': prompt });
await account.update_parameters_vardict_async(params, []);
await account.request_presence_async(Tp.ConnectionPresenceType.AVAILABLE,
'available', '', null);
}
}
export default GObject.registerClass(
......
......@@ -267,7 +267,7 @@ async function _clearPassword(schema, account) {
}
/**
* @typedef {Object} UrlMatch
* @typedef {object} UrlMatch
* @property {string} url - the matched URL
* @property {string} name - the user-visible name of the URL
* @property {number} pos - the position of the match
......