Re: Cleaning default keyboard layouts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Michele

07.05.23 16:03, Michele Calgaro via tde-users wrote:
On 2023/05/07 08:53 PM, Roman Savochenko via tde-users wrote:
I am going to test the patch some time yet.
Thanks for the patch Roman. Please feedback after "the test" and we will then look at merging it.

So, I have expanded and widely tested the patch and it performs:
• preventing translation untranslatable messages like to "grp" and keys
• loading the system XKB configuration at disabling TDE Layouts with overriding the XKB options from the tab "Options Xkb"
• applying TDE Layouts at its enable

Also I removed the controversial part "Modes" in the tab "Options Xkb"!

Now that fine works for me.

Regards. Roman
--- tdebase-trinity-14.1.0/kxkb/kcmlayout.cpp~	2023-04-12 17:41:00.000000000 +0300
+++ tdebase-trinity-14.1.0/kxkb/kcmlayout.cpp	2023-05-07 14:05:01.468389428 +0300
@@ -246,7 +246,7 @@
 	widget->radFlagOnly->setChecked( showFlag && !showLabel );
 	widget->radLabelOnly->setChecked( !showFlag && showLabel );
 
-	widget->xkbOptsMode->setButton(m_kxkbConfig.m_resetOldOptions ? 0 : 1);
+	//widget->xkbOptsMode->setButton(m_kxkbConfig.m_resetOldOptions ? 0 : 1);
 
 	widget->grpLabel->setButton( ( m_kxkbConfig.m_useThemeColors ? 0 : 1 )  );
 	widget->bgColor->setColor( m_kxkbConfig.m_colorBackground );
@@ -287,7 +287,8 @@
 	widget->indOptsFrame->setEnabled( m_kxkbConfig.m_useKxkb );
 
 	// display xkb options
-	TQStringList activeOptions = TQStringList::split(',', m_kxkbConfig.m_options);
+	TQStringList activeOptions = TQStringList::split(",", XKBExtension::getServerOptions());
+				     //TQStringList::split(',', m_kxkbConfig.m_options);
 	bool foundGrp = false;
 	for (TQStringList::ConstIterator it = activeOptions.begin(); it != activeOptions.end(); ++it)
 	{
@@ -299,7 +300,7 @@
 			foundGrp = true;
 		}
 
-		OptionListItem *item = m_optionGroups[i18n(optionKey.latin1())];
+		OptionListItem *item = m_optionGroups[optionKey.latin1()];
 
 		if (item != NULL) {
 			OptionListItem *child = item->findChildItem( option );
@@ -332,7 +332,7 @@
 	TQString model = lookupLocalized(m_rules->models(), widget->comboModel->currentText());
 	m_kxkbConfig.m_model = model;
 
-	m_kxkbConfig.m_resetOldOptions = widget->radXkbOverwrite->isOn();
+	m_kxkbConfig.m_resetOldOptions = true;// widget->radXkbOverwrite->isOn();
 	m_kxkbConfig.m_options = createOptionString();
 
 	m_kxkbConfig.m_useThemeColors = widget->radLabelUseTheme->isChecked();
@@ -650,9 +650,9 @@
   connect(listView, TQT_SIGNAL(clicked(TQListViewItem *)), TQT_SLOT(resolveConflicts(TQListViewItem *)));
   connect(listView, TQT_SIGNAL(clicked(TQListViewItem *)), TQT_SLOT(updateHotkeyCombo()));
 
-  connect(widget->xkbOptsMode, TQT_SIGNAL(released(int)), TQT_SLOT(changed()));
-  connect(widget->xkbOptsMode, TQT_SIGNAL(released(int)), TQT_SLOT(updateOptionsCommand()));
-  connect(widget->xkbOptsMode, TQT_SIGNAL(released(int)), TQT_SLOT(updateHotkeyCombo()));
+  //connect(widget->xkbOptsMode, TQT_SIGNAL(released(int)), TQT_SLOT(changed()));
+  //connect(widget->xkbOptsMode, TQT_SIGNAL(released(int)), TQT_SLOT(updateOptionsCommand()));
+  //connect(widget->xkbOptsMode, TQT_SIGNAL(released(int)), TQT_SLOT(updateHotkeyCombo()));
 
   //Create controllers for all options
   TQDictIterator<char> it(m_rules->options());
@@ -681,7 +682,7 @@
             TQCheckListItem::CheckBoxController, it.currentKey());
       }
       parent->setOpen(true);
-      m_optionGroups.insert(i18n(it.currentKey().local8Bit()), parent);
+      m_optionGroups.insert(it.currentKey().local8Bit(), parent);
     }
   }
 
