← Back to team overview

cairo-dock-team team mailing list archive

[Merge] lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/WebSearch into lp:cairo-dock-plug-ins-extras

 

Eduardo Mucelli R. Oliveira has proposed merging lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/WebSearch into lp:cairo-dock-plug-ins-extras.

Requested reviews:
  Cairo-Dock Team (cairo-dock-team)


Now sub-menu is using icons to a better engine indication
-- 
https://code.launchpad.net/~eduardo-mucelli/cairo-dock-plug-ins-extras/WebSearch/+merge/25514
Your team Cairo-Dock Team is requested to review the proposed merge of lp:~eduardo-mucelli/cairo-dock-plug-ins-extras/WebSearch into lp:cairo-dock-plug-ins-extras.
=== modified file 'WebSearch/Changelog.txt'
--- WebSearch/Changelog.txt	2010-05-13 01:31:32 +0000
+++ WebSearch/Changelog.txt	2010-05-18 14:03:32 +0000
@@ -1,3 +1,4 @@
+1.1.0: (May/17/2010): Now sub-menu is using icons to a better engine indication.
 1.0.0: (May/12/2010): A heavy code refactoring, each search engine has its own module. Webshots has changed its HTML the whole fetching was recoded. Removing user-defined option for a pre-fetching limit. Finally a totally functional parallelized thumbnail download.
 0.7.3: (May/10/2010): Fixing the Google search since the engine changed the result stats HTML. Fixing the Bing result stats. Fixing the stats showing.
 0.7.0: (May/3/2010): WebSearch now fetch results from Wikipedia. Some code improvements. A new icon has been drawn, and a new preview also, both using Gimp. 

=== modified file 'WebSearch/WebSearch'
--- WebSearch/WebSearch	2010-05-13 01:31:32 +0000
+++ WebSearch/WebSearch	2010-05-18 14:03:32 +0000
@@ -15,7 +15,8 @@
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 
-# This applet provides an interface to some search engines such as Google, Bing, Teoma, Yahoo!, Youtube, Webshots, Flickr, and Wikipedia.
+# This applet provides an interface to some search engines such as
+# Google, Bing, Teoma, Yahoo!, Youtube, Webshots, Flickr, Wikipedia, and ImageShack.
 #	 To choose the search engine you can
 #		(1) Right-click -> Configure this applet -> Configuration (tab) -> Search engine
 #		(2) Scroll up or down over the icon (applicable only for the first search)
@@ -77,13 +78,13 @@
 		attr_accessor 	:engine, :query, :engines,
 						:number_of_fetched_links, :number_of_displayed_links, :page_of_displayed_links,
 						:show_current_page, :show_description_instead_url, :show_thumbnail_preview,
-						:scroll_engine_index
+						:scroll_engine_index, :add_menu_items_available
 
 		DialogActiveTime = 5															# time in seconds the dialog window will be active
 
 		def initialize applet, sub_icons
 			self.query = ""
-			self.engines = %w(Google Bing Yahoo! Teoma Wikipedia Youtube Webshots Flickr)
+			self.engines = %w(Google Bing Yahoo! Teoma Wikipedia Youtube Webshots Flickr ImageShack)
 			self.engine = Engine.new
 			self.scroll_engine_index = 0												# current index when scrolling through search engines
 			@icon = applet
@@ -139,12 +140,23 @@
 		end
 
 		def action_on_build_menu
-			#if @icon.add_menu_items_available											# Cairo-Dock > 2.1.4-0beta0
-			# items = [{:type => 1, :label => 'Google', :menu => 0, :id => 1, :icon => './images/google.png', :tooltip => 'Google'}]
-				# @icon.AddMenuItems(items)
-			#else
-			@icon.PopulateMenu(self.engines)
-			#end
+			item = {}
+			items = []
+			self.engines.each_with_index do |engine, i|									# each property must do be string and never use Symbol
+				item['type'] = 0
+				item['label'] = engine
+				item['menu'] = 1
+				item['id'] = i
+				item['icon'] = File.expand_path("./images/data/#{engine}.png")
+				items.push item
+				item = {}
+			end	
+			begin
+				@icon.AddMenuItems(items)
+			rescue NoMethodError														# Cairo-Dock < 2.1.4-0beta0
+				WebSearch.log "AddMenuItems method is not available"
+				@icon.PopulateMenu(self.engines)
+			end
 		end
 
 		def ask_for_search_query

=== modified file 'WebSearch/WebSearch.conf'
--- WebSearch/WebSearch.conf	2010-05-13 01:31:32 +0000
+++ WebSearch/WebSearch.conf	2010-05-18 14:03:32 +0000
@@ -1,4 +1,4 @@
-#!en;1.0.0
+#!en;1.1.0
 
 #[gtk-about]
 [Icon]
@@ -83,7 +83,7 @@
 #[gtk-preferences]
 [Configuration]
 
