[Kget] branches/work/make_kget_cool/kget
Manolo Valdes
nolis71cu at gmail.com
Thu Dec 21 04:25:51 CET 2006
SVN commit 615320 by mvaldes:
now the plugins settings widget is working.
it still need to add the name of the plugin in the tab but i'll work on it :)
test it and feed me back :)
CCMAIL: kget at kde.org
M +0 -1 CMakeLists.txt
D conf/dlgplugins.ui
M +1 -4 conf/preferencesdialog.cpp
M +3 -2 conf/preferencesdialog.h
M +14 -0 core/kget.cpp
M +7 -0 core/kget.h
M +2 -0 core/plugin/transferfactory.h
M +1 -1 mainwindow.cpp
M +1 -0 transfers/CMakeLists.txt
M +5 -0 transfers/kio/transferKioFactory.cpp
M +2 -0 transfers/kio/transferKioFactory.h
M +1 -0 transfers/multisegmentkio/CMakeLists.txt
A transfers/multisegmentkio/dlgmultisegkio.cpp [License: GPL]
A transfers/multisegmentkio/dlgmultisegkio.h [License: GPL]
M +7 -22 transfers/multisegmentkio/dlgmultisegkio.ui
M +11 -8 transfers/multisegmentkio/kget_MultiSegKiofactory.kcfg
M +2 -5 transfers/multisegmentkio/transferMultiSegKioFactory.cpp
--- branches/work/make_kget_cool/kget/CMakeLists.txt #615319:615320
@@ -28,7 +28,6 @@
${CMAKE_SOURCE_DIR}/kget/conf/dlgappearance.ui
${CMAKE_SOURCE_DIR}/kget/conf/dlgdirectories.ui
${CMAKE_SOURCE_DIR}/kget/conf/dlgnetwork.ui
- ${CMAKE_SOURCE_DIR}/kget/conf/dlgplugins.ui
)
set(kgetcore_SRCS
--- branches/work/make_kget_cool/kget/conf/preferencesdialog.cpp #615319:615320
@@ -16,7 +16,6 @@
#include "ui_dlgnetwork.h"
#include "ui_dlgdirectories.h"
#include "ui_dlgadvanced.h"
-#include "ui_dlgplugins.h"
PreferencesDialog::PreferencesDialog( QWidget * parent, KConfigSkeleton * skeleton )
: KConfigDialog( parent, "preferences", skeleton )
@@ -25,19 +24,17 @@
network = new QWidget(this);
directories = new QWidget(this);
advanced = new QWidget(this);
- plugins = new QWidget(this);
+ plugins = new KTabWidget(this);
Ui::DlgAppearance dlgApp;
Ui::DlgNetwork dlgNet;
Ui::DlgDirectories dlgDir;
Ui::DlgAdvanced dlgAdv;
- Ui::DlgPlugins dlgPlugins;
dlgApp.setupUi(appearance);
dlgNet.setupUi(network);
dlgDir.setupUi(directories);
dlgAdv.setupUi(advanced);
- dlgPlugins.setupUi(plugins);
addPage(appearance, i18n("Appearance"), "looknfeel", i18n("Look and Feel"));
addPage(directories, i18n("Folders"), "folder_open", i18n("Default Download Folders"));
--- branches/work/make_kget_cool/kget/conf/preferencesdialog.h #615319:615320
@@ -11,6 +11,7 @@
#define PREFERENCESDIALOG_H
#include <kconfigdialog.h>
+#include <ktabwidget.h>
class QWidget;
class KConfigSkeleton;
@@ -19,13 +20,13 @@
{
public:
PreferencesDialog( QWidget * parent, KConfigSkeleton * config );
-
+ KTabWidget * pluginsWidget(){return plugins;};
private:
QWidget * appearance;
QWidget * network;
QWidget * directories;
QWidget * advanced;
- QWidget * plugins;
+ KTabWidget * plugins;
};
#endif
--- branches/work/make_kget_cool/kget/core/kget.cpp #615319:615320
@@ -371,6 +371,20 @@
m_scheduler->stop();
}
+void KGet::setPluginsSettingsWidget(KTabWidget * widget)
+{
+ QList<TransferFactory *>::iterator it = m_transferFactories.begin();
+ QList<TransferFactory *>::iterator itEnd = m_transferFactories.end();
+
+ QWidget * _w;
+ for( ; it!=itEnd ; ++it)
+ {
+ _w = (*it)->dlgSettings();
+ if(_w)
+ widget->addTab( _w, "Plugin Name" );
+ }
+}
+
// ------ STATIC MEMBERS INITIALIZATION ------
QList<ModelObserver *> KGet::m_observers;
TransferTreeModel * KGet::m_transferTreeModel;
--- branches/work/make_kget_cool/kget/core/kget.h #615319:615320
@@ -18,6 +18,7 @@
#include <kservice.h>
#include <kurl.h>
#include <kactioncollection.h>
+#include <ktabwidget.h>
#include "scheduler.h"
#include "kget_export.h"
@@ -181,6 +182,12 @@
*/
static void addTransferTreeView(QAbstractItemView * view);
+ /**
+ * Adds a Settings tab for every plugins that needs one
+ * to the KTabWidget.
+ */
+ static void setPluginsSettingsWidget(KTabWidget * widget);
+
private:
KGet();
~KGet();
--- branches/work/make_kget_cool/kget/core/plugin/transferfactory.h #615319:615320
@@ -58,6 +58,8 @@
virtual TransferHandler * createTransferHandler(Transfer * transfer,
Scheduler * scheduler)=0;
+ virtual QWidget * dlgSettings()=0;
+
virtual QWidget * createDetailsWidget( TransferHandler * transfer )=0;
virtual const QList<KAction *> actions()=0;
--- branches/work/make_kget_cool/kget/mainwindow.cpp #615319:615320
@@ -283,7 +283,7 @@
// we didn't find an instance of this dialog, so lets create it
PreferencesDialog * dialog = new PreferencesDialog( this, Settings::self() );
-
+ KGet::setPluginsSettingsWidget( dialog->pluginsWidget() );
// keep us informed when the user changes settings
connect( dialog, SIGNAL(settingsChanged(const QString&)),
this, SLOT(slotNewConfig()) );
--- branches/work/make_kget_cool/kget/transfers/CMakeLists.txt #615319:615320
@@ -1,4 +1,5 @@
add_subdirectory(kio)
add_subdirectory(multisegmentkio)
#add_subdirectory(multithreaded)
+#add_subdirectory(metalink)
#add_subdirectory(bittorrent)
--- branches/work/make_kget_cool/kget/transfers/kio/transferKioFactory.cpp #615319:615320
@@ -48,6 +48,11 @@
return new TransferHandler(transfer, scheduler);
}
+QWidget * TransferKioFactory::dlgSettings()
+{
+ return 0; // if there is no settings widget then returns 0
+}
+
QWidget * TransferKioFactory::createDetailsWidget( TransferHandler * transfer )
{
Q_UNUSED(transfer);
--- branches/work/make_kget_cool/kget/transfers/kio/transferKioFactory.h #615319:615320
@@ -30,6 +30,8 @@
TransferHandler * createTransferHandler(Transfer * transfer,
Scheduler * scheduler);
+ QWidget * dlgSettings();
+
QWidget * createDetailsWidget( TransferHandler * transfer );
const QList<KAction *> actions();
--- branches/work/make_kget_cool/kget/transfers/multisegmentkio/CMakeLists.txt #615319:615320
@@ -10,6 +10,7 @@
########### next target ###############
set(kget_MultiSegKiofactory_PART_SRCS
+ dlgmultisegkio.cpp
segmentfactory.cpp
MultiSegKio.cpp
mirrors.cpp
--- branches/work/make_kget_cool/kget/transfers/multisegmentkio/dlgmultisegkio.ui #615319:615320
@@ -6,12 +6,9 @@
<x>0</x>
<y>0</y>
<width>400</width>
- <height>300</height>
+ <height>319</height>
</rect>
</property>
- <property name="windowTitle" >
- <string>Form</string>
- </property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
@@ -58,6 +55,11 @@
</property>
<item>
<widget class="QLabel" name="label" >
+ <property name="font" >
+ <font>
+ <family>Sans Serif</family>
+ </font>
+ </property>
<property name="text" >
<string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
@@ -194,22 +196,5 @@
</layout>
</widget>
<resources/>
- <connections>
- <connection>
- <sender>checkBox</sender>
- <signal>clicked(bool)</signal>
- <receiver>searchEngineGroupBox</receiver>
- <slot>setDisabled(bool)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>31</x>
- <y>73</y>
- </hint>
- <hint type="destinationlabel" >
- <x>39</x>
- <y>103</y>
- </hint>
- </hints>
- </connection>
- </connections>
+ <connections/>
</ui>
--- branches/work/make_kget_cool/kget/transfers/multisegmentkio/kget_MultiSegKiofactory.kcfg #615319:615320
@@ -1,12 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
<kcfg>
- <group name="Segments">
- <entry name="UseSearchEngines" type="Bool">
- <default>false</default>
- </entry>
- <entry name="Segments" type="Int">
- <default>5</default>
- </entry>
- </group>
+ <kcfgfile name="kget_MultiSegKiofactory.rc"/>
+ <group name="Segments">
+ <entry name="Segments" type="Int">
+ <default>5</default>
+ </entry>
+ </group>
+ <group name="SearchEngines">
+ <entry name="UseSearchEngines" type="Bool">
+ <default>false</default>
+ </entry>
+ </group>
</kcfg>
--- branches/work/make_kget_cool/kget/transfers/multisegmentkio/transferMultiSegKioFactory.cpp #615319:615320
@@ -14,7 +14,7 @@
#include "core/scheduler.h"
#include "core/transfergroup.h"
#include "MultiSegKioSettings.h"
-#include "ui_dlgmultisegkio.h"
+#include "dlgmultisegkio.h"
#include "transfers/multisegmentkio/transferMultiSegKioFactory.h"
#include "transfers/multisegmentkio/transferMultiSegKio.h"
@@ -54,10 +54,7 @@
QWidget * TransferMultiSegKioFactory::dlgSettings()
{
- QWidget *dlg = new QWidget();
- Ui::DlgMultiSeg DlgMultiSeg;
- DlgMultiSeg.setupUi(dlg);
- return dlg;
+ return new dlgSettingsWidget();
}
QWidget * TransferMultiSegKioFactory::createDetailsWidget( TransferHandler * transfer )
More information about the Kget
mailing list