shoeset

Check-in [bb7231a2cb]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Adding "loading" animation for app and set list

* An attempt to reduce the 'hang' of startup when the app is actually
performing flickr login and getting the set list
* Quite sure this could be done more nicely

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: bb7231a2cb2a744a9baf8198e540be310d4d71f63d2565f805019ad7870e1a40
User & Date: i5ivem@gmail.com 2010-03-29 12:36:32
Context
2010-03-29
13:45
ListBox cloudgen block now runs in serial

* Because of threading used, if the user selected another item in the listbox
whilst the app was already running and generating a tag cloud, another
progress bar would appear, etc. This forces selections to run in serial,
i.e. will ignore the selection if cloud generator is already running
* Also resets list box selection to the set currently being used if user tries
to change whilst running
* Better future approach could be to cancel current cloud generation and start
again for new set selected. Debatable though... Leaf check-in: 4624b9404c user: i5ivem@gmail.com tags: trunk, v0.0.2

12:36
Adding "loading" animation for app and set list

* An attempt to reduce the 'hang' of startup when the app is actually
performing flickr login and getting the set list
* Quite sure this could be done more nicely check-in: bb7231a2cb user: i5ivem@gmail.com tags: trunk

2010-03-26
13:57
Check for infinity when all tags are the same in a set check-in: fd8c0d0bb2 user: i5ivem@gmail.com tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to shoeset.rb.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17


18
19
20
21
22
23
24
Shoes.setup do
	gem 'flickraw'
end

require 'flickraw'
require 'yaml'
require 'cloud'


Shoes.app :title => "Shoeset" do

	
	KEYFILE = "keys.yml"
	KEYS = YAML::load(File.read(KEYFILE))
	FlickRaw.api_key=KEYS["api_key"]
	FlickRaw.shared_secret=KEYS["shared_secret"]
	TOKENFILE = ENV['HOME']+"\\.shoeset.yml"



	#Need to improve GUI feedback/responsive on opening. Thread??
	def login
		if File.exists?(TOKENFILE) #Load token if it exists
					$SETTINGS = YAML::load(File.read(TOKENFILE))
					@token = $SETTINGS["Token"]
					@auth = flickr.auth.checkToken :auth_token => @token








|








>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Shoes.setup do
	gem 'flickraw'
end

require 'flickraw'
require 'yaml'
require 'cloud'

	
Shoes.app :title => "Shoeset" do

	
	KEYFILE = "keys.yml"
	KEYS = YAML::load(File.read(KEYFILE))
	FlickRaw.api_key=KEYS["api_key"]
	FlickRaw.shared_secret=KEYS["shared_secret"]
	TOKENFILE = ENV['HOME']+"\\.shoeset.yml"



	#Need to improve GUI feedback/responsive on opening. Thread??
	def login
		if File.exists?(TOKENFILE) #Load token if it exists
					$SETTINGS = YAML::load(File.read(TOKENFILE))
					@token = $SETTINGS["Token"]
					@auth = flickr.auth.checkToken :auth_token => @token
54
55
56
57
58
59
60





61
62
63


64
65
66
67
68
69
70
			button "Logout", :displace_left => 10 do
				logout
			end
		end
		@token = para "Token: #{@auth.token}"
		@token.hide
		@setlist = []





		@photosetlist = flickr.photosets.getList.each do |set|
			@setlist << set["title"]
		end


		flow do
			para "Pick a set to generate Tag Cloud: "
			list_box :items => @setlist, 
				:chose => @setlist[0] do |set|
					fluffygen(set)				
				end
		end #flow







>
>
>
>
>



>
>







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
			button "Logout", :displace_left => 10 do
				logout
			end
		end
		@token = para "Token: #{@auth.token}"
		@token.hide
		@setlist = []
		@loadingsetlist = para "Loading sets..."
		@animatelist = animate(5) do |frame|
			weight = ["bold", "normal"]
			@loadingsetlist.style(:weight => weight[frame&1])
		end
		@photosetlist = flickr.photosets.getList.each do |set|
			@setlist << set["title"]
		end
		@animatelist.stop
		@loadingsetlist.hide
		flow do
			para "Pick a set to generate Tag Cloud: "
			list_box :items => @setlist, 
				:chose => @setlist[0] do |set|
					fluffygen(set)				
				end
		end #flow
113
114
115
116
117
118
119
120

121
122
123





124

125
126
127
128
129
			cloud = TagCloud.new($array.join(" "))
			$p.hide
			#debug cloud.build
			@tagcloud.clear{eval cloud.build}
		end
	end



	@container = slot do
		para "Never see this"
	end





	login


end










|
>
|
|

>
>
>
>
>
|
>





122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
			cloud = TagCloud.new($array.join(" "))
			$p.hide
			#debug cloud.build
			@tagcloud.clear{eval cloud.build}
		end
	end

	

	@container = stack do
		@loading = para "Loading..."
	end
	@animate = animate(5) do |frame|
		weight = ["bold", "normal"]
		@loading.style(:weight => weight[frame&1])
	end
	Thread.new do 
		login
	end

end