[Kget] make_it_cool: kdenetwork/kget/plugins/konqueror

Pino Toscano toscano.pino at tiscali.it
Fri Mar 4 12:17:16 CET 2005


CVS commit by pino: 

More work on Konqueror plugin:
* add a sort indicator to list view, implementing wish #77398
* add a caption for the link window, implementing wish #77402
* add a Select All button to the lik window toolbar.

CCMAIL: kget at kde.org


  M +24 -6     kget_linkview.cpp   1.1.2.5
  M +3 -1      kget_linkview.h   1.1.2.3
  M +2 -0      kget_plug_in.cpp   1.1.2.4


--- kdenetwork/kget/plugins/konqueror/kget_linkview.cpp  #1.1.2.4:1.1.2.5
@@ -7,4 +7,5 @@
 #include <kmessagebox.h>
 #include <kprocess.h>
+#include <kstdaction.h>
 #include <ktoolbar.h>
 
@@ -36,12 +37,18 @@ KGetLinkView::KGetLinkView( QWidget *par
     : KMainWindow( parent, name )
 {
-    (void ) new KAction( i18n("Download Selected Files"),
-                         "khtml_kget",
-                         CTRL+Key_D,
+    setPlainCaption( i18n( "KGet" ) );
+
+    KAction* actionDownload = new KAction( i18n("Download Selected Files"),
+                                           "khtml_kget", CTRL+Key_D,
                          this, SLOT( slotStartLeech() ),
                          actionCollection(), "startDownload" );
 
+    KAction* actionSelectAll = KStdAction::selectAll( this, SLOT( slotSelectAll() ),
+                                                      actionCollection() );
+
     m_links.setAutoDelete( true );
-    actionCollection()->action( "startDownload" )->plug( toolBar() );
+    actionDownload->plug( toolBar() );
+    toolBar()->insertLineSeparator();
+    actionSelectAll->plug( toolBar() );
 
     m_view = new KListView( this, "listview" );
@@ -51,4 +58,5 @@ KGetLinkView::KGetLinkView( QWidget *par
     m_view->addColumn( i18n("File Type") );
     m_view->addColumn( i18n("Location (URL)") );
+    m_view->setShowSortIndicator( true );
 
     setCentralWidget( m_view );
@@ -124,3 +132,13 @@ void KGetLinkView::slotStartLeech()
 }
 
+void KGetLinkView::setPageURL( const QString& url )
+{
+    setPlainCaption( i18n( "Links in: %1 - KGet" ).arg( url ) );
+}
+
+void KGetLinkView::slotSelectAll()
+{
+    m_view->selectAll( true );
+}
+
 #include "kget_linkview.moc"

--- kdenetwork/kget/plugins/konqueror/kget_linkview.h  #1.1.2.2:1.1.2.3
@@ -34,4 +34,5 @@ public:
 
     void setLinks( QPtrList<LinkItem>& links );
+    void setPageURL( const QString& url );
 
 signals:
@@ -40,4 +41,5 @@ signals:
 private slots:
     void slotStartLeech();
+    void slotSelectAll();
 
 private:

--- kdenetwork/kget/plugins/konqueror/kget_plug_in.cpp  #1.1.2.3:1.1.2.4
@@ -151,4 +151,6 @@ void KGet_plug_in::slotShowLinks()
 
     KGetLinkView *view = new KGetLinkView();
+    QString url = doc.URL().string();
+    view->setPageURL( url );
 //    connect( view, SIGNAL( leechURLs( const KURL::List& ) ),
 //             SLOT( startDownload( const KURL::List& ) ));





More information about the Kget mailing list