Bug 76652 - cannot change shortcut for "delete word right" to Ctrl + T
Summary: cannot change shortcut for "delete word right" to Ctrl + T
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 73982 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-03 14:37 UTC by Filepra
Modified: 2004-08-22 05:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Filepra 2004-03-03 14:37:32 UTC
Version:            (using KDE KDE 3.2.0)
OS:          Linux

In kate, I changed shortcut for "Delete word right" to Ctrl+T in Configure shortcuts dialog. When I restart kate, shortcuts are broken: Ctrl+T does nothing and End and Home keys too. 

What I learned:
Ctrl+T is by default assigned to "Transpose characters". Assigning Ctrl+T to any action doesn't work. 
When I remove "Transpose Characters" KAction
from kdelibs/kate/part/kateview.cpp , everything starts to work.
Comment 1 cryst 2004-03-05 05:28:18 UTC
I can confirm this behaviour (I was going to submit a bug report on it myself).
Also of not Transpose Characters is the LAST item in the list of actions. (could be off by one error?) 

This error occurs in Kate and kdevelop.
Comment 2 Anders Lund 2004-03-16 01:16:18 UTC
What steps do you do to assign c-t to an other command? As long as the conflick is in the same collection (as is the case with Transpose Characters and Delete Word Right), a warning is issued since forever (handled by the shortcut config widget).

However, I know that there has been problems with changing the editor shortcuts since a forever as well, so it's time we try to get it right :)
Comment 3 cryst 2004-03-16 04:51:45 UTC
I'm aware of the warning, and although the steps taken would give the warning, the problem isn't in the assigning. It's that the reassigning messes keystrokes up. 

Steps Taken:
1. Settings->Configure Kate
2. Shortcuts
3. Select Delete Work Right
4. Custom
5. Ctrl-T
6. Say yes to the warning.

Now go back to the editor and push home or end (as two examples) and notice the cursor doesn't go to the beginning or end of the line.
Comment 4 Filepra 2004-03-16 13:44:10 UTC
I did

1. Settings->Configure Kate
2. Shortcuts
3. Select Transpose Characters
4. None
5. Select Delete Work Right
6. Custom
7. Ctrl-T

with the same result.
Comment 5 Anders Lund 2004-03-25 11:59:13 UTC
CVS commit by alund: 

Attempt to make setting editor shortcuts work:
* Use a group "Katepart Shortcuts" rather than "Shortcuts" (to avoid conflicts)
It seems that this makes changed keys work for new views.
Shortcuts allready assigned must still be unassigned in a seperate config dialog
session. Settings are correctly restored when the application is restarted.

I'll backport in a while, if everything works as expected.

CCMAIL: 76652@bugs.kde.org


  M +3 -1      katedialogs.cpp   1.112
  M +1 -0      katedialogs.h   1.60
  M +12 -7     kateview.cpp   1.338


--- kdelibs/kate/part/kateview.cpp  #1.337:1.338
@@ -407,5 +406,5 @@ void KateView::setupActions()
 void KateView::setupEditActions()
 {
-  m_editActions = new KActionCollection( m_viewInternal );
+  m_editActions = new KActionCollection( m_viewInternal, this, "edit_actions" );
   KActionCollection* ac = m_editActions;
 
@@ -564,4 +563,6 @@ void KateView::setupEditActions()
            this, SLOT(slotLostFocus()) );
 
+  m_editActions->readShortcutSettings( "Katepart Shortcuts" );
+
   if( hasFocus() )
     slotGotFocus();
@@ -569,5 +570,5 @@ void KateView::setupEditActions()
     slotLostFocus();
 
-  m_editActions->readShortcutSettings();
+
 }
 
@@ -871,4 +872,5 @@ void KateView::gotoLine()
 void KateView::gotoLineNumber( int line )
 {
+  kdDebug()<<"=== gotoLineNumber( "<<line<<" )"<<endl;
   setCursorPositionInternal ( line, 0, 1 );
 }
@@ -889,4 +891,7 @@ void KateView::joinLines()
 void KateView::readSessionConfig(KConfig *config)
 {
+  kdDebug()<<"KateView::readSessionConfig("<<config<<")"<<endl;
+  kdDebug()<<"group: "<<config->group()<<endl;
+  kdDebug()<<"cursor position: "<<config->readNumEntry("CursorLine")<<", "<<config->readNumEntry("CursorColumn")<<endl;
   setCursorPositionInternal (config->readNumEntry("CursorLine"), config->readNumEntry("CursorColumn"), 1);
 }
