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

List:       kde-commits
Subject:    branches/work/make_kget_cool/kget
From:       Urs Wolfer <u.wolfer () bluewin ! ch>
Date:       2005-09-17 15:03:31
Message-ID: 1126969411.122842.20709.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 461408 by uwolfer:

* Konqueror integration implementation. Note: Konqueror freezes at download start if \
integration is enabled. But I think it's more a Konqueror than a KGet problem. I hope \
                I'll find a solution.
* Cleanups
* Forwardport aboutdialog changes from 3.5 (remove website, add mailinglist link)


 M  +5 -0      Changelog  
 M  +41 -8     kget.cpp  
 M  +3 -0      kget.h  
 M  +1 -1      main.cpp  
 M  +1 -0      ui/tray.cpp  


--- branches/work/make_kget_cool/kget/Changelog #461407:461408
@@ -1,3 +1,8 @@
+2005-09-17 Urs Wolfer <u.wolfer @ bluewin.ch>
+        * Konqueror integration implementation.
+        Note: Konqueror freezes at download start if integration is enabled.
+        But I think it's more a Konqueror than a KGet problem. I hope I'll find a \
solution. +
 2005-09-10 Dario Massarin <nekkar@libero.it>
         * Now a TransferHandler object is created always bt the TransferFactory.
         This allows to easily reimplement the TransferHandler class, just by
--- branches/work/make_kget_cool/kget/kget.cpp #461407:461408
@@ -28,6 +28,7 @@
 #include <QDragEnterEvent>
 #include <QDropEvent>
 #include <QCloseEvent>
+#include <QTimer>
 
 #include <kapplication.h>
 #include <kconfig.h>
@@ -45,9 +46,8 @@
 #include <knotifyclient.h>
 #include <knotifydialog.h>
 #include <kfiledialog.h>
+#include <kmessagebox.h>
 
-#include <qtimer.h>
-
 #include "kget.h"
 #include "core/model.h"
 #include "core/transferhandler.h"
@@ -110,6 +110,8 @@
     slotSaveMyself();
     delete m_drop;
     delete m_dock;
+    // reset konqueror integration (necessary if user enabled / disabled temporarily \
integration from tray) +    slotKonquerorIntegration( \
Settings::konquerorIntegration() );  // the following call saves options set in above \
dtors  Settings::writeConfig();
 }
@@ -133,15 +135,21 @@
     ta = new KToggleAction(i18n("Start Downloading"), "down", 0, this,
                            SLOT(slotDownloadToggled()), ac, "download");
     ta->setWhatsThis(i18n("<b>Start/Stop</b> the automatic download of files."));
-#if KDE_IS_VERSION(3,2,91)
+
     KGuiItem checkedDownloadAction(i18n("Stop Downloading"), "stop");
     ta->setCheckedState( checkedDownloadAction );
-#endif
+
     ta->setChecked( Settings::downloadAtStartup() );
 
     m_showDropTarget = new KToggleAction(i18n("Show Drop Target"), "target", 0, \
this,  SLOT(slotShowDropTarget()), ac, "show_drop_target");
 
+    m_KonquerorIntegration = new KAction(i18n("Enable &KGet as Konqueror Download \
Manager"), "konqueror", 0, this, +                \
SLOT(slotTrayKonquerorIntegration()), ac, "konqueror_integration"); +    if ( \
Settings::konquerorIntegration() ) +        \
m_KonquerorIntegration->setText(i18n("Disable &KGet as Konqueror Download Manager")); \
+    slotKonquerorIntegration( Settings::konquerorIntegration() ); +
     // local - Destroys all sub-windows and exits
     KStdAction::quit(this, SLOT(slotQuit()), ac, "quit");
     // local - Standard configure actions
@@ -286,10 +294,6 @@
     bool downloading = action->isChecked();
     //TODO find an alternative way of doing this with the model
     //schedRequestOperation( downloading ? OpRun : OpStop );
