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

List:       kde-commits
Subject:    extragear/office/skrooge
From:       Stephane Mankowski <stephane () mankowski ! fr>
Date:       2010-07-19 15:11:02
Message-ID: 20100719151102.EF3D7AC76B () svn ! kde ! org
[Download RAW message or body]

SVN commit 1151787 by smankowski:



 M  +1 -0      CHANGELOG  
 M  +3 -0      skg_bookmark/skg_bookmark.rc  
 M  +26 -15    skg_bookmark/skgbookmarkplugin.cpp  
 M  +1 -0      skg_bookmark/skgbookmarkplugin.h  
 M  +1 -1      skgbasegui/CMakeLists.txt  
 M  +1 -0      skgbasegui/skgmainpanel.cpp  
 M  +4 -0      skgbasegui/skgmainpanel.rc  
 M  +17 -1     skgbasegui/skgtabpage.cpp  
 M  +1 -1      skrooge_monthly/skgmonthlyboardwidget.cpp  
 M  +18 -1     skrooge_monthly/skgmonthlypluginwidget.cpp  
 M  +16 -1     skrooge_monthly/skgmonthlypluginwidget.h  
 M  +17 -11    skrooge_operation/skgoperationpluginwidget_board.ui  
 U             templates/skrooge_xxx/skrooge_xxx.rc  
 M  +4 -1      tests/suite_squish/shared/scripts/skrooge_functions.py  
 M  +1 -1      tests/suite_squish/tst_properties/test.py  


--- trunk/extragear/office/skrooge/CHANGELOG #1151786:1151787
@@ -25,6 +25,7 @@
   *New feature: Report plugin is able to display graph based on properties
   *New feature: Possibility to select icon file for a bank
   *New feature: Any kind of file as property
+  *New feature: Go home
   
  -- maintainer Stephane MANKOWSKI <stephane@mankowski.fr>  xxx
  
--- trunk/extragear/office/skrooge/skg_bookmark/skg_bookmark.rc #1151786:1151787
@@ -12,6 +12,9 @@
 	  		<Action name="view_bookmarks"/>
 		</Menu>
   	</Menu>
+  <Menu name="go"><Text>Go</Text>
+	  <Action name="go_home"/>
+  </Menu>  	
 </MenuBar>
 <ToolBar noMerge="1" name="file" fullWidth="false" newline="false" >
 	<text>File</text>
--- trunk/extragear/office/skrooge/skg_bookmark/skgbookmarkplugin.cpp \
#1151786:1151787 @@ -85,8 +85,12 @@
     importStdBookmarkAction = new KAction ( KIcon ( "document-import", NULL, \
                overlaybookmarks ), i18nc ("Verb", "Import standard bookmarks" ), \
                this );
     connect ( importStdBookmarkAction, SIGNAL ( triggered ( bool ) ), SLOT ( \
                importStandardBookmarks() ) );
     actionCollection()->addAction ( QLatin1String ( "import_standard_bookmarks" ), \
importStdBookmarkAction ); +    if ( SKGMainPanel::getMainPanel() ) \
SKGMainPanel::getMainPanel()->registedGlobalAction ( "import_standard_bookmarks", \
importStdBookmarkAction );  
-    if ( SKGMainPanel::getMainPanel() ) \
SKGMainPanel::getMainPanel()->registedGlobalAction ( "import_standard_bookmarks", \
importStdBookmarkAction ); +    //
+    KAction* goHome=KStandardAction::home ( this, SLOT ( goHome() ), \
actionCollection() ); +    if ( SKGMainPanel::getMainPanel() ) \
SKGMainPanel::getMainPanel()->registedGlobalAction ( "go_home", goHome ); +
     return true;
 }
 
@@ -120,24 +124,11 @@
                 }
 
                 //Automatic open of autostart bookmark
-                if ( err.isSucceeded() )
-                {
-                    SKGObjectBase::SKGListSKGObjectBase oNodeList;
-                    err = SKGObjectBase::getObjects ( currentBankDocument, "v_node", \
                "t_autostart='Y' ORDER BY f_sortorder, t_name", oNodeList );
-                    int nbAutoStartedBookmarks = oNodeList.count();
-                    for ( int i=0; i<nbAutoStartedBookmarks; i++ )
-                    {
-                        SKGNodeObject autostarted_bookmark = oNodeList.at ( i );
-                        autostarted_bookmark.load();
-                        SKGTRACEIN ( 10, "autostarting bookmark : \
                "+autostarted_bookmark.getName() );
-                        SKGBookmarkPluginDockWidget::openBookmark ( \
                autostarted_bookmark, i>0 );
-
+                if ( err.isSucceeded() ) goHome();
                     }
                 }
             }
         }
