From 1c0cfa88e5699e91d3c4b10098cfa1f0d4bb4d00 Mon Sep 17 00:00:00 2001 From: glenux Date: Thu, 21 Jul 2011 14:36:33 +0000 Subject: [PATCH] sshfs-mapper qasim-gui: Use real map list from configuration. git-svn-id: https://websvn.glenux.net/svn/Upoc/sshfs-mapper/trunk@1706 eaee96b3-f302-0410-b096-c6cfd47f7835 --- bin/qasim-gui.rb | 6 +++++- qasim/config.rb | 2 +- qasim/map.rb | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/qasim-gui.rb b/bin/qasim-gui.rb index 74db743..d7feebe 100755 --- a/bin/qasim-gui.rb +++ b/bin/qasim-gui.rb @@ -22,6 +22,9 @@ module Qasim def initialize + @config = Config.new + @config.parse_cmd_line ARGV + @config.parse_file end def dbus_notify title, body, icon @@ -70,7 +73,8 @@ module Qasim menu = Qt::Menu.new - ['Diades', 'Daneel', 'Dolos'].each do |name| + @config.maps.each do |map| + name = (File.basename map.path).gsub(/\.map$/,'') itemx = Qt::Action.new(name, menu) itemx.setCheckable true; itemx.connect(SIGNAL(:triggered)) do diff --git a/qasim/config.rb b/qasim/config.rb index 63ae5db..10f84c0 100644 --- a/qasim/config.rb +++ b/qasim/config.rb @@ -9,7 +9,7 @@ require 'find' require 'rubygems' require 'rdebug/base' -module SshfsMapper +module Qasim class Config attr_reader :maps_active diff --git a/qasim/map.rb b/qasim/map.rb index ed3fb53..6a3904e 100644 --- a/qasim/map.rb +++ b/qasim/map.rb @@ -2,7 +2,7 @@ require 'rubygems' require 'rdebug/base' -module SshfsMapper +module Qasim class Map attr_reader :path,