Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update icon in AppIndicator

  • Loading branch information...
commit 7ff0b0e943b97b6f2281e4f2d4078f9c80984063 1 parent 0afaeeb
@cmur2 authored
View
2  README.md
@@ -39,7 +39,7 @@ And then the [ruby-libappindicator bindings as a gem](https://github.com/leander
gem install ruby-libappindicator
-Note: be beware that this is an experimentl feature and that the bindings are stated
+Note: be beware that this is an experimental feature and that the bindings are stated
as 'beta' by their author.
Usage
View
3  gloudapp.gemspec
@@ -10,7 +10,6 @@ Gem::Specification.new do |s|
s.email = GloudApp::Info::AUTHORS.map { |author| author[1] }
s.homepage = GloudApp::Info::HOMEPAGE
s.summary = GloudApp::Info::SUMMARY
- #s.description = %q{CloudApp client for GNOME/GTK}
s.rubyforge_project = "gloudapp"
@@ -19,8 +18,6 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- # specify any dependencies here; for example:
- # s.add_development_dependency "rspec"
s.add_runtime_dependency "cloudapp_api"
s.add_runtime_dependency "gtk2"
s.add_runtime_dependency "json"
View
32 lib/gloudapp.rb
@@ -185,14 +185,14 @@ def upload_via_chooser
# timeout to close file chooser before blocking gtk thread
Gtk.timeout_add 50 do
if upload_file(file)
- @tray.icon = Icon.finish
+ @tray.icon = Icon.finish_path
end
false
end
false
else
file_dlg.destroy
- @tray.icon = Icon.normal
+ @tray.icon = Icon.normal_path
false
end
end
@@ -228,7 +228,7 @@ def error(message)
options = {:message => message} unless message.is_a?(Hash)
options = {:title => 'GloudApp - Error'}.merge(options)
- @tray.icon = Icon.error
+ @tray.icon = Icon.error_path
@tray.message = options[:message]
ErrorDialog.run!(options[:title], options[:message])
false
@@ -237,14 +237,14 @@ def error(message)
class Icon
def self.icon(icon) File.join(File.dirname(__FILE__), 'gloudapp', 'icons', icon + '.png') end
- def self.normal_path; self.icon 'gloudapp' end
- def self.finish_path; self.icon 'gloudapp_finish' end
- def self.working_path; self.icon 'gloudapp_working' end
- def self.error_path; self.icon 'gloudapp_error' end
- def self.normal; Gdk::Pixbuf.new(normal_path) end
- def self.finish; Gdk::Pixbuf.new(finish_path) end
+ def self.normal_path; self.icon('gloudapp') end
+ def self.finish_path; self.icon('gloudapp_finish') end
+ def self.working_path; self.icon('gloudapp_working') end
+ def self.error_path; self.icon('gloudapp_error') end
+ def self.normal; Gdk::Pixbuf.new(normal_path) end
+ def self.finish; Gdk::Pixbuf.new(finish_path) end
def self.working; Gdk::Pixbuf.new(working_path) end
- def self.error; Gdk::Pixbuf.new(error_path) end
+ def self.error; Gdk::Pixbuf.new(error_path) end
end
class Tray
@@ -282,7 +282,7 @@ def run!
action[:show].call(action[:item])
end
end
- self.icon = Icon.normal
+ self.icon = Icon.normal_path
self.message = nil
@menu.popup(nil, nil, button, time)
end
@@ -301,7 +301,11 @@ def run!
end
def icon=(icon)
- @si.pixbuf = icon.is_a?(Gdk::Pixbuf) ? icon : Gdk::Pixbuf.new(icon)
+ @si.pixbuf = Gdk::Pixbuf.new(icon)
+ if not @ai.nil?
+ # this relies on direct local file paths which works though it shouldn't
+ @ai.set_icon(icon)
+ end
end
def message=(message)
@@ -311,13 +315,13 @@ def message=(message)
private
def run_action(proc, no_icon_change = false)
if proc.is_a?(Proc)
- self.icon = Icon.working unless no_icon_change
+ self.icon = Icon.working_path unless no_icon_change
# timeout action to get at least on repaint event after
# changing icon to working image
Gtk.timeout_add 50 do
if proc.call
- self.icon = Icon.finish unless no_icon_change
+ self.icon = Icon.finish_path unless no_icon_change
end
false
end
View
2  lib/gloudapp/info.rb
@@ -1,6 +1,6 @@
module GloudApp
module Info
- VERSION = "1.2.0"
+ VERSION = "1.3.0"
AUTHORS = [
["Christian Nicolai", "chrnicolai@gmail.com"],
["Jan Graichen", "jan.graichen@altimos.de"]
Please sign in to comment.
Something went wrong with that request. Please try again.