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

List:       kde-commits
Subject:    KDE/kdepim/akregator/src
From:       Frank Osterfeld <frank.osterfeld () kdemail ! net>
Date:       2009-12-05 20:02:16
Message-ID: 1260043336.707854.9644.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1059092 by osterfeld:

merge from 4.3 branch
------------------------------------------------------------------------
r996539 | osterfeld | 2009-07-14 16:08:16 +0200 (Tue, 14 Jul 2009) | 11 lines

This patch enables ctrl-+ and ctrl-- again to enlarge/shrink the font of the
articleviewer (font != zoom). These two actions are also added to the "View"
menu.
Additionally actions for print (ctrl-p) and copy (ctrl-c) now also work again
with shortcuts and are configurable in the shortcut configuration menu.

Patch by Alexander Elbs

BUG: 163391


------------------------------------------------------------------------


 M  +21 -0     actionmanagerimpl.cpp  
 M  +3 -0      akregator_part.rc  
 M  +15 -28    articleviewer.cpp  
 M  +2 -2      articleviewer.rc  
 M  +2 -2      pageviewer.cpp  
 M  +2 -2      pageviewer.rc  


--- trunk/KDE/kdepim/akregator/src/actionmanagerimpl.cpp #1059091:1059092
@@ -409,6 +409,27 @@
         return;
     else
         d->articleViewer = articleViewer;
+
+    KActionCollection* coll = actionCollection();
+    KAction* action = 0;
+
+    action = KStandardAction::print(articleViewer, SLOT(slotPrint()), actionCollection());
+    coll->addAction("viewer_print", action);
+
+    action = KStandardAction::copy(articleViewer, SLOT(slotCopy()), coll);
+    coll->addAction("viewer_copy", action);
+
+    action = coll->addAction("inc_font_sizes");
+    action->setIcon(KIcon("zoom-in"));
+    action->setText(i18n("&Increase Font Sizes"));
+    connect(action, SIGNAL(triggered(bool)), articleViewer, SLOT(slotZoomIn()));
+    action->setShortcut( QKeySequence::ZoomIn );
+
+    action = coll->addAction("dec_font_sizes");
+    action->setIcon(KIcon("zoom-out"));
+    action->setText(i18n("&Decrease Font Sizes"));
+    connect(action, SIGNAL(triggered(bool)), articleViewer, SLOT(slotZoomOut()));
+    action->setShortcut( QKeySequence::ZoomOut );
 }
 
 void ActionManagerImpl::initArticleListView(ArticleListView* articleList)
--- trunk/KDE/kdepim/akregator/src/akregator_part.rc #1059091:1059092
@@ -22,6 +22,9 @@
       <Action name="normal_view"/>
       <Action name="widescreen_view"/>
       <Action name="combined_view"/>
+      <Separator/>
+      <Action name="inc_font_sizes"/>
+      <Action name="dec_font_sizes"/>
     </Menu>
 
     <Menu name="go">
--- trunk/KDE/kdepim/akregator/src/articleviewer.cpp #1059091:1059092
@@ -93,6 +93,7 @@
 
     setFocusProxy( m_part->widget() );
 
+    m_part->setFontScaleFactor(100);
     m_part->setZoomFactor(100);
     m_part->setJScriptEnabled(false);
     m_part->setJavaEnabled(false);
@@ -126,25 +127,8 @@
                          KParts::WindowArgs,
                          KParts::ReadOnlyPart**)));
 
-    QAction* action = 0;
-    action = KStandardAction::print(this, SLOT(slotPrint()), m_part->actionCollection());
-    m_part->actionCollection()->addAction("viewer_print", action);
+    KAction* action = 0;
 
-    action = KStandardAction::copy(this, SLOT(slotCopy()), m_part->actionCollection());
-    m_part->actionCollection()->addAction("viewer_copy", action);
-
-    action = m_part->actionCollection()->addAction("incFontSizes");
-    action->setIcon(KIcon("zoom-in"));
-    action->setText(i18n("&Increase Font Sizes"));
-    connect(action, SIGNAL(triggered(bool)), SLOT(slotZoomIn()));
-    action->setShortcut( QKeySequence( Qt::CTRL+Qt::Key_Plus ) );
-
-    action = m_part->actionCollection()->addAction("decFontSizes");
-    action->setIcon(KIcon("zoom-out"));
-    action->setText(i18n("&Decrease Font Sizes"));
-    connect(action, SIGNAL(triggered(bool)), SLOT(slotZoomOut()));
-    action->setShortcut( QKeySequence(  Qt::CTRL + Qt::Key_Minus ) );
-
     action = m_part->actionCollection()->addAction("copylinkaddress");
     action->setText(i18n("Copy &Link Address"));
     connect(action, SIGNAL(triggered(bool) ), SLOT(slotCopyLinkAddress()));
