gloudapp 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +14 -0
- data/gloudapp.gemspec +0 -3
- data/lib/gloudapp/info.rb +1 -1
- data/lib/gloudapp.rb +29 -14
- metadata +6 -8
data/README.md
CHANGED
@@ -28,6 +28,20 @@ but rvm ist strongly recommended because some
|
|
28
28
|
[linux distributions](https://bugs.launchpad.net/ubuntu/+source/gems/+bug/145267)
|
29
29
|
do not add rubygem binaries to PATH)
|
30
30
|
|
31
|
+
### Ubuntu and AppIndicator (experimental)
|
32
|
+
|
33
|
+
People using newer versions of Ubuntu don't see the StatusIcon of GloudApp anymore.
|
34
|
+
To solve this you should install the libappindicator header files:
|
35
|
+
|
36
|
+
sudo apt-get install libappindicator-dev
|
37
|
+
|
38
|
+
And then the [ruby-libappindicator bindings as a gem](https://github.com/leander256/ruby_libappindicator):
|
39
|
+
|
40
|
+
gem install ruby-libappindicator
|
41
|
+
|
42
|
+
Note: be beware that this is an experimental feature and that the bindings are stated
|
43
|
+
as 'beta' by their author.
|
44
|
+
|
31
45
|
Usage
|
32
46
|
-----
|
33
47
|
|
data/gloudapp.gemspec
CHANGED
@@ -10,7 +10,6 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.email = GloudApp::Info::AUTHORS.map { |author| author[1] }
|
11
11
|
s.homepage = GloudApp::Info::HOMEPAGE
|
12
12
|
s.summary = GloudApp::Info::SUMMARY
|
13
|
-
#s.description = %q{CloudApp client for GNOME/GTK}
|
14
13
|
|
15
14
|
s.rubyforge_project = "gloudapp"
|
16
15
|
|
@@ -19,8 +18,6 @@ Gem::Specification.new do |s|
|
|
19
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
19
|
s.require_paths = ["lib"]
|
21
20
|
|
22
|
-
# specify any dependencies here; for example:
|
23
|
-
# s.add_development_dependency "rspec"
|
24
21
|
s.add_runtime_dependency "cloudapp_api"
|
25
22
|
s.add_runtime_dependency "gtk2"
|
26
23
|
s.add_runtime_dependency "json"
|
data/lib/gloudapp/info.rb
CHANGED
data/lib/gloudapp.rb
CHANGED
@@ -185,14 +185,14 @@ module GloudApp
|
|
185
185
|
# timeout to close file chooser before blocking gtk thread
|
186
186
|
Gtk.timeout_add 50 do
|
187
187
|
if upload_file(file)
|
188
|
-
@tray.icon = Icon.
|
188
|
+
@tray.icon = Icon.finish_path
|
189
189
|
end
|
190
190
|
false
|
191
191
|
end
|
192
192
|
false
|
193
193
|
else
|
194
194
|
file_dlg.destroy
|
195
|
-
@tray.icon = Icon.
|
195
|
+
@tray.icon = Icon.normal_path
|
196
196
|
false
|
197
197
|
end
|
198
198
|
end
|
@@ -228,7 +228,7 @@ module GloudApp
|
|
228
228
|
options = {:message => message} unless message.is_a?(Hash)
|
229
229
|
options = {:title => 'GloudApp - Error'}.merge(options)
|
230
230
|
|
231
|
-
@tray.icon = Icon.
|
231
|
+
@tray.icon = Icon.error_path
|
232
232
|
@tray.message = options[:message]
|
233
233
|
ErrorDialog.run!(options[:title], options[:message])
|
234
234
|
false
|
@@ -237,14 +237,14 @@ module GloudApp
|
|
237
237
|
|
238
238
|
class Icon
|
239
239
|
def self.icon(icon) File.join(File.dirname(__FILE__), 'gloudapp', 'icons', icon + '.png') end
|
240
|
-
def self.normal_path;
|
241
|
-
def self.finish_path;
|
242
|
-
def self.working_path; self.icon
|
243
|
-
def self.error_path;
|
244
|
-
def self.normal;
|
245
|
-
def self.finish;
|
240
|
+
def self.normal_path; self.icon('gloudapp') end
|
241
|
+
def self.finish_path; self.icon('gloudapp_finish') end
|
242
|
+
def self.working_path; self.icon('gloudapp_working') end
|
243
|
+
def self.error_path; self.icon('gloudapp_error') end
|
244
|
+
def self.normal; Gdk::Pixbuf.new(normal_path) end
|
245
|
+
def self.finish; Gdk::Pixbuf.new(finish_path) end
|
246
246
|
def self.working; Gdk::Pixbuf.new(working_path) end
|
247
|
-
def self.error;
|
247
|
+
def self.error; Gdk::Pixbuf.new(error_path) end
|
248
248
|
end
|
249
249
|
|
250
250
|
class Tray
|
@@ -282,15 +282,30 @@ module GloudApp
|
|
282
282
|
action[:show].call(action[:item])
|
283
283
|
end
|
284
284
|
end
|
285
|
-
self.icon = Icon.
|
285
|
+
self.icon = Icon.normal_path
|
286
286
|
self.message = nil
|
287
287
|
@menu.popup(nil, nil, button, time)
|
288
288
|
end
|
289
289
|
end
|
290
|
+
|
291
|
+
begin
|
292
|
+
require 'ruby-libappindicator'
|
293
|
+
puts "Initialize AppIndicator..."
|
294
|
+
# params: id, icon name, category
|
295
|
+
@ai = AppIndicator::AppIndicator.new("gloudapp", GloudApp::Icon.normal_path, AppIndicator::Category::APPLICATION_STATUS);
|
296
|
+
@ai.set_menu(@menu)
|
297
|
+
@ai.set_status(AppIndicator::Status::ACTIVE)
|
298
|
+
rescue LoadError
|
299
|
+
puts "No AppIndicator support available."
|
300
|
+
end
|
290
301
|
end
|
291
302
|
|
292
303
|
def icon=(icon)
|
293
|
-
@si.pixbuf =
|
304
|
+
@si.pixbuf = Gdk::Pixbuf.new(icon)
|
305
|
+
if not @ai.nil?
|
306
|
+
# this relies on direct local file paths which works though it shouldn't
|
307
|
+
@ai.set_icon(icon)
|
308
|
+
end
|
294
309
|
end
|
295
310
|
|
296
311
|
def message=(message)
|
@@ -300,13 +315,13 @@ module GloudApp
|
|
300
315
|
private
|
301
316
|
def run_action(proc, no_icon_change = false)
|
302
317
|
if proc.is_a?(Proc)
|
303
|
-
self.icon = Icon.
|
318
|
+
self.icon = Icon.working_path unless no_icon_change
|
304
319
|
|
305
320
|
# timeout action to get at least on repaint event after
|
306
321
|
# changing icon to working image
|
307
322
|
Gtk.timeout_add 50 do
|
308
323
|
if proc.call
|
309
|
-
self.icon = Icon.
|
324
|
+
self.icon = Icon.finish_path unless no_icon_change
|
310
325
|
end
|
311
326
|
false
|
312
327
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gloudapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
8
|
+
- 3
|
9
9
|
- 0
|
10
|
-
version: 1.
|
10
|
+
version: 1.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christian Nicolai
|
@@ -16,8 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
20
|
-
default_executable:
|
19
|
+
date: 2011-10-03 00:00:00 Z
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|
23
22
|
name: cloudapp_api
|
@@ -86,7 +85,6 @@ files:
|
|
86
85
|
- lib/gloudapp/icons/gloudapp_working.png
|
87
86
|
- lib/gloudapp/info.rb
|
88
87
|
- lib/gloudapp/patches.rb
|
89
|
-
has_rdoc: true
|
90
88
|
homepage: https://github.com/cmur2/gloudapp
|
91
89
|
licenses: []
|
92
90
|
|
@@ -116,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
114
|
requirements: []
|
117
115
|
|
118
116
|
rubyforge_project: gloudapp
|
119
|
-
rubygems_version: 1.
|
117
|
+
rubygems_version: 1.8.10
|
120
118
|
signing_key:
|
121
119
|
specification_version: 3
|
122
120
|
summary: CloudApp (tm) applet for Gnome/GTK2
|