diff --git a/qasim-gui/qasim.128.png b/qasim-gui/qasim.128.png new file mode 100644 index 0000000..7fe12dc Binary files /dev/null and b/qasim-gui/qasim.128.png differ diff --git a/qasim-gui/qasim.16.png b/qasim-gui/qasim.16.png new file mode 100644 index 0000000..57f12e0 Binary files /dev/null and b/qasim-gui/qasim.16.png differ diff --git a/qasim-gui/qasim.256.png b/qasim-gui/qasim.256.png new file mode 100644 index 0000000..93f0f06 Binary files /dev/null and b/qasim-gui/qasim.256.png differ diff --git a/qasim-gui/qasim.32.png b/qasim-gui/qasim.32.png new file mode 100644 index 0000000..78fafcb Binary files /dev/null and b/qasim-gui/qasim.32.png differ diff --git a/qasim-gui/qasim.64.png b/qasim-gui/qasim.64.png new file mode 100644 index 0000000..ac8fa81 Binary files /dev/null and b/qasim-gui/qasim.64.png differ diff --git a/qasim-gui/qasim.png b/qasim-gui/qasim.png new file mode 100644 index 0000000..2f768b0 Binary files /dev/null and b/qasim-gui/qasim.png differ diff --git a/qasim-gui/qasim.rb b/qasim-gui/qasim.rb new file mode 100755 index 0000000..e0970cf --- /dev/null +++ b/qasim-gui/qasim.rb @@ -0,0 +1,82 @@ +#!/usr/bin/ruby + +require 'Qt4' + +# QaSiM // Qt Sshfs Mapper + +VERSION="0.1" + +def _ str + Qt::Object.tr(str) +end + + +def build_app + + app = Qt::Application.new(ARGV) + si = Qt::SystemTrayIcon.new + + std_icon = Qt::Icon.new('qtsshfsmapper.svg') + alt_icon = Qt::Icon.new + blinking = false + + si.icon = std_icon + si.show + si.setToolTip("Qasim v%s" % VERSION); + + 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 + + ['Diades', 'Daneel', 'Dolos'].each do |name| + itemx = Qt::Action.new(name, menu) + itemx.setCheckable true; + itemx.connect(SIGNAL(:triggered)) do + puts "%s => %s" % [name, itemx.checked ] + end + menu.addAction itemx; + end + + menu.addSeparator + + act_pref = Qt::Action.new _('&Preferences'), menu + act_pref.setIcon( Qt::Icon::fromTheme("configure") ) + act_pref.setIconVisibleInMenu true + menu.addAction act_pref; + + act_about = Qt::Action.new '&About', menu + act_about.setIcon( Qt::Icon::fromTheme("help-about") ) + act_about.setIconVisibleInMenu true + menu.addAction act_about; + + menu.addSeparator + + act_quit = Qt::Action.new _('Quit'), menu + act_quit.setIcon( Qt::Icon::fromTheme("application-exit") ) + act_quit.setIconVisibleInMenu true + act_quit.connect(SIGNAL(:triggered)) { app.quit } + menu.addAction act_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 +end + +build_app + diff --git a/qasim-gui/qasim.svg b/qasim-gui/qasim.svg new file mode 100644 index 0000000..3c755c5 --- /dev/null +++ b/qasim-gui/qasim.svg @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + +