gloudapp 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
File without changes
data/Gemfile.lock CHANGED
File without changes
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
@@ -5,9 +5,11 @@ GloudApp is a [CloudApp](http://getcloudapp.com/) client for Linux and
5
5
  [GNOME2](http://www.gnome.org/) based on GTK using the
6
6
  [Ruby-GNOME2](http://ruby-gnome2.sourceforge.jp/) bindings.
7
7
 
8
- It hat equivalent features as the official OSX client allowing you
9
- to take and upload screenshots with only a single click and other
10
- files through a file chooser dialog.
8
+ It is the equivalent to the official OSX client allowing you
9
+ to take and upload screenshots with only a single click and
10
+ other files through a file chooser dialog.
11
+
12
+ **[Works with regenwolken](https://github.com/posativ/regenwolken)**
11
13
 
12
14
  Install
13
15
  -------
@@ -15,17 +17,16 @@ Install
15
17
  Header files needed to build native gem extensions for gtk2 gem and dependencies
16
18
  (distribution specific package names; here: Ubuntu 11.04):
17
19
 
18
- - libgdk-pixbuf2.0-dev
19
- - libglib2.0-dev
20
- - libatk1.0-dev
21
- - libgtk2.0-dev
22
- - libpango1.0-dev
20
+ libgdk-pixbuf2.0-dev libglib2.0-dev libatk1.0-dev libgtk2.0-dev libpango1.0-dev
23
21
 
24
22
  Then install the gloudapp gem:
25
23
 
26
- sudo gem install gloudapp
24
+ gem install gloudapp
27
25
 
28
- (If you use [rvm](http://beginrescueend.com/) you should omit the 'sudo'.)
26
+ If you do not use [rvm](http://beginrescueend.com/) you should add an 'sudo'
27
+ but rvm ist strongly recommended because some
28
+ [linux distributions](https://bugs.launchpad.net/ubuntu/+source/gems/+bug/145267)
29
+ do not add rubygem binaries to PATH)
29
30
 
30
31
  Usage
31
32
  -----
@@ -33,13 +34,20 @@ Usage
33
34
  You could launch gloudapp (or place it in auto-start) via:
34
35
 
35
36
  gloudapp
37
+
38
+ If this does not work and you are not using rvm think about using it. If you
39
+ really do not want to use rvm you may have to add rubygem binaries to your
40
+ PATH by adding `/var/lib/gems/1.8/bin` (depending on your system) to your PATH,
41
+ e.g. for Ubuntu 11.04 (into *~/.profile*):
42
+
43
+ PATH="$PATH:/var/lib/gems/1.8/bin"
36
44
 
37
- Then you will be prompted to provide your credentials (or not if you're already
45
+ You will be prompted to enter your credentials (or not if you're already
38
46
  using [cloudapp-cli](https://github.com/cmur2/cloudapp-cli) on the same machine).
39
47
  A successful login gives you a new small but fine icon right in your notification bar
40
48
  which is sensitive for left clicking (take screenshot and upload) and right clicking
41
- (offering a popup menu with all other commands). After an upload the new URL will
42
- appear immediately be copied into the clipboard for easily pasting it somewhere.
49
+ (offering a popup menu with all other commands). After an upload the new URL
50
+ gets copied to the clipboard automatically for easily pasting it somewhere.
43
51
  Have fun!
44
52
 
45
53
  Thanks
data/Rakefile CHANGED
File without changes
data/gloudapp.gemspec CHANGED
@@ -4,24 +4,24 @@ $:.push File.expand_path("../lib", __FILE__)
4
4
  require "gloudapp/info"
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "gloudapp"
8
- s.version = GloudApp::Info::VERSION
9
- s.authors = GloudApp::Info::AUTHORS.map { |author| author[0] }
10
- s.email = GloudApp::Info::AUTHORS.map { |author| author[1] }
11
- s.homepage = GloudApp::Info::HOMEPAGE
12
- s.summary = GloudApp::Info::SUMMARY
13
- #s.description = %q{CloudApp client for GNOME/GTK}
7
+ s.name = "gloudapp"
8
+ s.version = GloudApp::Info::VERSION
9
+ s.authors = GloudApp::Info::AUTHORS.map { |author| author[0] }
10
+ s.email = GloudApp::Info::AUTHORS.map { |author| author[1] }
11
+ s.homepage = GloudApp::Info::HOMEPAGE
12
+ s.summary = GloudApp::Info::SUMMARY
13
+ #s.description = %q{CloudApp client for GNOME/GTK}
14
14
 
15
- s.rubyforge_project = "gloudapp"
15
+ s.rubyforge_project = "gloudapp"
16
16
 
17
- s.files = `git ls-files`.split("\n")
18
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
- s.require_paths = ["lib"]
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
21
 
22
- # specify any dependencies here; for example:
23
- # s.add_development_dependency "rspec"
24
- s.add_runtime_dependency "cloudapp_api"
25
- s.add_runtime_dependency "gtk2"
26
- s.add_runtime_dependency "json"
22
+ # specify any dependencies here; for example:
23
+ # s.add_development_dependency "rspec"
24
+ s.add_runtime_dependency "cloudapp_api"
25
+ s.add_runtime_dependency "gtk2"
26
+ s.add_runtime_dependency "json"
27
27
  end
File without changes
File without changes
File without changes
File without changes
data/lib/gloudapp/info.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module GloudApp
2
2
  module Info
3
- VERSION = "1.1.1"
3
+ VERSION = "1.2.0"
4
4
  AUTHORS = [
5
5
  ["Christian Nicolai", "chrnicolai@gmail.com"],
6
6
  ["Jan Graichen", "jan.graichen@altimos.de"]
@@ -9,8 +9,8 @@ module GloudApp
9
9
  ["Jan Graichen", "jan.graichen@altimos.de"]
10
10
  ]
11
11
  HOMEPAGE = "https://github.com/cmur2/gloudapp"
12
- SUMMARY = "CloudApp client for GNOME/GTK"
12
+ SUMMARY = "CloudApp (tm) applet for Gnome/GTK2"
13
13
  COPYRIGHT = "Copyright 2011 GloudApp Team"
14
14
  LICENSE = "Apache License, Version 2.0"
15
15
  end
16
- end
16
+ end
@@ -28,4 +28,4 @@ module CloudApp
28
28
  }
29
29
  end
30
30
  end
31
- end
31
+ end
data/lib/gloudapp.rb CHANGED
@@ -13,17 +13,7 @@ module GloudApp
13
13
  def initialize
14
14
  @client = CloudApp::Client.new
15
15
 
16
- @credentials = load_credentials
17
- @client.authenticate(@credentials[:username], @credentials[:password])
18
-
19
- if not credentials_valid?
20
- @credentials = request_credentials
21
- @client.authenticate(@credentials[:username], @credentials[:password])
22
- end
23
-
24
- if not credentials_valid?
25
- ErrorDialog.run!("Error", "Authentication failed!")
26
- end
16
+ login!
27
17
 
28
18
  create_tray
29
19
  end
@@ -33,6 +23,42 @@ module GloudApp
33
23
  Gtk.main
34
24
  end
35
25
 
26
+ def login!
27
+ if ARGV.length == 2
28
+ # assume that's username and password in ARGV
29
+ @credentials = {:username => ARGV[0], :password => ARGV[1]}
30
+ @client.authenticate(@credentials[:username], @credentials[:password])
31
+ return if credentials_valid?
32
+ ErrorDialog.run!("GloudApp - Error", "Authentication failed!")
33
+ exit 1
34
+ end
35
+
36
+ default_remember = false
37
+
38
+ @credentials = load_credentials('.gloudapp')
39
+ if not @credentials.nil?
40
+ @client.authenticate(@credentials[:username], @credentials[:password])
41
+ return if credentials_valid?
42
+ # make the login dialog remember the new credentials by default
43
+ # since the old ones in .gloudapp are wrong
44
+ default_remember = true
45
+ else
46
+ @credentials = load_credentials('.cloudapp-cli')
47
+ if not @credentials.nil?
48
+ @client.authenticate(@credentials[:username], @credentials[:password])
49
+ return if credentials_valid?
50
+ end
51
+ end
52
+
53
+ @credentials = request_credentials(default_remember)
54
+ if not @credentials.nil?
55
+ @client.authenticate(@credentials[:username], @credentials[:password])
56
+ return if credentials_valid?
57
+ end
58
+ ErrorDialog.run!("GloudApp - Error", "Authentication failed!")
59
+ exit 1
60
+ end
61
+
36
62
  def credentials_valid?
37
63
  # check whether auth was successful
38
64
  @acc = CloudApp::Account.find
@@ -42,26 +68,22 @@ module GloudApp
42
68
  return false
43
69
  end
44
70
 
45
- def load_credentials
46
- if ARGV.length == 2
47
- # assume that's username and password in ARGV
48
- return {:username => ARGV[0], :password => ARGV[1]}
49
- end
50
-
51
- @config_file = File.join(ENV['HOME'], '.cloudapp-cli')
52
- if File.exists?(@config_file)
53
- creds = YAML.load_file(@config_file)
54
- return creds unless creds[:username].nil? or creds[:password].nil?
71
+ def load_credentials(name)
72
+ config_file = File.join(ENV['HOME'], name)
73
+ if File.exists?(config_file)
74
+ return YAML.load_file(config_file)
55
75
  end
56
-
57
- request_credentails
76
+ nil
58
77
  end
59
78
 
60
- def request_credentials
61
- login_dlg = LoginDialog.new
79
+ def request_credentials(default_remember)
80
+ login_dlg = LoginDialog.new(default_remember)
62
81
  case login_dlg.run
63
82
  when Gtk::Dialog::RESPONSE_ACCEPT
64
83
  creds = {:username => login_dlg.login.text, :password => login_dlg.password.text}
84
+ if login_dlg.remember.active?
85
+ File.open(File.join(ENV['HOME'], '.gloudapp'), 'w+') do |f| YAML.dump(creds, f) end
86
+ end
65
87
  login_dlg.destroy
66
88
  return creds
67
89
  when Gtk::Dialog::RESPONSE_REJECT
@@ -89,7 +111,7 @@ module GloudApp
89
111
  :action => Proc.new { upload_from_clipboard }
90
112
 
91
113
  # upload file via file chooser
92
- @tray.add_action("Upload file") { upload_via_chooser }
114
+ @tray.add_action("Upload...") { upload_via_chooser }
93
115
 
94
116
  # show about dialog
95
117
  @tray.add_action("About", :no_icon_change => true) { GloudApp::AboutDialog.run! }
@@ -117,7 +139,7 @@ module GloudApp
117
139
  # on popup menu creation...
118
140
  with_clipboard_text do |text|
119
141
  if !text.nil?
120
- puts "Uploading file from clipboard..."
142
+ #puts "Uploading file from clipboard..."
121
143
  upload_file(text)
122
144
  end
123
145
  end
@@ -177,9 +199,9 @@ module GloudApp
177
199
 
178
200
  def upload_file(file)
179
201
  if File.file?(file)
180
- puts "Uploading #{file}"
202
+ #puts "Uploading #{file}"
181
203
  drop = @client.upload(file)
182
- puts "URL (in clipboard, too): #{drop.url}"
204
+ #puts "URL (in clipboard, too): #{drop.url}"
183
205
  # copy URL to clipboard
184
206
  self.clipboard_text = drop.url
185
207
  @last_drop = drop
@@ -191,7 +213,7 @@ module GloudApp
191
213
 
192
214
  def take_screenshot
193
215
  file = File.join(TMP_DIR, "Screenshot #{Time.now.strftime(SCRN_TIME_FMT)}.png")
194
- puts "Taking screenshot..."
216
+ #puts "Taking screenshot..."
195
217
  # TODO: find rubish way to take screen shots
196
218
  # make screenshot via image magick:
197
219
  system("import -window root \"#{file}\"")
@@ -204,7 +226,7 @@ module GloudApp
204
226
 
205
227
  def error(message)
206
228
  options = {:message => message} unless message.is_a?(Hash)
207
- options = {:title => 'Error'}.merge(options)
229
+ options = {:title => 'GloudApp - Error'}.merge(options)
208
230
 
209
231
  @tray.icon = Icon.error
210
232
  @tray.message = options[:message]
@@ -351,9 +373,9 @@ module GloudApp
351
373
  end
352
374
 
353
375
  class LoginDialog < Gtk::Dialog
354
- attr_reader :login, :password
376
+ attr_reader :login, :password, :remember
355
377
 
356
- def initialize
378
+ def initialize(default_remember = false)
357
379
  super("Authentication",
358
380
  nil,
359
381
  Gtk::Dialog::MODAL,
@@ -364,6 +386,8 @@ module GloudApp
364
386
 
365
387
  @login = Gtk::Entry.new
366
388
  @password = Gtk::Entry.new.set_visibility(false)
389
+ @remember = Gtk::CheckButton.new('Remember login')
390
+ @remember.active = default_remember
367
391
  image = Gtk::Image.new(Gtk::Stock::DIALOG_AUTHENTICATION, Gtk::IconSize::DIALOG)
368
392
 
369
393
  table = Gtk::Table.new(2, 3).set_border_width(5)
@@ -372,6 +396,7 @@ module GloudApp
372
396
  table.attach_defaults(@login, 2, 3, 0, 1)
373
397
  table.attach_defaults(Gtk::Label.new("Password:").set_xalign(1).set_xpad(5), 1, 2, 1, 2)
374
398
  table.attach_defaults(@password, 2, 3, 1, 2)
399
+ table.attach_defaults(@remember, 2, 3, 2, 3)
375
400
 
376
401
  self.vbox.add(table)
377
402
  self.show_all
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: 17
5
- prerelease:
4
+ hash: 31
5
+ prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 1
9
- - 1
10
- version: 1.1.1
8
+ - 2
9
+ - 0
10
+ version: 1.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Christian Nicolai
@@ -16,7 +16,8 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-09-16 00:00:00 Z
19
+ date: 2011-09-28 00:00:00 +02:00
20
+ default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
22
23
  name: cloudapp_api
@@ -85,6 +86,7 @@ files:
85
86
  - lib/gloudapp/icons/gloudapp_working.png
86
87
  - lib/gloudapp/info.rb
87
88
  - lib/gloudapp/patches.rb
89
+ has_rdoc: true
88
90
  homepage: https://github.com/cmur2/gloudapp
89
91
  licenses: []
90
92
 
@@ -114,9 +116,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
116
  requirements: []
115
117
 
116
118
  rubyforge_project: gloudapp
117
- rubygems_version: 1.8.6
119
+ rubygems_version: 1.3.7
118
120
  signing_key:
119
121
  specification_version: 3
120
- summary: CloudApp client for GNOME/GTK
122
+ summary: CloudApp (tm) applet for Gnome/GTK2
121
123
  test_files: []
122
124