From 8b945073ef6c165f6b54ddf0e53123d769d760a2 Mon Sep 17 00:00:00 2001 From: Kai Huuhko Date: Fri, 9 Aug 2013 00:36:54 +0300 Subject: [PATCH] Use global elementary scale as a multiplier for the initial window size. --- epour/Epour.py | 2 +- epour/gui/Main.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/epour/Epour.py b/epour/Epour.py index 9da6bf8..31b2f31 100755 --- a/epour/Epour.py +++ b/epour/Epour.py @@ -403,7 +403,7 @@ class AlertManager(object): try: cb(a, *args, **kwargs) except: - log.exception("Exception while handling alerts") + self.log.exception("Exception while handling alerts") return True diff --git a/epour/gui/Main.py b/epour/gui/Main.py index eca6b2a..7ab0bdf 100644 --- a/epour/gui/Main.py +++ b/epour/gui/Main.py @@ -34,7 +34,7 @@ try: Box, Label, Button, ELM_GENLIST_ITEM_FIELD_TEXT, \ ELM_GENLIST_ITEM_FIELD_CONTENT, InnerWindow, Frame, \ Fileselector, Entry, Panel, ELM_PANEL_ORIENT_BOTTOM, \ - ELM_OBJECT_SELECT_MODE_NONE, Table, Separator, Menu + ELM_OBJECT_SELECT_MODE_NONE, Table, Separator, Menu, Configuration except ImportError: from efl.evas import EVAS_ASPECT_CONTROL_VERTICAL, Rectangle from efl.ecore import Timer @@ -55,6 +55,7 @@ except ImportError: from efl.elementary.table import Table from efl.elementary.separator import Separator from efl.elementary.menu import Menu + from efl.elementary.configuration import Configuration from TorrentInfo import TorrentInfo from Preferences import Preferences @@ -67,13 +68,17 @@ class MainInterface(object): self.parent = parent self.session = session + elm_conf = Configuration() + scale = elm_conf.scale + self.log = logging.getLogger("epour.gui") self.torrentitems = {} win = self.win = StandardWindow("epour", "Epour") win.callback_delete_request_add(lambda x: elm.exit()) - win.size = 480, 480 + win.screen_constrain = True + win.size = 480 * scale, 400 * scale self.tlist = tlist = Genlist(win) tlist.select_mode_set(ELM_OBJECT_SELECT_MODE_NONE) @@ -371,6 +376,8 @@ class SessionStatus(Table): sf.content = sel sf.show() + # TODO: Auto-paste magnet links from clipboard + magnet = Entry(self.top_widget) magnet.single_line = True magnet.scrollable = True