@@ -719,7 +719,7 @@
 {
   TQString setxkbmap;
   TQString options = createOptionString();
-  bool overwrite = widget->radXkbOverwrite->isOn();
+  bool overwrite = true; //widget->radXkbOverwrite->isOn();
 
   if( !options.isEmpty() ) {
     setxkbmap = "setxkbmap -option "; //-rules " + m_rule
@@ -817,7 +818,7 @@
     kdDebug() << "resolveConflicts : " << current->optionName() << endl;
 
     if (current->optionName().startsWith("grp:")) {
-        OptionListItem *grpItem = m_optionGroups[i18n("grp")];
+        OptionListItem *grpItem = m_optionGroups["grp"];
         if (grpItem == NULL) {
             kdWarning() << "LayoutConfig: cannot find grp item group" << endl;
             return;
@@ -947,7 +948,7 @@
 }
 
 void LayoutConfig::updateHotkeyCombo(bool initial) {
-    OptionListItem *grpItem = m_optionGroups[i18n("grp")];
+    OptionListItem *grpItem = m_optionGroups["grp"];
     if (grpItem == NULL) {
         kdWarning() << "LayoutConfig: cannot find grp item group" << endl;
         return;
@@ -956,7 +956,7 @@
     TQStringList hotkeys;
 
     // Get server options first
-    if (initial || widget->xkbOptsMode->selectedId() == 1)
+    if (initial /*|| widget->xkbOptsMode->selectedId() == 1*/)
     {
         TQStringList opts = TQStringList::split(",", XKBExtension::getServerOptions());
         for (TQStringList::Iterator it = opts.begin(); it != opts.end(); ++it)
@@ -1051,7 +1052,7 @@
         }
     }
 
-    OptionListItem *grpItem = m_optionGroups[i18n("grp")];
+    OptionListItem *grpItem = m_optionGroups["grp"];
     if (grpItem == NULL) {
         kdWarning() << "LayoutConfig: cannot find grp item group" << endl;
         return;
@@ -1214,14 +1215,17 @@
 		KxkbConfig m_kxkbConfig;
 		m_kxkbConfig.load(KxkbConfig::LOAD_INIT_OPTIONS);
 
-		if( m_kxkbConfig.m_useKxkb == true ) {
+		if( m_kxkbConfig.m_useKxkb == true )
 			kapp->startServiceByDesktopName("kxkb");
+
+		XkbOptions opts = m_kxkbConfig.getKXkbOptions();
+		//Only Xkb options processing for compatibility
+		if(!m_kxkbConfig.m_useKxkb) {
+		    opts.layouts = opts.variants = opts.model = "";
+		    opts.resetOld = false;
 		}
-		else {
-			if (!XKBExtension::setXkbOptions(m_kxkbConfig.getKXkbOptions())) {
-				kdDebug() << "Setting XKB options failed!" << endl;
-			}
-		}
+		if(!XKBExtension::setXkbOptions(opts))
+		    kdDebug() << "Setting XKB options failed!" << endl;
 	}
 }
 
--- tdebase-trinity-14.1.0/kxkb/kxkb.cpp~	2023-04-12 17:41:00.000000000 +0300
+++ tdebase-trinity-14.1.0/kxkb/kxkb.cpp	2023-05-07 14:09:17.115729594 +0300
@@ -99,16 +99,19 @@
 
 bool KXKBApp::settingsRead()
 {
-	XkbOptions options = kxkbConfig.getKXkbOptions();
-	if( !m_extension->setXkbOptions(options) ) {
-		kdDebug() << "Setting XKB options failed!" << endl;
-	}
+    XkbOptions options = kxkbConfig.getKXkbOptions();
+    //Only Xkb options processing for compatibility
+    if(!kxkbConfig.m_useKxkb) {
+	options.layouts = options.variants = options.model = "";
+	options.resetOld = false;
+    }
+    if(!m_extension->setXkbOptions(options))
+	kdDebug() << "Setting XKB options failed!" << endl;
 
     if ( kxkbConfig.m_useKxkb == false ) {
         kapp->quit();
         return false;
     }
-	
 	m_prevWinId = X11Helper::UNKNOWN_WINDOW_ID;
 	
 	if( kxkbConfig.m_switchingPolicy == SWITCH_POLICY_GLOBAL ) {

--- tdebase-trinity-14.1.0/kxkb/extension.cpp~	2023-04-12 17:41:00.000000000 +0300
+++ tdebase-trinity-14.1.0/kxkb/extension.cpp	2023-05-12 22:56:33.083599713 +0300
@@ -114,7 +114,10 @@
 	if (!options.options.isEmpty()) {
 		p << "-option";
 
-		if (options.resetOld)
+		p << "-option";
+		p << options.options;
+
+		/*if (options.resetOld)
 		{
 			p << options.options;
 		}
@@ -133,7 +136,7 @@
 				}
 			}
 			p << newOptions.join(",");
-		}
+		}*/
 	}
 
 	kdDebug() << "[setXkbOptions] Command: " << p.args() << endl;
--- tdebase-trinity-14.1.0/kxkb/kcmlayoutwidget.ui~	2023-04-12 17:41:00.000000000 +0300
+++ tdebase-trinity-14.1.0/kxkb/kcmlayoutwidget.ui	2023-05-12 21:44:32.530253875 +0300
@@ -1048,7 +1048,7 @@
                             </widget>
                         </grid>
                     </widget>
-                    <widget class="TQButtonGroup">
+                    <!--<widget class="TQButtonGroup">
                         <property name="name">
                             <cstring>xkbOptsMode</cstring>
                         </property>
@@ -1082,7 +1082,7 @@
                                 </property>
                             </widget>
                         </vbox>
-                    </widget>
+                    </widget>-->
                 </vbox>
             </widget>
         </widget>
BEGIN:VCARD
VERSION:4.0
EMAIL;PREF=1:roman@xxxxxxxxxx
FN:Roman Savochenko
ORG:OpenSCADA Team;
TITLE:OpenSCADA author and main developer
N:Savochenko;Roman;;;
ADR:;;;Kamjanske;Sicheslavska;51939;Ukraine
TEL;VALUE=TEXT:+380679859815
URL;TYPE=work;VALUE=URL:http://oscada.org
UID:bc92ca63-75ca-498b-801c-54be2b34328e
END:VCARD
____________________________________________________
tde-users mailing list -- users@xxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxx
Web mail archive available at https://mail.trinitydesktop.org/mailman3/hyperkitty/list/users@xxxxxxxxxxxxxxxxxx

[Index of Archives]     [Trinity Devel]     [KDE]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]     [Trinity Desktop Environment]

  Powered by Linux