|
2012-03-05
, 21:40
|
Posts: 2 |
Thanked: 5 times |
Joined on Mar 2012
@ Praha, Czech Republic
|
#282
|
How about the following? (Don't know how to add the new cache record in core.py and the indents disappear...)
|
2012-03-06
, 17:10
|
Posts: 25 |
Thanked: 9 times |
Joined on Oct 2010
@ Germany / Mannheim
|
#283
|
|
2012-03-06
, 22:44
|
Posts: 301 |
Thanked: 531 times |
Joined on Aug 2010
@ The Netherlands
|
#284
|
|
2012-03-06
, 23:07
|
Posts: 1,548 |
Thanked: 7,510 times |
Joined on Apr 2010
@ Czech Republic
|
#285
|
The Following User Says Thank You to MartinK For This Useful Post: | ||
|
2012-03-07
, 11:23
|
Posts: 25 |
Thanked: 9 times |
Joined on Oct 2010
@ Germany / Mannheim
|
#286
|
|
2012-03-11
, 12:57
|
Posts: 169 |
Thanked: 149 times |
Joined on Mar 2010
|
#287
|
The Following 2 Users Say Thank You to webhamster For This Useful Post: | ||
|
2012-03-11
, 13:47
|
Posts: 25 |
Thanked: 9 times |
Joined on Oct 2010
@ Germany / Mannheim
|
#288
|
|
2012-03-11
, 13:54
|
Posts: 169 |
Thanked: 149 times |
Joined on Mar 2010
|
#289
|
The Following User Says Thank You to webhamster For This Useful Post: | ||
|
2012-03-25
, 20:00
|
Posts: 301 |
Thanked: 531 times |
Joined on Aug 2010
@ The Netherlands
|
#290
|
The Following User Says Thank You to rob_kouw For This Useful Post: | ||
hildon_plugins.py, around line 830 add:
button = hildon.Button(gtk.HILDON_SIZE_FINGER_HEIGHT, hildon.BUTTON_ARRANGEMENT_VERTICAL)
button.set_label("Download Cache by GC-code")
button.connect("clicked", self._show_tool_download_by_name, None)
button.connect("clicked", lambda caller: dialog.hide())
list.pack_start(button)
hildon_plugins.py, button above could be accompanied by:
def _show_tool_download_by_name(self, caller, data = None):
dialog = gtk.Dialog("Dowload Cache by GC-code", self.window, gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
search = hildon.Entry(gtk.HILDON_SIZE_AUTO)
search.set_text('GC')
dialog.vbox.pack_start(search)
dialog.show_all()
result = dialog.run()
dialog.hide()
name_search = search.get_text().strip().upper()
if result != gtk.RESPONSE_ACCEPT or name_search == '':
return
if left(name_search,2) != 'GC' or len(name_search) < 6 or len(name_search) > 7:
self.show_error("GC-code should be entered like GC1234 or GC12345.")
return
current_cache = self.core.get_geocache_by_name(name_search)
if current_cache.name != name_search:
# Search returned no geocaches. Add a new cache record to the db. Should be performed by core.py, can't figure that one out.
current_cache = newcache
self.core.on_download_cache(self.current_cache)