Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial port to qt-only.

  • Loading branch information...
commit 843b29cb62306857b311c3a8a58bee3c3cba6c49 1 parent e6f52be
@pcapriotti authored
View
5 kaya-qt
@@ -0,0 +1,5 @@
+#!/usr/bin/env ruby
+$toolkit = :qt
+require 'lib/kaya.rb'
+
+start_kaya if __FILE__ == $0
View
2  lib/kaya.rb
@@ -36,7 +36,7 @@ def start_kaya
args = KDE::CmdLineArgs.parsed_args
game = if args.count > 0
- name = args.arg(0)
+ name = args[0]
g = Game.get(name.to_sym)
unless g
warn "No such game #{name}. Defaulting to #{default_game}"
View
2  lib/plugins/clocks/lib/clock_display.rb
@@ -45,7 +45,7 @@ def active?
def data=(d)
@caption = translate[d[:color]]
- @player = d[:player] || i18n('(unknown)')
+ @player = d[:player] || KDE::i18n('(unknown)')
items[:caption].text = @caption
items[:player].text = @player
View
2  lib/plugins/movelist/simple_movelist.rb
@@ -60,7 +60,7 @@ def on_force_update
def move(i)
if i == 0
- i18n('Mainline')
+ KDE::i18n('Mainline')
else
state = @history[i - 1].state
move = @history[i].move
View
88 lib/toolkits/compat/qtkde.rb
@@ -0,0 +1,88 @@
+KDE = Qt
+
+Qt::XmlGuiWindow = Qt::MainWindow
+class Qt::MainWindow
+ def action_collection
+ self
+ end
+end
+
+
+Qt::XMLGUIClient = Qt::Object
+
+module ActionHandler
+ def add_action(*args)
+ end
+
+ def std_action(*args)
+ end
+
+ def regular_action(*args)
+ end
+end
+
+module Qt
+ def self.gui(name)
+ ""
+ end
+
+ def self.with_xml_gui(*args)
+ end
+
+ def self.ki18n(str)
+ str
+ end
+
+ def self.i18n(str)
+ str
+ end
+end
+
+class Qt::Application
+ def self.init(data)
+ new(ARGV)
+ end
+end
+
+class KDE::CmdLineArgs
+ def self.parsed_args
+ ARGV
+ end
+end
+
+class KDE::Global
+ def self.config
+ Qt::Settings.new
+ end
+end
+
+class Qt::Settings
+ module GroupMixin
+ def exists
+ false
+ end
+
+ def delete_group
+ end
+
+ def group(name)
+ Group.new
+ end
+
+ def write_entry(*args)
+ end
+
+ def sync
+ end
+
+ def group_list
+ []
+ end
+ end
+
+ include GroupMixin
+
+ class Group
+ include GroupMixin
+ end
+end
View
15 lib/toolkits/kde.rb
@@ -42,8 +42,13 @@ def self.init(data)
KDE::CmdLineArgs.init(ARGV, about)
KDE::CmdLineOptions.new.tap do |opts|
- data[:options].each do |opt, desc|
- opts.add(opt, desc)
+ data[:options].each do |args|
+ case args.size
+ when 2
+ opts.add(args[0], args[1])
+ when 3
+ opts.add(args[0], args[1], args[2])
+ end
end
KDE::CmdLineArgs.add_cmd_line_options opts
end
@@ -52,6 +57,12 @@ def self.init(data)
end
end
+class KDE::CmdLineArgs
+ def [](i)
+ arg(i)
+ end
+end
+
module ActionHandler
def std_action(action, opts = {}, &blk)
target, slot = get_slot(opts[:slot], &blk)
Please sign in to comment.
Something went wrong with that request. Please try again.