From 9b1eb727d68a4af4780781618e28d6163af8d588 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Sun, 24 Jul 2011 15:45:34 +0000 Subject: [PATCH] sshfs-mapper qasim: added map.name method. git-svn-id: https://websvn.glenux.net/svn/Upoc/sshfs-mapper/trunk@1710 eaee96b3-f302-0410-b096-c6cfd47f7835 --- bin/qasim-gui.rb | 15 +++------------ qasim/map.rb | 4 +++- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/bin/qasim-gui.rb b/bin/qasim-gui.rb index 861abfc..8dcd992 100755 --- a/bin/qasim-gui.rb +++ b/bin/qasim-gui.rb @@ -70,8 +70,7 @@ module Qasim if map.host != previous_host and not previous_host.nil? then @map_menu.addSeparator end - name = (File.basename map.path).gsub(/\.map$/,'') - itemx = Qt::Action.new(name, @map_menu) + itemx = Qt::Action.new(map.name, @map_menu) itemx.setCheckable true; itemx.connect(SIGNAL(:triggered)) do action_trigger_map_item map, itemx @@ -103,6 +102,8 @@ module Qasim end process.start cmd, cmd_args end + + dbus_notify map.name, "Map connected successfully", 'dialog-information' rescue Map::ConnectError => e puts e.inspect end @@ -153,20 +154,10 @@ module Qasim si.icon = std_icon si.show - dbus_notify "Hello", "World", 'dialog-information' si.setToolTip("Qasim %s" % APP_VERSION); -=begin - Qt::Timer.new(@app) do |timer| - timer.connect(SIGNAL('timeout()')) do - si.icon = (si.icon.isNull ? std_icon : alt_icon) if blinking - end - timer.start(500) - end -=end - build_map_menu build_context_menu diff --git a/qasim/map.rb b/qasim/map.rb index 7660c1c..cc0dd57 100644 --- a/qasim/map.rb +++ b/qasim/map.rb @@ -10,7 +10,8 @@ module Qasim :port, :enable, :user, - :map + :map, + :name class MapParseError < RuntimeError ; end class ConnectError < RuntimeError ; end @@ -28,6 +29,7 @@ module Qasim @cypher = :arcfour @maps = {} @debug = true + @name = (File.basename map_path).gsub(/\.map$/,'') self.load @path end