@@ -1093,5 +1098,5 @@ void KateView::updateConfig ()
     return;
 
-  m_editActions->readShortcutSettings();
+  m_editActions->readShortcutSettings( "Katepart Shortcuts" );
 
   // dyn. word wrap & markers

--- kdelibs/kate/part/katedialogs.cpp  #1.111:1.112
@@ -676,4 +676,5 @@ void KateEditKeyConfiguration::showEvent
     (new QVBoxLayout(this))->setAutoAdd(true);
     KateView* view = (KateView*)m_doc->views().at(0);
+    m_ac = view->editActionCollection();
     m_keyChooser = new KKeyChooser( view->editActionCollection(), this, false );
     connect( m_keyChooser, SIGNAL( keyChange() ), this, SLOT( slotChanged() ) );
@@ -690,5 +691,6 @@ void KateEditKeyConfiguration::apply()
   if (m_ready)
   {
-    m_keyChooser->save();
+    m_keyChooser->commitChanges();
+    m_ac->writeShortcutSettings( "Katepart Shortcuts" );
   }
 }

--- kdelibs/kate/part/katedialogs.h  #1.59:1.60
@@ -239,4 +239,5 @@ class KateEditKeyConfiguration: public K
     class KateDocument *m_doc;
     KKeyChooser* m_keyChooser;
+    class KActionCollection *m_ac;
 };
 


Comment 6 Anders Lund 2004-03-30 21:41:43 UTC
CVS commit by alund: 

Backport: Use a dedicated group for saving the editor shortcuts.
It is now possible to set shortcuts for the editor, and they will be
remembered. to set a shortcut that is allready used, either restart the
editor, or use two config sessions.

CCMAIL: 76652@bugs.kde.org


  M +30 -28    katedialogs.cpp   1.106.2.2
  M +14 -13    katedialogs.h   1.55.2.1
  M +2 -2      kateview.cpp   1.333.2.4


--- kdelibs/kate/part/katedialogs.cpp  #1.106.2.1:1.106.2.2
@@ -668,7 +668,8 @@ void EditKeyConfiguration::showEvent ( Q
     (new QVBoxLayout(this))->setAutoAdd(true);
     KateView* view = (KateView*)m_doc->views().at(0);
-    m_keyChooser = new KKeyChooser( view->editActionCollection(), this, false );
+    m_ac = view->editActionCollection();
+    m_keyChooser = new KKeyChooser( m_ac, this, false );
     connect( m_keyChooser, SIGNAL( keyChange() ), this, SLOT( slotChanged() ) );
-    m_keyChooser->show ();
+    m_keyChooser->show();
 
     m_ready = true;
@@ -682,5 +683,6 @@ void EditKeyConfiguration::apply()
   if (m_ready)
   {
-    m_keyChooser->save();
+    m_keyChooser->commitChanges();
+    m_ac->writeShortcutSettings( "Katepart Shortcuts" );
   }
 }

--- kdelibs/kate/part/katedialogs.h  #1.55:1.55.2.1
@@ -238,4 +238,5 @@ class EditKeyConfiguration: public KateC
     bool m_ready;
     class KateDocument *m_doc;
+    class KActionCollection *m_ac;
     KKeyChooser* m_keyChooser;
 };

--- kdelibs/kate/part/kateview.cpp  #1.333.2.3:1.333.2.4
@@ -569,5 +569,5 @@ void KateView::setupEditActions()
     slotLostFocus();
 
-  m_editActions->readShortcutSettings();
+  m_editActions->readShortcutSettings( "Katepart Shortcuts" );
 }
 
@@ -1095,5 +1095,5 @@ void KateView::updateConfig ()
     return;
 
-  m_editActions->readShortcutSettings();
+  m_editActions->readShortcutSettings( "Katepart Shortcuts" );
 
   // dyn. word wrap & markers


Comment 7 Jan Villat 2004-05-31 01:06:42 UTC
*** Bug 73982 has been marked as a duplicate of this bug. ***
Comment 8 Christoph Cullmann 2004-08-21 16:57:42 UTC
works in kde 3.3.0
Comment 9 cryst 2004-08-22 05:48:34 UTC
Does NOT work in Kate in 3.3.0
Note that we aren't talking about Settings/Configure Shortcuts,
We are talking about Settings/Configure Kate/Shortcuts