-#l[Google;Bing;Yahoo!;Teoma;Youtube;Webshots;Flickr;Wikipedia] Search engine :
+#l[Google;Bing;Yahoo!;Teoma;Youtube;Webshots;Flickr;Wikipedia;ImageShack] Search engine :
 engine = 0
 #i[5;10] Maximum number of results shown :
 #{in sub-icons.}

=== modified file 'WebSearch/auto-load.conf'
--- WebSearch/auto-load.conf	2010-05-13 01:31:32 +0000
+++ WebSearch/auto-load.conf	2010-05-18 14:03:32 +0000
@@ -4,10 +4,10 @@
 author = Eduardo Mucelli Rezende Oliveira
 
 # A short description of the applet and how to use it.
-description = This applet provides an interface to some search engines such as Google, Bing, Teoma, Yahoo!, Youtube, Webshots, Flickr, and Wikipedia.\nTo choose the search engine you can\n    (1) Right-click -> Configure this applet -> Configuration -> Search engine\n    (2) Scroll up or down over the icon (applicable only for the first search)\nYou can search in three ways\n    (1) Middle-click on the main icon\n    (2) Right-click on the main icon -> WebSearch -> (Choose the engine)\n    (3) Left-click on main icon (applicable only for the first search)\nType your query and validate. Each result will be shown as a sub-icon.\nLeft-click to open the the result in the default Web Browser\nMiddle-click on the sub-icon of any result to show its description\nScroll up to fetch the next results\nScroll down to fetch the previous results\nLeft-click on the main icon to show search stats
+description = This applet provides an interface to some search engines such as\nGoogle, Bing, Teoma, Yahoo!, Youtube, Webshots, Flickr, Wikipedia, and ImageShack.\nTo choose the search engine you can\n    (1) Right-click -> Configure this applet -> Configuration -> Search engine\n    (2) Scroll up or down over the icon (applicable only for the first search)\nYou can search in three ways\n    (1) Middle-click on the main icon\n    (2) Right-click on the main icon -> WebSearch -> (Choose the engine)\n    (3) Left-click on main icon (applicable only for the first search)\nType your query and validate. Each result will be shown as a sub-icon.\nLeft-click to open the the result in the default Web Browser\nMiddle-click on the sub-icon of any result to show its description\nScroll up to fetch the next results\nScroll down to fetch the previous results\nLeft-click on the main icon to show search stats
 
 # Category of the applet : 2 = accessory, 3 = Desktop, 4 = Controler
 category = 2
 
 # Version of the applet; change it everytime you change something in the config file. Don't forget to update the version both in this file and in the config file.
-version = 1.0.0
+version = 1.1.0

=== added directory 'WebSearch/images/data'
=== added file 'WebSearch/images/data/Bing.png'
Binary files WebSearch/images/data/Bing.png	1970-01-01 00:00:00 +0000 and WebSearch/images/data/Bing.png	2010-05-18 14:03:32 +0000 differ
=== added file 'WebSearch/images/data/Flickr.png'
Binary files WebSearch/images/data/Flickr.png	1970-01-01 00:00:00 +0000 and WebSearch/images/data/Flickr.png	2010-05-18 14:03:32 +0000 differ
=== added file 'WebSearch/images/data/Google.png'
Binary files WebSearch/images/data/Google.png	1970-01-01 00:00:00 +0000 and WebSearch/images/data/Google.png	2010-05-18 14:03:32 +0000 differ
=== added file 'WebSearch/images/data/ImageShack.png'
Binary files WebSearch/images/data/ImageShack.png	1970-01-01 00:00:00 +0000 and WebSearch/images/data/ImageShack.png	2010-05-18 14:03:32 +0000 differ
=== added file 'WebSearch/images/data/Teoma.png'
Binary files WebSearch/images/data/Teoma.png	1970-01-01 00:00:00 +0000 and WebSearch/images/data/Teoma.png	2010-05-18 14:03:32 +0000 differ
=== added file 'WebSearch/images/data/Webshots.png'
Binary files WebSearch/images/data/Webshots.png	1970-01-01 00:00:00 +0000 and WebSearch/images/data/Webshots.png	2010-05-18 14:03:32 +0000 differ
=== added file 'WebSearch/images/data/Wikipedia.png'
Binary files WebSearch/images/data/Wikipedia.png	1970-01-01 00:00:00 +0000 and WebSearch/images/data/Wikipedia.png	2010-05-18 14:03:32 +0000 differ
=== added file 'WebSearch/images/data/Yahoo!.png'
Binary files WebSearch/images/data/Yahoo!.png	1970-01-01 00:00:00 +0000 and WebSearch/images/data/Yahoo!.png	2010-05-18 14:03:32 +0000 differ
=== added file 'WebSearch/images/data/Youtube.png'
Binary files WebSearch/images/data/Youtube.png	1970-01-01 00:00:00 +0000 and WebSearch/images/data/Youtube.png	2010-05-18 14:03:32 +0000 differ

Follow ups