From ff25b667276437356158c3856f7e29b092715b3e Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Fri, 29 Jul 2011 13:38:41 +0200 Subject: [PATCH] Cleanup output messages. --- bin/qasim-gui.rb | 17 ++++++++--------- qasim/map.rb | 8 +++----- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/bin/qasim-gui.rb b/bin/qasim-gui.rb index 02b85dd..eac0991 100755 --- a/bin/qasim-gui.rb +++ b/bin/qasim-gui.rb @@ -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 diff --git a/qasim/map.rb b/qasim/map.rb index 430662a..42e1a38 100644 --- a/qasim/map.rb +++ b/qasim/map.rb @@ -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 = [