qasim-gui: Fixed various little things since structure reorganisation.
git-svn-id: https://websvn.glenux.net/svn/Upoc/sshfs-mapper/trunk@1705 eaee96b3-f302-0410-b096-c6cfd47f7835
This commit is contained in:
parent
6362d896db
commit
e7e1abb8be
1 changed files with 15 additions and 7 deletions
|
@ -36,7 +36,7 @@ module Qasim
|
||||||
'/org/freedesktop/Notifications',
|
'/org/freedesktop/Notifications',
|
||||||
'org.freedesktop.Notifications',
|
'org.freedesktop.Notifications',
|
||||||
'Notify' )
|
'Notify' )
|
||||||
msg.arguments = [ NAME, Qt::Variant.from_value( 0, "unsigned int" ),
|
msg.arguments = [ APP_NAME, Qt::Variant.from_value( 0, "unsigned int" ),
|
||||||
icon, title, body, [], {}, -1 ]
|
icon, title, body, [], {}, -1 ]
|
||||||
rep = bus.call( msg )
|
rep = bus.call( msg )
|
||||||
# if rep.type == Qt::DBusMessage
|
# if rep.type == Qt::DBusMessage
|
||||||
|
@ -45,9 +45,9 @@ module Qasim
|
||||||
# "Sorry dude", 2, 5000 )
|
# "Sorry dude", 2, 5000 )
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.build_app
|
def build_interface
|
||||||
|
|
||||||
app = Qt::Application.new(ARGV)
|
@app = Qt::Application.new(ARGV)
|
||||||
si = Qt::SystemTrayIcon.new
|
si = Qt::SystemTrayIcon.new
|
||||||
|
|
||||||
std_icon = Qt::Icon.new( File.join APP_ICON_PATH, "qasim.svg" )
|
std_icon = Qt::Icon.new( File.join APP_ICON_PATH, "qasim.svg" )
|
||||||
|
@ -61,7 +61,7 @@ module Qasim
|
||||||
|
|
||||||
si.setToolTip("Qasim %s" % VERSION);
|
si.setToolTip("Qasim %s" % VERSION);
|
||||||
|
|
||||||
Qt::Timer.new(app) do |timer|
|
Qt::Timer.new(@app) do |timer|
|
||||||
timer.connect(SIGNAL('timeout()')) do
|
timer.connect(SIGNAL('timeout()')) do
|
||||||
si.icon = (si.icon.isNull ? std_icon : alt_icon) if blinking
|
si.icon = (si.icon.isNull ? std_icon : alt_icon) if blinking
|
||||||
end
|
end
|
||||||
|
@ -96,7 +96,7 @@ module Qasim
|
||||||
act_quit = Qt::Action.new _('Quit'), menu
|
act_quit = Qt::Action.new _('Quit'), menu
|
||||||
act_quit.setIcon( Qt::Icon::fromTheme("application-exit") )
|
act_quit.setIcon( Qt::Icon::fromTheme("application-exit") )
|
||||||
act_quit.setIconVisibleInMenu true
|
act_quit.setIconVisibleInMenu true
|
||||||
act_quit.connect(SIGNAL(:triggered)) { app.quit }
|
act_quit.connect(SIGNAL(:triggered)) { @app.quit }
|
||||||
menu.addAction act_quit
|
menu.addAction act_quit
|
||||||
|
|
||||||
si.contextMenu = menu
|
si.contextMenu = menu
|
||||||
|
@ -111,13 +111,21 @@ module Qasim
|
||||||
when Qt::SystemTrayIcon::DoubleClick: puts 'Double Click'
|
when Qt::SystemTrayIcon::DoubleClick: puts 'Double Click'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
app.exec
|
def run
|
||||||
|
@app.exec
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.main
|
||||||
|
qasim = QasimGui.new
|
||||||
|
qasim.build_interface
|
||||||
|
qasim.run
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Qasim::QasimGui::build_app
|
Qasim::QasimGui::main
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue