Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Ortiz <dirakx@gmail.com>2013-03-15 19:49:17 (GMT)
committer Rafael Ortiz <dirakx@gmail.com>2013-03-15 19:49:17 (GMT)
commit4a05cb9270a83c879e345caebf1a5c255bcbe0e5 (patch)
tree55cd6657a7578b9e4590f18359d21c5f77a189fb
parentac912803e2efd3ad012928055cd20c00b4336ed7 (diff)
ui fixes
-rw-r--r--GetIABooksActivity.py69
1 files changed, 38 insertions, 31 deletions
diff --git a/GetIABooksActivity.py b/GetIABooksActivity.py
index 5726fe3..4e47500 100644
--- a/GetIABooksActivity.py
+++ b/GetIABooksActivity.py
@@ -51,7 +51,6 @@ import base64
import urllib2
import socket
-
from listview import ListView
import opds
import languagenames
@@ -75,7 +74,7 @@ class GetIABooksActivity(activity.Activity):
"The entry point to the Activity"
activity.Activity.__init__(self, handle, False)
self.max_participants = 1 # no estamos compartiendo
-
+ self._pid = None
self.selected_book = None
self.queryresults = None
self._getter = None
@@ -90,7 +89,7 @@ class GetIABooksActivity(activity.Activity):
else:
self._read_configuration()
- # toolbar
+ # Toolbar
toolbar_box = ToolbarBox()
#activity_button = ToolButton() # boton de icono de actividad
@@ -109,17 +108,21 @@ class GetIABooksActivity(activity.Activity):
separator.set_expand(True)
toolbar_box.toolbar.insert(separator, -1)
- stop_button = StopButton(self)
+ stop_button = StopButton(self) # stop button
stop_button.props.accelerator = '<Ctrl>q'
toolbar_box.toolbar.insert(stop_button, -1)
stop_button.show()
-
- #toolbar_box.toolbar.insert(StopButton(self), -1) # boton de parado.
-
+
self.set_toolbar_box(toolbar_box)
toolbar_box.show_all()
self._books_toolbar = toolbar_box.toolbar
+
+
+ # Main layout. Layout inicial
+ self.hpane = Gtk.Paned.new(orientation=Gtk.Orientation.HORIZONTAL)
+ self.hpane.set_position(600) # setting initial position
+
self._create_controls()
# suspend-resume
@@ -176,7 +179,7 @@ class GetIABooksActivity(activity.Activity):
else:
return False
- # reading configuration
+ # Reading configuration
def _read_configuration(self, file_name='get-books.cfg'):
logging.error('Reading configuration from file %s', file_name)
@@ -260,7 +263,7 @@ class GetIABooksActivity(activity.Activity):
toolbar.insert(book_search_item, -1)
book_search_item.show()
- toolbar.source_combo = ComboBox() # combo de fuente de donde salen los libros.
+ toolbar.source_combo = ComboBox() # combo de fuentes de donde salen los libros.
toolbar.source_combo.props.sensitive = True
toolbar.source_changed_cb_id = \
toolbar.source_combo.connect('changed', self.__source_changed_cb)
@@ -269,27 +272,25 @@ class GetIABooksActivity(activity.Activity):
toolbar.insert(combotool, -1)
combotool.show()
- toolbar.mislibros_toolbarbutton = ToolbarButton() # boton mis libros
- toolbar.mislibros_toolbarbutton.props.icon_name = 'preferences-system' #icono mis libros
- toolbar.mislibros_toolbarbox = Gtk.Toolbar()
- toolbar.mislibros_toolbarbutton.props.page = toolbar.mislibros_toolbarbox
- toolbar.mislibros1_combo = ComboBox()
- toolbar.mislibros1_combo.props.sensitive = True
- combotool = ToolComboBox(toolbar.mislibros1_combo)
- toolbar.mislibros1_combo.append_item('all', _('Any language'))
+ #toolbar.mislibros_toolbarbutton = ToolbarButton() # boton mis libros TODO aun sin implementar
+ #toolbar.mislibros_toolbarbutton.props.icon_name = 'preferences-system' #icono mis libros
+ #toolbar.mislibros_toolbarbox = Gtk.Toolbar()
+ #toolbar.mislibros_toolbarbutton.props.page = toolbar.mislibros_toolbarbox
+ #toolbar.mislibros1_combo = ComboBox()
+ #toolbar.mislibros1_combo.props.sensitive = True
+ #combotool = ToolComboBox(toolbar.mislibros1_combo)
+ #toolbar.mislibros1_combo.append_item('all', _('Any language'))
#for key in self.languages.keys():
# toolbar.language_combo.append_item(key, self.languages[key])
- toolbar.mislibros1_combo.set_active(0)
- toolbar.mislibros_toolbarbutton.props.page.insert(combotool, -1)
- toolbar.insert(toolbar.mislibros_toolbarbutton, -1)
- toolbar.mislibros_toolbarbutton.show()
- combotool.show()
- toolbar.mislibros_changed_cb_id = \
- toolbar.mislibros1_combo.connect('changed',
- self.__language_changed_cb)
-
+ #toolbar.mislibros1_combo.set_active(0)
+ #toolbar.mislibros_toolbarbutton.props.page.insert(combotool, -1)
+ #toolbar.insert(toolbar.mislibros_toolbarbutton, -1)
+ #toolbar.mislibros_toolbarbutton.show()
+ #combotool.show()
+ #toolbar.mislibros_changed_cb_id = \
+ #toolbar.mislibros1_combo.connect('changed',
+ # self.__language_changed_cb)
-
#self.bt_catalogs = ToggleToolButton('books')
#self.bt_catalogs.set_tooltip(_('Catalogs'))
#toolbar.insert(self.bt_catalogs, -1)
@@ -432,6 +433,12 @@ class GetIABooksActivity(activity.Activity):
toolbar.source_combo.handler_unblock(toolbar.source_changed_cb_id)
# Callbacks
+
+ #def stop_button_cb(self, stop_button):
+ # try:
+ # if self._pid != None: os.kill(self._pid[1], SIGTERM)
+ # except:
+ # pass # process must already be dead.
def __format_changed_cb(self, combo):
self.show_book_data(False)
@@ -532,7 +539,7 @@ class GetIABooksActivity(activity.Activity):
self.msg_label = Gtk.Label()
- self.list_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
+ self.list_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL) # caja listas
# Catalogs treeview
self.catalog_listview = Gtk.TreeView()
@@ -921,7 +928,7 @@ class GetIABooksActivity(activity.Activity):
self.get_window().set_cursor(None)
self._allow_suspend()
- # catalogs updated
+ # Catalogs updated
def catalogs_updated(self, query, midway):
self.catalogs = {}
i = 0
@@ -1019,13 +1026,13 @@ class GetIABooksActivity(activity.Activity):
logging.debug('Download was canceled by the user.')
self._allow_suspend()
- # getting book
+ # Getting book
def get_book(self):
self.enable_button(False)
self.progressbox.show_all()
GObject.idle_add(self.download_book, self.download_url)
- # downloading book
+ # Downloading book
def download_book(self, url):
self._inhibit_suspend()
logging.error('DOWNLOAD BOOK %s', url)