From e8208c1dfb4dcd17b1168ac2614aa8d5b761f3fd Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Fri, 10 Feb 2023 14:57:28 +0200 Subject: Kxkb: improve TDE Control Centre module. 1) Add conflicts check for hotkey checkboxes Due to the ability to set multiple keyboard layout switching hotkeys, it is important to inform the user of conflicting options that are not handled properly by the X.org server when set at the same time (e.g. Win+Space and Alt+Space). This change adds a warning that informs the user about the problem and the conflicting options. This warning is shown only when setting multiple hotkeys via the Xkb options tab, which is for the advanced user. Most users will ever need only one hotkey, and the combobox on the first tab should be more than enough. 2) Add "none" item to layout switching options 3) Replace Reset old options checkbox with radio buttons As per discussion, this makes the function of the option more apparent. WhatIs hints have been added for additional clarity. 4) Update hotkey combobox per server options 5) Avoid duplication of options by querying Xkb for already set options. This was a problem in Append Mode in which `setxkbmap` strings would get too long due to setting already set options. This code checks for already set options and omits them from the new `setxkbmap` call. This does not apply to Overwrite Mode. 6) Overwrite previous grp: options when using the combobox See previous commit message about the addition of hotkeys combobox. Signed-off-by: Mavridis Philippe --- kxkb/kcmlayout.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kxkb/kcmlayout.h') diff --git a/kxkb/kcmlayout.h b/kxkb/kcmlayout.h index e16c09bf7..cfb748c10 100644 --- a/kxkb/kcmlayout.h +++ b/kxkb/kcmlayout.h @@ -31,6 +31,7 @@ public: protected: TQString createOptionString(); void updateIndicator(TQListViewItem* selLayout); + OptionListItem* itemForOption(TQString option); protected slots: void moveUp(); @@ -43,8 +44,10 @@ protected slots: void updateLayoutCommand(); void updateOptionsCommand(); void updateHotkeyCombo(); + void updateHotkeyCombo(bool initial); void add(); void remove(); + void resolveConflicts(TQListViewItem *lvi); void changed(); @@ -54,10 +57,13 @@ private: XkbRules *m_rules; KxkbConfig m_kxkbConfig; TQDict m_optionGroups; + bool m_forceGrpOverwrite; TQWidget* makeOptionsTab(); void updateStickyLimit(); static LayoutUnit getLayoutUnitKey(TQListViewItem *sel); + void checkConflicts(OptionListItem *current, TQStringList conflicting, + TQStringList &conflicts); }; -- cgit v1.2.1