From e062cb81bfd525de86edf2800c2966b842447e8c Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Tue, 19 Jul 2011 11:35:04 +0000 Subject: [PATCH] sshfs-mapper: Use svg icon & populate the menu. git-svn-id: https://websvn.glenux.net/svn/Upoc/sshfs-mapper/trunk@1685 eaee96b3-f302-0410-b096-c6cfd47f7835 --- qt-mapper/qtsshfsmapper.rb | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/qt-mapper/qtsshfsmapper.rb b/qt-mapper/qtsshfsmapper.rb index cf9c3c0..ff58293 100755 --- a/qt-mapper/qtsshfsmapper.rb +++ b/qt-mapper/qtsshfsmapper.rb @@ -5,7 +5,7 @@ require 'Qt4' app = Qt::Application.new(ARGV) si = Qt::SystemTrayIcon.new -std_icon = Qt::Icon.new('qtsshfsmapper.32.png') +std_icon = Qt::Icon.new('qtsshfsmapper.svg') alt_icon = Qt::Icon.new blinking = false @@ -20,10 +20,27 @@ Qt::Timer.new(app) do |timer| end menu = Qt::Menu.new -quit = Qt::Action.new('&Quit', menu) -quit.connect(SIGNAL(:triggered)) { app.quit } -menu.addAction(quit) +['Diades', 'Daneel', 'Dolos'].each do |name| + itemx = Qt::Action.new('Diades', menu) + itemx.setCheckable true; + itemx.connect(SIGNAL(:triggered)) { puts itemx.checked } + menu.addAction itemx; +end + +menu.addSeparator + +act_pref = Qt::Action.new '&Preferences', menu +menu.addAction act_pref; + +act_about = Qt::Action.new '&About', menu +menu.addAction act_about; + +menu.addSeparator + +act_quit = Qt::Action.new '&Quit', menu +act_quit.connect(SIGNAL(:triggered)) { app.quit } +menu.addAction act_quit si.contextMenu = menu