@@ -265,13 +249,16 @@
     {
         if (isSelection)
         {
-            popup.addAction( m_part->action("viewer_copy") );
+            popup.addAction( ActionManager::getInstance()->action("viewer_copy") );
             popup.addSeparator();
         }
-        popup.addAction( m_part->action("viewer_print") );
+        popup.addAction( ActionManager::getInstance()->action("viewer_print") );
        //KAction *ac = action("setEncoding");
        //if (ac)
        //     ac->plug(&popup);
+        popup.addSeparator();
+        popup.addAction( ActionManager::getInstance()->action("inc_font_sizes") );
+        popup.addAction( ActionManager::getInstance()->action("dec_font_sizes") );
     }
     popup.exec(p);
 }
@@ -299,7 +286,7 @@
 
 void ArticleViewer::slotSelectionChanged()
 {
-    m_part->action("viewer_copy")->setEnabled(!m_part->selectedText().isEmpty());
+    ActionManager::getInstance()->action("viewer_copy")->setEnabled(!m_part->selectedText().isEmpty());
 }
 
 void ArticleViewer::slotOpenLinkInternal()
@@ -362,37 +349,37 @@
 
 void ArticleViewer::slotZoomIn()
 {
-    int zf = m_part->zoomFactor();
+    int zf = m_part->fontScaleFactor();
     if (zf < 100)
     {
         zf = zf - (zf % 20) + 20;
-        m_part->setZoomFactor(zf);
+        m_part->setFontScaleFactor(zf);
     }
     else
     {
         zf = zf - (zf % 50) + 50;
-        m_part->setZoomFactor(zf < 300 ? zf : 300);
+        m_part->setFontScaleFactor(zf < 300 ? zf : 300);
     }
 }
 
 void ArticleViewer::slotZoomOut()
 {
-    int zf = m_part->zoomFactor();
+    int zf = m_part->fontScaleFactor();
     if (zf <= 100)
     {
         zf = zf - (zf % 20) - 20;
-        m_part->setZoomFactor(zf > 20 ? zf : 20);
+        m_part->setFontScaleFactor(zf > 20 ? zf : 20);
     }
     else
     {
         zf = zf - (zf % 50) - 50;
-        m_part->setZoomFactor(zf);
+        m_part->setFontScaleFactor(zf);
     }
 }
 
 void ArticleViewer::slotSetZoomFactor(int percent)
 {
-    m_part->setZoomFactor(percent);
+    m_part->setFontScaleFactor(percent);
 }
 
 // some code taken from KDevelop (lib/widgets/kdevhtmlpart.cpp)
--- trunk/KDE/kdepim/akregator/src/articleviewer.rc #1059091:1059092
@@ -16,8 +16,8 @@
 </Menu> 
 <Menu noMerge="1" name="view">
   <Separator/> 
-  <Action name="incFontSizes"/>
-  <Action name="decFontSizes"/>
+  <Action name="inc_font_sizes"/>
+  <Action name="dec_font_sizes"/>
 </Menu> 
 
 </MenuBar>
--- trunk/KDE/kdepim/akregator/src/pageviewer.cpp #1059091:1059092
@@ -433,8 +433,8 @@
         action("viewer_copy")->plug(&popup);
         popup.addSeparator();
 
-        KAction* incFontAction = this->action("incFontSizes");
-        KAction* decFontAction = this->action("decFontSizes");
+        KAction* incFontAction = this->action("inc_font_sizes");
+        KAction* decFontAction = this->action("dec_font_sizes");
         if ( incFontAction && decFontAction )
         {
             incFontAction->plug( &popup );
--- trunk/KDE/kdepim/akregator/src/pageviewer.rc #1059091:1059092
@@ -25,8 +25,8 @@
   <Separator/>
   <Action name="pageviewer_reload"/>
   <Action name="pageviewer_stop"/>
-  <Action name="incFontSizes"/>
-  <Action name="decFontSizes"/>
+  <Action name="inc_font_sizes"/>
+  <Action name="dec_font_sizes"/>
   <Action name="setEncoding"/>
   <Merge/>
 </Menu>
[prev in list] [next in list] [prev in thread] [next in thread] 

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