diff --git a/qt-mapper/qtsshfsmapper.32.png b/qt-mapper/qtsshfsmapper.32.png new file mode 100644 index 0000000..5b51f9f Binary files /dev/null and b/qt-mapper/qtsshfsmapper.32.png differ diff --git a/qt-mapper/qtsshfsmapper.64.png b/qt-mapper/qtsshfsmapper.64.png new file mode 100644 index 0000000..638e764 Binary files /dev/null and b/qt-mapper/qtsshfsmapper.64.png differ diff --git a/qt-mapper/qtsshfsmapper.png b/qt-mapper/qtsshfsmapper.png new file mode 100644 index 0000000..2f768b0 Binary files /dev/null and b/qt-mapper/qtsshfsmapper.png differ diff --git a/qt-mapper/qtsshfsmapper.rb b/qt-mapper/qtsshfsmapper.rb new file mode 100755 index 0000000..cf9c3c0 --- /dev/null +++ b/qt-mapper/qtsshfsmapper.rb @@ -0,0 +1,41 @@ +#!/usr/bin/ruby + +require 'Qt4' + +app = Qt::Application.new(ARGV) +si = Qt::SystemTrayIcon.new + +std_icon = Qt::Icon.new('qtsshfsmapper.32.png') +alt_icon = Qt::Icon.new +blinking = false + +si.icon = std_icon +si.show + +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 + +menu = Qt::Menu.new +quit = Qt::Action.new('&Quit', menu) + +quit.connect(SIGNAL(:triggered)) { app.quit } +menu.addAction(quit) + +si.contextMenu = menu + +si.connect(SIGNAL('activated(QSystemTrayIcon::ActivationReason)')) do |reason| + case reason + when Qt::SystemTrayIcon::Trigger + blinking = !blinking + si.icon = blinking ? alt_icon : std_icon + when Qt::SystemTrayIcon::MiddleClick: puts 'Middle Click' + when Qt::SystemTrayIcon::Context: puts 'Right Click' + when Qt::SystemTrayIcon::DoubleClick: puts 'Double Click' + end +end + +app.exec diff --git a/qt-mapper/qtsshfsmapper.svg b/qt-mapper/qtsshfsmapper.svg new file mode 100644 index 0000000..646273a --- /dev/null +++ b/qt-mapper/qtsshfsmapper.svg @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + +