Cleanup output messages.

This commit is contained in:
Glenn Y. Rolland 2011-07-29 13:38:41 +02:00
parent e6be2a649b
commit ff25b66727
2 changed files with 11 additions and 14 deletions

View file

@ -91,21 +91,18 @@ module Qasim
# Action when map item triggered
#
def action_trigger_map_item map, item
puts "%s => %s" % [map.path, item.checked ]
@connect_error[map.path] = Set.new
@connect_running[map.path] = 0
if map.connected? then
puts "disconnect !"
method = :disconnect
else
puts "connect !"
method = :connect
end
begin
map.send(method) do |linkname,cmd,cmd_args|
process = Qt::Process.new
process.connect(SIGNAL('finished(int, QProcess::ExitStatus)')) do |exitcode,exitstatus|
puts "exitcode = %s, exitstatus = %s" % [exitcode, exitstatus]
#puts "exitcode = %s, exitstatus = %s" % [exitcode, exitstatus]
@connect_running[map.path] -= 1
if exitcode != 0 then
@connect_error[map.path].add linkname
@ -134,7 +131,6 @@ module Qasim
rescue Map::ConnectError => e
puts e.inspect
end
#FIXME: on error, setChecked false
end
#
@ -190,14 +186,17 @@ module Qasim
si.connect(SIGNAL('activated(QSystemTrayIcon::ActivationReason)')) do |reason|
case reason
when Qt::SystemTrayIcon::Trigger
when Qt::SystemTrayIcon::Trigger then
build_map_menu
@map_menu.popup(Qt::Cursor::pos())
#blinking = !blinking
#si.icon = blinking ? alt_icon : std_icon
when Qt::SystemTrayIcon::MiddleClick: puts 'Middle Click'
when Qt::SystemTrayIcon::Context: puts 'Right Click'
when Qt::SystemTrayIcon::DoubleClick: puts 'Double Click'
when Qt::SystemTrayIcon::MiddleClick then
#
when Qt::SystemTrayIcon::Context then
#
when Qt::SystemTrayIcon::DoubleClick then
#
end
end
end

View file

@ -30,7 +30,7 @@ module Qasim
@user = nil
@cypher = :arcfour
@links = {}
@debug = true
@debug = false
@name = (File.basename map_path).gsub(/\.map$/,'')
self.load @path
@ -47,7 +47,7 @@ module Qasim
linect += 1
while line =~ /\$(\w+)/ do
puts "FOUND PATTERN %s => %s" % [$1, local_env[$1]]
#puts "FOUND PATTERN %s => %s" % [$1, local_env[$1]]
case line
when /\$\{(.+)\}/ then
pattern = $1
@ -57,7 +57,7 @@ module Qasim
pattern = $1
line.gsub!(/\$#{pattern}/,local_env[pattern])
else
puts "unknown pattern: %s" % line
puts "w: unknown pattern: %s" % line
end
end
@ -143,7 +143,6 @@ module Qasim
#
# FIXME: test connexion with Net::SSH + timeout or ask password
@links.each do |name, remotepath|
pp map
localpath = File.join ENV['HOME'], "mnt", name
cmd = "sshfs"
cmd_args = [
@ -175,7 +174,6 @@ module Qasim
def disconnect &block
puts "Disconnecting map #{@path}"
@links.each do |name, remotepath|
pp map
localpath = File.join ENV['HOME'], "mnt", name
cmd = "fusermount"
cmd_args = [