From 119b70091a3eb1d032610df2e084ca66f5bf5b4b Mon Sep 17 00:00:00 2001 From: wurstsalat Date: Sun, 12 Nov 2023 23:47:34 +0100 Subject: [length_notifier] 1.4.9 Fix spin setting in config dialog --- length_notifier/config_dialog.py | 28 ++++------------------------ length_notifier/plugin-manifest.json | 4 ++-- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/length_notifier/config_dialog.py b/length_notifier/config_dialog.py index b25e8af..4bfdd43 100644 --- a/length_notifier/config_dialog.py +++ b/length_notifier/config_dialog.py @@ -18,11 +18,9 @@ from __future__ import annotations from typing import Any from typing import TYPE_CHECKING -from gi.repository import GObject from gi.repository import Gtk from gajim.gtk.settings import SettingsDialog -from gajim.gtk.settings import SpinSetting from gajim.gtk.const import Setting from gajim.gtk.const import SettingKind from gajim.gtk.const import SettingType @@ -42,14 +40,14 @@ class LengthNotifierConfigDialog(SettingsDialog): self.plugin = plugin jids = self.plugin.config['JIDS'] or '' settings = [ - Setting('MessageLengthSpinSetting', # type: ignore + Setting(SettingKind.SPIN, _('Message Length'), SettingType.VALUE, - self.plugin.config['MESSAGE_WARNING_LENGTH'], + str(self.plugin.config['MESSAGE_WARNING_LENGTH']), callback=self._on_setting, data='MESSAGE_WARNING_LENGTH', desc=_('Message length at which the highlight is shown'), - props={'range_': (1, 1000)}, + props={'range_': (1, 1000, 1)}, ), Setting(SettingKind.COLOR, _('Color'), @@ -74,28 +72,10 @@ class LengthNotifierConfigDialog(SettingsDialog): _('Length Notifier Configuration'), Gtk.DialogFlags.MODAL, settings, - '', - extend=[('MessageLengthSpinSetting', # type: ignore - SizeSpinSetting)]) + '') def _on_setting(self, value: Any, data: Any) -> None: if isinstance(value, str): value.strip() self.plugin.config[data] = value self.plugin.update() - - -class SizeSpinSetting(SpinSetting): - - __gproperties__ = { - 'setting-value': (int, - 'Size', - '', - 1, - 1000, - 140, - GObject.ParamFlags.READWRITE), - } - - def __init__(self, *args: Any, **kwargs: Any) -> None: - SpinSetting.__init__(self, *args, **kwargs) diff --git a/length_notifier/plugin-manifest.json b/length_notifier/plugin-manifest.json index 1ffc083..841a8a3 100644 --- a/length_notifier/plugin-manifest.json +++ b/length_notifier/plugin-manifest.json @@ -13,8 +13,8 @@ "win32" ], "requirements": [ - "gajim>=1.5.0" + "gajim>=1.8.2" ], "short_name": "length_notifier", - "version": "1.4.8" + "version": "1.4.9" } \ No newline at end of file -- cgit v1.2.3