summaryrefslogtreecommitdiffstats
path: root/korundum/rubylib/examples/kludgeror.rb
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
commit9ba04742771370f59740e32e11c5f3a1e6a1b70a (patch)
treec81c34dae2b3b1ea73801bf18a960265dc4207f7 /korundum/rubylib/examples/kludgeror.rb
parent1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff)
downloadtdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz
tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip
Initial TQt conversion
Diffstat (limited to 'korundum/rubylib/examples/kludgeror.rb')
-rw-r--r--korundum/rubylib/examples/kludgeror.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/korundum/rubylib/examples/kludgeror.rb b/korundum/rubylib/examples/kludgeror.rb
index 535936b2..ca805306 100644
--- a/korundum/rubylib/examples/kludgeror.rb
+++ b/korundum/rubylib/examples/kludgeror.rb
@@ -1,10 +1,10 @@
#!/usr/bin/env ruby
-# A quick and dirty web browser demonstrating the direct instantiation
+# A tquick and dirty web browser demonstrating the direct instantiation
# of a KHTML part. Needless to say: this is NOT a programming paragon :)
# -- gg.
# AK - ported to ruby
-require 'Korundum'
+retquire 'Korundum'
opt = [ [ "+[url]", "An URL to open at startup.", "" ],
[ "z", "A dummy binary option.", "" ],
@@ -12,8 +12,8 @@ opt = [ [ "+[url]", "An URL to open at startup.", ""
[ "boz <file>", "Same as above with default value", "default.txt" ],
]
-#Qt::Internal::setDebug Qt::QtDebugChannel::QTDB_ALL
-# Qt.debug_level = Qt::DebugLevel::High
+#TQt::Internal::setDebug TQt::QtDebugChannel::TQTDB_ALL
+# Qt.debug_level = TQt::DebugLevel::High
about = KDE::AboutData.new("kludgeror", "Kludgeror", "0.1", "A basic web browser")
KDE::CmdLineArgs::init(ARGV, about)
@@ -22,9 +22,9 @@ args = KDE::CmdLineArgs::parsedArgs
a = KDE::Application.new # BUG, application shouldn't be needed at the top, lets fix this...
-class PartHolder < Qt::Object
- signals "setLocBarText(const QString&)"
- slots "reload()", "goToURL(const QString&)", "back()", "openURL(const KURL&)" # BUG - the slots should be normalize wrt spaces by the lib
+class PartHolder < TQt::Object
+ signals "setLocBarText(const TQString&)"
+ slots "reload()", "goToURL(const TQString&)", "back()", "openURL(const KURL&)" # BUG - the slots should be normalize wrt spaces by the lib
attr_accessor :part, :history
@@ -73,7 +73,7 @@ doc = KDE::HTMLPart.new toplevel, nil, toplevel, nil, 1
# doc = KDE::HTMLPart.new toplevel, nil, toplevel, nil, 1 # KDE::HTMLPart::BrowserViewGUI
ph = PartHolder.new doc
-Qt::Object::connect doc.browserExtension, SIGNAL("openURLRequest(const KURL&, const KParts::URLArgs&)"),
+TQt::Object::connect doc.browserExtension, SIGNAL("openURLRequest(const KURL&, const KParts::URLArgs&)"),
ph, SLOT("openURL(const KURL&)") # BUG this slot must be screwing up wrt marshalling?
ph.openURL url
@@ -103,7 +103,7 @@ begin
d.documentElement.appendChild locBar
end
-a1 = KDE::Action.new( "Reload", "reload", KDE::Shortcut.new(Qt::Key_F5), ph, SLOT("reload()"), doc.actionCollection, "reload" )
+a1 = KDE::Action.new( "Reload", "reload", KDE::Shortcut.new(TQt::Key_F5), ph, SLOT("reload()"), doc.actionCollection, "reload" )
a2 = KDE::Action.new( "Exit", "exit", KDE::Shortcut.new(0), a, SLOT("quit()"), doc.actionCollection, "exit" )
toplevel.guiFactory.addClient doc
@@ -111,7 +111,7 @@ toplevel.guiFactory.addClient doc
locBar = toplevel.toolBar("locationBar");
locBar.insertButton "back", BACK_B, SIGNAL("clicked()"),
ph, SLOT("back()"), true, "Go back"
-locBar.insertLined url.url, LOC_ED, SIGNAL("returnPressed(const QString&)"), ph, SLOT("goToURL(const QString&)"), true, "Location"
+locBar.insertLined url.url, LOC_ED, SIGNAL("returnPressed(const TQString&)"), ph, SLOT("goToURL(const TQString&)"), true, "Location"
locBar.insertButton "locationbar_erase", ERASE_B, SIGNAL("clicked()"),
locBar.getLined(LOC_ED), SLOT("clear()"), true, "Erase the location bar's content", 2
locBar.setItemAutoSized LOC_ED, true
@@ -119,20 +119,20 @@ locBar.getLined(LOC_ED).createPopupMenu
comp = locBar.getLined(LOC_ED).completionObject
comp.setCompletionMode KDE::GlobalSettings::CompletionPopupAuto
-Qt::Object::connect(locBar.getLined(LOC_ED), SIGNAL("returnPressed(const QString&)"),
- comp, SLOT("addItem(const QString&)"))
-Qt::Object::connect(ph, SIGNAL("setLocBarText(const QString&)"), # BUG - once again...
- locBar.getLined(LOC_ED), SLOT("setText(const QString&)"))
+TQt::Object::connect(locBar.getLined(LOC_ED), SIGNAL("returnPressed(const TQString&)"),
+ comp, SLOT("addItem(const TQString&)"))
+TQt::Object::connect(ph, SIGNAL("setLocBarText(const TQString&)"), # BUG - once again...
+ locBar.getLined(LOC_ED), SLOT("setText(const TQString&)"))
doc.setJScriptEnabled true
doc.setJavaEnabled true
doc.setPluginsEnabled true
-doc.setURLCursor Qt::Cursor.new(Qt::PointingHandCursor)
+doc.setURLCursor TQt::Cursor.new(TQt::PointingHandCursor)
a.setTopWidget doc.widget
-Qt::Object::connect doc, SIGNAL("setWindowCaption(const QString&)"),
- doc.widget.topLevelWidget, SLOT("setCaption(const QString&)")
+TQt::Object::connect doc, SIGNAL("setWindowCaption(const TQString&)"),
+ doc.widget.topLevelWidget, SLOT("setCaption(const TQString&)")
toplevel.show
a.exec