[Kst] branches/work/kst/pluginify/kst/src
Adam Treat
treat at kde.org
Tue Sep 5 21:48:31 CEST 2006
SVN commit 581250 by treat:
Add a combo for now to invoke the kstdataobject's showDialog() method.
Each plugin can now present its own config dialog.
M +41 -24 libkstapp/datamanager.ui
M +11 -1 libkstapp/kstdatamanager_i.cpp
M +1 -0 libkstapp/kstdatamanager_i.h
M +0 -1 libkstmath/kstdataobject.cpp
M +1 -1 plugins/testplugin/testplugin.cpp
M +3 -0 plugins/testplugin/testplugin.h
--- branches/work/kst/pluginify/kst/src/libkstapp/datamanager.ui #581249:581250
@@ -1,4 +1,4 @@
-<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>KstDataManager</class>
<widget class="QDialog">
<property name="name">
@@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>879</width>
- <height>514</height>
+ <width>883</width>
+ <height>527</height>
</rect>
</property>
<property name="caption">
@@ -109,19 +109,22 @@
<property name="title">
<string>New</string>
</property>
- <grid>
+ <vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QPushButton" row="0" column="0">
+ <widget class="QPushButton">
<property name="name">
<cstring>NewVector</cstring>
</property>
<property name="text">
<string>&Vector...</string>
</property>
+ <property name="accel">
+ <string>Alt+V</string>
+ </property>
</widget>
- <widget class="QPushButton" row="1" column="0">
+ <widget class="QPushButton">
<property name="name">
<cstring>NewCurve</cstring>
</property>
@@ -129,23 +132,29 @@
<string>C&urve...</string>
</property>
</widget>
- <widget class="QPushButton" row="2" column="0">
+ <widget class="QPushButton">
<property name="name">
<cstring>NewEq</cstring>
</property>
<property name="text">
<string>E&quation...</string>
</property>
+ <property name="accel">
+ <string>Alt+Q</string>
+ </property>
</widget>
- <widget class="QPushButton" row="3" column="0">
+ <widget class="QPushButton">
<property name="name">
<cstring>NewHs</cstring>
</property>
<property name="text">
<string>&Histogram...</string>
</property>
+ <property name="accel">
+ <string>Alt+H</string>
+ </property>
</widget>
- <widget class="QPushButton" row="4" column="0">
+ <widget class="QPushButton">
<property name="name">
<cstring>NewPSD</cstring>
</property>
@@ -153,23 +162,15 @@
<string>Po&wer Spectrum...</string>
</property>
</widget>
- <widget class="QPushButton" row="5" column="0">
+ <widget class="QPushButton">
<property name="name">
- <cstring>NewPlugin</cstring>
- </property>
- <property name="text">
- <string>Plu&gin...</string>
- </property>
- </widget>
- <widget class="QPushButton" row="6" column="0">
- <property name="name">
<cstring>NewEvent</cstring>
</property>
<property name="text">
<string>Event &Monitor...</string>
</property>
</widget>
- <widget class="QPushButton" row="7" column="0">
+ <widget class="QPushButton">
<property name="name">
<cstring>NewMatrix</cstring>
</property>
@@ -177,7 +178,7 @@
<string>M&atrix...</string>
</property>
</widget>
- <widget class="QPushButton" row="8" column="0">
+ <widget class="QPushButton">
<property name="name">
<cstring>NewImage</cstring>
</property>
@@ -185,7 +186,7 @@
<string>&Image...</string>
</property>
</widget>
- <widget class="QPushButton" row="9" column="0">
+ <widget class="QPushButton">
<property name="name">
<cstring>NewCSD</cstring>
</property>
@@ -193,8 +194,24 @@
<string>C&SD...</string>
</property>
</widget>
- <spacer row="10" column="0">
+ <widget class="QPushButton">
<property name="name">
+ <cstring>NewPlugin</cstring>
+ </property>
+ <property name="text">
+ <string>Plu&gin...</string>
+ </property>
+ <property name="accel">
+ <string>Alt+G</string>
+ </property>
+ </widget>
+ <widget class="KComboBox">
+ <property name="name">
+ <cstring>NewPluginCombo</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
<cstring>spacer7</cstring>
</property>
<property name="orientation">
@@ -206,11 +223,11 @@
<property name="sizeHint">
<size>
<width>20</width>
- <height>20</height>
+ <height>100</height>
</size>
</property>
</spacer>
- </grid>
+ </vbox>
</widget>
<widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="2">
<property name="name">
--- branches/work/kst/pluginify/kst/src/libkstapp/kstdatamanager_i.cpp #581249:581250
@@ -25,6 +25,7 @@
#include <klistview.h>
#include <kmessagebox.h>
#include <kstandarddirs.h>
+#include <kcombobox.h>
// application specific includes
#include "datasourcemetadatadialog.h"
@@ -604,7 +605,8 @@
connect(DataView, SIGNAL(contextMenuRequested(QListViewItem*, const QPoint&, int)), this, SLOT(contextMenu(QListViewItem*, const QPoint&, int)));
- KstDataObject::pluginList();
+ NewPluginCombo->insertStringList( KstDataObject::pluginList() );
+ connect(NewPluginCombo, SIGNAL(activated(const QString &)), this, SLOT(newPluginConfigDialog(const QString &)));
}
@@ -612,6 +614,14 @@
}
+void KstDataManagerI::newPluginConfigDialog( const QString &name )
+{
+ KstDataObjectPtr ptr = KstDataObject::plugin( name );
+ Q_ASSERT( ptr );
+ ptr->showDialog();
+}
+
+
void KstDataManagerI::show_I() {
show();
raise();
--- branches/work/kst/pluginify/kst/src/libkstapp/kstdatamanager_i.h #581249:581250
@@ -47,6 +47,7 @@
void doUpdates();
void contextMenu(QListViewItem *i, const QPoint& p, int c);
void currentChanged(QListViewItem *);
+ void newPluginConfigDialog( const QString &name );
private:
KstDoc *doc;
--- branches/work/kst/pluginify/kst/src/libkstmath/kstdataobject.cpp #581249:581250
@@ -121,7 +121,6 @@
if (pluginInfo.isEmpty()) {
scanPlugins();
}
- kdDebug() << pluginInfo.keys() << endl;
return pluginInfo.keys();
}
--- branches/work/kst/pluginify/kst/src/plugins/testplugin/testplugin.cpp #581249:581250
@@ -23,7 +23,7 @@
K_EXPORT_COMPONENT_FACTORY( kstobject_testplugin,
KGenericFactory<TestPlugin>( "kstobject_testplugin" ) )
-TestPlugin::TestPlugin( QObject *parent, const char *name, const QStringList &args )
+TestPlugin::TestPlugin( QObject */*parent*/, const char */*name*/, const QStringList &/*args*/ )
: KstDataObject() {
_name = "testplugin";
--- branches/work/kst/pluginify/kst/src/plugins/testplugin/testplugin.h #581249:581250
@@ -19,6 +19,8 @@
#include <kstdataobject.h>
+#include <kmessagebox.h>
+
class TestPlugin : public KstDataObject {
Q_OBJECT
public:
@@ -45,6 +47,7 @@
protected slots:
virtual void _showDialog()
{
+ KMessageBox::information( 0, "insert testplugin config widget here :)", "testpluginconfig" );
}
private:
More information about the Kst
mailing list