-#if ! KDE_IS_VERSION(3,2,91)
-    action->setText( downloading ? i18n("Stop Downloading") : i18n("Start \
                Downloading") );
-    action->setIcon( downloading ? "stop" : "down" );
-#endif
     m_dock->setDownloading( downloading );
 }
 
@@ -377,6 +381,7 @@
         m_showDropTarget->setChecked( !m_drop->isVisible() );
         m_drop->setShown( Settings::showDropTarget(), false );
     }
+    slotKonquerorIntegration( Settings::konquerorIntegration() );
 }
 
 void KGet::slotShowDropTarget()
@@ -385,6 +390,34 @@
     m_drop->setShown( !m_drop->isVisible() );
 }
 
+void KGet::slotTrayKonquerorIntegration()
+{
+    static bool tempIntegration = Settings::konquerorIntegration();
+    tempIntegration = !tempIntegration;
+    slotKonquerorIntegration( tempIntegration );
+    if ( !tempIntegration && Settings::konquerorIntegration() )
+    {
+        KMessageBox::information(0,
+            i18n("KGet has been temporarily disabled as download manager for \
Konqueror. " +            "If you want to disable it forever, go to \
Settings->Advanced and disable \"Use " +            "as download manager for \
Konqueror\"."), +            i18n("Konqueror Integration disabled"),
+            "KonquerorIntegrationDisabled");
+    }
+}
+
+void KGet::slotKonquerorIntegration(bool konquerorIntegration)
+{
+    KConfig cfgKonqueror("konquerorrc", false, false);
+    cfgKonqueror.setGroup("HTML Settings");
+    cfgKonqueror.writePathEntry("DownloadManager",QString(konquerorIntegration?"kget":""));
 +    cfgKonqueror.sync();
+    if ( konquerorIntegration )
+        m_KonquerorIntegration->setText(i18n("Disable &KGet as Konqueror Download \
Manager")); +    else
+        m_KonquerorIntegration->setText(i18n("Enable &KGet as Konqueror Download \
Manager")); +}
+
 void KGet::updateStatusBar()
 {
 //     QString transfers = i18n("Downloading %1 transfers (%2) at %3");
--- branches/work/make_kget_cool/kget/kget.h #461407:461408
@@ -91,6 +91,8 @@
     void slotConfigureKeys();
     void slotConfigureToolbars();
     void slotShowDropTarget();
+    void slotTrayKonquerorIntegration();
+    void slotKonquerorIntegration( bool );
 
     // transfers slots
     void slotTransfersStart();
@@ -124,6 +126,7 @@
     DropTarget    * m_drop;
     Tray          * m_dock;
     KToggleAction * m_showDropTarget;
+    KAction       * m_KonquerorIntegration;
 };
 
 #endif
--- branches/work/make_kget_cool/kget/main.cpp #461407:461408
@@ -175,7 +175,7 @@
                          I18N_NOOP("(C) 2001 - 2002, Patrick Charbonnier\n"
                                    "(C) 2002, Carsten Pfeiffer\n"
                                    "(C) 1998 - 2000, Matej Koss"),
-                         0, "http://kget.sourceforge.net");
+                         "kget@kde.org", 0);
 
     aboutData.addAuthor("Patrick  Charbonnier", 0, "pch@freeshell.org");
     aboutData.addAuthor("Carsten Pfeiffer", 0, "pfeiffer@kde.org");
--- branches/work/make_kget_cool/kget/ui/tray.cpp #461407:461408
@@ -66,6 +66,7 @@
     // add preferences action to the context menu
     parent->actionCollection()->action("new_transfer")->plug(contextMenu());
     parent->actionCollection()->action("preferences")->plug(contextMenu());
+    parent->actionCollection()->action("konqueror_integration")->plug(contextMenu());
  
     // enable dropping
     setAcceptDrops(true);


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

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