Merge lp:~jsjgruber/lernid/lernid.fix751019.fix749848.fix764069.fix764082 into lp:lernid

Proposed by John S. Gruber
Status: Merged
Merged at revision: 219
Proposed branch: lp:~jsjgruber/lernid/lernid.fix751019.fix749848.fix764069.fix764082
Merge into: lp:lernid
Diff against target: 158 lines (+44/-16)
5 files modified
bin/lernid (+27/-11)
data/ui/LernidWindow.ui (+1/-1)
debian/changelog (+13/-0)
lernid/widgets/Browser.py (+1/-0)
lernid/widgets/Slide.py (+2/-4)
To merge this branch: bzr merge lp:~jsjgruber/lernid/lernid.fix751019.fix749848.fix764069.fix764082
Reviewer Review Type Date Requested Status
Peeyoosh Sangolekar Pending
Lernid Development Team Pending
Review via email: mp+59310@code.launchpad.net

Description of the change

Contains fixes for lernid. All but the fix for LP: #764082 have already been merged into natty.

The fix for LP: #749848 unfortunately reverses the effect of enli's patch to load slides asynchronously rather than synchronously. I left it using webkit, however, so that it could be easily reinstated should the flash plugin support it, or should we convert it to a separate process, for example.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/lernid'
2--- bin/lernid 2010-03-07 20:47:42 +0000
3+++ bin/lernid 2011-04-27 23:59:22 +0000
4@@ -26,8 +26,6 @@
5 import locale
6 import pynotify
7
8-gtk.gdk.threads_init()
9-
10 try:
11 import appindicator
12 HAVE_APPINDICATOR = True
13@@ -97,9 +95,12 @@
14
15 self._main_window = self.builder.get_object("lernid_window")
16 # Restore size and maximize state
17- main_window_size = Preferences.get('main_window_size')
18- if main_window_size:
19- self._main_window.resize(main_window_size['width'], main_window_size['height'])
20+ self.main_window_size = Preferences.get('main_window_size')
21+ if self.main_window_size:
22+ self._main_window.resize(self.main_window_size['width'], self.main_window_size['height'])
23+ else:
24+ size=self._main_window.get_size()
25+ self.main_window_size = {'width': size[0], 'height' : size[1]}
26 if Preferences.get('main_window_maximize'):
27 self._main_window.maximize()
28 def save_maximize_state(win, event):
29@@ -142,8 +143,14 @@
30 def unhighlight_session_tab(w, p, page_num):
31 if page_num == self.TAB_SESSION:
32 self._session_label.set_label(_('_Session'))
33+
34+ def configure_event_mainwindow(self, event):
35+ self.main_window_size['width'] = event.width
36+ self.main_window_size['height'] = event.height
37+
38 self._browser.connect('page-changed', highlight_session_tab)
39 self._slide.connect('slide-changed', highlight_session_tab)
40+ self._main_window.connect('configure-event', configure_event_mainwindow)
41
42 # Add widgets to the interface
43 self.pack_widgets(Preferences.get('vertical'))
44@@ -160,8 +167,18 @@
45 self._subpane = self.builder.get_object(prefix+'subpaned')
46 pos = Preferences.get(prefix+'panes')
47 if pos:
48- # FIXME: Main pane is increased with 300 ±200 px every launch
49- #self._mainpane.set_position(pos['main'])
50+ if prefix == 'h':
51+ if pos['main'] > self.main_window_size['height']-160:
52+ pos['main'] = self.main_window_size['height']-160
53+ if pos['sub'] > self.main_window_size['width']-160:
54+ pos['sub'] = self.main_window_size['width']-160
55+ else:
56+ if pos['main'] > self.main_window_size['width']-160:
57+ pos['main'] = self.main_window_size['width']-160
58+ if pos['sub'] > self.main_window_size['height']-160:
59+ pos['sub'] = self.main_window_size['height']-160
60+
61+ self._mainpane.set_position(pos['main'])
62 self._subpane.set_position(pos['sub'])
63
64 menu_tweet = builder.get_object('menu_tweet')
65@@ -362,13 +379,12 @@
66
67 prefs = {}
68 if not Preferences.get('main_window_maximize'):
69- width, height = self._main_window.get_size()
70+ width = self.main_window_size['width']; height = self.main_window_size['height']
71 prefs['main_window_size'] = {'width': width, 'height': height}
72 prefix = 'v' if Preferences.get('vertical') else 'h'
73 if (not Preferences.get(prefix+'panes') or
74- not (-15 < Preferences.get(prefix+'panes')['main'] - self._mainpane.get_position() < 15)):
75- # FIXME: HACK. For some reason the main pane position increases by 9-12
76- # pixels on every startup
77+ (Preferences.get(prefix+'panes')['main'] != self._mainpane.get_position() ) or
78+ (Preferences.get(prefix+'panes')['sub'] != self._subpane.get_position() ) ):
79 prefs[prefix+'panes'] = {
80 'main': self._mainpane.get_position(),
81 'sub': self._subpane.get_position()
82
83=== modified file 'data/ui/LernidWindow.ui'
84--- data/ui/LernidWindow.ui 2010-03-04 13:13:13 +0000
85+++ data/ui/LernidWindow.ui 2011-04-27 23:59:22 +0000
86@@ -8,7 +8,7 @@
87 <property name="width_request">800</property>
88 <property name="height_request">550</property>
89 <property name="title" translatable="yes">Lernid</property>
90- <property name="window_position">center</property>
91+ <!--property name="window_position">center</property-->
92 <property name="icon_name">lernid</property>
93 <signal name="destroy" handler="quit"/>
94 <child>
95
96=== modified file 'debian/changelog'
97--- debian/changelog 2010-09-16 14:08:50 +0000
98+++ debian/changelog 2011-04-27 23:59:22 +0000
99@@ -1,3 +1,16 @@
100+lernid (0.8.0.4) natty; urgency=low
101+
102+ * Sanity check pane settings. Retrieve update main window size from
103+ configure-event callbacks rather than trying to retrieve size from
104+ a possibly destroyed window (by window manager). Allow window manager
105+ complete discretion in window placement. (LP: #764082)
106+ * Revise size parameters passed to poppler page render call. (LP: #764069)
107+ * Revert the slide loading function to run synchronously
108+ rather than using python threads. (LP: #749848)
109+ * Handle case where web page has no title. (LP: #751019)
110+
111+ -- John S Gruber <JohnSGruber@gmail.com> Wed, 27 Apr 2011 17:37:00 -0400
112+
113 lernid (0.7.1) maverick; urgency=low
114
115 [ Michael Budde ]
116
117=== modified file 'lernid/widgets/Browser.py'
118--- lernid/widgets/Browser.py 2010-03-06 14:16:47 +0000
119+++ lernid/widgets/Browser.py 2011-04-27 23:59:22 +0000
120@@ -154,6 +154,7 @@
121 storeiter = self._url_store.iter_next(storeiter)
122 if not match:
123 title = browser.get_property('title')
124+ if title is None: title = ''
125 urllen = 150 - len(title)
126 shorturl = url
127 if len(url) > urllen:
128
129=== modified file 'lernid/widgets/Slide.py'
130--- lernid/widgets/Slide.py 2010-03-06 04:07:29 +0000
131+++ lernid/widgets/Slide.py 2011-04-27 23:59:22 +0000
132@@ -24,7 +24,6 @@
133 import re
134 import logging
135 import urllib
136-from threading import Thread
137
138 from lernid.widgets.Widget import Widget
139 from lernid.lernidconfig import save_cache_path
140@@ -104,7 +103,7 @@
141 page = pdf.get_page(int(pagenumber) - 1)
142 w, h = page.get_size()
143 pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, 8, int(w), int(h))
144- page.render_to_pixbuf(0,0,8,11,1,0, pixbuf)
145+ page.render_to_pixbuf(0,0,int(w),int(h),1,0, pixbuf)
146 except:
147 Statusbar.push_message(_('An error was encountered while trying to load slide number {0}'.format(pagenumber)), duration=120)
148 logging.debug("Something went wrong when loading slide %s" % pagenumber)
149@@ -159,8 +158,7 @@
150 def _session_changed(self, schedule, session):
151 Statusbar.pop_message('slidesession')
152 if session.slides:
153- thread = Thread(target=self._download_slides, args=(session,))
154- thread.start()
155+ self._download_slides(session)
156 else:
157 self._image.clear()
158 self.hide()

Subscribers

People subscribed via source and target branches