-    }
-}
 
 QString SKGBookmarkPlugin::title() const
 {
@@ -206,4 +197,24 @@
     //Display error
     if ( SKGMainPanel::getMainPanel() ) \
SKGMainPanel::getMainPanel()->displayErrorMessage ( err );  }
+
+void SKGBookmarkPlugin::goHome()
+{
+    if ( SKGMainPanel::getMainPanel() ) \
SKGMainPanel::getMainPanel()->closeAllPages(); +
+    SKGObjectBase::SKGListSKGObjectBase oNodeList;
+    SKGObjectBase::getObjects ( currentBankDocument, "v_node", "t_autostart='Y' \
ORDER BY f_sortorder, t_name", oNodeList ); +    int nbAutoStartedBookmarks = \
oNodeList.count(); +    for ( int i=0; i<nbAutoStartedBookmarks; i++ )
+    {
+        SKGNodeObject autostarted_bookmark = oNodeList.at ( i );
+        autostarted_bookmark.load();
+        SKGTRACEIN ( 10, "autostarting bookmark : "+autostarted_bookmark.getName() \
); +        SKGBookmarkPluginDockWidget::openBookmark ( autostarted_bookmark, i>0 );
+
+    }
+
+}
+
+
 #include "skgbookmarkplugin.moc"
--- trunk/extragear/office/skrooge/skg_bookmark/skgbookmarkplugin.h #1151786:1151787
@@ -93,6 +93,7 @@
 
 private slots:
     void importStandardBookmarks();
+    void goHome();
 
 private:
     Q_DISABLE_COPY(SKGBookmarkPlugin);
--- trunk/extragear/office/skrooge/skgbasegui/CMakeLists.txt #1151786:1151787
@@ -50,7 +50,7 @@
 
 KDE4_ADD_LIBRARY(skgbasegui SHARED ${skgbasegui_SRCS})
 
-TARGET_LINK_LIBRARIES(skgbasegui ${KDE4_KPARTS_LIBS} ${QT_QTSCRIPT_LIBRARY} \
skgbasemodeler) +TARGET_LINK_LIBRARIES(skgbasegui ${KDE4_KPARTS_LIBS} \
${QT_QTSCRIPT_LIBRARY} ${QT_QTWEBKIT_LIBRARY} skgbasemodeler)  SET_TARGET_PROPERTIES( \
skgbasegui PROPERTIES VERSION ${VERSION} SOVERSION ${SOVERSION} )  
 ########### install files ###############
--- trunk/extragear/office/skrooge/skgbasegui/skgmainpanel.cpp #1151786:1151787
@@ -642,6 +642,7 @@
         }
     }
 }
+
 void SKGMainPanel::actionNext()
 {
     SKGError err;
--- trunk/extragear/office/skrooge/skgbasegui/skgmainpanel.rc #1151786:1151787
@@ -27,6 +27,10 @@
 	  </Menu>
 	  <Action name="view_contextmenu"/>
   </Menu>
+  <Menu name="go"><Text>Go</Text>
+	  <Action name="go_previous"/>
+	  <Action name="go_next"/>
+  </Menu>  
 </MenuBar>
 <ToolBar noMerge="1" name="file" fullWidth="false" newline="false" >
 	<text>File</text>
--- trunk/extragear/office/skrooge/skgbasegui/skgtabpage.cpp #1151786:1151787
@@ -26,12 +26,15 @@
 #include "skgtransactionmng.h"
 #include "skgtraces.h"
 #include "skgmainpanel.h"
+#include "skgtreeview.h"
 
 #include "kmessagebox.h"
 
 #include <QtGui/QWidget>
-#include "skgtreeview.h"
+#include <QWebView>
 
+#include "math.h"
+
 SKGTabPage::SKGTabPage(SKGDocument* iDocument)
         : SKGWidget(iDocument)
 {
@@ -232,6 +235,13 @@
     QWidget* widget=zoomableWidget();
     SKGTreeView* treeView=dynamic_cast<SKGTreeView*>(widget);
     if (treeView) treeView->setZoomPosition(iValue);
+    else
+    {
+        QWebView* webView=dynamic_cast<QWebView*>(widget);
+        if (webView)
+        {
+            webView->setZoomFactor(pow10(((qreal) iValue)/30.0));
+        }
     else if (widget)
     {
         QFont font = widget->font();
@@ -239,13 +249,19 @@
         widget->setFont( font );
     }
 }
+}
 
 int SKGTabPage::zoomPosition() const
 {
     QWidget* widget=zoomableWidget();
     SKGTreeView* treeView=dynamic_cast<SKGTreeView*>(widget);
     if (treeView) return treeView->zoomPosition();
+    else
+    {
+        QWebView* webView=dynamic_cast<QWebView*>(widget);
+        if (webView) return round(30.0*log10(webView->zoomFactor()));
     else if (widget) return widget->font().pointSize()-fontOriginalPointSize;
+    }
     return 0;
 }
 
--- trunk/extragear/office/skrooge/skrooge_monthly/skgmonthlyboardwidget.cpp \
#1151786:1151787 @@ -78,7 +78,7 @@
 
     QDate previousMonth=month.addMonths(-1);
 
-    if (mode==0) ui.kText->setText(SKGMonthlyPluginWidget::get5MainCategories(static_cast<SKGDocumentBank*>(getDocument()), \
month.toString("yyyy-MM"))); +    if (mode==0) \
ui.kText->setText(SKGMonthlyPluginWidget::get5MainCategories(static_cast<SKGDocumentBank*>(getDocument()), \
month.toString("yyyy-MM"), false));  else if (mode==1) \
ui.kText->setText(SKGMonthlyPluginWidget::get5MainCategoriesVariation(static_cast<SKGDocumentBank*>(getDocument()), \
month.toString("yyyy-MM"), previousMonth.toString("yyyy-MM")));  }
 
