Merge lp:~googol-deactivatedaccount/openlp/bug-807657 into lp:openlp
- bug-807657
- Merge into trunk
Status: | Rejected | ||||
---|---|---|---|---|---|
Rejected by: | Tim Bentley | ||||
Proposed branch: | lp:~googol-deactivatedaccount/openlp/bug-807657 | ||||
Merge into: | lp:openlp | ||||
Diff against target: |
488 lines (+290/-17) 10 files modified
openlp.pyw (+5/-1) openlp/core/ui/__init__.py (+2/-1) openlp/core/ui/mainwindow.py (+19/-7) openlp/core/ui/offlinehelpdialog.py (+86/-0) openlp/core/ui/offlinehelpform.py (+79/-0) openlp/core/utils/__init__.py (+10/-4) openlp/core/utils/languagemanager.py (+5/-1) resources/forms/offlineHelpDialog.ui (+79/-0) resources/windows/OpenLP-2.0.iss (+1/-1) scripts/windows-builder.py (+4/-2) |
||||
To merge this branch: | bzr merge lp:~googol-deactivatedaccount/openlp/bug-807657 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raoul Snyman | Needs Fixing | ||
Tim Bentley | Pending | ||
Review via email: mp+72621@code.launchpad.net |
This proposal supersedes a proposal from 2011-08-20.
Commit message
Description of the change
Hello,
- Bug #807657: Offline Help on all platforms
There has to be a "help" directory in the same directory as the "i18n" directory is. So on arch linux this would be /usr/share/
To be done afterwards (packaging):
- The qt_help_<lang>.qm files need to be packaged (like the qt_<lang>.qm) files.
- The help files have to be generated and included.
1) bzr checkout lp:openlp/documentation
2) cd documentation/
3) make qthelp
4) qcollectiongene
The "build/qthelp" folder has to be packaged.
NOTE (possible on relevant for packaging):
The Qt documentation mentions a dll file the help system need to so work. See http://
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal | # |
Andreas Preikschat (googol-deactivatedaccount) wrote : Posted in a previous version of this proposal | # |
> Looks good but search looks squashed
Yes, the search looks a bit odd. I am afraid, I cannot change this (as far as I know)....
Tim Bentley (trb143) wrote : | # |
Could not get search to work but UI is a lot better.
Raoul Snyman (raoul-snyman) wrote : | # |
As Tim said, search is not working.
- 1731. By Andreas Preikschat
-
attempt to fix search
Andreas Preikschat (googol-deactivatedaccount) wrote : | # |
I tried to find the problem. Here is what I have found until now:
1) I have overwritten the help file location (I copied it to the branch, we do not use /usr/share/
2) Navigate to the help directory and display hidden files. There should be only one hidden file (if at all).
3) The self.engine.
-> The search should work fine.
4) Refresh the folder; you should notice that there is a new hidden folder (.OpenLP).
5) Remove it and undo 3)
-> The search will not work
6) do 3) again
-> The search will work
The problems seems to be missing permissions. After creating the .OpenLP folder yourself:
Full Text Search, could not create index (missing permissions for '/usr/share/
Full Text Search, could not read index (missing permissions).
Full Text Search, could not read index (missing permissions).
Raoul Snyman (raoul-snyman) wrote : | # |
Is there a way to tell the help engine where to put it's indexes?
Raoul Snyman (raoul-snyman) wrote : | # |
Maybe this will help? QHelpEngineCore
Andreas Preikschat (googol-deactivatedaccount) wrote : | # |
> Maybe this will help? QHelpEngineCore
I don't think so. The files are created when calling setupData() and as the help files are in /usr/share/
:-/
Tim Bentley (trb143) wrote : | # |
I am not sure about this as the folder is created by and owned by root so how can a user create a file there.
Andreas Preikschat (googol-deactivatedaccount) wrote : | # |
> I am not sure about this as the folder is created by and owned by root so how
> can a user create a file there.
Exactly... but I think that's the place the help files should be placed.
Tim Bentley (trb143) wrote : | # |
When I see the help file compiled it says it is creating indexes but is it?
May be the source file is wrong and the index's are not being created properly.
Raoul Snyman (raoul-snyman) wrote : | # |
Perhaps we're doing it wrong, and we shouldn't be building the collection file until runtime?
qcollectiongene
Tim Bentley (trb143) wrote : | # |
Ok and I have been reading around this and we will not get indexes until indexes are defined in our text. If one looks on our web site the manual has no indexes so how can the code generate indexes for the off line version.
I suggest we get this in and sort out the documentation.
Raoul Snyman (raoul-snyman) wrote : | # |
Tim, that index has nothing to do with the index that Qt Help is trying to generate. That index is automatically generated by reStructuredText markup around modules, classes and functions, and since we have none of the above in the manual, we have nothing to automatically go in the index.
That said, we can manually add indices via the .. index:: directive.
Andreas Preikschat (googol-deactivatedaccount) wrote : | # |
Do you suggest to move the help files to ~/.something, right?
That would mean I have to copy the files to /usr/share/
Andreas Preikschat (googol-deactivatedaccount) wrote : | # |
> Do you suggest to move the help files to ~/.something, right?
>
> That would mean I have to copy the files to /usr/share/
> need the files I check it they exist in ~/.something; if that is not the case
> I copy them from /usr/share/
> sound correct especially the copying, but we have to ensure that OpenLP works
> for all users on a computer...
Is that correct?
Raoul Snyman (raoul-snyman) wrote : | # |
The only other thing is that we'd have to somehow figure out if the user has updated OpenLP (and therefore the documentation) and we need to re-copy the files. How would we do that? Is there a cross-platform way to get the last modified date of a file? When we install OpenLP, does it adjust this date?
Unmerged revisions
- 1734. By Andreas Preikschat
-
fixed merge error
- 1733. By Andreas Preikschat
-
fix
- 1732. By Andreas Preikschat
-
head
- 1731. By Andreas Preikschat
-
attempt to fix search
- 1730. By Andreas Preikschat
-
fixed windows help file link
- 1729. By Andreas Preikschat
-
r1717
- 1728. By Andreas Preikschat
-
make dialog larger
- 1727. By Andreas Preikschat
-
do not block the mainwindow when opening the help dialog
- 1726. By Andreas Preikschat
-
hide back/forward button (hackish)
- 1725. By Andreas Preikschat
-
do not use qthelp on windows; change help file's location on windows
Preview Diff
1 | === modified file 'openlp.pyw' |
2 | --- openlp.pyw 2011-07-30 16:00:11 +0000 |
3 | +++ openlp.pyw 2011-08-26 11:55:25 +0000 |
4 | @@ -262,7 +262,7 @@ |
5 | + "/qt4_plugins") |
6 | # i18n Set Language |
7 | language = LanguageManager.get_language() |
8 | - app_translator, default_translator = \ |
9 | + app_translator, default_translator, help_translator = \ |
10 | LanguageManager.get_translator(language) |
11 | if not app_translator.isEmpty(): |
12 | app.installTranslator(app_translator) |
13 | @@ -270,6 +270,10 @@ |
14 | app.installTranslator(default_translator) |
15 | else: |
16 | log.debug(u'Could not find default_translator.') |
17 | + if not help_translator.isEmpty(): |
18 | + app.installTranslator(help_translator) |
19 | + else: |
20 | + log.debug(u'Could not find help_translator.') |
21 | if not options.no_error_form: |
22 | sys.excepthook = app.hookException |
23 | sys.exit(app.run(qt_args)) |
24 | |
25 | === modified file 'openlp/core/ui/__init__.py' |
26 | --- openlp/core/ui/__init__.py 2011-07-30 07:34:37 +0000 |
27 | +++ openlp/core/ui/__init__.py 2011-08-26 11:55:25 +0000 |
28 | @@ -74,7 +74,8 @@ |
29 | from mediadockmanager import MediaDockManager |
30 | from servicemanager import ServiceManager |
31 | from thememanager import ThemeManager |
32 | +from offlinehelpform import OfflineHelpForm |
33 | |
34 | __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay', |
35 | 'SlideController', 'ServiceManager', 'ThemeManager', 'MediaDockManager', |
36 | - 'ServiceItemEditForm', u'FirstTimeForm'] |
37 | + 'ServiceItemEditForm', u'FirstTimeForm', u'OfflineHelpForm'] |
38 | |
39 | === modified file 'openlp/core/ui/mainwindow.py' |
40 | --- openlp/core/ui/mainwindow.py 2011-08-20 19:36:51 +0000 |
41 | +++ openlp/core/ui/mainwindow.py 2011-08-26 11:55:25 +0000 |
42 | @@ -39,7 +39,7 @@ |
43 | icon_action, shortcut_action |
44 | from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \ |
45 | ThemeManager, SlideController, PluginForm, MediaDockManager, \ |
46 | - ShortcutListForm, FormattingTagForm |
47 | + ShortcutListForm, FormattingTagForm, OfflineHelpForm |
48 | from openlp.core.utils import AppLocation, add_actions, LanguageManager, \ |
49 | get_application_version, delete_file |
50 | from openlp.core.utils.actions import ActionList, CategoryOrder |
51 | @@ -289,8 +289,12 @@ |
52 | [QtGui.QKeySequence(u'Ctrl+F1')], self.onAboutItemClicked, |
53 | u':/system/system_about.png', category=UiStrings().Help) |
54 | if os.name == u'nt': |
55 | - self.localHelpFile = os.path.join( |
56 | - AppLocation.get_directory(AppLocation.AppDir), 'OpenLP.chm') |
57 | + self.localHelpFileAvailable = os.path.exists(os.path.join( |
58 | + AppLocation.get_directory(AppLocation.HelpDir), u'OpenLP.chm')) |
59 | + else: |
60 | + self.localHelpFileAvailable = os.path.exists(os.path.join( |
61 | + AppLocation.get_directory(AppLocation.HelpDir), u'OpenLP.qhc')) |
62 | + if self.localHelpFileAvailable: |
63 | self.offlineHelpItem = shortcut_action( |
64 | mainWindow, u'offlineHelpItem', [QtGui.QKeySequence(u'F1')], |
65 | self.onOfflineHelpClicked, |
66 | @@ -335,7 +339,7 @@ |
67 | add_actions(self.toolsMenu, (self.toolsOpenDataFolder, None)) |
68 | add_actions(self.toolsMenu, (self.toolsFirstTimeWizard, None)) |
69 | add_actions(self.toolsMenu, [self.updateThemeImages]) |
70 | - if os.name == u'nt': |
71 | + if self.localHelpFileAvailable: |
72 | add_actions(self.helpMenu, (self.offlineHelpItem, |
73 | self.onlineHelpItem, None, self.webSiteItem, |
74 | self.aboutItem)) |
75 | @@ -461,7 +465,7 @@ |
76 | self.aboutItem.setText(translate('OpenLP.MainWindow', '&About')) |
77 | self.aboutItem.setStatusTip( |
78 | translate('OpenLP.MainWindow', 'More information about OpenLP')) |
79 | - if os.name == u'nt': |
80 | + if self.localHelpFileAvailable: |
81 | self.offlineHelpItem.setText( |
82 | translate('OpenLP.MainWindow', '&User Guide')) |
83 | self.onlineHelpItem.setText( |
84 | @@ -782,7 +786,7 @@ |
85 | translate('OpenLP.MainWindow', |
86 | 'OpenLP Main Display Blanked'), |
87 | translate('OpenLP.MainWindow', |
88 | - 'The Main Display has been blanked out')) |
89 | + 'The Main Display has been blanked out')) |
90 | |
91 | def onErrorMessage(self, data): |
92 | Receiver.send_message(u'close_splash') |
93 | @@ -807,7 +811,15 @@ |
94 | """ |
95 | Load the local OpenLP help file |
96 | """ |
97 | - os.startfile(self.localHelpFile) |
98 | + if os.name == u'nt': |
99 | + localHelpFile= os.path.join( |
100 | + AppLocation.get_directory(AppLocation.HelpDir), u'OpenLP.chm') |
101 | + os.startfile(localHelpFile) |
102 | + else: |
103 | + localHelpFile = os.path.join( |
104 | + AppLocation.get_directory(AppLocation.HelpDir), u'OpenLP.qhc') |
105 | + offlineHelpDialog = OfflineHelpForm(self, localHelpFile) |
106 | + offlineHelpDialog.show() |
107 | |
108 | def onOnlineHelpClicked(self): |
109 | """ |
110 | |
111 | === added file 'openlp/core/ui/offlinehelpdialog.py' |
112 | --- openlp/core/ui/offlinehelpdialog.py 1970-01-01 00:00:00 +0000 |
113 | +++ openlp/core/ui/offlinehelpdialog.py 2011-08-26 11:55:25 +0000 |
114 | @@ -0,0 +1,86 @@ |
115 | +# -*- coding: utf-8 -*- |
116 | +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
117 | + |
118 | +############################################################################### |
119 | +# OpenLP - Open Source Lyrics Projection # |
120 | +# --------------------------------------------------------------------------- # |
121 | +# Copyright (c) 2008-2011 Raoul Snyman # |
122 | +# Portions copyright (c) 2008-2011 Tim Bentley, Gerald Britton, Jonathan # |
123 | +# Corwin, Michael Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, # |
124 | +# Armin Köhler, Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias # |
125 | +# Põldaru, Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, # |
126 | +# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund # |
127 | +# --------------------------------------------------------------------------- # |
128 | +# This program is free software; you can redistribute it and/or modify it # |
129 | +# under the terms of the GNU General Public License as published by the Free # |
130 | +# Software Foundation; version 2 of the License. # |
131 | +# # |
132 | +# This program is distributed in the hope that it will be useful, but WITHOUT # |
133 | +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # |
134 | +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # |
135 | +# more details. # |
136 | +# # |
137 | +# You should have received a copy of the GNU General Public License along # |
138 | +# with this program; if not, write to the Free Software Foundation, Inc., 59 # |
139 | +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # |
140 | +############################################################################### |
141 | + |
142 | +from openlp.core.lib import translate |
143 | + |
144 | +from PyQt4 import QtGui, QtCore, QtWebKit |
145 | + |
146 | +class Ui_OfflineHelpDialog(object): |
147 | + def setupUi(self, dialog): |
148 | + dialog.setObjectName(u'dialog') |
149 | + dialog.resize(800, 550) |
150 | + dialog.setWindowFlags(QtCore.Qt.Window) |
151 | + self.horizontalLayout = QtGui.QHBoxLayout(dialog) |
152 | + self.horizontalLayout.setObjectName(u'horizontalLayout') |
153 | + self.splitter = QtGui.QSplitter(dialog) |
154 | + self.splitter.setObjectName(u'splitter') |
155 | + self.splitter.setOrientation(QtCore.Qt.Horizontal) |
156 | + self.contentTableWidget = QtGui.QWidget(self.splitter) |
157 | + self.contentTableWidget.setObjectName(u'contentTableWidget') |
158 | + self.contentTableLayout = QtGui.QVBoxLayout(self.contentTableWidget) |
159 | + self.contentTableLayout.setSpacing(0) |
160 | + self.contentTableLayout.setMargin(0) |
161 | + self.contentTableLayout.setObjectName(u'contentTableLayout') |
162 | + self.verticalLayout = QtGui.QVBoxLayout() |
163 | + self.verticalLayout.setObjectName(u'verticalLayout') |
164 | + self.searchField = self.engine.searchEngine().queryWidget() |
165 | + self.searchField.setFixedWidth(300) |
166 | + # Hide the toolbuttons which allow the user to go back/forward in the |
167 | + # query history. |
168 | + for child in self.searchField.children(): |
169 | + if isinstance(child, QtGui.QToolButton) and child.arrowType() in \ |
170 | + (QtCore.Qt.LeftArrow, QtCore.Qt.RightArrow): |
171 | + child.setHidden(True) |
172 | + self.searchField.setObjectName(u'searchField') |
173 | + self.verticalLayout.addWidget(self.searchField) |
174 | + self.tabWidget = QtGui.QTabWidget(self.contentTableWidget) |
175 | + self.tabWidget.setObjectName(u'tabWidget') |
176 | + self.indexTab = self.engine.contentWidget() |
177 | + self.indexTab.setObjectName(u'indexTab') |
178 | + self.tabWidget.addTab(self.indexTab, (u'')) |
179 | + self.searchTab = self.engine.searchEngine().resultWidget() |
180 | + self.searchTab.setObjectName(u'searchTab') |
181 | + self.tabWidget.addTab(self.searchTab, (u'')) |
182 | + self.verticalLayout.addWidget(self.tabWidget) |
183 | + self.contentTableLayout.addLayout(self.verticalLayout) |
184 | + self.contentView = QtWebKit.QWebView(self.splitter) |
185 | + self.contentView.setObjectName(u'contentView') |
186 | + self.horizontalLayout.addWidget(self.splitter) |
187 | + |
188 | + self.retranslateUi(dialog) |
189 | + self.tabWidget.setCurrentIndex(0) |
190 | + QtCore.QMetaObject.connectSlotsByName(dialog) |
191 | + |
192 | + def retranslateUi(self, dialog): |
193 | + dialog.setWindowTitle( |
194 | + translate('OpenLP.OfflineHelpDialog', 'User Guide')) |
195 | + self.tabWidget.setTabText( |
196 | + self.tabWidget.indexOf(self.indexTab), |
197 | + translate('OpenLP.OfflineHelpDialog', 'Content')) |
198 | + self.tabWidget.setTabText( |
199 | + self.tabWidget.indexOf(self.searchTab), |
200 | + translate('OpenLP.OfflineHelpDialog', 'Search')) |
201 | |
202 | === added file 'openlp/core/ui/offlinehelpform.py' |
203 | --- openlp/core/ui/offlinehelpform.py 1970-01-01 00:00:00 +0000 |
204 | +++ openlp/core/ui/offlinehelpform.py 2011-08-26 11:55:25 +0000 |
205 | @@ -0,0 +1,79 @@ |
206 | +# -*- coding: utf-8 -*- |
207 | +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
208 | + |
209 | +############################################################################### |
210 | +# OpenLP - Open Source Lyrics Projection # |
211 | +# --------------------------------------------------------------------------- # |
212 | +# Copyright (c) 2008-2011 Raoul Snyman # |
213 | +# Portions copyright (c) 2008-2011 Tim Bentley, Gerald Britton, Jonathan # |
214 | +# Corwin, Michael Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, # |
215 | +# Armin Köhler, Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias # |
216 | +# Põldaru, Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, # |
217 | +# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund # |
218 | +# --------------------------------------------------------------------------- # |
219 | +# This program is free software; you can redistribute it and/or modify it # |
220 | +# under the terms of the GNU General Public License as published by the Free # |
221 | +# Software Foundation; version 2 of the License. # |
222 | +# # |
223 | +# This program is distributed in the hope that it will be useful, but WITHOUT # |
224 | +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # |
225 | +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # |
226 | +# more details. # |
227 | +# # |
228 | +# You should have received a copy of the GNU General Public License along # |
229 | +# with this program; if not, write to the Free Software Foundation, Inc., 59 # |
230 | +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # |
231 | +############################################################################### |
232 | +import os |
233 | + |
234 | +from PyQt4 import QtGui, QtHelp, QtCore |
235 | + |
236 | +from openlp.core.ui.offlinehelpdialog import Ui_OfflineHelpDialog |
237 | + |
238 | +class OfflineHelpForm(QtGui.QDialog, Ui_OfflineHelpDialog): |
239 | + def __init__(self, parent, collectionFile): |
240 | + """ |
241 | + Constructor. |
242 | + |
243 | + ``collectionFile`` |
244 | + The collection file's extension (in binary form) is **.qhc**. |
245 | + """ |
246 | + QtGui.QDialog.__init__(self, parent) |
247 | + self.html_directory = os.path.dirname(collectionFile) |
248 | + self.engine = QtHelp.QHelpEngine(collectionFile, parent) |
249 | + self.setupUi(self) |
250 | + self.engine.setupData() |
251 | + self.contentView.load( |
252 | + QtCore.QUrl(os.path.join(self.html_directory, u'index.html'))) |
253 | + # Signals |
254 | + QtCore.QObject.connect(self.searchTab, |
255 | + QtCore.SIGNAL(u'requestShowLink(const QUrl&)'), |
256 | + self.showHelpContent) |
257 | + QtCore.QObject.connect(self.indexTab, |
258 | + QtCore.SIGNAL(u'linkActivated(const QUrl&)'), self.showHelpContent) |
259 | + QtCore.QObject.connect(self.engine.searchEngine().queryWidget(), |
260 | + QtCore.SIGNAL(u'search()'), self.onSearchButtonPressed) |
261 | + |
262 | + def onSearchButtonPressed(self): |
263 | + """ |
264 | + Called when the user pressed the search button. We obtain the query and |
265 | + tell the search engine to search. |
266 | + """ |
267 | + query = self.engine.searchEngine().queryWidget().query() |
268 | + self.engine.searchEngine().search(query) |
269 | + self.tabWidget.setCurrentIndex(1) |
270 | + |
271 | + def showHelpContent(self, url): |
272 | + """ |
273 | + Called when new help content is supposed to be shown. Some parts of the |
274 | + given ``url`` have to be removed and cleaned up. |
275 | + |
276 | + ``url`` |
277 | + The url to open:: |
278 | + |
279 | + ``qthelp://org.sphinx.openlp.2.0/doc/introduction.html#about`` |
280 | + """ |
281 | + url = unicode(url.toString()) |
282 | + url = url.replace(u'qthelp://org.sphinx.openlp.2.0/doc', u'file://' + |
283 | + self.html_directory) |
284 | + self.contentView.load(QtCore.QUrl(url)) |
285 | |
286 | === modified file 'openlp/core/utils/__init__.py' |
287 | --- openlp/core/utils/__init__.py 2011-08-12 14:54:16 +0000 |
288 | +++ openlp/core/utils/__init__.py 2011-08-26 11:55:25 +0000 |
289 | @@ -126,9 +126,10 @@ |
290 | VersionDir = 5 |
291 | CacheDir = 6 |
292 | LanguageDir = 7 |
293 | + HelpDir = 8 |
294 | |
295 | @staticmethod |
296 | - def get_directory(dir_type=1): |
297 | + def get_directory(dir_type=AppDir): |
298 | """ |
299 | Return the appropriate directory according to the directory type. |
300 | |
301 | @@ -152,6 +153,11 @@ |
302 | os.path.abspath(os.path.split(sys.argv[0])[0]), |
303 | _get_os_dir_path(dir_type)) |
304 | return os.path.join(app_path, u'i18n') |
305 | + elif dir_type == AppLocation.HelpDir: |
306 | + app_path = _get_frozen_path( |
307 | + os.path.abspath(os.path.split(sys.argv[0])[0]), |
308 | + _get_os_dir_path(dir_type)) |
309 | + return os.path.join(app_path, u'help') |
310 | else: |
311 | return _get_os_dir_path(dir_type) |
312 | |
313 | @@ -183,7 +189,7 @@ |
314 | if dir_type == AppLocation.DataDir: |
315 | return os.path.join(unicode(os.getenv(u'APPDATA'), encoding), |
316 | u'openlp', u'data') |
317 | - elif dir_type == AppLocation.LanguageDir: |
318 | + elif dir_type in (AppLocation.LanguageDir, AppLocation.HelpDir): |
319 | return os.path.split(openlp.__file__)[0] |
320 | return os.path.join(unicode(os.getenv(u'APPDATA'), encoding), |
321 | u'openlp') |
322 | @@ -191,12 +197,12 @@ |
323 | if dir_type == AppLocation.DataDir: |
324 | return os.path.join(unicode(os.getenv(u'HOME'), encoding), |
325 | u'Library', u'Application Support', u'openlp', u'Data') |
326 | - elif dir_type == AppLocation.LanguageDir: |
327 | + elif dir_type in (AppLocation.LanguageDir, AppLocation.HelpDir): |
328 | return os.path.split(openlp.__file__)[0] |
329 | return os.path.join(unicode(os.getenv(u'HOME'), encoding), |
330 | u'Library', u'Application Support', u'openlp') |
331 | else: |
332 | - if dir_type == AppLocation.LanguageDir: |
333 | + if dir_type in (AppLocation.LanguageDir, AppLocation.HelpDir): |
334 | return os.path.join(u'/usr', u'share', u'openlp') |
335 | if XDG_BASE_AVAILABLE: |
336 | if dir_type == AppLocation.ConfigDir: |
337 | |
338 | === modified file 'openlp/core/utils/languagemanager.py' |
339 | --- openlp/core/utils/languagemanager.py 2011-06-12 16:02:52 +0000 |
340 | +++ openlp/core/utils/languagemanager.py 2011-08-26 11:55:25 +0000 |
341 | @@ -56,6 +56,7 @@ |
342 | if LanguageManager.auto_language: |
343 | language = QtCore.QLocale.system().name() |
344 | lang_path = AppLocation.get_directory(AppLocation.LanguageDir) |
345 | + # Our own translations. |
346 | app_translator = QtCore.QTranslator() |
347 | app_translator.load(language, lang_path) |
348 | # A translator for buttons and other default strings provided by Qt. |
349 | @@ -64,7 +65,10 @@ |
350 | QtCore.QLibraryInfo.TranslationsPath) |
351 | default_translator = QtCore.QTranslator() |
352 | default_translator.load(u'qt_%s' % language, lang_path) |
353 | - return app_translator, default_translator |
354 | + # Strings for the help dialog are provided by Qt. |
355 | + help_translator = QtCore.QTranslator() |
356 | + help_translator.load(u'qt_help_%s' % language, lang_path) |
357 | + return app_translator, default_translator, help_translator |
358 | |
359 | @staticmethod |
360 | def find_qm_files(): |
361 | |
362 | === added file 'resources/forms/offlineHelpDialog.ui' |
363 | --- resources/forms/offlineHelpDialog.ui 1970-01-01 00:00:00 +0000 |
364 | +++ resources/forms/offlineHelpDialog.ui 2011-08-26 11:55:25 +0000 |
365 | @@ -0,0 +1,79 @@ |
366 | +<?xml version="1.0" encoding="UTF-8"?> |
367 | +<ui version="4.0"> |
368 | + <class>Dialog</class> |
369 | + <widget class="QDialog" name="Dialog"> |
370 | + <property name="geometry"> |
371 | + <rect> |
372 | + <x>0</x> |
373 | + <y>0</y> |
374 | + <width>580</width> |
375 | + <height>473</height> |
376 | + </rect> |
377 | + </property> |
378 | + <property name="windowTitle"> |
379 | + <string>Dialog</string> |
380 | + </property> |
381 | + <layout class="QHBoxLayout" name="horizontalLayout"> |
382 | + <item> |
383 | + <widget class="QSplitter" name="splitter"> |
384 | + <property name="orientation"> |
385 | + <enum>Qt::Horizontal</enum> |
386 | + </property> |
387 | + <widget class="QWidget" name="contentSearch" native="true"> |
388 | + <layout class="QVBoxLayout" name="PreviewPaneLayout"> |
389 | + <property name="spacing"> |
390 | + <number>0</number> |
391 | + </property> |
392 | + <property name="margin"> |
393 | + <number>0</number> |
394 | + </property> |
395 | + <item> |
396 | + <layout class="QVBoxLayout" name="verticalLayout"> |
397 | + <item> |
398 | + <widget class="QLineEdit" name="searchField"/> |
399 | + </item> |
400 | + <item> |
401 | + <widget class="QTabWidget" name="tabWidget"> |
402 | + <property name="currentIndex"> |
403 | + <number>0</number> |
404 | + </property> |
405 | + <widget class="QWidget" name="indexTab"> |
406 | + <attribute name="title"> |
407 | + <string>Tab 1</string> |
408 | + </attribute> |
409 | + </widget> |
410 | + <widget class="QWidget" name="searchTab"> |
411 | + <property name="enabled"> |
412 | + <bool>true</bool> |
413 | + </property> |
414 | + <attribute name="title"> |
415 | + <string>Tab 2</string> |
416 | + </attribute> |
417 | + </widget> |
418 | + </widget> |
419 | + </item> |
420 | + </layout> |
421 | + </item> |
422 | + </layout> |
423 | + </widget> |
424 | + <widget class="QWebView" name="contentView"> |
425 | + <property name="url"> |
426 | + <url> |
427 | + <string>about:blank</string> |
428 | + </url> |
429 | + </property> |
430 | + </widget> |
431 | + </widget> |
432 | + </item> |
433 | + </layout> |
434 | + </widget> |
435 | + <customwidgets> |
436 | + <customwidget> |
437 | + <class>QWebView</class> |
438 | + <extends>QWidget</extends> |
439 | + <header>QtWebKit/QWebView</header> |
440 | + </customwidget> |
441 | + </customwidgets> |
442 | + <resources/> |
443 | + <connections/> |
444 | +</ui> |
445 | |
446 | === modified file 'resources/windows/OpenLP-2.0.iss' |
447 | --- resources/windows/OpenLP-2.0.iss 2011-05-23 15:41:22 +0000 |
448 | +++ resources/windows/OpenLP-2.0.iss 2011-08-26 11:55:25 +0000 |
449 | @@ -71,7 +71,7 @@ |
450 | [Icons] |
451 | Name: {group}\{#AppName}; Filename: {app}\{#AppExeName} |
452 | Name: {group}\{#AppName} (Debug); Filename: {app}\{#AppExeName}; Parameters: -l debug |
453 | -Name: {group}\{#AppName} Help; Filename: {app}\{#AppName}.chm; Check: FileExists(ExpandConstant('{app}\{#AppName}.chm')) |
454 | +Name: {group}\{#AppName} Help; Filename: {app}\help\{#AppName}.chm; Check: FileExists(ExpandConstant('{app}\help\{#AppName}.chm')) |
455 | Name: {group}\{cm:ProgramOnTheWeb,{#AppName}}; Filename: {#AppURL} |
456 | Name: {group}\{cm:UninstallProgram,{#AppName}}; Filename: {uninstallexe} |
457 | Name: {commondesktop}\{#AppName}; Filename: {app}\{#AppExeName}; Tasks: desktopicon |
458 | |
459 | === modified file 'scripts/windows-builder.py' |
460 | --- scripts/windows-builder.py 2011-07-23 12:11:11 +0000 |
461 | +++ scripts/windows-builder.py 2011-08-26 11:55:25 +0000 |
462 | @@ -173,7 +173,7 @@ |
463 | pyinstaller = Popen((python_exe, pyi_build, |
464 | u'--noconfirm', |
465 | u'--windowed', |
466 | - u'--noupx', |
467 | + u'--noupx', |
468 | u'-o', branch_path, |
469 | u'-i', win32_icon, |
470 | u'-p', branch_path, |
471 | @@ -236,7 +236,7 @@ |
472 | if os.path.isfile(os.path.join(helpfile_path, u'OpenLP.chm')): |
473 | print u' Windows help file found' |
474 | copy(os.path.join(helpfile_path, u'OpenLP.chm'), |
475 | - os.path.join(dist_path, u'OpenLP.chm')) |
476 | + os.path.join(dist_path, u'help', u'OpenLP.chm')) |
477 | else: |
478 | print u' WARNING ---- Windows help file not found ---- WARNING' |
479 | |
480 | @@ -288,6 +288,8 @@ |
481 | |
482 | def run_htmlhelp(): |
483 | print u'Running HTML Help Workshop...' |
484 | + if not os.path.exists(os.path.join(dist_path, u'help')): |
485 | + os.makedirs(os.path.join(dist_path, u'help')) |
486 | os.chdir(os.path.join(manual_build_path, u'htmlhelp')) |
487 | hhc = Popen((hhc_exe, u'OpenLP.chm'), stdout=PIPE) |
488 | output, error = hhc.communicate() |
Looks good but search looks squashed