[Kde-bindings] KDE/kdebase/workspace/plasma/scriptengines/ruby
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Wed Nov 5 20:42:52 UTC 2008
SVN commit 880554 by rdale:
2008-11-05 Richard Dale <richard.j.dale at gmail.com>
* Fixed some bugs in the DataEngineScript class. The expected path was
'plasma/engines' whereas the plasmapkg tool installs them in
'plasma/dataengines'. The mainScript() and package() methods hadn't been
implemented and were added.
* Added a 'ruby_time' example scripting data engine
CCMAIL: kde-bindings at kde.org
M +7 -0 ChangeLog
M +56 -0 applet.rb
M +16 -4 data_engine.rb
A examples/dataengines (directory)
AM examples/dataengines/ruby_time (directory)
A examples/dataengines/ruby_time/contents (directory)
A examples/dataengines/ruby_time/contents/code (directory)
A examples/dataengines/ruby_time/contents/code/main.rb
A examples/dataengines/ruby_time/metadata.desktop
--- trunk/KDE/kdebase/workspace/plasma/scriptengines/ruby/ChangeLog #880553:880554
@@ -1,3 +1,10 @@
+2008-11-05 Richard Dale <richard.j.dale at gmail.com>
+* Fixed some bugs in the DataEngineScript class. The expected path was
+ 'plasma/engines' whereas the plasmapkg tool installs them in
+ 'plasma/dataengines'. The mainScript() and package() methods hadn't been
+ implemented and were added.
+* Added a 'ruby_time' example scripting data engine
+
2008-10-30 Richard Dale <richard.j.dale at gmail.com>
* Separated the script engine plugins from the plasma ruby extension and moved
the script engine code to kdebase with the other script engines
--- trunk/KDE/kdebase/workspace/plasma/scriptengines/ruby/applet.rb #880553:880554
@@ -291,6 +291,16 @@
# argument passed for the real Plasma::Applet in the ScriptEngine
#
+ class BusyWidget < Qt::Base
+ def initialize(parent = nil)
+ if parent.kind_of?(PlasmaScripting::Applet)
+ super(parent.applet_script.applet)
+ else
+ super
+ end
+ end
+ end
+
class CheckBox < Qt::Base
def initialize(parent = nil)
if parent.kind_of?(PlasmaScripting::Applet)
@@ -311,6 +321,16 @@
end
end
+ class Extender < Qt::Base
+ def initialize(parent = nil)
+ if parent.kind_of?(PlasmaScripting::Applet)
+ super(parent.applet_script.applet)
+ else
+ super
+ end
+ end
+ end
+
class FlashingLabel < Qt::Base
def initialize(parent = nil)
if parent.kind_of?(PlasmaScripting::Applet)
@@ -405,6 +425,16 @@
end
end
+ class ScrollBar < Qt::Base
+ def initialize(orientation, parent = nil)
+ if parent.kind_of?(PlasmaScripting::Applet)
+ super(orientation, parent.applet_script.applet)
+ else
+ super
+ end
+ end
+ end
+
class SignalPlotter < Qt::Base
def initialize(parent = nil)
if parent.kind_of?(PlasmaScripting::Applet)
@@ -425,6 +455,20 @@
end
end
+ class SvgWidget < Qt::Base
+ def initialize(*args)
+ if args.length > 0 && args[0].kind_of?(PlasmaScripting::Applet)
+ args[0] = args[0].applet_script.applet
+ super(*args)
+ elsif args.length > 2 && args[2].kind_of?(PlasmaScripting::Applet)
+ args[2] = args[2].applet_script.applet
+ super(*args)
+ else
+ super
+ end
+ end
+ end
+
class TabBar < Qt::Base
def initialize(parent = nil)
if parent.kind_of?(PlasmaScripting::Applet)
@@ -445,6 +489,16 @@
end
end
+ class TreeView < Qt::Base
+ def initialize(parent = nil)
+ if parent.kind_of?(PlasmaScripting::Applet)
+ super(parent.applet_script.applet)
+ else
+ super
+ end
+ end
+ end
+
class WebView < Qt::Base
def initialize(parent = nil)
if parent.kind_of?(PlasmaScripting::Applet)
@@ -572,3 +626,5 @@
end
end
end
+
+# kate: space-indent on; indent-width 2; replace-tabs on; mixed-indent off;
--- trunk/KDE/kdebase/workspace/plasma/scriptengines/ruby/data_engine.rb #880553:880554
@@ -39,6 +39,11 @@
end
def setData(*args)
+ if args.length == 2 && !args[1].kind_of?(Qt::Variant)
+ args[1] = Qt::Variant.new(args[1])
+ elsif args.length == 3 && !args[2].kind_of?(Qt::Variant)
+ args[2] = Qt::Variant.new(args[2])
+ end
@data_engine_script.setData(*args)
end
@@ -99,7 +104,7 @@
program = Qt::FileInfo.new(mainScript)
$: << program.path
load Qt::File.encodeName(program.filePath).to_s
- moduleName = camelize(package.metadata.name)
+ moduleName = camelize(Qt::Dir.new(package.path).dirName)
className = camelize(program.baseName)
puts "RubyAppletScript::DataEngine#init instantiating: #{moduleName}::#{className}"
klass = Object.const_get(moduleName.to_sym).const_get(className.to_sym)
@@ -108,12 +113,19 @@
return true
end
+ def sources
+ @data_engine_script.sources
+ end
+
def sourceRequestEvent(name)
- @data_engine.sourceRequestEvent(name)
+ @data_engine_script.sourceRequestEvent(name)
end
def updateSourceEvent(source)
- @data_engine.updateSourceEvent(source)
+ @data_engine_script.updateSourceEvent(source)
end
end
-end
\ No newline at end of file
+end
+
+# kate: space-indent on; indent-width 2; replace-tabs on; mixed-indent off;
+
** trunk/KDE/kdebase/workspace/plasma/scriptengines/ruby/examples/dataengines/ruby_time #property svn:mergeinfo
+
More information about the Kde-bindings
mailing list