--- trunk/extragear/office/skrooge/skrooge_monthly/skgmonthlypluginwidget.cpp \
#1151786:1151787 @@ -70,6 +70,7 @@
 
     //Get state
     root.setAttribute ( "month", ui.kMonth->text() );
+    root.setAttribute ( "zoomPosition", SKGServices::intToString(zoomPosition()) );
 
     return doc.toString();
 }
@@ -84,8 +85,16 @@
     //Set state
     QString month=root.attribute ( "month" );
     if ( !month.isEmpty() ) ui.kMonth->setText ( month );
+
+    QString zoomPositionS=root.attribute ( "zoomPosition" );
+    if ( !zoomPositionS.isEmpty() ) setZoomPosition(SKGServices::stringToInt ( \
zoomPositionS ));  }
 
+QString SKGMonthlyPluginWidget::getDefaultStateAttribute()
+{
+    return "SKGMONTHLY_DEFAULT_PARAMETERS";
+}
+
 QWidget* SKGMonthlyPluginWidget::getWidgetForPrint()
 {
     return ui.kWebView;
@@ -445,7 +454,7 @@
     SKGMainPanel::getMainPanel()->displayErrorMessage ( err );
 }
 
-QString SKGMonthlyPluginWidget::get5MainCategories ( SKGDocumentBank* iDocument, \
const QString& iMonth ) +QString SKGMonthlyPluginWidget::get5MainCategories ( \
SKGDocumentBank* iDocument, const QString& iMonth, bool iChart )  {
     QString html;
     if (iDocument)
@@ -485,12 +494,15 @@
             }
             html+="</table>";
 
+            if (iChart)
+            {
             QString \
img="http://chart.apis.google.com/chart?cht=p3&chco=FF0000&chd=t:"+qoogleChd+"&chs=300x100&chl="+qoogleChl+
  "&chds=0,"+SKGServices::doubleToString ( max );;
             //SKGTRACE << img << endl;
             html+="<img src=\""+img+"\" />";
         }
     }
+    }
     return html;
 }
 
@@ -546,6 +558,11 @@
     return html;
 }
 
+QWidget* SKGMonthlyPluginWidget::zoomableWidget() const
+{
+    return ui.kWebView;
+}
+
 #include "skgmonthlypluginwidget.moc"
 
 
--- trunk/extragear/office/skrooge/skrooge_monthly/skgmonthlypluginwidget.h \
#1151786:1151787 @@ -59,6 +59,13 @@
     virtual void setState(const QString& iState);
 
     /**
+     * Get attribute name to save the default state
+     * MUST BE OVERWRITTEN
+     * @return attribute name to save the default state.
+     */
+    virtual QString getDefaultStateAttribute();
+
+    /**
      * Get the widget must be printed
      * @return a widget
      */
@@ -68,9 +75,10 @@
      * Get 5 main category report
      * @param iDocument the document
      * @param iMonth the month
+     * @param iChart to add chart
      * @return the html report
      */
