1 # -*- coding: utf-8 -*-
3 from __future__
import absolute_import
6 from ..widget
.storedsize
import StoredSizeDialog
7 from jben
.dict_downloader
import static_mirror_list
10 class DictMirrorSelect(StoredSizeDialog
):
12 def __init__(self
, app
, parent
):
13 StoredSizeDialog
.__init
__(
14 self
, "gui.dialog.dict_mirror_select.size", -1, -1,
15 title
=_("Select download site"),
17 flags
=gtk
.DIALOG_MODAL
,
18 buttons
=(gtk
.STOCK_CANCEL
, gtk
.RESPONSE_CANCEL
,
19 gtk
.STOCK_OK
, gtk
.RESPONSE_OK
)
25 self
.server_list
= gtk
.combo_box_new_text()
26 for row
in static_mirror_list
:
27 self
.server_list
.append_text(row
)
28 self
.server_list
.set_active(0)
29 self
.server_list
.show()
31 layout
= self
.get_content_area()
32 layout
.pack_start(self
.server_list
, expand
=False)
35 return self
.server_list
.get_active_text()
38 """Single-time run command; hides GTK boilerplate and gets result.
40 Returns the selected mirror's URI.
43 resp
= gtk
.Dialog
.run(self
)
44 if resp
== gtk
.RESPONSE_OK
:
45 result
= self
.get_mirror()