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

List:       kde-commits
Subject:    KDE/kdewebdev/klinkstatus/src
From:       Paulo Moura Guedes <moura () kdewebdev ! org>
Date:       2008-01-29 17:04:13
Message-ID: 1201626253.696419.27835.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 768278 by mojo:

Allow to export only broken links

 M  +9 -3      actionmanager.cpp  
 M  +2 -2      engine/searchmanager.cpp  
 M  +1 -1      engine/searchmanager.h  
 M  +4 -1      klinkstatus_part.rc  
 M  +4 -4      ui/sessionwidget.cpp  
 M  +1 -1      ui/sessionwidget.h  
 M  +5 -0      ui/tabwidgetsession.cpp  
 M  +1 -0      ui/tabwidgetsession.h  


--- trunk/KDE/kdewebdev/klinkstatus/src/actionmanager.cpp #768277:768278
@@ -147,11 +147,16 @@
 
     // *************** File menu *********************
 
-    KAction *action  = new KAction(KIcon("document-save"), i18n("E&xport Results as \
                HTML..."), this);
-    actionCollection()->addAction("file_export_html", action );
+    KAction *action  = new KAction(KIcon("document-save"), i18n("All..."), this);
+    actionCollection()->addAction("file_export_html_all", action );
     connect(action, SIGNAL(triggered(bool) ), d->tabWidgetSession, \
SLOT(slotExportAsHTML()));  action->setEnabled(false);
 
+    action  = new KAction(KIcon("document-save"), i18n("Broken..."), this);
+    actionCollection()->addAction("file_export_html_broken", action );
+    connect(action, SIGNAL(triggered(bool) ), d->tabWidgetSession, \
SLOT(slotExportBrokenAsHTML())); +    action->setEnabled(false);
+
     // *************** View menu *********************
 
     //     this action must be in the tabwidget because the slot can't be connected \
to a particular sessionWidget @@ -418,7 +423,8 @@
 
     //     ____________________________________________________________________
 
-    action("file_export_html")->setEnabled(!sw->isEmpty());
+    action("file_export_html_all")->setEnabled(!sw->isEmpty());
+    action("file_export_html_broken")->setEnabled(!sw->isEmpty());
     action("html_fix_all")->setEnabled(!sw->isEmpty() && sw->stopped());
     action("find_unreferred_documents")->setEnabled(!sw->isEmpty() && \
sw->stopped());  }
--- trunk/KDE/kdewebdev/klinkstatus/src/engine/searchmanager.cpp #768277:768278
@@ -947,7 +947,7 @@
     } 
 }
 
-QString SearchManager::toXML() const
+QString SearchManager::toXML(LinkStatusHelper::Status status) const
 {
     QDomDocument doc;
     doc.appendChild(doc.createProcessingInstruction( "xml", 
@@ -956,7 +956,7 @@
     QDomElement root = doc.createElement("klinkstatus");
     doc.appendChild(root);
 
-    save(root);
+    save(root, status);
     
     return doc.toString(4);
 }
--- trunk/KDE/kdewebdev/klinkstatus/src/engine/searchmanager.h #768277:768278
@@ -67,7 +67,7 @@
     ~SearchManager();
 
     /** Returns the the results in XML format */
-    QString toXML() const;
+    QString toXML(LinkStatusHelper::Status status = LinkStatusHelper::none) const;
 
     void startSearch();
     void startSearch(KUrl const& root);
--- trunk/KDE/kdewebdev/klinkstatus/src/klinkstatus_part.rc #768277:768278
@@ -7,7 +7,10 @@
             <Action name="open_link"/>
             <Action name="close_tab"/>
             <Separator/>
-            <Action name="file_export_html"/>
+            <Menu name="file_export_html"><text>Export to HTML</text>
+                <Action name="file_export_html_all"/>
+                <Action name="file_export_html_broken"/>
+            </Menu>
             <Separator/>
         </Menu>
         
--- trunk/KDE/kdewebdev/klinkstatus/src/ui/sessionwidget.cpp #768277:768278
@@ -386,7 +386,8 @@
 {
     resultsSearchBar->show();
 
-    ActionManager::getInstance()->action("file_export_html")->setEnabled(!isEmpty());
 +    ActionManager::getInstance()->action("file_export_html_all")->setEnabled(!isEmpty());
 +    ActionManager::getInstance()->action("file_export_html_broken")->setEnabled(!isEmpty());
  
     emit signalTitleChanged();
 
@@ -747,7 +748,7 @@
     tree_view->show(link_matcher);
 }
 
-void SessionWidget::slotExportAsHTML()
+void SessionWidget::slotExportAsHTML(LinkStatusHelper::Status status)
 {
     KUrl url = KFileDialog::getSaveUrl(KUrl(), "text/html", 0, i18n("Export Results \
as HTML"));  
@@ -757,9 +758,8 @@
     kDebug(23100) << "\n\nXML document represention: \n\n" << \
search_manager_->toXML();  
     KUrl styleSheetUrl = KStandardDirs::locate("appdata", \
                "styles/results_stylesheet.xsl");
-    QString html = XSL::transform(search_manager_->toXML(), styleSheetUrl);
+    QString html = XSL::transform(search_manager_->toXML(status), styleSheetUrl);
     FileManager::write(html, url);
-
 }
 
 void SessionWidget::slotValidateAll()
--- trunk/KDE/kdewebdev/klinkstatus/src/ui/sessionwidget.h #768277:768278
@@ -91,7 +91,7 @@
     void slotFollowLastLinkChecked();
     void slotDisableUpdatesOnResultsTable(bool checked);
     
-    void slotExportAsHTML();
+    void slotExportAsHTML(LinkStatusHelper::Status status = LinkStatusHelper::none);
 
     void slotValidateAll();
 
--- trunk/KDE/kdewebdev/klinkstatus/src/ui/tabwidgetsession.cpp #768277:768278
@@ -250,6 +250,11 @@
     currentWidget()->sessionWidget()->slotExportAsHTML();
 }
 
+void TabWidgetSession::slotExportBrokenAsHTML()
+{
+    currentWidget()->sessionWidget()->slotExportAsHTML(LinkStatusHelper::bad);
+}
+
 void TabWidgetSession::slotValidateAll( )
 {
     currentWidget()->sessionWidget()->slotValidateAll();
--- trunk/KDE/kdewebdev/klinkstatus/src/ui/tabwidgetsession.h #768277:768278
@@ -79,6 +79,7 @@
     void slotRecheckBrokenItems();
 
     void slotExportAsHTML();
+    void slotExportBrokenAsHTML();
 
     void slotFindUnreferredDocuments();
 


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

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