-    static QString get5MainCategories(SKGDocumentBank* iDocument, const QString& \
iMonth); +    static QString get5MainCategories(SKGDocumentBank* iDocument, const \
QString& iMonth, bool iChart=true);  
     /**
      * Get 5 main variation of categories report
@@ -81,6 +89,13 @@
      */
     static QString get5MainCategoriesVariation (SKGDocumentBank* iDocument, const \
QString& iMonth, const QString& iPreviousMonth );  
+    /**
+     * Get the zoomable widget. MUST BE OVERWRITTEN
+     * By Overwritting this function, you don't have to implement following ones.
+     * @return the tree view.
+     */
+    virtual QWidget* zoomableWidget() const;
+
 private slots:
     void dataModified(const QString& iTableName, int iIdTransaction);
     void onMonthChanged();
--- trunk/extragear/office/skrooge/skrooge_operation/skgoperationpluginwidget_board.ui \
#1151786:1151787 @@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>186</width>
+    <width>190</width>
     <height>185</height>
    </rect>
   </property>
@@ -25,12 +25,15 @@
       </property>
       <item row="0" column="0" colspan="2">
        <widget class="QLabel" name="label">
+        <property name="font">
+         <font>
+          <weight>75</weight>
+          <bold>true</bold>
+          <underline>true</underline>
+         </font>
+        </property>
         <property name="text">
-         <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; \
                &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; \
                /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Sans'; \
                font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; \
font-weight:600; text-decoration: underline;&quot;&gt;Current \
month&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> +         \
<string>Current month</string>  </property>
        </widget>
       </item>
@@ -90,12 +93,15 @@
       </item>
       <item row="3" column="0" colspan="2">
        <widget class="QLabel" name="label_2">
+        <property name="font">
+         <font>
+          <weight>75</weight>
+          <bold>true</bold>
+          <underline>true</underline>
+         </font>
+        </property>
         <property name="text">
-         <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; \
                &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
-&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; \
                /&gt;&lt;style type=&quot;text/css&quot;&gt;
-p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'DejaVu Sans'; \
                font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; \
font-weight:600; text-decoration: underline;&quot;&gt;Previous \
month&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> +         \
<string>Previous month</string>  </property>
        </widget>
       </item>
--- trunk/extragear/office/skrooge/tests/suite_squish/shared/scripts/skrooge_functions.py \
#1151786:1151787 @@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 import os
 
 def initSimple():
@@ -50,11 +51,13 @@
     waitForObject(":all_plugins.skg [modified] - skrooge_KTabBar")
     type(":all_plugins.skg [modified] - skrooge_KTabBar", "<Ctrl+9>")
     waitForObject(":all_plugins.skg [modified] - skrooge_KTabBar")
-    type(":all_plugins.skg [modified] - skrooge_KTabBar", "<Ctrl+0>")
+    type(":all_plugins.skg [modified] - skrooge_KTabBar", "<Ctrl+Alt+0>")
     waitForObject(":all_plugins.skg [modified] - skrooge_KTabBar")
     type(":all_plugins.skg [modified] - skrooge_KTabBar", "<Ctrl+Alt+1>")
     waitForObject(":all_plugins.skg [modified] - skrooge_KTabBar")
+    type(":all_plugins.skg [modified] - skrooge_KTabBar", "<Ctrl+Alt+2>")
 
+
 def bookmarkAndRemoveCurrentPage():
     waitForObject(":&Bookmark.kBookmarksList_SKGTreeView")
     openContextMenu(":&Bookmark.kBookmarksList_SKGTreeView", 181, 151, 2)
--- trunk/extragear/office/skrooge/tests/suite_squish/tst_properties/test.py \
#1151786:1151787 @@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 def main():
     source(findFile("scripts", "skrooge_functions.py"))
     initSimple()
@@ -25,7 +26,6 @@
     
     sendEvent("QMouseEvent", waitForObject(":Untitled [modified] - skrooge.Add \
property_QToolButton"), QEvent.MouseButtonPress, 117, 22, Qt.LeftButton, 0)  \
                activateItem(waitForObjectItem(":Add property_KMenu", "p1=V2"))
-    clickButton(waitForObject(":&Properties.Open..._KPushButton"))
     clickButton(waitForObject(":&Properties.kRemove_KPushButton"))
     sendEvent("QCloseEvent", waitForObject(":Untitled [modified] - \
                skrooge_SKGMainPanel_2"))
     clickButton(waitForObject(":Question – Skrooge.Do not save_KPushButton"))


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

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