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

List:       kde-core-devel
Subject:    [PATCH] different Back/Previous actions for web/document Go menu
From:       Pino Toscano <toscano.pino () tiscali ! it>
Date:       2007-12-21 0:58:25
Message-ID: 200712210158.34193.toscano.pino () tiscali ! it
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Hi,

talking with David about the merging in Konqueror of the Go menu coming from 
thehosted kpart's, one of the problems faced is that the Back and Forward 
actions in the Go menu can have different (and valid) usages depending which 
type of Go they are (eg go_web for web navigation, and go_document for 
document navigation).
As document viewers can provide their behaviour (document-based) for those, it 
would clash with the counterparts for Konqueror history navigation.

So, this patch extracts the document-based actions in own actions, but it adds 
two new strings in the kdelibs4.po catalog (CC'ed kde-i18n-doc for this).

Can this patch be applied on next monday?

-- 
Pino Toscano

["kdelibs-godocument.diff" (text/x-diff)]

Index: actions/kstandardaction.h
===================================================================
--- actions/kstandardaction.h	(revisione 751062)
+++ actions/kstandardaction.h	(copia locale)
@@ -136,7 +136,7 @@
 
     // Go Menu
     Up, Back, Forward, Home /*Home page*/, Prior, Next, Goto, GotoPage, GotoLine,
-    FirstPage, LastPage,
+    FirstPage, LastPage, DocumentBack, DocumentForward,
 
     // Bookmarks Menu
     AddBookmark, EditBookmarks,
@@ -453,6 +453,16 @@
   KDEUI_EXPORT KAction *lastPage(const QObject *recvr, const char *slot, QObject \
*parent);  
   /**
+   * Move back (document style menu).
+   */
+  KDEUI_EXPORT KAction *documentBack(const QObject *recvr, const char *slot, QObject \
*parent); +
+  /**
+   * Move forward (document style menu).
+   */
+  KDEUI_EXPORT KAction *documentForward(const QObject *recvr, const char *slot, \
QObject *parent); +
+  /**
    * Add the current page to the bookmarks tree.
    */
   KDEUI_EXPORT KAction *addBookmark(const QObject *recvr, const char *slot, QObject \
                *parent);
Index: actions/kstandardaction.cpp
===================================================================
--- actions/kstandardaction.cpp	(revisione 751062)
+++ actions/kstandardaction.cpp	(copia locale)
@@ -112,6 +112,12 @@
 
       if ( id == Next )
         iconName = "edit-find-previous";
+
+      if ( id == DocumentBack )
+        iconName = "go-next";
+
+      if ( id == DocumentForward )
+        iconName = "go-previous";
     }
 
     QIcon icon = iconName.isEmpty() ? KIcon() : KIcon(iconName);
@@ -392,6 +398,16 @@
   return KStandardAction::create( LastPage, recvr, slot, parent );
 }
 
+KAction *documentBack( const QObject *recvr, const char *slot, QObject *parent )
+{
+  return KStandardAction::create( DocumentBack, recvr, slot, parent );
+}
+
+KAction *documentForward( const QObject *recvr, const char *slot, QObject *parent )
+{
+  return KStandardAction::create( DocumentForward, recvr, slot, parent );
+}
+
 KAction *addBookmark( const QObject *recvr, const char *slot, QObject *parent )
 {
   return KStandardAction::create( AddBookmark, recvr, slot, parent );
Index: actions/kstandardaction_p.h
===================================================================
--- actions/kstandardaction_p.h	(revisione 751062)
+++ actions/kstandardaction_p.h	(copia locale)
@@ -87,6 +87,8 @@
   { GotoLine,      KStandardShortcut::GotoLine, "go_goto_line", I18N_NOOP("&Go to \
Line..."), 0, 0 },  { FirstPage,     KStandardShortcut::Begin, "go_first", \
I18N_NOOP("&First Page"), 0, "go-first" },  { LastPage,      KStandardShortcut::End, \
"go_last", I18N_NOOP("&Last Page"), 0, "go-last" }, +  { DocumentBack,  \
KStandardShortcut::AccelNone, "go_document_back", I18N_NOOP("&Back in the Document"), \
0, "go-previous" }, +  { DocumentForward, KStandardShortcut::AccelNone, \
"go_document_forward", I18N_NOOP("&Forward in the Document"), 0, "go-next" },  
   { AddBookmark,   KStandardShortcut::AddBookmark, "bookmark_add", I18N_NOOP("&Add \
Bookmark"), 0, "bookmark-new" },  { EditBookmarks, KStandardShortcut::AccelNone, \
                "bookmark_edit", I18N_NOOP("&Edit Bookmarks"), 0, "bookmark" },
Index: xmlgui/ui_standards.rc
===================================================================
--- xmlgui/ui_standards.rc	(revisione 751062)
+++ xmlgui/ui_standards.rc	(copia locale)
@@ -130,6 +130,9 @@
     <Action name="go_first"/>
     <Action name="go_last"/>
     <Separator/>
+    <Action name="go_document_back"/>
+    <Action name="go_document_forward"/>
+    <Separator/>
     <MergeLocal/>
   </Menu>
   <MergeLocal/>


["signature.asc" (application/pgp-signature)]

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

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