This commit is contained in:
Tim Bentley 2011-02-13 10:38:05 +00:00
commit f12b5f60ae
4 changed files with 16 additions and 10 deletions

View File

@ -65,6 +65,7 @@ class MainDisplay(DisplayWidget):
self.parent = parent
self.screens = screens
self.isLive = live
self.alertTab = None
self.hideMode = None
self.override = {}
mainIcon = build_icon(u':/icon/openlp-logo-16x16.png')
@ -147,7 +148,7 @@ class MainDisplay(DisplayWidget):
serviceItem = ServiceItem()
serviceItem.bg_image_bytes = image_to_byte(initialFrame)
self.webView.setHtml(build_html(serviceItem, self.screen,
self.parent.alertTab, self.isLive, None))
self.alertTab, self.isLive, None))
self.initialFrame = True
# To display or not to display?
if not self.screen[u'primary']:
@ -418,7 +419,7 @@ class MainDisplay(DisplayWidget):
if self.serviceItem.themedata.background_filename:
self.serviceItem.bg_image_bytes = self.imageManager. \
get_image_bytes(self.serviceItem.themedata.theme_name)
html = build_html(self.serviceItem, self.screen, self.parent.alertTab,
html = build_html(self.serviceItem, self.screen, self.alertTab,
self.isLive, background)
log.debug(u'buildHtml - pre setHtml')
self.webView.setHtml(html)

View File

@ -110,11 +110,12 @@ class ServiceItemEditForm(QtGui.QDialog, Ui_ServiceItemEditDialog):
temp = self.itemList[row]
self.itemList.remove(self.itemList[row])
if direction == u'up':
self.itemList.insert(row - 1, temp)
row -= 1
else:
self.itemList.insert(row + 1, temp)
row += 1
self.itemList.insert(row, temp)
self.loadData()
self.listWidget.setCurrentRow(row + 1)
self.listWidget.setCurrentRow(row)
def onCurrentRowChanged(self, row):
"""

View File

@ -415,6 +415,7 @@ class SlideController(QtGui.QWidget):
# rebuild display as screen size changed
self.display = MainDisplay(self, self.screens, self.isLive)
self.display.imageManager = self.parent.renderManager.image_manager
self.display.alertTab = self.alertTab
self.display.setup()
if self.isLive:
self.__addActionsToWidget(self.display)

View File

@ -165,6 +165,8 @@ def _get_os_dir_path(dir_type):
Return a path based on which OS and environment we are running in.
"""
if sys.platform == u'win32':
if dir_type == AppLocation.DataDir:
return os.path.join(os.getenv(u'APPDATA'), u'openlp', u'data')
return os.path.join(os.getenv(u'APPDATA'), u'openlp')
elif sys.platform == u'darwin':
if dir_type == AppLocation.DataDir:
@ -177,11 +179,13 @@ def _get_os_dir_path(dir_type):
if dir_type == AppLocation.ConfigDir:
return os.path.join(BaseDirectory.xdg_config_home, u'openlp')
elif dir_type == AppLocation.DataDir:
return os.path.join(BaseDirectory.xdg_data_home, u'openlp')
return os.path.join(BaseDirectory.xdg_data_home, u'openlp',
u'data')
elif dir_type == AppLocation.CacheDir:
return os.path.join(BaseDirectory.xdg_cache_home, u'openlp')
else:
return os.path.join(os.getenv(u'HOME'), u'.openlp')
if dir_type == AppLocation.DataDir:
return os.path.join(os.getenv(u'HOME'), u'.openlp', u'data')
return os.path.join(os.getenv(u'HOME'), u'.openlp')
def _get_frozen_path(frozen_option, non_frozen_option):
"""
@ -189,8 +193,7 @@ def _get_frozen_path(frozen_option, non_frozen_option):
"""
if hasattr(sys, u'frozen') and sys.frozen == 1:
return frozen_option
else:
return non_frozen_option
return non_frozen_option
def check_latest_version(current_version):
"""