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
This commit is contained in:
Glenn Y. Rolland 2011-07-24 15:45:34 +00:00
parent cf584cc633
commit 9b1eb727d6
2 changed files with 6 additions and 13 deletions

View file

@ -70,8 +70,7 @@ module Qasim
if map.host != previous_host and not previous_host.nil? then if map.host != previous_host and not previous_host.nil? then
@map_menu.addSeparator @map_menu.addSeparator
end end
name = (File.basename map.path).gsub(/\.map$/,'') itemx = Qt::Action.new(map.name, @map_menu)
itemx = Qt::Action.new(name, @map_menu)
itemx.setCheckable true; itemx.setCheckable true;
itemx.connect(SIGNAL(:triggered)) do itemx.connect(SIGNAL(:triggered)) do
action_trigger_map_item map, itemx action_trigger_map_item map, itemx
@ -103,6 +102,8 @@ module Qasim
end end
process.start cmd, cmd_args process.start cmd, cmd_args
end end
dbus_notify map.name, "Map connected successfully", 'dialog-information'
rescue Map::ConnectError => e rescue Map::ConnectError => e
puts e.inspect puts e.inspect
end end
@ -153,20 +154,10 @@ module Qasim
si.icon = std_icon si.icon = std_icon
si.show si.show
dbus_notify "Hello", "World", 'dialog-information'
si.setToolTip("Qasim %s" % APP_VERSION); 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_map_menu
build_context_menu build_context_menu

View file

@ -10,7 +10,8 @@ module Qasim
:port, :port,
:enable, :enable,
:user, :user,
:map :map,
:name
class MapParseError < RuntimeError ; end class MapParseError < RuntimeError ; end
class ConnectError < RuntimeError ; end class ConnectError < RuntimeError ; end
@ -28,6 +29,7 @@ module Qasim
@cypher = :arcfour @cypher = :arcfour
@maps = {} @maps = {}
@debug = true @debug = true
@name = (File.basename map_path).gsub(/\.map$/,'')
self.load @path self.load @path
end end