[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    KStandardAction and "Home" in konqueror
From:       David Faure <faure () kde ! org>
Date:       2007-10-15 15:07:47
Message-ID: 200710151707.47887.faure () kde ! org
[Download RAW message or body]

I got the question again today on IRC:
"in almost other apps that I know of (text editors, kpdf, kword, etc), Ctrl+Home goes \
to the top of the view/page.  but in Konqueror (and dolphin), it goes to ~... would \
it still be possible to change that? or rather, why was it chosen to be that?"

There is indeed a conflict with the Ctrl+Home shortcut, especially in konqueror.
How about we finally split "Begin" and "Home [page]"? We could use ALT+Home for
"Home page". Something like the attached patch [untested yet].
It will require porting the apps that were using Home for 'beginning of document',
otherwise they'll get the wrong shortcut.

PS: the patch is BIC but if I commit today that's OK, right? Otherwise I can move
the enum to the end but that's just uglier :)

-- 
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).


["kstandardstuff.diff" (text/x-diff)]

Index: shortcuts/kstandardshortcut.cpp
===================================================================
--- shortcuts/kstandardshortcut.cpp	(revision 725385)
+++ shortcuts/kstandardshortcut.cpp	(working copy)
@@ -87,8 +87,9 @@ static KStandardShortcutInfo g_infoStand
 	{ Replace,             I18N_NOOP2("@action","Replace"), 0,  CTRL(R), 0, \
KShortcut(), false },  
 //Group Navigation
-	{ Home,                I18N_NOOP2("@action Opposite to End","Home"), 0, CTRL(Home), \
                Qt::Key_HomePage, KShortcut(), false },
-	{ End,                 I18N_NOOP2("@action","End"), 0,      CTRL(End), 0, \
KShortcut(), false }, +	{ Home,                I18N_NOOP2("@action Go to main \
page","Home"), 0, ALT(Home), Qt::Key_HomePage, KShortcut(), false }, +	{ Begin,       \
I18N_NOOP2("@action Beginning of document","Begin"), 0, CTRL(Home), Qt::Key_Home, \
KShortcut(), false }, +	{ End,                 I18N_NOOP2("@action End of \
document","End"), 0,      CTRL(End), 0, KShortcut(), false },  { Prior,               \
I18N_NOOP2("@action","Prior"), 0,    Qt::Key_PageUp, 0,KShortcut(), false },  { Next, \
I18N_NOOP2("@action Opposite to Prior","Next"), 0, Qt::Key_PageDown, 0, KShortcut(), \
false },  
Index: shortcuts/kstandardshortcut.h
===================================================================
--- shortcuts/kstandardshortcut.h	(revision 725385)
+++ shortcuts/kstandardshortcut.h	(working copy)
@@ -36,7 +36,7 @@ namespace KStandardShortcut
 { // STUFF WILL BREAK IF YOU DON'T READ THIS!!!
   /*
    *Always add new std-accels to the end of this enum, never in the middle!
-   *Don't forget to add the corresponding entries in g_infoStandardShortcut[] in \
kstdaccel.cpp, too. +   *Don't forget to add the corresponding entries in \
                g_infoStandardShortcut[] in kstandardshortcut.cpp, too.
    *Values of elements here and positions of the corresponding entries in
    *the big array g_infoStandardShortcut[] ABSOLUTELY MUST BE THE SAME.
    * !!!    !!!!   !!!!!    !!!!
@@ -60,7 +60,7 @@ namespace KStandardShortcut
     SelectAll, Deselect, DeleteWordBack, DeleteWordForward,
     Find, FindNext, FindPrev, Replace,
     // Navigation
-    Home, End, Prior, Next,
+    Home, Begin, End, Prior, Next,
     Up, Back, Forward, Reload,
     // Text Navigation
     BeginningOfLine, EndOfLine, GotoLine,
Index: actions/kstandardaction.h
===================================================================
--- actions/kstandardaction.h	(revision 725385)
+++ actions/kstandardaction.h	(working copy)
@@ -135,7 +135,7 @@ namespace KStandardAction
     Zoom, Redisplay,
 
     // Go Menu
-    Up, Back, Forward, Home, Prior, Next, Goto, GotoPage, GotoLine,
+    Up, Back, Forward, Home /*Home page*/, Prior, Next, Goto, GotoPage, GotoLine,
     FirstPage, LastPage,
 
     // Bookmarks Menu
Index: actions/kstandardaction.cpp
===================================================================
--- actions/kstandardaction.cpp	(revision 725385)
+++ actions/kstandardaction.cpp	(working copy)
@@ -81,7 +81,7 @@ KAction *create(StandardAction id, const
         break;
 
       case Home:
-        sLabel = i18nc( "beginning (of line)", "&Home" );
+        sLabel = i18nc( "home page", "&Home" );
         break;
       case Help:
         sLabel = i18nc( "show help", "&Help" );
Index: actions/kstandardaction_p.h
===================================================================
--- actions/kstandardaction_p.h	(revision 725385)
+++ actions/kstandardaction_p.h	(working copy)
@@ -85,7 +85,7 @@ static const KStandardActionInfo g_rgAct
   { Goto,          KStandardShortcut::AccelNone, "go_goto", I18N_NOOP("&Go To..."), \
0, 0 },  { GotoPage,      KStandardShortcut::AccelNone, "go_goto_page", \
I18N_NOOP("&Go to Page..."), 0, "go-jump" },  { GotoLine,      \
                KStandardShortcut::GotoLine, "go_goto_line", I18N_NOOP("&Go to \
                Line..."), 0, 0 },
-  { FirstPage,     KStandardShortcut::Home, "go_first", I18N_NOOP("&First Page"), 0, \
"go-first" }, +  { FirstPage,     KStandardShortcut::Begin, "go_first", \
I18N_NOOP("&First Page"), 0, "go-first" },  { LastPage,      KStandardShortcut::End, \
"go_last", I18N_NOOP("&Last Page"), 0, "go-last" },  
   { AddBookmark,   KStandardShortcut::AddBookmark, "bookmark_add", I18N_NOOP("&Add \
Bookmark"), 0, "bookmark-new" },



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic