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
This commit is contained in:
Glenn Y. Rolland 2011-07-19 11:35:04 +00:00
parent 438c78bb10
commit e062cb81bf

View file

@ -5,7 +5,7 @@ require 'Qt4'
app = Qt::Application.new(ARGV) app = Qt::Application.new(ARGV)
si = Qt::SystemTrayIcon.new si = Qt::SystemTrayIcon.new
std_icon = Qt::Icon.new('qtsshfsmapper.32.png') std_icon = Qt::Icon.new('qtsshfsmapper.svg')
alt_icon = Qt::Icon.new alt_icon = Qt::Icon.new
blinking = false blinking = false
@ -20,10 +20,27 @@ Qt::Timer.new(app) do |timer|
end end
menu = Qt::Menu.new menu = Qt::Menu.new
quit = Qt::Action.new('&Quit', menu)
quit.connect(SIGNAL(:triggered)) { app.quit } ['Diades', 'Daneel', 'Dolos'].each do |name|
menu.addAction(quit) 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 si.contextMenu = menu