forked from openlp/openlp
bugfixing and sync
This commit is contained in:
commit
01ff00dcf9
|
@ -143,7 +143,7 @@ class OpenLP(QtGui.QApplication):
|
||||||
u'general/update check', QtCore.QVariant(True)).toBool()
|
u'general/update check', QtCore.QVariant(True)).toBool()
|
||||||
if update_check:
|
if update_check:
|
||||||
VersionThread(self.mainWindow).start()
|
VersionThread(self.mainWindow).start()
|
||||||
Receiver.send_message(u'maindisplay_blank_check')
|
Receiver.send_message(u'live_display_blank_check')
|
||||||
self.mainWindow.appStartup()
|
self.mainWindow.appStartup()
|
||||||
DelayStartThread(self.mainWindow).start()
|
DelayStartThread(self.mainWindow).start()
|
||||||
# Skip exec_() for gui tests
|
# Skip exec_() for gui tests
|
||||||
|
|
|
@ -35,189 +35,190 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class EventReceiver(QtCore.QObject):
|
class EventReceiver(QtCore.QObject):
|
||||||
"""
|
"""
|
||||||
Class to allow events to be passed from different parts of the
|
Class to allow events to be passed from different parts of the system. This
|
||||||
system. This is a private class and should not be used directly
|
is a private class and should not be used directly but rather via the
|
||||||
but rather via the Receiver class.
|
Receiver class.
|
||||||
|
|
||||||
|
**Mainwindow related and generic signals**
|
||||||
|
|
||||||
|
``mainwindow_status_text``
|
||||||
|
Changes the bottom status bar text on the mainwindow.
|
||||||
|
|
||||||
|
``openlp_warning_message``
|
||||||
|
Displays a standalone Warning Message.
|
||||||
|
|
||||||
|
``openlp_error_message``
|
||||||
|
Displays a standalone Error Message.
|
||||||
|
|
||||||
|
``openlp_information_message``
|
||||||
|
Displays a standalone Information Message.
|
||||||
|
|
||||||
|
``cursor_busy``
|
||||||
|
Makes the cursor got to a busy form.
|
||||||
|
|
||||||
|
``cursor_normal``
|
||||||
|
Resets the cursor to default.
|
||||||
|
|
||||||
``openlp_process_events``
|
``openlp_process_events``
|
||||||
Requests the Application to flush the events queue
|
Requests the Application to flush the events queue.
|
||||||
|
|
||||||
``openlp_version_check``
|
``openlp_version_check``
|
||||||
Version has changed so pop up window.
|
Version has changed so pop up window.
|
||||||
|
|
||||||
|
``openlp_stop_wizard``
|
||||||
|
Stops a wizard before completion.
|
||||||
|
|
||||||
|
**Setting related signals**
|
||||||
|
|
||||||
``config_updated``
|
``config_updated``
|
||||||
Informs components the config has changed
|
Informs components that the config has changed.
|
||||||
|
|
||||||
``config_screen_changed``
|
``config_screen_changed``
|
||||||
The display monitor has been changed
|
The display monitor has been changed.
|
||||||
|
|
||||||
|
**Slidecontroller signals**
|
||||||
|
|
||||||
``slidecontroller_{live|preview}_next``
|
``slidecontroller_{live|preview}_next``
|
||||||
Moves to the next slide
|
Moves to the next slide.
|
||||||
|
|
||||||
``slidecontroller_{live|preview}_next_noloop``
|
``slidecontroller_{live|preview}_next_noloop``
|
||||||
Moves to the next slide without auto advance
|
Moves to the next slide without auto advance.
|
||||||
|
|
||||||
``slidecontroller_{live|preview}_previous``
|
``slidecontroller_{live|preview}_previous``
|
||||||
Moves to the previous slide
|
Moves to the previous slide.
|
||||||
|
|
||||||
``slidecontroller_{live|preview}_previous_noloop``
|
``slidecontroller_{live|preview}_previous_noloop``
|
||||||
Moves to the previous slide, without auto advance
|
Moves to the previous slide, without auto advance.
|
||||||
|
|
||||||
``slidecontroller_{live|preview}_set``
|
``slidecontroller_{live|preview}_set``
|
||||||
Moves to a specific slide, by index
|
Moves to a specific slide, by index.
|
||||||
|
|
||||||
``slidecontroller_{live|preview}_started``
|
``slidecontroller_{live|preview}_started``
|
||||||
Broadcasts that an item has been made live/previewed
|
Broadcasts that an item has been made live/previewed.
|
||||||
|
|
||||||
``slidecontroller_{live|preview}_change``
|
``slidecontroller_{live|preview}_change``
|
||||||
Informs the slidecontroller that a slide change has occurred and to
|
Informs the slidecontroller that a slide change has occurred and to
|
||||||
update itself
|
update itself.
|
||||||
|
|
||||||
``slidecontroller_{live|preview}_changed``
|
``slidecontroller_{live|preview}_changed``
|
||||||
Broadcasts that the slidecontroller has changed the current slide
|
Broadcasts that the slidecontroller has changed the current slide.
|
||||||
|
|
||||||
``slidecontroller_{live|preview}_blank``
|
``slidecontroller_{live|preview}_blank``
|
||||||
Request that the output screen is blanked
|
Request that the output screen is blanked.
|
||||||
|
|
||||||
``slidecontroller_{live|preview}_unblank``
|
``slidecontroller_{live|preview}_unblank``
|
||||||
Request that the output screen is unblanked
|
Request that the output screen is unblanked.
|
||||||
|
|
||||||
``slidecontroller_live_spin_delay``
|
``slidecontroller_live_spin_delay``
|
||||||
Pushes out the loop delay
|
Pushes out the loop delay.
|
||||||
|
|
||||||
``slidecontroller_live_stop_loop``
|
``slidecontroller_live_stop_loop``
|
||||||
Stop the loop on the main display
|
Stop the loop on the main display.
|
||||||
|
|
||||||
|
**Servicemanager related signals**
|
||||||
|
|
||||||
``servicemanager_previous_item``
|
``servicemanager_previous_item``
|
||||||
Display the previous item in the service
|
Display the previous item in the service.
|
||||||
|
|
||||||
``servicemanager_preview_live``
|
``servicemanager_preview_live``
|
||||||
Requests a Preview item from the Service Manager to update live and
|
Requests a Preview item from the Service Manager to update live and add
|
||||||
add a new item to the preview panel
|
a new item to the preview panel.
|
||||||
|
|
||||||
``servicemanager_next_item``
|
``servicemanager_next_item``
|
||||||
Display the next item in the service
|
Display the next item in the service.
|
||||||
|
|
||||||
``servicemanager_set_item``
|
``servicemanager_set_item``
|
||||||
Go live on a specific item, by index
|
Go live on a specific item, by index.
|
||||||
|
|
||||||
``maindisplay_blank``
|
|
||||||
Blank the maindisplay window
|
|
||||||
|
|
||||||
``maindisplay_hide``
|
|
||||||
Hide the maindisplay window
|
|
||||||
|
|
||||||
``maindisplay_show``
|
|
||||||
Return the maindisplay window
|
|
||||||
|
|
||||||
``maindisplay_active``
|
|
||||||
The maindisplay has been made active
|
|
||||||
|
|
||||||
``maindisplay_status_text``
|
|
||||||
Changes the bottom status bar text on the maindisplay window
|
|
||||||
|
|
||||||
``maindisplay_blank_check``
|
|
||||||
Check to see if the blank display message is required
|
|
||||||
|
|
||||||
``videodisplay_start``
|
|
||||||
Open a media item and prepare for playing
|
|
||||||
|
|
||||||
``videodisplay_play``
|
|
||||||
Start playing a media item
|
|
||||||
|
|
||||||
``videodisplay_pause``
|
|
||||||
Pause a media item
|
|
||||||
|
|
||||||
``videodisplay_stop``
|
|
||||||
Stop playing a media item
|
|
||||||
|
|
||||||
``videodisplay_background``
|
|
||||||
Replace the background video
|
|
||||||
|
|
||||||
``theme_update_list``
|
|
||||||
send out message with new themes
|
|
||||||
|
|
||||||
``theme_update_global``
|
|
||||||
Tell the components we have a new global theme
|
|
||||||
|
|
||||||
``{plugin}_start``
|
|
||||||
Requests a plugin to start a external program
|
|
||||||
Path and file provided in message
|
|
||||||
|
|
||||||
``{plugin}_first``
|
|
||||||
Requests a plugin to handle a first event
|
|
||||||
|
|
||||||
``{plugin}_previous``
|
|
||||||
Requests a plugin to handle a previous event
|
|
||||||
|
|
||||||
``{plugin}_next``
|
|
||||||
Requests a plugin to handle a next event
|
|
||||||
|
|
||||||
``{plugin}_last``
|
|
||||||
Requests a plugin to handle a last event
|
|
||||||
|
|
||||||
``{plugin}_slide``
|
|
||||||
Requests a plugin to handle a go to specific slide event
|
|
||||||
|
|
||||||
``{plugin}_stop``
|
|
||||||
Requests a plugin to handle a stop event
|
|
||||||
|
|
||||||
``{plugin}_blank``
|
|
||||||
Requests a plugin to handle a blank screen event
|
|
||||||
|
|
||||||
``{plugin}_unblank``
|
|
||||||
Requests a plugin to handle an unblank screen event
|
|
||||||
|
|
||||||
``{plugin}_edit``
|
|
||||||
Requests a plugin edit a database item with the key as the payload
|
|
||||||
|
|
||||||
``{plugin}_edit_clear``
|
|
||||||
Editing has been completed
|
|
||||||
|
|
||||||
``{plugin}_load_list``
|
|
||||||
Tells the the plugin to reload the media manager list
|
|
||||||
|
|
||||||
``{plugin}_preview``
|
|
||||||
Tells the plugin it's item can be previewed
|
|
||||||
|
|
||||||
``{plugin}_add_service_item``
|
|
||||||
Ask the plugin to push the selected items to the service item
|
|
||||||
|
|
||||||
``{plugin}_service_load``
|
|
||||||
Ask the plugin to process an individual service item after it has been
|
|
||||||
loaded
|
|
||||||
|
|
||||||
``service_item_update``
|
``service_item_update``
|
||||||
Passes back to the service manager the service item after it has been
|
Passes back to the service manager the service item after it has been
|
||||||
processed by the plugin
|
processed by the plugin.
|
||||||
|
|
||||||
|
**Display signals**
|
||||||
|
|
||||||
|
``update_display_css``
|
||||||
|
CSS has been updated which needs to be changed on the main display.
|
||||||
|
|
||||||
|
**Live Display signals**
|
||||||
|
|
||||||
|
``live_display_hide``
|
||||||
|
Hide the live display.
|
||||||
|
|
||||||
|
``live_display_show``
|
||||||
|
Return the live display.
|
||||||
|
|
||||||
|
``live_display_active``
|
||||||
|
The live display has been made active.
|
||||||
|
|
||||||
|
``live_display_blank_check``
|
||||||
|
Check to see if the blank display message is required.
|
||||||
|
|
||||||
|
**Theme related singlas**
|
||||||
|
|
||||||
|
``theme_update_list``
|
||||||
|
send out message with new themes.
|
||||||
|
|
||||||
|
``theme_update_global``
|
||||||
|
Tell the components we have a new global theme.
|
||||||
|
|
||||||
|
**Plugin specific signals**
|
||||||
|
|
||||||
|
``{plugin}_start``
|
||||||
|
Requests a plugin to start a external program. Path and file have to
|
||||||
|
be provided in the message.
|
||||||
|
|
||||||
|
``{plugin}_first``
|
||||||
|
Requests a plugin to handle a first event.
|
||||||
|
|
||||||
|
``{plugin}_previous``
|
||||||
|
Requests a plugin to handle a previous event.
|
||||||
|
|
||||||
|
``{plugin}_next``
|
||||||
|
Requests a plugin to handle a next event.
|
||||||
|
|
||||||
|
``{plugin}_last``
|
||||||
|
Requests a plugin to handle a last event.
|
||||||
|
|
||||||
|
``{plugin}_slide``
|
||||||
|
Requests a plugin to handle a go to specific slide event.
|
||||||
|
|
||||||
|
``{plugin}_stop``
|
||||||
|
Requests a plugin to handle a stop event.
|
||||||
|
|
||||||
|
``{plugin}_blank``
|
||||||
|
Requests a plugin to handle a blank screen event.
|
||||||
|
|
||||||
|
``{plugin}_unblank``
|
||||||
|
Requests a plugin to handle an unblank screen event.
|
||||||
|
|
||||||
|
``{plugin}_edit``
|
||||||
|
Requests a plugin edit a database item with the key as the payload.
|
||||||
|
|
||||||
|
``{plugin}_edit_clear``
|
||||||
|
Editing has been completed.
|
||||||
|
|
||||||
|
``{plugin}_load_list``
|
||||||
|
Tells the the plugin to reload the media manager list.
|
||||||
|
|
||||||
|
``{plugin}_preview``
|
||||||
|
Tells the plugin it's item can be previewed.
|
||||||
|
|
||||||
|
``{plugin}_add_service_item``
|
||||||
|
Ask the plugin to push the selected items to the service item.
|
||||||
|
|
||||||
|
``{plugin}_service_load``
|
||||||
|
Ask the plugin to process an individual service item after it has been
|
||||||
|
loaded.
|
||||||
|
|
||||||
``alerts_text``
|
``alerts_text``
|
||||||
Displays an alert message
|
Displays an alert message.
|
||||||
|
|
||||||
``bibles_nobook``
|
``bibles_nobook``
|
||||||
Attempt to find book resulted in no match
|
Attempt to find book resulted in no match.
|
||||||
|
|
||||||
``openlp_stop_wizard``
|
|
||||||
Stops a wizard before completion
|
|
||||||
|
|
||||||
``remotes_poll_request``
|
``remotes_poll_request``
|
||||||
Waits for openlp to do something "interesting" and sends a
|
Waits for openlp to do something "interesting" and sends a
|
||||||
remotes_poll_response signal when it does
|
``remotes_poll_response`` signal when it does.
|
||||||
|
|
||||||
``openlp_warning_message``
|
|
||||||
Displays a standalone Warning Message
|
|
||||||
|
|
||||||
``openlp_error_message``
|
|
||||||
Displays a standalone Error Message
|
|
||||||
|
|
||||||
``openlp_information_message``
|
|
||||||
Displays a standalone Information Message
|
|
||||||
|
|
||||||
``cursor_busy``
|
|
||||||
Makes the cursor got to a busy form
|
|
||||||
|
|
||||||
``cursor_normal``
|
|
||||||
Resets the cursor to default
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
|
@ -68,13 +68,6 @@ body {
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
%s
|
%s
|
||||||
#alert {
|
|
||||||
position: absolute;
|
|
||||||
left: 0px;
|
|
||||||
top: 0px;
|
|
||||||
z-index: 10;
|
|
||||||
%s
|
|
||||||
}
|
|
||||||
#footer {
|
#footer {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 6;
|
z-index: 6;
|
||||||
|
@ -106,18 +99,14 @@ sup {
|
||||||
function show_blank(state){
|
function show_blank(state){
|
||||||
var black = 'none';
|
var black = 'none';
|
||||||
var lyrics = '';
|
var lyrics = '';
|
||||||
var pause = false;
|
|
||||||
switch(state){
|
switch(state){
|
||||||
case 'theme':
|
case 'theme':
|
||||||
lyrics = 'hidden';
|
lyrics = 'hidden';
|
||||||
pause = true;
|
|
||||||
break;
|
break;
|
||||||
case 'black':
|
case 'black':
|
||||||
black = 'block';
|
black = 'block';
|
||||||
pause = true;
|
|
||||||
break;
|
break;
|
||||||
case 'desktop':
|
case 'desktop':
|
||||||
pause = true;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
document.getElementById('black').style.display = black;
|
document.getElementById('black').style.display = black;
|
||||||
|
@ -130,41 +119,6 @@ sup {
|
||||||
if(shadow!=null)
|
if(shadow!=null)
|
||||||
shadow.style.visibility = lyrics;
|
shadow.style.visibility = lyrics;
|
||||||
document.getElementById('footer').style.visibility = lyrics;
|
document.getElementById('footer').style.visibility = lyrics;
|
||||||
var vid = document.getElementById('video');
|
|
||||||
if(vid.src != ''){
|
|
||||||
if(pause)
|
|
||||||
vid.pause();
|
|
||||||
else
|
|
||||||
vid.play();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function show_alert(alerttext, position){
|
|
||||||
var text = document.getElementById('alert');
|
|
||||||
text.innerHTML = alerttext;
|
|
||||||
if(alerttext == '') {
|
|
||||||
text.style.visibility = 'hidden';
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if(position == ''){
|
|
||||||
position = getComputedStyle(text, '').verticalAlign;
|
|
||||||
}
|
|
||||||
switch(position)
|
|
||||||
{
|
|
||||||
case 'top':
|
|
||||||
text.style.top = '0px';
|
|
||||||
break;
|
|
||||||
case 'middle':
|
|
||||||
text.style.top = ((window.innerHeight - text.clientHeight) / 2)
|
|
||||||
+ 'px';
|
|
||||||
break;
|
|
||||||
case 'bottom':
|
|
||||||
text.style.top = (window.innerHeight - text.clientHeight)
|
|
||||||
+ 'px';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
text.style.visibility = 'visible';
|
|
||||||
return text.clientHeight;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_footer(footertext){
|
function show_footer(footertext){
|
||||||
|
@ -220,7 +174,6 @@ sup {
|
||||||
function show_text_complete(){
|
function show_text_complete(){
|
||||||
return (text_opacity()==1);
|
return (text_opacity()==1);
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -230,13 +183,12 @@ sup {
|
||||||
%s
|
%s
|
||||||
<div id="footer" class="footer"></div>
|
<div id="footer" class="footer"></div>
|
||||||
<div id="black" class="size"></div>
|
<div id="black" class="size"></div>
|
||||||
<div id="alert" style="visibility:hidden"></div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def build_html(item, screen, alert, islive, background, plugins=None,
|
def build_html(item, screen, islive, background, image=None,
|
||||||
image=None):
|
plugins=None):
|
||||||
"""
|
"""
|
||||||
Build the full web paged structure for display
|
Build the full web paged structure for display
|
||||||
|
|
||||||
|
@ -246,20 +198,17 @@ def build_html(item, screen, alert, islive, background, plugins=None,
|
||||||
``screen``
|
``screen``
|
||||||
Current display information
|
Current display information
|
||||||
|
|
||||||
``alert``
|
|
||||||
Alert display display information
|
|
||||||
|
|
||||||
``islive``
|
``islive``
|
||||||
Item is going live, rather than preview/theme building
|
Item is going live, rather than preview/theme building
|
||||||
|
|
||||||
``background``
|
``background``
|
||||||
Theme background image - bytes
|
Theme background image - bytes
|
||||||
|
|
||||||
``plugins``
|
|
||||||
access to the plugins
|
|
||||||
|
|
||||||
``image``
|
``image``
|
||||||
Image media item - bytes
|
Image media item - bytes
|
||||||
|
|
||||||
|
``plugins``
|
||||||
|
The List of available plugins
|
||||||
"""
|
"""
|
||||||
width = screen[u'size'].width()
|
width = screen[u'size'].width()
|
||||||
height = screen[u'size'].height()
|
height = screen[u'size'].height()
|
||||||
|
@ -286,7 +235,6 @@ def build_html(item, screen, alert, islive, background, plugins=None,
|
||||||
html_additions += plugin.getDisplayHtml()
|
html_additions += plugin.getDisplayHtml()
|
||||||
html = HTMLSRC % (build_background_css(item, width, height),
|
html = HTMLSRC % (build_background_css(item, width, height),
|
||||||
css_additions,
|
css_additions,
|
||||||
build_alert_css(alert),
|
|
||||||
build_footer_css(item, height),
|
build_footer_css(item, height),
|
||||||
build_lyrics_css(item, webkitvers),
|
build_lyrics_css(item, webkitvers),
|
||||||
u'true' if theme and theme.display_slide_transition and islive \
|
u'true' if theme and theme.display_slide_transition and islive \
|
||||||
|
|
|
@ -372,18 +372,27 @@ class Plugin(QtCore.QObject):
|
||||||
|
|
||||||
def getDisplayCss(self):
|
def getDisplayCss(self):
|
||||||
"""
|
"""
|
||||||
Add css style sheets to htmlbuilder
|
Add css style sheets to htmlbuilder.
|
||||||
"""
|
"""
|
||||||
return u''
|
return u''
|
||||||
|
|
||||||
def getDisplayJavaScript(self):
|
def getDisplayJavaScript(self):
|
||||||
"""
|
"""
|
||||||
Add javascript functions to htmlbuilder
|
Add javascript functions to htmlbuilder.
|
||||||
|
"""
|
||||||
|
return u''
|
||||||
|
|
||||||
|
def refreshCss(self, frame):
|
||||||
|
"""
|
||||||
|
Allow plugins to refresh javascript on displayed screen.
|
||||||
|
|
||||||
|
``frame``
|
||||||
|
The Web frame holding the page.
|
||||||
"""
|
"""
|
||||||
return u''
|
return u''
|
||||||
|
|
||||||
def getDisplayHtml(self):
|
def getDisplayHtml(self):
|
||||||
"""
|
"""
|
||||||
Add html code to htmlbuilder
|
Add html code to htmlbuilder.
|
||||||
"""
|
"""
|
||||||
return u''
|
return u''
|
||||||
|
|
|
@ -42,6 +42,13 @@ class PluginManager(object):
|
||||||
"""
|
"""
|
||||||
log.info(u'Plugin manager loaded')
|
log.info(u'Plugin manager loaded')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_instance():
|
||||||
|
"""
|
||||||
|
Obtain a single instance of class.
|
||||||
|
"""
|
||||||
|
return PluginManager.instance
|
||||||
|
|
||||||
def __init__(self, plugin_dir):
|
def __init__(self, plugin_dir):
|
||||||
"""
|
"""
|
||||||
The constructor for the plugin manager. Passes the controllers on to
|
The constructor for the plugin manager. Passes the controllers on to
|
||||||
|
@ -51,6 +58,7 @@ class PluginManager(object):
|
||||||
The directory to search for plugins.
|
The directory to search for plugins.
|
||||||
"""
|
"""
|
||||||
log.info(u'Plugin manager Initialising')
|
log.info(u'Plugin manager Initialising')
|
||||||
|
PluginManager.instance = self
|
||||||
if not plugin_dir in sys.path:
|
if not plugin_dir in sys.path:
|
||||||
log.debug(u'Inserting %s into sys.path', plugin_dir)
|
log.debug(u'Inserting %s into sys.path', plugin_dir)
|
||||||
sys.path.insert(0, plugin_dir)
|
sys.path.insert(0, plugin_dir)
|
||||||
|
|
|
@ -31,7 +31,7 @@ from PyQt4 import QtGui, QtCore, QtWebKit
|
||||||
|
|
||||||
from openlp.core.lib import ServiceItem, expand_tags, \
|
from openlp.core.lib import ServiceItem, expand_tags, \
|
||||||
build_lyrics_format_css, build_lyrics_outline_css, Receiver, \
|
build_lyrics_format_css, build_lyrics_outline_css, Receiver, \
|
||||||
ItemCapabilities, FormattingTags
|
ItemCapabilities, FormattingTags, PluginManager
|
||||||
from openlp.core.lib.theme import ThemeLevel
|
from openlp.core.lib.theme import ThemeLevel
|
||||||
from openlp.core.ui import MainDisplay, ScreenList
|
from openlp.core.ui import MainDisplay, ScreenList
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ class Renderer(object):
|
||||||
"""
|
"""
|
||||||
log.info(u'Renderer Loaded')
|
log.info(u'Renderer Loaded')
|
||||||
|
|
||||||
def __init__(self, imageManager, themeManager, plugins):
|
def __init__(self, imageManager, themeManager):
|
||||||
"""
|
"""
|
||||||
Initialise the renderer.
|
Initialise the renderer.
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ class Renderer(object):
|
||||||
log.debug(u'Initialisation started')
|
log.debug(u'Initialisation started')
|
||||||
self.themeManager = themeManager
|
self.themeManager = themeManager
|
||||||
self.imageManager = imageManager
|
self.imageManager = imageManager
|
||||||
self.plugins = plugins
|
self.plugins = PluginManager.get_instance().plugins
|
||||||
self.screens = ScreenList.get_instance()
|
self.screens = ScreenList.get_instance()
|
||||||
self.service_theme = u''
|
self.service_theme = u''
|
||||||
self.theme_level = u''
|
self.theme_level = u''
|
||||||
|
@ -77,8 +77,7 @@ class Renderer(object):
|
||||||
self.theme_data = None
|
self.theme_data = None
|
||||||
self.bg_frame = None
|
self.bg_frame = None
|
||||||
self.force_page = False
|
self.force_page = False
|
||||||
self.display = MainDisplay(None, self.imageManager, False, self,
|
self.display = MainDisplay(None, self.imageManager, False, self)
|
||||||
self.plugins)
|
|
||||||
self.display.setup()
|
self.display.setup()
|
||||||
|
|
||||||
def update_display(self):
|
def update_display(self):
|
||||||
|
@ -89,8 +88,7 @@ class Renderer(object):
|
||||||
self._calculate_default()
|
self._calculate_default()
|
||||||
if self.display:
|
if self.display:
|
||||||
self.display.close()
|
self.display.close()
|
||||||
self.display = MainDisplay(None, self.imageManager, False, self,
|
self.display = MainDisplay(None, self.imageManager, False, self)
|
||||||
self.plugins)
|
|
||||||
self.display.setup()
|
self.display.setup()
|
||||||
self.bg_frame = None
|
self.bg_frame = None
|
||||||
self.theme_data = None
|
self.theme_data = None
|
||||||
|
|
|
@ -39,6 +39,11 @@ try:
|
||||||
PHONON_VERSION = Phonon.phononVersion()
|
PHONON_VERSION = Phonon.phononVersion()
|
||||||
except ImportError:
|
except ImportError:
|
||||||
PHONON_VERSION = u'-'
|
PHONON_VERSION = u'-'
|
||||||
|
try:
|
||||||
|
import migrate
|
||||||
|
MIGRATE_VERSION = getattr(migrate, u'__version__', u'< 0.7')
|
||||||
|
except ImportError:
|
||||||
|
MIGRATE_VERSION = u'-'
|
||||||
try:
|
try:
|
||||||
import chardet
|
import chardet
|
||||||
CHARDET_VERSION = chardet.__version__
|
CHARDET_VERSION = chardet.__version__
|
||||||
|
@ -54,6 +59,24 @@ try:
|
||||||
SQLITE_VERSION = sqlite.version
|
SQLITE_VERSION = sqlite.version
|
||||||
except ImportError:
|
except ImportError:
|
||||||
SQLITE_VERSION = u'-'
|
SQLITE_VERSION = u'-'
|
||||||
|
try:
|
||||||
|
import mako
|
||||||
|
MAKO_VERSION = mako.__version__
|
||||||
|
except ImportError:
|
||||||
|
MAKO_VERSION = u'-'
|
||||||
|
try:
|
||||||
|
import uno
|
||||||
|
arg = uno.createUnoStruct(u'com.sun.star.beans.PropertyValue')
|
||||||
|
arg.Name = u'nodepath'
|
||||||
|
arg.Value = u'/org.openoffice.Setup/Product'
|
||||||
|
context = uno.getComponentContext()
|
||||||
|
provider = context.ServiceManager.createInstance(
|
||||||
|
u'com.sun.star.configuration.ConfigurationProvider')
|
||||||
|
node = provider.createInstanceWithArguments(
|
||||||
|
u'com.sun.star.configuration.ConfigurationAccess', (arg,))
|
||||||
|
UNO_VERSION = node.getByName(u'ooSetupVersion')
|
||||||
|
except ImportError:
|
||||||
|
UNO_VERSION = u'-'
|
||||||
|
|
||||||
from openlp.core.lib import translate, SettingsManager
|
from openlp.core.lib import translate, SettingsManager
|
||||||
from openlp.core.lib.ui import UiStrings
|
from openlp.core.lib.ui import UiStrings
|
||||||
|
@ -89,11 +112,14 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
|
||||||
u'Phonon: %s\n' % PHONON_VERSION + \
|
u'Phonon: %s\n' % PHONON_VERSION + \
|
||||||
u'PyQt4: %s\n' % Qt.PYQT_VERSION_STR + \
|
u'PyQt4: %s\n' % Qt.PYQT_VERSION_STR + \
|
||||||
u'SQLAlchemy: %s\n' % sqlalchemy.__version__ + \
|
u'SQLAlchemy: %s\n' % sqlalchemy.__version__ + \
|
||||||
|
u'SQLAlchemy Migrate: %s\n' % MIGRATE_VERSION + \
|
||||||
u'BeautifulSoup: %s\n' % BeautifulSoup.__version__ + \
|
u'BeautifulSoup: %s\n' % BeautifulSoup.__version__ + \
|
||||||
u'lxml: %s\n' % etree.__version__ + \
|
u'lxml: %s\n' % etree.__version__ + \
|
||||||
u'Chardet: %s\n' % CHARDET_VERSION + \
|
u'Chardet: %s\n' % CHARDET_VERSION + \
|
||||||
u'PyEnchant: %s\n' % ENCHANT_VERSION + \
|
u'PyEnchant: %s\n' % ENCHANT_VERSION + \
|
||||||
u'PySQLite: %s\n' % SQLITE_VERSION
|
u'PySQLite: %s\n' % SQLITE_VERSION + \
|
||||||
|
u'Mako: %s\n' % MAKO_VERSION + \
|
||||||
|
u'pyUNO bridge: %s\n' % UNO_VERSION
|
||||||
if platform.system() == u'Linux':
|
if platform.system() == u'Linux':
|
||||||
if os.environ.get(u'KDE_FULL_SESSION') == u'true':
|
if os.environ.get(u'KDE_FULL_SESSION') == u'true':
|
||||||
system = system + u'Desktop: KDE SC\n'
|
system = system + u'Desktop: KDE SC\n'
|
||||||
|
@ -152,6 +178,8 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog):
|
||||||
'Please add the information that bug reports are favoured written '
|
'Please add the information that bug reports are favoured written '
|
||||||
'in English.'))
|
'in English.'))
|
||||||
content = self._createReport()
|
content = self._createReport()
|
||||||
|
source = u''
|
||||||
|
exception = u''
|
||||||
for line in content[2].split(u'\n'):
|
for line in content[2].split(u'\n'):
|
||||||
if re.search(r'[/\\]openlp[/\\]', line):
|
if re.search(r'[/\\]openlp[/\\]', line):
|
||||||
source = re.sub(r'.*[/\\]openlp[/\\](.*)".*', r'\1', line)
|
source = re.sub(r'.*[/\\]openlp[/\\](.*)".*', r'\1', line)
|
||||||
|
|
|
@ -35,7 +35,7 @@ from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL
|
||||||
from PyQt4.phonon import Phonon
|
from PyQt4.phonon import Phonon
|
||||||
|
|
||||||
from openlp.core.lib import Receiver, build_html, ServiceItem, image_to_byte, \
|
from openlp.core.lib import Receiver, build_html, ServiceItem, image_to_byte, \
|
||||||
translate
|
translate, PluginManager
|
||||||
|
|
||||||
from openlp.core.ui import HideMode, ScreenList
|
from openlp.core.ui import HideMode, ScreenList
|
||||||
|
|
||||||
|
@ -48,14 +48,16 @@ class Display(QtGui.QGraphicsView):
|
||||||
"""
|
"""
|
||||||
This is a general display screen class.
|
This is a general display screen class.
|
||||||
"""
|
"""
|
||||||
def __init__(self, parent, live, controller, plugins):
|
def __init__(self, parent, live, controller):
|
||||||
if live:
|
if live:
|
||||||
QtGui.QGraphicsView.__init__(self)
|
QtGui.QGraphicsView.__init__(self)
|
||||||
|
# Do not overwrite the parent() method.
|
||||||
|
self.parent = lambda: parent
|
||||||
else:
|
else:
|
||||||
QtGui.QGraphicsView.__init__(self, parent)
|
QtGui.QGraphicsView.__init__(self, parent)
|
||||||
self.isLive = live
|
self.isLive = live
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
self.plugins = plugins
|
self.plugins = PluginManager.get_instance().plugins
|
||||||
self.setViewport(QtOpenGL.QGLWidget())
|
self.setViewport(QtOpenGL.QGLWidget())
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
|
@ -77,7 +79,7 @@ class Display(QtGui.QGraphicsView):
|
||||||
screen[u'size'] = self.size()
|
screen[u'size'] = self.size()
|
||||||
serviceItem = ServiceItem()
|
serviceItem = ServiceItem()
|
||||||
self.webView.setHtml(build_html(serviceItem, screen,
|
self.webView.setHtml(build_html(serviceItem, screen,
|
||||||
None, None, None, self.plugins))
|
None, self.isLive, None))
|
||||||
self.webView.hide()
|
self.webView.hide()
|
||||||
|
|
||||||
def resizeEvent(self, ev):
|
def resizeEvent(self, ev):
|
||||||
|
@ -88,11 +90,12 @@ class MainDisplay(Display):
|
||||||
"""
|
"""
|
||||||
This is the display screen.
|
This is the display screen.
|
||||||
"""
|
"""
|
||||||
def __init__(self, parent, imageManager, live, controller, plugins):
|
def __init__(self, parent, imageManager, live, controller):
|
||||||
Display.__init__(self, parent, live, controller, plugins)
|
Display.__init__(self, parent, live, controller)
|
||||||
self.imageManager = imageManager
|
self.imageManager = imageManager
|
||||||
self.screens = ScreenList.get_instance()
|
self.screens = ScreenList.get_instance()
|
||||||
self.alertTab = None
|
self.plugins = PluginManager.get_instance().plugins
|
||||||
|
self.rebuildCSS = False
|
||||||
self.hideMode = None
|
self.hideMode = None
|
||||||
self.override = {}
|
self.override = {}
|
||||||
self.retranslateUi()
|
self.retranslateUi()
|
||||||
|
@ -109,9 +112,29 @@ class MainDisplay(Display):
|
||||||
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
|
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'maindisplay_hide'), self.hideDisplay)
|
QtCore.SIGNAL(u'live_display_hide'), self.hideDisplay)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'maindisplay_show'), self.showDisplay)
|
QtCore.SIGNAL(u'live_display_show'), self.showDisplay)
|
||||||
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
|
QtCore.SIGNAL(u'update_display_css'), self.cssChanged)
|
||||||
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
|
QtCore.SIGNAL(u'config_updated'), self.configChanged)
|
||||||
|
|
||||||
|
def cssChanged(self):
|
||||||
|
"""
|
||||||
|
We may need to rebuild the CSS on the live display.
|
||||||
|
"""
|
||||||
|
self.rebuildCSS = True
|
||||||
|
|
||||||
|
def configChanged(self):
|
||||||
|
"""
|
||||||
|
Call the plugins to rebuild the Live display CSS as the screen has
|
||||||
|
not been rebuild on exit of config.
|
||||||
|
"""
|
||||||
|
if self.rebuildCSS and self.plugins:
|
||||||
|
for plugin in self.plugins:
|
||||||
|
plugin.refreshCss(self.frame)
|
||||||
|
self.rebuildCSS = False
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
"""
|
"""
|
||||||
|
@ -135,6 +158,9 @@ class MainDisplay(Display):
|
||||||
QtWebKit.QWebSettings.PluginsEnabled, True)
|
QtWebKit.QWebSettings.PluginsEnabled, True)
|
||||||
self.page = self.webView.page()
|
self.page = self.webView.page()
|
||||||
self.frame = self.page.mainFrame()
|
self.frame = self.page.mainFrame()
|
||||||
|
if self.isLive and log.getEffectiveLevel() == logging.DEBUG:
|
||||||
|
self.webView.settings().setAttribute(
|
||||||
|
QtWebKit.QWebSettings.DeveloperExtrasEnabled, True)
|
||||||
QtCore.QObject.connect(self.webView,
|
QtCore.QObject.connect(self.webView,
|
||||||
QtCore.SIGNAL(u'loadFinished(bool)'), self.isWebLoaded)
|
QtCore.SIGNAL(u'loadFinished(bool)'), self.isWebLoaded)
|
||||||
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||||
|
@ -144,14 +170,6 @@ class MainDisplay(Display):
|
||||||
self.frame.setScrollBarPolicy(QtCore.Qt.Horizontal,
|
self.frame.setScrollBarPolicy(QtCore.Qt.Horizontal,
|
||||||
QtCore.Qt.ScrollBarAlwaysOff)
|
QtCore.Qt.ScrollBarAlwaysOff)
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
# Build the initial frame.
|
|
||||||
self.black = QtGui.QImage(
|
|
||||||
self.screen[u'size'].width(),
|
|
||||||
self.screen[u'size'].height(),
|
|
||||||
QtGui.QImage.Format_ARGB32_Premultiplied)
|
|
||||||
painter_image = QtGui.QPainter()
|
|
||||||
painter_image.begin(self.black)
|
|
||||||
painter_image.fillRect(self.black.rect(), QtCore.Qt.black)
|
|
||||||
# Build the initial frame.
|
# Build the initial frame.
|
||||||
image_file = QtCore.QSettings().value(u'advanced/default image',
|
image_file = QtCore.QSettings().value(u'advanced/default image',
|
||||||
QtCore.QVariant(u':/graphics/openlp-splash-screen.png'))\
|
QtCore.QVariant(u':/graphics/openlp-splash-screen.png'))\
|
||||||
|
@ -177,7 +195,7 @@ class MainDisplay(Display):
|
||||||
serviceItem = ServiceItem()
|
serviceItem = ServiceItem()
|
||||||
serviceItem.bg_image_bytes = image_to_byte(self.initialFrame)
|
serviceItem.bg_image_bytes = image_to_byte(self.initialFrame)
|
||||||
self.webView.setHtml(build_html(serviceItem, self.screen,
|
self.webView.setHtml(build_html(serviceItem, self.screen,
|
||||||
self.alertTab, self.isLive, None, self.plugins))
|
self.isLive, None))
|
||||||
self.__hideMouse()
|
self.__hideMouse()
|
||||||
# To display or not to display?
|
# To display or not to display?
|
||||||
if not self.screen[u'primary']:
|
if not self.screen[u'primary']:
|
||||||
|
@ -190,7 +208,7 @@ class MainDisplay(Display):
|
||||||
"""
|
"""
|
||||||
Add the slide text from slideController
|
Add the slide text from slideController
|
||||||
|
|
||||||
`slide`
|
``slide``
|
||||||
The slide text to be displayed
|
The slide text to be displayed
|
||||||
"""
|
"""
|
||||||
log.debug(u'text to display')
|
log.debug(u'text to display')
|
||||||
|
@ -203,20 +221,22 @@ class MainDisplay(Display):
|
||||||
|
|
||||||
def alert(self, text):
|
def alert(self, text):
|
||||||
"""
|
"""
|
||||||
Add the alert text
|
Display an alert.
|
||||||
|
|
||||||
`slide`
|
``text``
|
||||||
The slide text to be displayed
|
The text to be displayed.
|
||||||
"""
|
"""
|
||||||
log.debug(u'alert to display')
|
log.debug(u'alert to display')
|
||||||
if self.height() != self.screen[u'size'].height() or \
|
if self.height() != self.screen[u'size'].height() or \
|
||||||
not self.isVisible():
|
not self.isVisible():
|
||||||
shrink = True
|
shrink = True
|
||||||
|
js = u'show_alert("%s", "%s")' % (
|
||||||
|
text.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'),
|
||||||
|
u'top')
|
||||||
else:
|
else:
|
||||||
shrink = False
|
shrink = False
|
||||||
js = u'show_alert("%s", "%s")' % (
|
js = u'show_alert("%s", "")' % (
|
||||||
text.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'),
|
text.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
|
||||||
u'top' if shrink else u'')
|
|
||||||
height = self.frame.evaluateJavaScript(js)
|
height = self.frame.evaluateJavaScript(js)
|
||||||
if shrink:
|
if shrink:
|
||||||
if text:
|
if text:
|
||||||
|
@ -235,13 +255,16 @@ class MainDisplay(Display):
|
||||||
|
|
||||||
def directImage(self, name, path, background):
|
def directImage(self, name, path, background):
|
||||||
"""
|
"""
|
||||||
API for replacement backgrounds so Images are added directly to cache
|
API for replacement backgrounds so Images are added directly to cache.
|
||||||
"""
|
"""
|
||||||
self.imageManager.add_image(name, path, u'image', background)
|
self.imageManager.add_image(name, path, u'image', background)
|
||||||
if hasattr(self, u'serviceItem'):
|
if hasattr(self, u'serviceItem'):
|
||||||
self.override[u'image'] = name
|
self.override[u'image'] = name
|
||||||
self.override[u'theme'] = self.serviceItem.themedata.theme_name
|
self.override[u'theme'] = self.serviceItem.themedata.theme_name
|
||||||
self.image(name)
|
self.image(name)
|
||||||
|
# Update the preview frame.
|
||||||
|
if self.isLive:
|
||||||
|
self.parent().updatePreview()
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -250,8 +273,8 @@ class MainDisplay(Display):
|
||||||
Add an image as the background. The image has already been added
|
Add an image as the background. The image has already been added
|
||||||
to the cache.
|
to the cache.
|
||||||
|
|
||||||
`Image`
|
``Image``
|
||||||
The name of the image to be displayed
|
The name of the image to be displayed.
|
||||||
"""
|
"""
|
||||||
log.debug(u'image to display')
|
log.debug(u'image to display')
|
||||||
image = self.imageManager.get_image_bytes(name)
|
image = self.imageManager.get_image_bytes(name)
|
||||||
|
@ -268,14 +291,11 @@ class MainDisplay(Display):
|
||||||
else:
|
else:
|
||||||
js = u'show_image("");'
|
js = u'show_image("");'
|
||||||
self.frame.evaluateJavaScript(js)
|
self.frame.evaluateJavaScript(js)
|
||||||
# Update the preview frame.
|
|
||||||
if self.isLive:
|
|
||||||
Receiver.send_message(u'maindisplay_active')
|
|
||||||
|
|
||||||
def resetImage(self):
|
def resetImage(self):
|
||||||
"""
|
"""
|
||||||
Reset the backgound image to the service item image.
|
Reset the backgound image to the service item image. Used after the
|
||||||
Used after Image plugin has changed the background
|
image plugin has changed the background.
|
||||||
"""
|
"""
|
||||||
log.debug(u'resetImage')
|
log.debug(u'resetImage')
|
||||||
if hasattr(self, u'serviceItem'):
|
if hasattr(self, u'serviceItem'):
|
||||||
|
@ -284,9 +304,6 @@ class MainDisplay(Display):
|
||||||
self.displayImage(None)
|
self.displayImage(None)
|
||||||
# clear the cache
|
# clear the cache
|
||||||
self.override = {}
|
self.override = {}
|
||||||
# Update the preview frame.
|
|
||||||
if self.isLive:
|
|
||||||
Receiver.send_message(u'maindisplay_active')
|
|
||||||
|
|
||||||
def isWebLoaded(self):
|
def isWebLoaded(self):
|
||||||
"""
|
"""
|
||||||
|
@ -366,8 +383,8 @@ class MainDisplay(Display):
|
||||||
image_bytes = self.imageManager.get_image_bytes(image)
|
image_bytes = self.imageManager.get_image_bytes(image)
|
||||||
else:
|
else:
|
||||||
image_bytes = None
|
image_bytes = None
|
||||||
html = build_html(self.serviceItem, self.screen, self.alertTab,
|
html = build_html(self.serviceItem, self.screen, self.isLive,
|
||||||
self.isLive, background, self.plugins, image_bytes)
|
background, image_bytes, self.plugins)
|
||||||
log.debug(u'buildHtml - pre setHtml')
|
log.debug(u'buildHtml - pre setHtml')
|
||||||
self.webView.setHtml(html)
|
self.webView.setHtml(html)
|
||||||
log.debug(u'buildHtml - post setHtml')
|
log.debug(u'buildHtml - post setHtml')
|
||||||
|
@ -423,7 +440,7 @@ class MainDisplay(Display):
|
||||||
self.hideMode = None
|
self.hideMode = None
|
||||||
# Trigger actions when display is active again
|
# Trigger actions when display is active again
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
Receiver.send_message(u'maindisplay_active')
|
Receiver.send_message(u'live_display_active')
|
||||||
|
|
||||||
def __hideMouse(self):
|
def __hideMouse(self):
|
||||||
# Hide mouse cursor when moved over display if enabled in settings
|
# Hide mouse cursor when moved over display if enabled in settings
|
||||||
|
|
|
@ -613,11 +613,11 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'openlp_version_check'), self.versionNotice)
|
QtCore.SIGNAL(u'openlp_version_check'), self.versionNotice)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'maindisplay_blank_check'), self.blankCheck)
|
QtCore.SIGNAL(u'live_display_blank_check'), self.blankCheck)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged)
|
QtCore.SIGNAL(u'config_screen_changed'), self.screenChanged)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'maindisplay_status_text'), self.showStatusMessage)
|
QtCore.SIGNAL(u'mainwindow_status_text'), self.showStatusMessage)
|
||||||
# Media Manager
|
# Media Manager
|
||||||
QtCore.QObject.connect(self.mediaToolBox,
|
QtCore.QObject.connect(self.mediaToolBox,
|
||||||
QtCore.SIGNAL(u'currentChanged(int)'), self.onMediaToolBoxChanged)
|
QtCore.SIGNAL(u'currentChanged(int)'), self.onMediaToolBoxChanged)
|
||||||
|
@ -633,8 +633,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
# warning cyclic dependency
|
# warning cyclic dependency
|
||||||
# renderer needs to call ThemeManager and
|
# renderer needs to call ThemeManager and
|
||||||
# ThemeManager needs to call Renderer
|
# ThemeManager needs to call Renderer
|
||||||
self.renderer = Renderer(self.imageManager, self.themeManagerContents,
|
self.renderer = Renderer(self.imageManager, self.themeManagerContents)
|
||||||
self.pluginManager.plugins)
|
|
||||||
# Define the media Dock Manager
|
# Define the media Dock Manager
|
||||||
self.mediaDockManager = MediaDockManager(self.mediaToolBox)
|
self.mediaDockManager = MediaDockManager(self.mediaToolBox)
|
||||||
log.info(u'Load Plugins')
|
log.info(u'Load Plugins')
|
||||||
|
|
|
@ -39,6 +39,7 @@ class MediaState(object):
|
||||||
|
|
||||||
class MediaType(object):
|
class MediaType(object):
|
||||||
"""
|
"""
|
||||||
|
An enumeration of possibible Media Types
|
||||||
"""
|
"""
|
||||||
Unused = 0
|
Unused = 0
|
||||||
Audio = 1
|
Audio = 1
|
||||||
|
|
|
@ -143,7 +143,7 @@ class MediaController(object):
|
||||||
"""
|
"""
|
||||||
Add css style sheets to htmlbuilder
|
Add css style sheets to htmlbuilder
|
||||||
"""
|
"""
|
||||||
css = u'';
|
css = u''
|
||||||
for api in self.APIs.values():
|
for api in self.APIs.values():
|
||||||
css += api.get_media_display_css()
|
css += api.get_media_display_css()
|
||||||
return css
|
return css
|
||||||
|
@ -263,6 +263,7 @@ class MediaController(object):
|
||||||
controller.media_info.volume = controller.volumeSlider.value()
|
controller.media_info.volume = controller.volumeSlider.value()
|
||||||
controller.media_info.file_info = QtCore.QFileInfo(file)
|
controller.media_info.file_info = QtCore.QFileInfo(file)
|
||||||
controller.media_info.is_background = isBackground
|
controller.media_info.is_background = isBackground
|
||||||
|
display = None
|
||||||
if controller.isLive:
|
if controller.isLive:
|
||||||
if self.withLivePreview and controller.previewDisplay:
|
if self.withLivePreview and controller.previewDisplay:
|
||||||
display = controller.previewDisplay
|
display = controller.previewDisplay
|
||||||
|
@ -284,6 +285,7 @@ class MediaController(object):
|
||||||
'Unsupported File')))
|
'Unsupported File')))
|
||||||
return False
|
return False
|
||||||
# now start playing
|
# now start playing
|
||||||
|
display.frame.evaluateJavaScript(u'show_blank("black");')
|
||||||
if self.video_play([controller], False):
|
if self.video_play([controller], False):
|
||||||
self.video_pause([controller])
|
self.video_pause([controller])
|
||||||
self.video_seek([controller, [0]])
|
self.video_seek([controller, [0]])
|
||||||
|
@ -358,6 +360,7 @@ class MediaController(object):
|
||||||
if not self.curDisplayMediaAPI[display].play(display):
|
if not self.curDisplayMediaAPI[display].play(display):
|
||||||
return False
|
return False
|
||||||
if status:
|
if status:
|
||||||
|
display.frame.evaluateJavaScript(u'show_blank("desktop");')
|
||||||
self.curDisplayMediaAPI[display].set_visible(display, True)
|
self.curDisplayMediaAPI[display].set_visible(display, True)
|
||||||
# Start Timer for ui updates
|
# Start Timer for ui updates
|
||||||
if not self.timer.isActive():
|
if not self.timer.isActive():
|
||||||
|
@ -382,6 +385,7 @@ class MediaController(object):
|
||||||
controller = msg[0]
|
controller = msg[0]
|
||||||
for display in self.curDisplayMediaAPI.keys():
|
for display in self.curDisplayMediaAPI.keys():
|
||||||
if display.controller == controller:
|
if display.controller == controller:
|
||||||
|
display.frame.evaluateJavaScript(u'show_blank("black");')
|
||||||
self.curDisplayMediaAPI[display].stop(display)
|
self.curDisplayMediaAPI[display].stop(display)
|
||||||
self.curDisplayMediaAPI[display].set_visible(display, False)
|
self.curDisplayMediaAPI[display].set_visible(display, False)
|
||||||
|
|
||||||
|
@ -440,7 +444,9 @@ class MediaController(object):
|
||||||
Blank the related video Widget
|
Blank the related video Widget
|
||||||
"""
|
"""
|
||||||
isLive = msg[1]
|
isLive = msg[1]
|
||||||
|
hide_mode = msg[2]
|
||||||
if isLive:
|
if isLive:
|
||||||
|
Receiver.send_message(u'live_display_hide', hide_mode)
|
||||||
controller = self.parent.liveController
|
controller = self.parent.liveController
|
||||||
for display in self.curDisplayMediaAPI.keys():
|
for display in self.curDisplayMediaAPI.keys():
|
||||||
if display.controller == controller:
|
if display.controller == controller:
|
||||||
|
@ -454,7 +460,7 @@ class MediaController(object):
|
||||||
"""
|
"""
|
||||||
Unblank the related video Widget
|
Unblank the related video Widget
|
||||||
"""
|
"""
|
||||||
Receiver.send_message(u'maindisplay_show')
|
Receiver.send_message(u'live_display_show')
|
||||||
isLive = msg[1]
|
isLive = msg[1]
|
||||||
if isLive:
|
if isLive:
|
||||||
controller = self.parent.liveController
|
controller = self.parent.liveController
|
||||||
|
|
|
@ -34,7 +34,7 @@ from openlp.core.ui.media import MediaAPI, MediaState
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
video_css = u"""
|
VIDEO_CSS = u"""
|
||||||
#video1 {
|
#video1 {
|
||||||
z-index:3;
|
z-index:3;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ video_css = u"""
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
video_js = u"""
|
VIDEO_JS = u"""
|
||||||
var video_timer = null;
|
var video_timer = null;
|
||||||
var current_video = '1';
|
var current_video = '1';
|
||||||
|
|
||||||
|
@ -139,20 +139,20 @@ video_js = u"""
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
video_html = u"""
|
VIDEO_HTML = u"""
|
||||||
<video id="video1" class="size" style="visibility:hidden" autobuffer preload>
|
<video id="video1" class="size" style="visibility:hidden" autobuffer preload>
|
||||||
</video>
|
</video>
|
||||||
<video id="video2" class="size" style="visibility:hidden" autobuffer preload>
|
<video id="video2" class="size" style="visibility:hidden" autobuffer preload>
|
||||||
</video>
|
</video>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
flash_css = u"""
|
FLASH_CSS = u"""
|
||||||
#flash {
|
#flash {
|
||||||
z-index:4;
|
z-index:4;
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
flash_js = u"""
|
FLASH_JS = u"""
|
||||||
function getFlashMovieObject(movieName)
|
function getFlashMovieObject(movieName)
|
||||||
{
|
{
|
||||||
if (window.document[movieName])
|
if (window.document[movieName])
|
||||||
|
@ -211,7 +211,7 @@ flash_js = u"""
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
flash_html = u"""
|
FLASH_HTML = u"""
|
||||||
<div id="flash" class="size" style="visibility:hidden"></div>
|
<div id="flash" class="size" style="visibility:hidden"></div>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -261,21 +261,21 @@ class WebkitAPI(MediaAPI):
|
||||||
"""
|
"""
|
||||||
Add css style sheets to htmlbuilder
|
Add css style sheets to htmlbuilder
|
||||||
"""
|
"""
|
||||||
return video_css + flash_css
|
return VIDEO_CSS + FLASH_CSS
|
||||||
|
|
||||||
|
|
||||||
def get_media_display_javascript(self):
|
def get_media_display_javascript(self):
|
||||||
"""
|
"""
|
||||||
Add javascript functions to htmlbuilder
|
Add javascript functions to htmlbuilder
|
||||||
"""
|
"""
|
||||||
return video_js + flash_js
|
return VIDEO_JS + FLASH_JS
|
||||||
|
|
||||||
|
|
||||||
def get_media_display_html(self):
|
def get_media_display_html(self):
|
||||||
"""
|
"""
|
||||||
Add html code to htmlbuilder
|
Add html code to htmlbuilder
|
||||||
"""
|
"""
|
||||||
return video_html + flash_html
|
return VIDEO_HTML + FLASH_HTML
|
||||||
|
|
||||||
def setup(self, display):
|
def setup(self, display):
|
||||||
display.webView.resize(display.size())
|
display.webView.resize(display.size())
|
||||||
|
|
|
@ -58,7 +58,7 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
|
||||||
# load all the settings
|
# load all the settings
|
||||||
self.settingListWidget.clear()
|
self.settingListWidget.clear()
|
||||||
for tabIndex in range(0, self.stackedLayout.count() + 1):
|
for tabIndex in range(0, self.stackedLayout.count() + 1):
|
||||||
# take at 0 and the rest shuffell up.
|
# take at 0 and the rest shuffle up.
|
||||||
self.stackedLayout.takeAt(0)
|
self.stackedLayout.takeAt(0)
|
||||||
self.insertTab(self.generalTab, 0, PluginStatus.Active)
|
self.insertTab(self.generalTab, 0, PluginStatus.Active)
|
||||||
self.insertTab(self.themesTab, 1, PluginStatus.Active)
|
self.insertTab(self.themesTab, 1, PluginStatus.Active)
|
||||||
|
|
|
@ -98,7 +98,6 @@ class SlideController(Controller):
|
||||||
self.songEdit = False
|
self.songEdit = False
|
||||||
self.selectedRow = 0
|
self.selectedRow = 0
|
||||||
self.serviceItem = None
|
self.serviceItem = None
|
||||||
self.alertTab = None
|
|
||||||
self.panel = QtGui.QWidget(parent.controlSplitter)
|
self.panel = QtGui.QWidget(parent.controlSplitter)
|
||||||
self.slideList = {}
|
self.slideList = {}
|
||||||
# Layout for holding panel
|
# Layout for holding panel
|
||||||
|
@ -286,7 +285,7 @@ class SlideController(Controller):
|
||||||
self.slideLayout.setSpacing(0)
|
self.slideLayout.setSpacing(0)
|
||||||
self.slideLayout.setMargin(0)
|
self.slideLayout.setMargin(0)
|
||||||
self.slideLayout.setObjectName(u'SlideLayout')
|
self.slideLayout.setObjectName(u'SlideLayout')
|
||||||
self.previewDisplay = Display(self, self.isLive, self, self.parent().pluginManager.plugins)
|
self.previewDisplay = Display(self, self.isLive, self)
|
||||||
self.previewDisplay.setGeometry(QtCore.QRect(0, 0, 300, 300))
|
self.previewDisplay.setGeometry(QtCore.QRect(0, 0, 300, 300))
|
||||||
self.slideLayout.insertWidget(0, self.previewDisplay)
|
self.slideLayout.insertWidget(0, self.previewDisplay)
|
||||||
self.previewDisplay.hide()
|
self.previewDisplay.hide()
|
||||||
|
@ -404,8 +403,7 @@ class SlideController(Controller):
|
||||||
if self.display:
|
if self.display:
|
||||||
self.display.close()
|
self.display.close()
|
||||||
self.display = MainDisplay(self, self.imageManager, self.isLive,
|
self.display = MainDisplay(self, self.imageManager, self.isLive,
|
||||||
self, self.parent().pluginManager.plugins)
|
self)
|
||||||
self.display.alertTab = self.alertTab
|
|
||||||
self.display.setup()
|
self.display.setup()
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
self.__addActionsToWidget(self.display)
|
self.__addActionsToWidget(self.display)
|
||||||
|
@ -528,7 +526,6 @@ class SlideController(Controller):
|
||||||
if item.is_capable(ItemCapabilities.CanEdit) and item.from_plugin:
|
if item.is_capable(ItemCapabilities.CanEdit) and item.from_plugin:
|
||||||
self.toolbar.makeWidgetsVisible(self.songEditList)
|
self.toolbar.makeWidgetsVisible(self.songEditList)
|
||||||
elif item.is_media():
|
elif item.is_media():
|
||||||
#self.toolbar.setVisible(False)
|
|
||||||
self.mediabar.setVisible(True)
|
self.mediabar.setVisible(True)
|
||||||
self.previousItem.setVisible(False)
|
self.previousItem.setVisible(False)
|
||||||
self.nextItem.setVisible(False)
|
self.nextItem.setVisible(False)
|
||||||
|
@ -740,9 +737,9 @@ class SlideController(Controller):
|
||||||
elif display_type == u'blanked':
|
elif display_type == u'blanked':
|
||||||
self.onBlankDisplay(True)
|
self.onBlankDisplay(True)
|
||||||
else:
|
else:
|
||||||
Receiver.send_message(u'maindisplay_show')
|
Receiver.send_message(u'live_display_show')
|
||||||
else:
|
else:
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
Receiver.send_message(u'live_display_hide', HideMode.Screen)
|
||||||
|
|
||||||
def onSlideBlank(self):
|
def onSlideBlank(self):
|
||||||
"""
|
"""
|
||||||
|
@ -828,21 +825,21 @@ class SlideController(Controller):
|
||||||
if self.serviceItem is not None:
|
if self.serviceItem is not None:
|
||||||
if hide_mode:
|
if hide_mode:
|
||||||
if not self.serviceItem.is_command():
|
if not self.serviceItem.is_command():
|
||||||
Receiver.send_message(u'maindisplay_hide', hide_mode)
|
Receiver.send_message(u'live_display_hide', hide_mode)
|
||||||
Receiver.send_message(u'%s_blank'
|
Receiver.send_message(u'%s_blank'
|
||||||
% self.serviceItem.name.lower(),
|
% self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive, hide_mode])
|
[self.serviceItem, self.isLive, hide_mode])
|
||||||
else:
|
else:
|
||||||
if not self.serviceItem.is_command():
|
if not self.serviceItem.is_command():
|
||||||
Receiver.send_message(u'maindisplay_show')
|
Receiver.send_message(u'live_display_show')
|
||||||
Receiver.send_message(u'%s_unblank'
|
Receiver.send_message(u'%s_unblank'
|
||||||
% self.serviceItem.name.lower(),
|
% self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive])
|
[self.serviceItem, self.isLive])
|
||||||
else:
|
else:
|
||||||
if hide_mode:
|
if hide_mode:
|
||||||
Receiver.send_message(u'maindisplay_hide', hide_mode)
|
Receiver.send_message(u'live_display_hide', hide_mode)
|
||||||
else:
|
else:
|
||||||
Receiver.send_message(u'maindisplay_show')
|
Receiver.send_message(u'live_display_show')
|
||||||
|
|
||||||
def hidePlugin(self, hide):
|
def hidePlugin(self, hide):
|
||||||
"""
|
"""
|
||||||
|
@ -851,21 +848,21 @@ class SlideController(Controller):
|
||||||
log.debug(u'hidePlugin %s ', hide)
|
log.debug(u'hidePlugin %s ', hide)
|
||||||
if self.serviceItem is not None:
|
if self.serviceItem is not None:
|
||||||
if hide:
|
if hide:
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
Receiver.send_message(u'live_display_hide', HideMode.Screen)
|
||||||
Receiver.send_message(u'%s_hide'
|
Receiver.send_message(u'%s_hide'
|
||||||
% self.serviceItem.name.lower(),
|
% self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive])
|
[self.serviceItem, self.isLive])
|
||||||
else:
|
else:
|
||||||
if not self.serviceItem.is_command():
|
if not self.serviceItem.is_command():
|
||||||
Receiver.send_message(u'maindisplay_show')
|
Receiver.send_message(u'live_display_show')
|
||||||
Receiver.send_message(u'%s_unblank'
|
Receiver.send_message(u'%s_unblank'
|
||||||
% self.serviceItem.name.lower(),
|
% self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive])
|
[self.serviceItem, self.isLive])
|
||||||
else:
|
else:
|
||||||
if hide:
|
if hide:
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
Receiver.send_message(u'live_display_hide', HideMode.Screen)
|
||||||
else:
|
else:
|
||||||
Receiver.send_message(u'maindisplay_show')
|
Receiver.send_message(u'live_display_show')
|
||||||
|
|
||||||
def onSlideSelected(self, start=False):
|
def onSlideSelected(self, start=False):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -32,6 +32,7 @@ from PyQt4 import QtCore
|
||||||
from openlp.core.lib import Plugin, StringContent, build_icon, translate
|
from openlp.core.lib import Plugin, StringContent, build_icon, translate
|
||||||
from openlp.core.lib.db import Manager
|
from openlp.core.lib.db import Manager
|
||||||
from openlp.core.lib.ui import icon_action, UiStrings
|
from openlp.core.lib.ui import icon_action, UiStrings
|
||||||
|
from openlp.core.lib.theme import VerticalType
|
||||||
from openlp.core.utils.actions import ActionList
|
from openlp.core.utils.actions import ActionList
|
||||||
from openlp.plugins.alerts.lib import AlertsManager, AlertsTab
|
from openlp.plugins.alerts.lib import AlertsManager, AlertsTab
|
||||||
from openlp.plugins.alerts.lib.db import init_schema
|
from openlp.plugins.alerts.lib.db import init_schema
|
||||||
|
@ -39,6 +40,63 @@ from openlp.plugins.alerts.forms import AlertForm
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
JAVASCRIPT = """
|
||||||
|
function show_alert(alerttext, position){
|
||||||
|
var text = document.getElementById('alert');
|
||||||
|
text.innerHTML = alerttext;
|
||||||
|
if(alerttext == '') {
|
||||||
|
text.style.visibility = 'hidden';
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if(position == ''){
|
||||||
|
position = getComputedStyle(text, '').verticalAlign;
|
||||||
|
}
|
||||||
|
switch(position)
|
||||||
|
{
|
||||||
|
case 'top':
|
||||||
|
text.style.top = '0px';
|
||||||
|
break;
|
||||||
|
case 'middle':
|
||||||
|
text.style.top = ((window.innerHeight - text.clientHeight) / 2)
|
||||||
|
+ 'px';
|
||||||
|
break;
|
||||||
|
case 'bottom':
|
||||||
|
text.style.top = (window.innerHeight - text.clientHeight)
|
||||||
|
+ 'px';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
text.style.visibility = 'visible';
|
||||||
|
return text.clientHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
function update_css(align, font, size, color, bgcolor){
|
||||||
|
var text = document.getElementById('alert');
|
||||||
|
text.style.verticalAlign = align;
|
||||||
|
text.style.fontSize = size + "pt";
|
||||||
|
text.style.fontFamily = font;
|
||||||
|
text.style.color = color;
|
||||||
|
text.style.backgroundColor = bgcolor;
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
CSS = """
|
||||||
|
#alert {
|
||||||
|
position: absolute;
|
||||||
|
left: 0px;
|
||||||
|
top: 0px;
|
||||||
|
z-index: 10;
|
||||||
|
width: 100%%;
|
||||||
|
vertical-align: %s;
|
||||||
|
font-family: %s;
|
||||||
|
font-size: %spt;
|
||||||
|
color: %s;
|
||||||
|
background-color: %s;
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
|
||||||
|
HTML = """
|
||||||
|
<div id="alert" style="visibility:hidden"></div>
|
||||||
|
"""
|
||||||
|
|
||||||
class AlertsPlugin(Plugin):
|
class AlertsPlugin(Plugin):
|
||||||
log.info(u'Alerts Plugin loaded')
|
log.info(u'Alerts Plugin loaded')
|
||||||
|
|
||||||
|
@ -79,7 +137,6 @@ class AlertsPlugin(Plugin):
|
||||||
self.toolsAlertItem.setVisible(True)
|
self.toolsAlertItem.setVisible(True)
|
||||||
action_list = ActionList.get_instance()
|
action_list = ActionList.get_instance()
|
||||||
action_list.add_action(self.toolsAlertItem, UiStrings().Tools)
|
action_list.add_action(self.toolsAlertItem, UiStrings().Tools)
|
||||||
self.liveController.alertTab = self.settings_tab
|
|
||||||
|
|
||||||
def finalise(self):
|
def finalise(self):
|
||||||
"""
|
"""
|
||||||
|
@ -121,3 +178,35 @@ class AlertsPlugin(Plugin):
|
||||||
u'title': translate('AlertsPlugin', 'Alerts', 'container title')
|
u'title': translate('AlertsPlugin', 'Alerts', 'container title')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def getDisplayJavaScript(self):
|
||||||
|
"""
|
||||||
|
Add Javascript to the main display.
|
||||||
|
"""
|
||||||
|
return JAVASCRIPT
|
||||||
|
|
||||||
|
def getDisplayCss(self):
|
||||||
|
"""
|
||||||
|
Add CSS to the main display.
|
||||||
|
"""
|
||||||
|
align = VerticalType.Names[self.settings_tab.location]
|
||||||
|
return CSS % (align, self.settings_tab.font_face,
|
||||||
|
self.settings_tab.font_size, self.settings_tab.font_color,
|
||||||
|
self.settings_tab.bg_color)
|
||||||
|
|
||||||
|
def getDisplayHtml(self):
|
||||||
|
"""
|
||||||
|
Add HTML to the main display.
|
||||||
|
"""
|
||||||
|
return HTML
|
||||||
|
|
||||||
|
def refreshCss(self, frame):
|
||||||
|
"""
|
||||||
|
Trigger an update of the CSS in the maindisplay.
|
||||||
|
|
||||||
|
``frame``
|
||||||
|
The Web frame holding the page.
|
||||||
|
"""
|
||||||
|
align = VerticalType.Names[self.settings_tab.location]
|
||||||
|
frame.evaluateJavaScript(u'update_css("%s", "%s", "%s", "%s", "%s")' %
|
||||||
|
(align, self.settings_tab.font_face, self.settings_tab.font_size,
|
||||||
|
self.settings_tab.font_color, self.settings_tab.bg_color))
|
||||||
|
|
|
@ -45,7 +45,7 @@ class AlertsManager(QtCore.QObject):
|
||||||
self.timer_id = 0
|
self.timer_id = 0
|
||||||
self.alertList = []
|
self.alertList = []
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'maindisplay_active'), self.generateAlert)
|
QtCore.SIGNAL(u'live_display_active'), self.generateAlert)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'alerts_text'), self.onAlertText)
|
QtCore.SIGNAL(u'alerts_text'), self.onAlertText)
|
||||||
|
|
||||||
|
@ -69,11 +69,11 @@ class AlertsManager(QtCore.QObject):
|
||||||
log.debug(u'display alert called %s' % text)
|
log.debug(u'display alert called %s' % text)
|
||||||
self.alertList.append(text)
|
self.alertList.append(text)
|
||||||
if self.timer_id != 0:
|
if self.timer_id != 0:
|
||||||
Receiver.send_message(u'maindisplay_status_text',
|
Receiver.send_message(u'mainwindow_status_text',
|
||||||
translate('AlertsPlugin.AlertsManager',
|
translate('AlertsPlugin.AlertsManager',
|
||||||
'Alert message created and displayed.'))
|
'Alert message created and displayed.'))
|
||||||
return
|
return
|
||||||
Receiver.send_message(u'maindisplay_status_text', u'')
|
Receiver.send_message(u'mainwindow_status_text', u'')
|
||||||
self.generateAlert()
|
self.generateAlert()
|
||||||
|
|
||||||
def generateAlert(self):
|
def generateAlert(self):
|
||||||
|
@ -81,7 +81,7 @@ class AlertsManager(QtCore.QObject):
|
||||||
Format and request the Alert and start the timer
|
Format and request the Alert and start the timer
|
||||||
"""
|
"""
|
||||||
log.debug(u'Generate Alert called')
|
log.debug(u'Generate Alert called')
|
||||||
if len(self.alertList) == 0:
|
if not self.alertList:
|
||||||
return
|
return
|
||||||
text = self.alertList.pop(0)
|
text = self.alertList.pop(0)
|
||||||
alertTab = self.parent().settings_tab
|
alertTab = self.parent().settings_tab
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import SettingsTab, translate
|
from openlp.core.lib import SettingsTab, translate, Receiver
|
||||||
from openlp.core.lib.ui import UiStrings, create_valign_combo
|
from openlp.core.lib.ui import UiStrings, create_valign_combo
|
||||||
|
|
||||||
class AlertsTab(SettingsTab):
|
class AlertsTab(SettingsTab):
|
||||||
|
@ -140,6 +140,7 @@ class AlertsTab(SettingsTab):
|
||||||
|
|
||||||
def onTimeoutSpinBoxChanged(self):
|
def onTimeoutSpinBoxChanged(self):
|
||||||
self.timeout = self.timeoutSpinBox.value()
|
self.timeout = self.timeoutSpinBox.value()
|
||||||
|
self.changed = True
|
||||||
|
|
||||||
def onFontSizeSpinBoxChanged(self):
|
def onFontSizeSpinBoxChanged(self):
|
||||||
self.font_size = self.fontSizeSpinBox.value()
|
self.font_size = self.fontSizeSpinBox.value()
|
||||||
|
@ -171,10 +172,15 @@ class AlertsTab(SettingsTab):
|
||||||
font.setFamily(self.font_face)
|
font.setFamily(self.font_face)
|
||||||
self.fontComboBox.setCurrentFont(font)
|
self.fontComboBox.setCurrentFont(font)
|
||||||
self.updateDisplay()
|
self.updateDisplay()
|
||||||
|
self.changed = False
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.settingsSection)
|
settings.beginGroup(self.settingsSection)
|
||||||
|
# Check value has changed as no event handles this field
|
||||||
|
if settings.value(u'location', QtCore.QVariant(1)).toInt()[0] != \
|
||||||
|
self.verticalComboBox.currentIndex():
|
||||||
|
self.changed = True
|
||||||
settings.setValue(u'background color', QtCore.QVariant(self.bg_color))
|
settings.setValue(u'background color', QtCore.QVariant(self.bg_color))
|
||||||
settings.setValue(u'font color', QtCore.QVariant(self.font_color))
|
settings.setValue(u'font color', QtCore.QVariant(self.font_color))
|
||||||
settings.setValue(u'font size', QtCore.QVariant(self.font_size))
|
settings.setValue(u'font size', QtCore.QVariant(self.font_size))
|
||||||
|
@ -184,6 +190,9 @@ class AlertsTab(SettingsTab):
|
||||||
self.location = self.verticalComboBox.currentIndex()
|
self.location = self.verticalComboBox.currentIndex()
|
||||||
settings.setValue(u'location', QtCore.QVariant(self.location))
|
settings.setValue(u'location', QtCore.QVariant(self.location))
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
|
if self.changed:
|
||||||
|
Receiver.send_message(u'update_display_css')
|
||||||
|
self.changed = False
|
||||||
|
|
||||||
def updateDisplay(self):
|
def updateDisplay(self):
|
||||||
font = QtGui.QFont()
|
font = QtGui.QFont()
|
||||||
|
@ -193,4 +202,5 @@ class AlertsTab(SettingsTab):
|
||||||
self.fontPreview.setFont(font)
|
self.fontPreview.setFont(font)
|
||||||
self.fontPreview.setStyleSheet(u'background-color: %s; color: %s' %
|
self.fontPreview.setStyleSheet(u'background-color: %s; color: %s' %
|
||||||
(self.bg_color, self.font_color))
|
(self.bg_color, self.font_color))
|
||||||
|
self.changed = True
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,8 @@ from openlp.plugins.media.forms import MediaOpenForm
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
CLAPPERBOARD = QtGui.QImage(u':/media/media_video.png')
|
CLAPPERBOARD = QtGui.QImage(u':/media/media_video.png')
|
||||||
|
#TODO: Add an appropriate Icon for DVDs, CDs, ...
|
||||||
|
DVD_ICON = QtGui.QImage(u':/media/media_video.png')
|
||||||
|
|
||||||
class MediaMediaItem(MediaManagerItem):
|
class MediaMediaItem(MediaManagerItem):
|
||||||
"""
|
"""
|
||||||
|
@ -52,7 +54,7 @@ class MediaMediaItem(MediaManagerItem):
|
||||||
def __init__(self, parent, plugin, icon):
|
def __init__(self, parent, plugin, icon):
|
||||||
self.iconPath = u'images/image'
|
self.iconPath = u'images/image'
|
||||||
self.background = False
|
self.background = False
|
||||||
self.PreviewFunction = CLAPPERBOARD
|
self.previewFunction = CLAPPERBOARD
|
||||||
self.Automatic = u''
|
self.Automatic = u''
|
||||||
MediaManagerItem.__init__(self, parent, plugin, icon)
|
MediaManagerItem.__init__(self, parent, plugin, icon)
|
||||||
self.singleServiceItem = False
|
self.singleServiceItem = False
|
||||||
|
@ -66,7 +68,7 @@ class MediaMediaItem(MediaManagerItem):
|
||||||
self.plugin.mediaController.set_controls_visible(self.mediaController, \
|
self.plugin.mediaController.set_controls_visible(self.mediaController, \
|
||||||
False)
|
False)
|
||||||
self.mediaController.previewDisplay = Display(self.mediaController, \
|
self.mediaController.previewDisplay = Display(self.mediaController, \
|
||||||
False, self.mediaController, self.plugin.pluginManager.plugins)
|
False, self.mediaController)
|
||||||
self.mediaController.previewDisplay.setup()
|
self.mediaController.previewDisplay.setup()
|
||||||
self.plugin.mediaController.setup_display( \
|
self.plugin.mediaController.setup_display( \
|
||||||
self.mediaController.previewDisplay)
|
self.mediaController.previewDisplay)
|
||||||
|
@ -144,10 +146,6 @@ class MediaMediaItem(MediaManagerItem):
|
||||||
Add a folder to the list widget to make it available for showing
|
Add a folder to the list widget to make it available for showing
|
||||||
"""
|
"""
|
||||||
self.mediaOpenForm.exec_()
|
self.mediaOpenForm.exec_()
|
||||||
# folder = QtGui.QFileDialog.getExistingDirectory (
|
|
||||||
# self, self.onNewPrompt,
|
|
||||||
# SettingsManager.get_last_dir(self.settingsSection))
|
|
||||||
# log.info(u'New folder(s) %s', unicode(folder))
|
|
||||||
|
|
||||||
def overrideApiChanged(self, index):
|
def overrideApiChanged(self, index):
|
||||||
Receiver.send_message(u'media_overrideApi', \
|
Receiver.send_message(u'media_overrideApi', \
|
||||||
|
@ -289,10 +287,8 @@ class MediaMediaItem(MediaManagerItem):
|
||||||
else:
|
else:
|
||||||
filename = os.path.split(unicode(track))[1]
|
filename = os.path.split(unicode(track))[1]
|
||||||
item_name = QtGui.QListWidgetItem(filename)
|
item_name = QtGui.QListWidgetItem(filename)
|
||||||
#imageFile = u'F:/Computer/Platform/pythonDev/openlp/branches/media/media-optical-dvd-video.png'
|
#TODO: add the appropriate Icon
|
||||||
#thumbFile = u'F:/Computer/Platform/pythonDev/openlp/branches/media/media-optical-dvd-video_thumb.png'
|
#item_name.setIcon(build_icon(DVD_ICON))
|
||||||
#icon = self.iconFromFile(imageFile, thumbFile)
|
|
||||||
#item_name.setIcon(icon)
|
|
||||||
item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(track))
|
item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(track))
|
||||||
item_name.setToolTip(track)
|
item_name.setToolTip(track)
|
||||||
self.listView.addItem(item_name)
|
self.listView.addItem(item_name)
|
||||||
|
|
|
@ -200,4 +200,3 @@ class MediaTab(SettingsTab):
|
||||||
Receiver.send_message(u'mediaitem_media_rebuild')
|
Receiver.send_message(u'mediaitem_media_rebuild')
|
||||||
if api_string_changed:
|
if api_string_changed:
|
||||||
Receiver.send_message(u'config_screen_changed')
|
Receiver.send_message(u'config_screen_changed')
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ class Controller(object):
|
||||||
self.doc.slidenumber = slide_no
|
self.doc.slidenumber = slide_no
|
||||||
if self.is_live:
|
if self.is_live:
|
||||||
if hide_mode == HideMode.Screen:
|
if hide_mode == HideMode.Screen:
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
Receiver.send_message(u'live_display_hide', HideMode.Screen)
|
||||||
self.stop()
|
self.stop()
|
||||||
elif hide_mode == HideMode.Theme:
|
elif hide_mode == HideMode.Theme:
|
||||||
self.blank(hide_mode)
|
self.blank(hide_mode)
|
||||||
|
@ -76,7 +76,7 @@ class Controller(object):
|
||||||
self.blank(hide_mode)
|
self.blank(hide_mode)
|
||||||
else:
|
else:
|
||||||
self.doc.start_presentation()
|
self.doc.start_presentation()
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
Receiver.send_message(u'live_display_hide', HideMode.Screen)
|
||||||
self.doc.slidenumber = 0
|
self.doc.slidenumber = 0
|
||||||
if slide_no > 1:
|
if slide_no > 1:
|
||||||
self.slide(slide_no)
|
self.slide(slide_no)
|
||||||
|
@ -196,7 +196,7 @@ class Controller(object):
|
||||||
if not self.doc.is_active():
|
if not self.doc.is_active():
|
||||||
return
|
return
|
||||||
if hide_mode == HideMode.Theme:
|
if hide_mode == HideMode.Theme:
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Theme)
|
Receiver.send_message(u'live_display_hide', HideMode.Theme)
|
||||||
self.doc.blank_screen()
|
self.doc.blank_screen()
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
|
@ -224,7 +224,7 @@ class Controller(object):
|
||||||
self.doc.slidenumber != self.doc.get_slide_number():
|
self.doc.slidenumber != self.doc.get_slide_number():
|
||||||
self.doc.goto_slide(self.doc.slidenumber)
|
self.doc.goto_slide(self.doc.slidenumber)
|
||||||
self.doc.unblank_screen()
|
self.doc.unblank_screen()
|
||||||
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
Receiver.send_message(u'live_display_hide', HideMode.Screen)
|
||||||
|
|
||||||
def poll(self):
|
def poll(self):
|
||||||
self.doc.poll_slidenumber(self.is_live)
|
self.doc.poll_slidenumber(self.is_live)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -65,8 +65,11 @@ Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription
|
||||||
|
|
||||||
[Files]
|
[Files]
|
||||||
Source: ..\..\dist\OpenLP\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
|
Source: ..\..\dist\OpenLP\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||||
Source: psvince.dll; Flags: dontcopy
|
; DLL used to check if the target program is running at install time
|
||||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
Source: psvince.dll; flags: dontcopy
|
||||||
|
; psvince is installed in {app} folder, so it will be loaded at
|
||||||
|
; uninstall time to check if the target program is running
|
||||||
|
Source: psvince.dll; DestDir: {app}
|
||||||
|
|
||||||
[Icons]
|
[Icons]
|
||||||
Name: {group}\{#AppName}; Filename: {app}\{#AppExeName}
|
Name: {group}\{#AppName}; Filename: {app}\{#AppExeName}
|
||||||
|
@ -87,8 +90,13 @@ Root: HKCR; Subkey: "OpenLP\DefaultIcon"; ValueType: string; ValueName: ""; Valu
|
||||||
Root: HKCR; Subkey: "OpenLP\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\OpenLP.exe"" ""%1"""
|
Root: HKCR; Subkey: "OpenLP\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\OpenLP.exe"" ""%1"""
|
||||||
|
|
||||||
[Code]
|
[Code]
|
||||||
function IsModuleLoaded(modulename: AnsiString ): Boolean;
|
// Function to call psvince.dll at install time
|
||||||
external 'IsModuleLoaded@files:psvince.dll stdcall';
|
function IsModuleLoadedInstall(modulename: AnsiString ): Boolean;
|
||||||
|
external 'IsModuleLoaded@files:psvince.dll stdcall setuponly';
|
||||||
|
|
||||||
|
// Function to call psvince.dll at uninstall time
|
||||||
|
function IsModuleLoadedUninstall(modulename: AnsiString ): Boolean;
|
||||||
|
external 'IsModuleLoaded@{app}\psvince.dll stdcall uninstallonly' ;
|
||||||
|
|
||||||
function GetUninstallString(): String;
|
function GetUninstallString(): String;
|
||||||
var
|
var
|
||||||
|
@ -133,7 +141,7 @@ end;
|
||||||
function InitializeSetup(): Boolean;
|
function InitializeSetup(): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := true;
|
Result := true;
|
||||||
while IsModuleLoaded( 'OpenLP.exe' ) and Result do
|
while IsModuleLoadedInstall( 'OpenLP.exe' ) and Result do
|
||||||
begin
|
begin
|
||||||
if MsgBox( 'Openlp is currently running, please close it to continue the install.',
|
if MsgBox( 'Openlp is currently running, please close it to continue the install.',
|
||||||
mbError, MB_OKCANCEL ) = IDCANCEL then
|
mbError, MB_OKCANCEL ) = IDCANCEL then
|
||||||
|
@ -153,3 +161,16 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function InitializeUninstall(): Boolean;
|
||||||
|
begin
|
||||||
|
Result := true;
|
||||||
|
while IsModuleLoadedUninstall( 'OpenLP.exe' ) and Result do
|
||||||
|
begin
|
||||||
|
if MsgBox( 'Openlp is currently running, please close it to continue the uninstall.',
|
||||||
|
mbError, MB_OKCANCEL ) = IDCANCEL then
|
||||||
|
begin
|
||||||
|
Result := false;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
|
@ -73,6 +73,7 @@ MODULES = [
|
||||||
'BeautifulSoup',
|
'BeautifulSoup',
|
||||||
'mako',
|
'mako',
|
||||||
'migrate',
|
'migrate',
|
||||||
|
'uno',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue