Merge lp:~trb143/openlp/servicing2 into lp:openlp
- servicing2
- Merge into trunk
Proposed by
Tim Bentley
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~trb143/openlp/servicing2 |
Merge into: | lp:openlp |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~trb143/openlp/servicing2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raoul Snyman | Approve | ||
Review via email: mp+8019@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote : | # |
Revision history for this message
Raoul Snyman (raoul-snyman) wrote : | # |
If a class is a Python class, please use the Python naming convention. If your class is supposed to be a GUI class, please inherit it from QWidget.
450 +class BaseToolbar(
451 +
452 + def __init__(self, isLive):
453 + self.Toolbar = None
454 + self.PreviewLis
455 + self.PreviewLis
456 + self.isLive = isLive
457 + self.defineTool
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'openlp/core/lib/__init__.py' | |||
2 | --- openlp/core/lib/__init__.py 2009-06-24 20:15:24 +0000 | |||
3 | +++ openlp/core/lib/__init__.py 2009-06-29 05:13:06 +0000 | |||
4 | @@ -39,7 +39,7 @@ | |||
5 | 39 | ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal, | 39 | ButtonIcon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal, |
6 | 40 | QtGui.QIcon.Off) | 40 | QtGui.QIcon.Off) |
7 | 41 | else: | 41 | else: |
9 | 42 | ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QImage(icon)), | 42 | ButtonIcon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)), |
10 | 43 | QtGui.QIcon.Normal, QtGui.QIcon.Off) | 43 | QtGui.QIcon.Normal, QtGui.QIcon.Off) |
11 | 44 | return ButtonIcon | 44 | return ButtonIcon |
12 | 45 | 45 | ||
13 | @@ -75,7 +75,7 @@ | |||
14 | 75 | from renderer import Renderer | 75 | from renderer import Renderer |
15 | 76 | from rendermanager import RenderManager | 76 | from rendermanager import RenderManager |
16 | 77 | from mediamanageritem import MediaManagerItem | 77 | from mediamanageritem import MediaManagerItem |
18 | 78 | from baselistwithdnd import BaseListWithDnD | 78 | from baselistwithdnd import BaseListWithDnD |
19 | 79 | from listwithpreviews import ListWithPreviews | 79 | from listwithpreviews import ListWithPreviews |
20 | 80 | 80 | ||
21 | 81 | __all__ = [ 'translate', 'file_to_xml', 'str_to_bool', | 81 | __all__ = [ 'translate', 'file_to_xml', 'str_to_bool', |
22 | 82 | 82 | ||
23 | === modified file 'openlp/core/lib/baselistwithdnd.py' | |||
24 | --- openlp/core/lib/baselistwithdnd.py 2009-06-26 16:17:55 +0000 | |||
25 | +++ openlp/core/lib/baselistwithdnd.py 2009-06-27 15:33:03 +0000 | |||
26 | @@ -24,13 +24,13 @@ | |||
27 | 24 | from openlp.core.lib.toolbar import * | 24 | from openlp.core.lib.toolbar import * |
28 | 25 | from openlp.core.lib import translate | 25 | from openlp.core.lib import translate |
29 | 26 | 26 | ||
31 | 27 | class BaseListWithDnD(QtGui.QListView): | 27 | class BaseListWithDnD(QtGui.QListWidget): |
32 | 28 | """ | 28 | """ |
33 | 29 | Please put a short description of what this class does in here. | 29 | Please put a short description of what this class does in here. |
34 | 30 | """ | 30 | """ |
35 | 31 | 31 | ||
36 | 32 | def __init__(self,parent = None): | 32 | def __init__(self,parent = None): |
38 | 33 | QtGui.QListView.__init__(self,parent) | 33 | QtGui.QListWidget.__init__(self,parent) |
39 | 34 | # this must be set by the class which is inheriting | 34 | # this must be set by the class which is inheriting |
40 | 35 | assert(self.PluginName) | 35 | assert(self.PluginName) |
41 | 36 | 36 | ||
42 | 37 | 37 | ||
43 | === modified file 'openlp/core/lib/mediamanageritem.py' | |||
44 | --- openlp/core/lib/mediamanageritem.py 2009-06-26 16:40:49 +0000 | |||
45 | +++ openlp/core/lib/mediamanageritem.py 2009-06-29 05:07:32 +0000 | |||
46 | @@ -18,6 +18,7 @@ | |||
47 | 18 | Place, Suite 330, Boston, MA 02111-1307 USA | 18 | Place, Suite 330, Boston, MA 02111-1307 USA |
48 | 19 | """ | 19 | """ |
49 | 20 | import types | 20 | import types |
50 | 21 | import os | ||
51 | 21 | 22 | ||
52 | 22 | from PyQt4 import QtCore, QtGui | 23 | from PyQt4 import QtCore, QtGui |
53 | 23 | 24 | ||
54 | @@ -50,7 +51,6 @@ | |||
55 | 50 | if title is not None: | 51 | if title is not None: |
56 | 51 | self.title = title | 52 | self.title = title |
57 | 52 | self.Toolbar = None | 53 | self.Toolbar = None |
58 | 53 | #self.ConfigSection = None | ||
59 | 54 | self.PageLayout = QtGui.QVBoxLayout(self) | 54 | self.PageLayout = QtGui.QVBoxLayout(self) |
60 | 55 | self.PageLayout.setSpacing(0) | 55 | self.PageLayout.setSpacing(0) |
61 | 56 | self.PageLayout.setMargin(0) | 56 | self.PageLayout.setMargin(0) |
62 | @@ -118,13 +118,17 @@ | |||
63 | 118 | # self.PluginTextShort # eg "Image" for the image plugin | 118 | # self.PluginTextShort # eg "Image" for the image plugin |
64 | 119 | # self.ConfigSection - where the items in the media manager are stored | 119 | # self.ConfigSection - where the items in the media manager are stored |
65 | 120 | # this could potentially be self.PluginTextShort.lower() | 120 | # this could potentially be self.PluginTextShort.lower() |
66 | 121 | # self.IconPath=u'images/images' - allows specific icons to be used | ||
67 | 122 | # self.hasFileIcon - Is the file Icon required | ||
68 | 123 | # self.hasEditIcon - Is the edit Icon required | ||
69 | 124 | # self.hasNewIcon - Is the new Icon required | ||
70 | 121 | # | 125 | # |
71 | 122 | # self.OnNewPrompt=u'Select Image(s)' | 126 | # self.OnNewPrompt=u'Select Image(s)' |
72 | 123 | # self.OnNewFileMasks=u'Images (*.jpg *jpeg *.gif *.png *.bmp)' | 127 | # self.OnNewFileMasks=u'Images (*.jpg *jpeg *.gif *.png *.bmp)' |
73 | 124 | # assumes that the new action is to load a file. If not, override onnew | 128 | # assumes that the new action is to load a file. If not, override onnew |
74 | 125 | # self.ListViewWithDnD_class - there is a base list class with DnD assigned to it (openlp.core.lib.BaseListWithDnD()) | 129 | # self.ListViewWithDnD_class - there is a base list class with DnD assigned to it (openlp.core.lib.BaseListWithDnD()) |
77 | 126 | # each plugin needs to inherit a class from this and pass that *class* (not an instance) to here | 130 | # each plugin needs to inherit a class from this and pass that *class* (not an instance) to here |
78 | 127 | # via the ListViewWithDnD_class member | 131 | # via the ListViewWithDnD_class member |
79 | 128 | # The assumption is that given that at least two plugins are of the form | 132 | # The assumption is that given that at least two plugins are of the form |
80 | 129 | # "text with an icon" then all this will help | 133 | # "text with an icon" then all this will help |
81 | 130 | # even for plugins of another sort, the setup of the right-click menu, common toolbar | 134 | # even for plugins of another sort, the setup of the right-click menu, common toolbar |
82 | @@ -139,16 +143,29 @@ | |||
83 | 139 | # Add a toolbar | 143 | # Add a toolbar |
84 | 140 | self.addToolbar() | 144 | self.addToolbar() |
85 | 141 | # Create buttons for the toolbar | 145 | # Create buttons for the toolbar |
92 | 142 | ## New Song Button ## | 146 | ## File Button ## |
93 | 143 | self.addToolbarButton( | 147 | if self.hasFileIcon: |
94 | 144 | translate(self.TranslationContext, u'Load '+self.PluginTextShort), | 148 | self.addToolbarButton( |
95 | 145 | translate(self.TranslationContext, u'Load item into openlp.org'), | 149 | translate(self.TranslationContext, u'Load '+self.PluginTextShort), |
96 | 146 | u':/images/image_load.png', self.onNewClick, u'ImageNewItem') | 150 | translate(self.TranslationContext, u'Load a new '+self.PluginTextShort), |
97 | 147 | ## Delete Song Button ## | 151 | u':'+self.IconPath+ u'_load.png', self.onFileClick, self.PluginTextShort+u'FileItem') |
98 | 152 | ## New Button ## | ||
99 | 153 | if self.hasNewIcon: | ||
100 | 154 | self.addToolbarButton( | ||
101 | 155 | translate(self.TranslationContext, u'New '+self.PluginTextShort), | ||
102 | 156 | translate(self.TranslationContext, u'Add a new '+self.PluginTextShort), | ||
103 | 157 | u':'+self.IconPath+ u'_load.png', self.onNewClick, self.PluginTextShort+u'NewItem') | ||
104 | 158 | ## Edit Button ## | ||
105 | 159 | if self.hasEditIcon: | ||
106 | 160 | self.addToolbarButton( | ||
107 | 161 | translate(self.TranslationContext, u'Edit '+self.PluginTextShort), | ||
108 | 162 | translate(self.TranslationContext, u'Edit the selected '+self.PluginTextShort), | ||
109 | 163 | u':'+self.IconPath+ u'_load.png', self.onEditClick, self.PluginTextShort+u'EditItem') | ||
110 | 164 | ## Delete Button ## | ||
111 | 148 | self.addToolbarButton( | 165 | self.addToolbarButton( |
112 | 149 | translate(self.TranslationContext, u'Delete '+self.PluginTextShort), | 166 | translate(self.TranslationContext, u'Delete '+self.PluginTextShort), |
113 | 150 | translate(self.TranslationContext, u'Delete the selected item'), | 167 | translate(self.TranslationContext, u'Delete the selected item'), |
115 | 151 | u':/images/image_delete.png', self.onDeleteClick, u'DeleteItem') | 168 | u':'+self.IconPath+ u'_delete.png', self.onDeleteClick, self.PluginTextShort+u'DeleteItem') |
116 | 152 | ## Separator Line ## | 169 | ## Separator Line ## |
117 | 153 | self.addToolbarSeparator() | 170 | self.addToolbarSeparator() |
118 | 154 | ## Preview Button ## | 171 | ## Preview Button ## |
119 | @@ -166,20 +183,27 @@ | |||
120 | 166 | translate(self.TranslationContext, u'Add '+self.PluginTextShort+u' To Service'), | 183 | translate(self.TranslationContext, u'Add '+self.PluginTextShort+u' To Service'), |
121 | 167 | translate(self.TranslationContext, u'Add the selected item(s) to the service'), | 184 | translate(self.TranslationContext, u'Add the selected item(s) to the service'), |
122 | 168 | u':/system/system_add.png', self.onAddClick, self.PluginTextShort+u'AddItem') | 185 | u':/system/system_add.png', self.onAddClick, self.PluginTextShort+u'AddItem') |
123 | 186 | #Allow the plugin to define it's own header | ||
124 | 187 | self.addHeaderBar() | ||
125 | 169 | #Add the List widget | 188 | #Add the List widget |
126 | 170 | self.ListView = self.ListViewWithDnD_class() | 189 | self.ListView = self.ListViewWithDnD_class() |
127 | 171 | self.ListView.uniformItemSizes = True | 190 | self.ListView.uniformItemSizes = True |
128 | 172 | self.ListData = ListWithPreviews() | ||
129 | 173 | self.ListView.setModel(self.ListData) | ||
130 | 174 | self.ListView.setGeometry(QtCore.QRect(10, 100, 256, 591)) | 191 | self.ListView.setGeometry(QtCore.QRect(10, 100, 256, 591)) |
131 | 175 | self.ListView.setSpacing(1) | 192 | self.ListView.setSpacing(1) |
132 | 176 | self.ListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) | 193 | self.ListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) |
133 | 177 | self.ListView.setAlternatingRowColors(True) | 194 | self.ListView.setAlternatingRowColors(True) |
134 | 178 | self.ListView.setDragEnabled(True) | 195 | self.ListView.setDragEnabled(True) |
135 | 179 | self.ListView.setObjectName(self.PluginTextShort+u'ListView') | 196 | self.ListView.setObjectName(self.PluginTextShort+u'ListView') |
136 | 197 | #Add tp PageLayout | ||
137 | 180 | self.PageLayout.addWidget(self.ListView) | 198 | self.PageLayout.addWidget(self.ListView) |
138 | 181 | #define and add the context menu | 199 | #define and add the context menu |
139 | 182 | self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) | 200 | self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) |
140 | 201 | if self.hasEditIcon: | ||
141 | 202 | self.ListView.addAction(self.contextMenuAction(self.ListView, | ||
142 | 203 | ':' +self.IconPath+u'_new.png', | ||
143 | 204 | translate(self.TranslationContext, u'&Edit '+self.PluginTextShort), | ||
144 | 205 | self.onEditClick)) | ||
145 | 206 | self.ListView.addAction(self.contextMenuSeparator(self.SongListWidget)) | ||
146 | 183 | self.ListView.addAction(self.contextMenuAction( | 207 | self.ListView.addAction(self.contextMenuAction( |
147 | 184 | self.ListView, ':/system/system_preview.png', | 208 | self.ListView, ':/system/system_preview.png', |
148 | 185 | translate(self.TranslationContext, u'&Preview '+self.PluginTextShort), | 209 | translate(self.TranslationContext, u'&Preview '+self.PluginTextShort), |
149 | @@ -195,52 +219,63 @@ | |||
150 | 195 | QtCore.QObject.connect(self.ListView, | 219 | QtCore.QObject.connect(self.ListView, |
151 | 196 | QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onPreviewClick) | 220 | QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onPreviewClick) |
152 | 197 | 221 | ||
155 | 198 | def initialise(self): | 222 | def addHeaderBar(self): |
156 | 199 | self.loadList(self.parent.config.load_list(self.ConfigSection)) | 223 | pass |
157 | 200 | 224 | ||
159 | 201 | def onNewClick(self): | 225 | def onFileClick(self): |
160 | 202 | files = QtGui.QFileDialog.getOpenFileNames(None, | 226 | files = QtGui.QFileDialog.getOpenFileNames(None, |
161 | 203 | translate(self.TranslationContext, self.OnNewPrompt), | 227 | translate(self.TranslationContext, self.OnNewPrompt), |
162 | 204 | self.parent.config.get_last_dir(), | 228 | self.parent.config.get_last_dir(), |
163 | 205 | self.OnNewFileMasks) | 229 | self.OnNewFileMasks) |
165 | 206 | log.info(u'New files(s)', unicode(files)) | 230 | log.info(u'New files(s)%s', unicode(files)) |
166 | 207 | if len(files) > 0: | 231 | if len(files) > 0: |
167 | 208 | self.loadList(files) | 232 | self.loadList(files) |
168 | 209 | dir, filename = os.path.split(unicode(files[0])) | 233 | dir, filename = os.path.split(unicode(files[0])) |
169 | 210 | self.parent.config.set_last_dir(dir) | 234 | self.parent.config.set_last_dir(dir) |
171 | 211 | self.parent.config.set_list(self.ConfigSection, self.ListData.getFileList()) | 235 | #self.parent.config.set_list(self.ConfigSection, self.ListData.getFileList()) |
172 | 236 | |||
173 | 237 | def getFileList(self): | ||
174 | 238 | count = 0 | ||
175 | 239 | while count < len(self.ListView): | ||
176 | 240 | filelist = [set.ListView.item(count).text()] | ||
177 | 241 | count += 1 | ||
178 | 242 | return filelist | ||
179 | 212 | 243 | ||
180 | 213 | def loadList(self, list): | 244 | def loadList(self, list): |
183 | 214 | for file in list: | 245 | raise NotImplementedError(u'MediaManagerItem.loadList needs to be defined by the plugin') |
184 | 215 | self.ListData.addRow(file) | 246 | |
185 | 247 | def onNewClick(self): | ||
186 | 248 | raise NotImplementedError(u'MediaManagerItem.onNewClick needs to be defined by the plugin') | ||
187 | 249 | |||
188 | 250 | def onEditClick(self): | ||
189 | 251 | raise NotImplementedError(u'MediaManagerItem.onEditClick needs to be defined by the plugin') | ||
190 | 216 | 252 | ||
191 | 217 | def onDeleteClick(self): | 253 | def onDeleteClick(self): |
197 | 218 | indexes = self.ListView.selectedIndexes() | 254 | raise NotImplementedError(u'MediaManagerItem.onDeleteClick needs to be defined by the plugin') |
193 | 219 | for index in indexes: | ||
194 | 220 | current_row = int(index.row()) | ||
195 | 221 | self.ListData.removeRow(current_row) | ||
196 | 222 | self.parent.config.set_list(self.ConfigSection, self.ListData.getFileList()) | ||
198 | 223 | 255 | ||
200 | 224 | def generateSlideData(self): | 256 | def generateSlideData(self, item): |
201 | 225 | raise NotImplementedError(u'MediaManagerItem.generateSlideData needs to be defined by the plugin') | 257 | raise NotImplementedError(u'MediaManagerItem.generateSlideData needs to be defined by the plugin') |
202 | 226 | 258 | ||
203 | 227 | def onPreviewClick(self): | 259 | def onPreviewClick(self): |
204 | 228 | log.debug(self.PluginTextShort+u'Preview Requested') | 260 | log.debug(self.PluginTextShort+u'Preview Requested') |
205 | 229 | service_item = ServiceItem(self.parent) | 261 | service_item = ServiceItem(self.parent) |
207 | 230 | service_item.addIcon(u':/media/media_image.png') | 262 | service_item.addIcon(u':/media/media_'+self.PluginTextShort.lower()+u'.png') |
208 | 231 | self.generateSlideData(service_item) | 263 | self.generateSlideData(service_item) |
209 | 232 | self.parent.preview_controller.addServiceItem(service_item) | 264 | self.parent.preview_controller.addServiceItem(service_item) |
210 | 265 | self.ListView.clearSelection() | ||
211 | 233 | 266 | ||
212 | 234 | def onLiveClick(self): | 267 | def onLiveClick(self): |
214 | 235 | log.debug(self.PluginTextShort+u' Live Requested') | 268 | log.debug(self.PluginTextShort + u' Live Requested') |
215 | 236 | service_item = ServiceItem(self.parent) | 269 | service_item = ServiceItem(self.parent) |
217 | 237 | service_item.addIcon(u':/media/media_image.png') | 270 | service_item.addIcon(u':/media/media_'+self.PluginTextShort.lower()+u'.png') |
218 | 238 | self.generateSlideData(service_item) | 271 | self.generateSlideData(service_item) |
219 | 239 | self.parent.live_controller.addServiceItem(service_item) | 272 | self.parent.live_controller.addServiceItem(service_item) |
220 | 273 | self.ListView.clearSelection() | ||
221 | 240 | 274 | ||
222 | 241 | def onAddClick(self): | 275 | def onAddClick(self): |
223 | 242 | log.debug(self.PluginTextShort+u' Add Requested') | 276 | log.debug(self.PluginTextShort+u' Add Requested') |
224 | 243 | service_item = ServiceItem(self.parent) | 277 | service_item = ServiceItem(self.parent) |
226 | 244 | service_item.addIcon(u':/media/media_image.png') | 278 | service_item.addIcon(u':/media/media_'+self.PluginTextShort.lower()+u'.png') |
227 | 245 | self.generateSlideData(service_item) | 279 | self.generateSlideData(service_item) |
228 | 246 | self.parent.service_manager.addServiceItem(service_item) | 280 | self.parent.service_manager.addServiceItem(service_item) |
229 | 281 | self.ListView.clearSelection() | ||
230 | 247 | 282 | ||
231 | === modified file 'openlp/core/lib/plugin.py' | |||
232 | --- openlp/core/lib/plugin.py 2009-06-24 20:15:24 +0000 | |||
233 | +++ openlp/core/lib/plugin.py 2009-06-28 06:54:12 +0000 | |||
234 | @@ -101,7 +101,8 @@ | |||
235 | 101 | self.event_manager = plugin_helpers[u'event'] | 101 | self.event_manager = plugin_helpers[u'event'] |
236 | 102 | self.render_manager = plugin_helpers[u'render'] | 102 | self.render_manager = plugin_helpers[u'render'] |
237 | 103 | self.service_manager = plugin_helpers[u'service'] | 103 | self.service_manager = plugin_helpers[u'service'] |
239 | 104 | self.settings= plugin_helpers[u'settings'] | 104 | self.settings = plugin_helpers[u'settings'] |
240 | 105 | self.slideManager = plugin_helpers[u'slideManager'] | ||
241 | 105 | self.dnd_id=None | 106 | self.dnd_id=None |
242 | 106 | 107 | ||
243 | 107 | def check_pre_conditions(self): | 108 | def check_pre_conditions(self): |
244 | 108 | 109 | ||
245 | === modified file 'openlp/core/lib/toolbar.py' | |||
246 | --- openlp/core/lib/toolbar.py 2009-06-16 18:21:24 +0000 | |||
247 | +++ openlp/core/lib/toolbar.py 2009-06-29 05:07:32 +0000 | |||
248 | @@ -28,7 +28,7 @@ | |||
249 | 28 | Lots of toolbars around the place, so it makes sense to have a common way to manage them | 28 | Lots of toolbars around the place, so it makes sense to have a common way to manage them |
250 | 29 | """ | 29 | """ |
251 | 30 | def __init__(self, parent): | 30 | def __init__(self, parent): |
253 | 31 | QtGui.QToolBar.__init__(self, parent) | 31 | QtGui.QToolBar.__init__(self, None) |
254 | 32 | # useful to be able to reuse button icons... | 32 | # useful to be able to reuse button icons... |
255 | 33 | self.icons = {} | 33 | self.icons = {} |
256 | 34 | self.log = logging.getLogger(u'OpenLPToolbar') | 34 | self.log = logging.getLogger(u'OpenLPToolbar') |
257 | 35 | 35 | ||
258 | === modified file 'openlp/core/ui/__init__.py' | |||
259 | --- openlp/core/ui/__init__.py 2009-06-26 16:39:16 +0000 | |||
260 | +++ openlp/core/ui/__init__.py 2009-06-29 05:07:32 +0000 | |||
261 | @@ -17,6 +17,7 @@ | |||
262 | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
263 | 18 | Place, Suite 330, Boston, MA 02111-1307 USA | 18 | Place, Suite 330, Boston, MA 02111-1307 USA |
264 | 19 | """ | 19 | """ |
265 | 20 | from slidecontroller import BaseToolbar | ||
266 | 20 | from slidecontrollermanager import SlideControllerManager | 21 | from slidecontrollermanager import SlideControllerManager |
267 | 21 | from maindisplay import MainDisplay | 22 | from maindisplay import MainDisplay |
268 | 22 | from amendthemeform import AmendThemeForm | 23 | from amendthemeform import AmendThemeForm |
269 | @@ -32,5 +33,5 @@ | |||
270 | 32 | from thememanager import ThemeManager | 33 | from thememanager import ThemeManager |
271 | 33 | from mainwindow import MainWindow | 34 | from mainwindow import MainWindow |
272 | 34 | 35 | ||
274 | 35 | __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', | 36 | __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'BaseToolbar' |
275 | 36 | 'MainWindow', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeManager', 'AmendThemeForm'] | 37 | 'MainWindow', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeManager', 'AmendThemeForm'] |
276 | 37 | 38 | ||
277 | === modified file 'openlp/core/ui/mainwindow.py' | |||
278 | --- openlp/core/ui/mainwindow.py 2009-06-26 16:39:16 +0000 | |||
279 | +++ openlp/core/ui/mainwindow.py 2009-06-29 05:07:32 +0000 | |||
280 | @@ -50,7 +50,7 @@ | |||
281 | 50 | self.alertForm = AlertForm(self) | 50 | self.alertForm = AlertForm(self) |
282 | 51 | self.aboutForm = AboutForm() | 51 | self.aboutForm = AboutForm() |
283 | 52 | self.settingsForm = SettingsForm(self.screenList, self) | 52 | self.settingsForm = SettingsForm(self.screenList, self) |
285 | 53 | self.slideControllerManager = SlideControllerManager() | 53 | self.slideControllerManager = SlideControllerManager(self) |
286 | 54 | # Set up the path with plugins | 54 | # Set up the path with plugins |
287 | 55 | pluginpath = os.path.split(os.path.abspath(__file__))[0] | 55 | pluginpath = os.path.split(os.path.abspath(__file__))[0] |
288 | 56 | pluginpath = os.path.abspath( | 56 | pluginpath = os.path.abspath( |
289 | @@ -73,6 +73,7 @@ | |||
290 | 73 | self.plugin_helpers[u'render'] = self.RenderManager | 73 | self.plugin_helpers[u'render'] = self.RenderManager |
291 | 74 | self.plugin_helpers[u'service'] = self.ServiceManagerContents | 74 | self.plugin_helpers[u'service'] = self.ServiceManagerContents |
292 | 75 | self.plugin_helpers[u'settings'] = self.settingsForm | 75 | self.plugin_helpers[u'settings'] = self.settingsForm |
293 | 76 | self.plugin_helpers[u'slideManager'] = self.slideControllerManager | ||
294 | 76 | self.plugin_manager.find_plugins(pluginpath, self.plugin_helpers, | 77 | self.plugin_manager.find_plugins(pluginpath, self.plugin_helpers, |
295 | 77 | self.EventManager) | 78 | self.EventManager) |
296 | 78 | # hook methods have to happen after find_plugins. Find plugins needs the | 79 | # hook methods have to happen after find_plugins. Find plugins needs the |
297 | @@ -168,11 +169,8 @@ | |||
298 | 168 | self.ControlSplitter.setObjectName(u'ControlSplitter') | 169 | self.ControlSplitter.setObjectName(u'ControlSplitter') |
299 | 169 | self.MainContentLayout.addWidget(self.ControlSplitter) | 170 | self.MainContentLayout.addWidget(self.ControlSplitter) |
300 | 170 | # Create slide controllers | 171 | # Create slide controllers |
306 | 171 | PreviewController = SlideController(self.ControlSplitter, self) | 172 | self.PreviewController = SlideController(self) |
307 | 172 | LiveController = SlideController(self.ControlSplitter, self, True) | 173 | self.LiveController = SlideController(self, True) |
303 | 173 | self.slideControllerManager.add_controllers(u'base', PreviewController, LiveController) | ||
304 | 174 | self.PreviewController = self.slideControllerManager.getPreviewController(u'base') | ||
305 | 175 | self.LiveController = self.slideControllerManager.getLiveController(u'base') | ||
308 | 176 | # Create menu | 174 | # Create menu |
309 | 177 | self.MenuBar = QtGui.QMenuBar(self.mainWindow) | 175 | self.MenuBar = QtGui.QMenuBar(self.mainWindow) |
310 | 178 | self.MenuBar.setGeometry(QtCore.QRect(0, 0, 1087, 27)) | 176 | self.MenuBar.setGeometry(QtCore.QRect(0, 0, 1087, 27)) |
311 | 179 | 177 | ||
312 | === modified file 'openlp/core/ui/servicemanager.py' | |||
313 | --- openlp/core/ui/servicemanager.py 2009-06-26 16:39:16 +0000 | |||
314 | +++ openlp/core/ui/servicemanager.py 2009-06-29 17:37:46 +0000 | |||
315 | @@ -29,6 +29,22 @@ | |||
316 | 29 | contextMenuAction, contextMenuSeparator | 29 | contextMenuAction, contextMenuSeparator |
317 | 30 | from openlp.core.utils import ConfigHelper | 30 | from openlp.core.utils import ConfigHelper |
318 | 31 | 31 | ||
319 | 32 | class ServiceManagerList(QtGui.QTreeWidget): | ||
320 | 33 | |||
321 | 34 | def __init__(self,parent=None,name=None): | ||
322 | 35 | QtGui.QListView.__init__(self,parent) | ||
323 | 36 | self.parent = parent | ||
324 | 37 | |||
325 | 38 | def keyPressEvent(self, event): | ||
326 | 39 | if type(event) == QtGui.QKeyEvent: | ||
327 | 40 | #here accept the event and do something | ||
328 | 41 | if event.key() == QtCore.Qt.Key_Enter: | ||
329 | 42 | self.parent.makeLive() | ||
330 | 43 | event.accept() | ||
331 | 44 | event.ignore() | ||
332 | 45 | else: | ||
333 | 46 | event.ignore() | ||
334 | 47 | |||
335 | 32 | class ServiceManager(QtGui.QWidget): | 48 | class ServiceManager(QtGui.QWidget): |
336 | 33 | """ | 49 | """ |
337 | 34 | Manages the orders of service. Currently this involves taking | 50 | Manages the orders of service. Currently this involves taking |
338 | @@ -66,7 +82,7 @@ | |||
339 | 66 | self.Toolbar.addAction(self.ThemeWidget) | 82 | self.Toolbar.addAction(self.ThemeWidget) |
340 | 67 | self.Layout.addWidget(self.Toolbar) | 83 | self.Layout.addWidget(self.Toolbar) |
341 | 68 | # Create the service manager list | 84 | # Create the service manager list |
343 | 69 | self.ServiceManagerList = QtGui.QTreeWidget(self) | 85 | self.ServiceManagerList = ServiceManagerList(self) |
344 | 70 | self.ServiceManagerList.setEditTriggers(QtGui.QAbstractItemView.CurrentChanged|QtGui.QAbstractItemView.DoubleClicked|QtGui.QAbstractItemView.EditKeyPressed) | 86 | self.ServiceManagerList.setEditTriggers(QtGui.QAbstractItemView.CurrentChanged|QtGui.QAbstractItemView.DoubleClicked|QtGui.QAbstractItemView.EditKeyPressed) |
345 | 71 | self.ServiceManagerList.setDragDropMode(QtGui.QAbstractItemView.DragDrop) | 87 | self.ServiceManagerList.setDragDropMode(QtGui.QAbstractItemView.DragDrop) |
346 | 72 | self.ServiceManagerList.setAlternatingRowColors(True) | 88 | self.ServiceManagerList.setAlternatingRowColors(True) |
347 | 73 | 89 | ||
348 | === modified file 'openlp/core/ui/slidecontroller.py' | |||
349 | --- openlp/core/ui/slidecontroller.py 2009-06-23 16:25:40 +0000 | |||
350 | +++ openlp/core/ui/slidecontroller.py 2009-06-29 05:07:32 +0000 | |||
351 | @@ -122,20 +122,20 @@ | |||
352 | 122 | 122 | ||
353 | 123 | class SlideController(QtGui.QWidget): | 123 | class SlideController(QtGui.QWidget): |
354 | 124 | """ | 124 | """ |
356 | 125 | SlideController is THE slide controller widget. This widget is what the user | 125 | SlideController is the slide controller widget. This widget is what the user |
357 | 126 | uses to control the displaying of verses/slides/etc on the screen. | 126 | uses to control the displaying of verses/slides/etc on the screen. |
358 | 127 | """ | 127 | """ |
359 | 128 | global log | 128 | global log |
360 | 129 | log = logging.getLogger(u'SlideController') | 129 | log = logging.getLogger(u'SlideController') |
361 | 130 | 130 | ||
363 | 131 | def __init__(self, controlSplitter, parent, isLive=False): | 131 | def __init__(self, parent, isLive=False): |
364 | 132 | """ | 132 | """ |
365 | 133 | Set up the Slide Controller. | 133 | Set up the Slide Controller. |
366 | 134 | """ | 134 | """ |
367 | 135 | QtGui.QWidget.__init__(self, parent.mainWindow) | 135 | QtGui.QWidget.__init__(self, parent.mainWindow) |
368 | 136 | self.isLive = isLive | 136 | self.isLive = isLive |
369 | 137 | self.parent = parent | 137 | self.parent = parent |
371 | 138 | self.Panel = QtGui.QWidget(controlSplitter) | 138 | self.Panel = QtGui.QWidget(parent.ControlSplitter) |
372 | 139 | self.Splitter = QtGui.QSplitter(self.Panel) | 139 | self.Splitter = QtGui.QSplitter(self.Panel) |
373 | 140 | self.Splitter.setOrientation(QtCore.Qt.Vertical) | 140 | self.Splitter.setOrientation(QtCore.Qt.Vertical) |
374 | 141 | # Layout for holding panel | 141 | # Layout for holding panel |
375 | @@ -166,39 +166,17 @@ | |||
376 | 166 | self.PreviewListView.setSpacing(0) | 166 | self.PreviewListView.setSpacing(0) |
377 | 167 | self.PreviewListView.setObjectName(u'PreviewListView') | 167 | self.PreviewListView.setObjectName(u'PreviewListView') |
378 | 168 | self.ControllerLayout.addWidget(self.PreviewListView) | 168 | self.ControllerLayout.addWidget(self.PreviewListView) |
411 | 169 | # Controller toolbar | 169 | # Plugin the Base Toolbar class |
412 | 170 | self.Toolbar = OpenLPToolbar(self.Controller) | 170 | self.BaseToolbar = BaseToolbar(self.isLive) |
413 | 171 | sizeToolbarPolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, | 171 | self.Toolbar = self.BaseToolbar.getToolbar() |
382 | 172 | QtGui.QSizePolicy.Fixed) | ||
383 | 173 | sizeToolbarPolicy.setHorizontalStretch(0) | ||
384 | 174 | sizeToolbarPolicy.setVerticalStretch(0) | ||
385 | 175 | sizeToolbarPolicy.setHeightForWidth( | ||
386 | 176 | self.Toolbar.sizePolicy().hasHeightForWidth()) | ||
387 | 177 | if self.isLive: | ||
388 | 178 | self.Toolbar.addToolbarButton(u'First Slide', | ||
389 | 179 | u':/slides/slide_first.png', | ||
390 | 180 | translate(u'SlideController', u'Move to first'), | ||
391 | 181 | self.onSlideSelectedFirst) | ||
392 | 182 | self.Toolbar.addToolbarButton(u'Last Slide', | ||
393 | 183 | u':/slides/slide_previous.png', | ||
394 | 184 | translate(u'SlideController', u'Move to previous'), | ||
395 | 185 | self.onSlideSelectedPrevious) | ||
396 | 186 | self.Toolbar.addToolbarButton(u'First Slide', | ||
397 | 187 | u':/slides/slide_next.png', | ||
398 | 188 | translate(u'SlideController', u'Move to next'), | ||
399 | 189 | self.onSlideSelectedNext) | ||
400 | 190 | if self.isLive: | ||
401 | 191 | self.Toolbar.addToolbarButton(u'Last Slide', | ||
402 | 192 | u':/slides/slide_last.png', | ||
403 | 193 | translate(u'SlideController', u'Move to last'), | ||
404 | 194 | self.onSlideSelectedLast) | ||
405 | 195 | self.Toolbar.addSeparator() | ||
406 | 196 | self.Toolbar.addToolbarButton(u'Close Screen', | ||
407 | 197 | u':/slides/slide_close.png', | ||
408 | 198 | translate(u'SlideController', u'Close Screen'), | ||
409 | 199 | self.onBlankScreen) | ||
410 | 200 | self.Toolbar.setSizePolicy(sizeToolbarPolicy) | ||
414 | 201 | self.ControllerLayout.addWidget(self.Toolbar) | 172 | self.ControllerLayout.addWidget(self.Toolbar) |
415 | 173 | sizeToolbarPolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, | ||
416 | 174 | QtGui.QSizePolicy.Fixed) | ||
417 | 175 | sizeToolbarPolicy.setHorizontalStretch(0) | ||
418 | 176 | sizeToolbarPolicy.setVerticalStretch(0) | ||
419 | 177 | sizeToolbarPolicy.setHeightForWidth( | ||
420 | 178 | self.Toolbar.sizePolicy().hasHeightForWidth()) | ||
421 | 179 | self.Toolbar.setSizePolicy(sizeToolbarPolicy) | ||
422 | 202 | # Screen preview area | 180 | # Screen preview area |
423 | 203 | self.PreviewFrame = QtGui.QFrame(self.Splitter) | 181 | self.PreviewFrame = QtGui.QFrame(self.Splitter) |
424 | 204 | self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, 250, 190)) | 182 | self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, 250, 190)) |
425 | @@ -226,11 +204,69 @@ | |||
426 | 226 | self.SlidePreview.setScaledContents(True) | 204 | self.SlidePreview.setScaledContents(True) |
427 | 227 | self.SlidePreview.setObjectName(u'SlidePreview') | 205 | self.SlidePreview.setObjectName(u'SlidePreview') |
428 | 228 | self.grid.addWidget(self.SlidePreview, 0, 0, 1, 1) | 206 | self.grid.addWidget(self.SlidePreview, 0, 0, 1, 1) |
434 | 229 | # Some events | 207 | QtCore.QObject.connect(self.PreviewListView, |
435 | 230 | QtCore.QObject.connect(self.PreviewListView, | 208 | QtCore.SIGNAL(u'clicked(QModelIndex)'), self.BaseToolbar.onSlideSelected) |
436 | 231 | QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSlideSelected) | 209 | QtCore.QObject.connect(self.PreviewListView, |
437 | 232 | QtCore.QObject.connect(self.PreviewListView, | 210 | QtCore.SIGNAL(u'activated(QModelIndex)'), self.BaseToolbar.onSlideSelected) |
438 | 233 | QtCore.SIGNAL(u'activated(QModelIndex)'), self.onSlideSelected) | 211 | # Add Late Arrivals |
439 | 212 | self.BaseToolbar.PreviewListView = self.PreviewListView | ||
440 | 213 | self.BaseToolbar.PreviewListData = self.PreviewListData | ||
441 | 214 | self.BaseToolbar.SlidePreview = self.SlidePreview | ||
442 | 215 | self.BaseToolbar.mainDisplay = self.parent.mainDisplay | ||
443 | 216 | |||
444 | 217 | def addServiceItem(self, item): | ||
445 | 218 | self.BaseToolbar.addServiceItem(item) | ||
446 | 219 | |||
447 | 220 | def addServiceManagerItem(self, item, slideno): | ||
448 | 221 | self.BaseToolbar.addServiceManagerItem(item, slideno) | ||
449 | 222 | |||
450 | 223 | class BaseToolbar(object): | ||
451 | 224 | |||
452 | 225 | def __init__(self, isLive): | ||
453 | 226 | self.Toolbar = None | ||
454 | 227 | self.PreviewListView = QtGui.QListWidget() | ||
455 | 228 | self.PreviewListData = None | ||
456 | 229 | self.isLive = isLive | ||
457 | 230 | self.defineToolbar() | ||
458 | 231 | |||
459 | 232 | def getToolbar(self): | ||
460 | 233 | return self.Toolbar | ||
461 | 234 | |||
462 | 235 | def defineToolbar(self): | ||
463 | 236 | # Controller toolbar | ||
464 | 237 | #self.Toolbar = OpenLPToolbar(self.Controller) | ||
465 | 238 | self.Toolbar = OpenLPToolbar(self) | ||
466 | 239 | sizeToolbarPolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, | ||
467 | 240 | QtGui.QSizePolicy.Fixed) | ||
468 | 241 | sizeToolbarPolicy.setHorizontalStretch(0) | ||
469 | 242 | sizeToolbarPolicy.setVerticalStretch(0) | ||
470 | 243 | sizeToolbarPolicy.setHeightForWidth( | ||
471 | 244 | self.Toolbar.sizePolicy().hasHeightForWidth()) | ||
472 | 245 | self.Toolbar.setSizePolicy(sizeToolbarPolicy) | ||
473 | 246 | |||
474 | 247 | if self.isLive: | ||
475 | 248 | self.Toolbar.addToolbarButton(u'First Slide', | ||
476 | 249 | u':/slides/slide_first.png', | ||
477 | 250 | translate(u'SlideController', u'Move to first'), | ||
478 | 251 | self.onSlideSelectedFirst) | ||
479 | 252 | self.Toolbar.addToolbarButton(u'Last Slide', | ||
480 | 253 | u':/slides/slide_previous.png', | ||
481 | 254 | translate(u'SlideController', u'Move to previous'), | ||
482 | 255 | self.onSlideSelectedPrevious) | ||
483 | 256 | self.Toolbar.addToolbarButton(u'First Slide', | ||
484 | 257 | u':/slides/slide_next.png', | ||
485 | 258 | translate(u'SlideController', u'Move to next'), | ||
486 | 259 | self.onSlideSelectedNext) | ||
487 | 260 | if self.isLive: | ||
488 | 261 | self.Toolbar.addToolbarButton(u'Last Slide', | ||
489 | 262 | u':/slides/slide_last.png', | ||
490 | 263 | translate(u'SlideController', u'Move to last'), | ||
491 | 264 | self.onSlideSelectedLast) | ||
492 | 265 | self.Toolbar.addSeparator() | ||
493 | 266 | self.Toolbar.addToolbarButton(u'Close Screen', | ||
494 | 267 | u':/slides/slide_close.png', | ||
495 | 268 | translate(u'SlideController', u'Close Screen'), | ||
496 | 269 | self.onBlankScreen) | ||
497 | 234 | 270 | ||
498 | 235 | def onSlideSelectedFirst(self): | 271 | def onSlideSelectedFirst(self): |
499 | 236 | """ | 272 | """ |
500 | @@ -308,7 +344,7 @@ | |||
501 | 308 | if self.isLive: | 344 | if self.isLive: |
502 | 309 | no = frame[1] | 345 | no = frame[1] |
503 | 310 | LiveFrame = self.serviceitem.frames[no][u'image'] | 346 | LiveFrame = self.serviceitem.frames[no][u'image'] |
505 | 311 | self.parent.mainDisplay.frameView(LiveFrame) | 347 | self.mainDisplay.frameView(LiveFrame) |
506 | 312 | 348 | ||
507 | 313 | def addServiceItem(self, serviceitem): | 349 | def addServiceItem(self, serviceitem): |
508 | 314 | """ | 350 | """ |
509 | 315 | 351 | ||
510 | === added file 'openlp/core/ui/slidecontrollermanager.py' | |||
511 | --- openlp/core/ui/slidecontrollermanager.py 1970-01-01 00:00:00 +0000 | |||
512 | +++ openlp/core/ui/slidecontrollermanager.py 2009-06-28 06:54:12 +0000 | |||
513 | @@ -0,0 +1,52 @@ | |||
514 | 1 | # -*- coding: utf-8 -*- | ||
515 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | ||
516 | 3 | """ | ||
517 | 4 | OpenLP - Open Source Lyrics Projection | ||
518 | 5 | Copyright (c) 2008 Raoul Snyman | ||
519 | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, | ||
520 | 7 | |||
521 | 8 | This program is free software; you can redistribute it and/or modify it under | ||
522 | 9 | the terms of the GNU General Public License as published by the Free Software | ||
523 | 10 | Foundation; version 2 of the License. | ||
524 | 11 | |||
525 | 12 | This program is distributed in the hope that it will be useful, but WITHOUT ANY | ||
526 | 13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
527 | 14 | PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
528 | 15 | |||
529 | 16 | You should have received a copy of the GNU General Public License along with | ||
530 | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
531 | 18 | Place, Suite 330, Boston, MA 02111-1307 USA | ||
532 | 19 | """ | ||
533 | 20 | import logging | ||
534 | 21 | import os | ||
535 | 22 | |||
536 | 23 | class SlideControllerManager(): | ||
537 | 24 | """ | ||
538 | 25 | This class controls which SlideController is availabe to the | ||
539 | 26 | main window | ||
540 | 27 | """ | ||
541 | 28 | global log | ||
542 | 29 | log = logging.getLogger(u'SlideControllerManager') | ||
543 | 30 | |||
544 | 31 | def __init__(self, parent): | ||
545 | 32 | """ | ||
546 | 33 | Set up the Slide Controller. Manager | ||
547 | 34 | """ | ||
548 | 35 | self.parent = parent | ||
549 | 36 | self.live = {} | ||
550 | 37 | self.preview = {} | ||
551 | 38 | |||
552 | 39 | def add_controllers(self, handle, preview, live): | ||
553 | 40 | self.live[handle] = live | ||
554 | 41 | self.preview[handle] = preview | ||
555 | 42 | print self.live | ||
556 | 43 | |||
557 | 44 | def getPreviewController(self, handle): | ||
558 | 45 | return self.preview[handle] | ||
559 | 46 | |||
560 | 47 | def getLiveController(self, handle): | ||
561 | 48 | print "---" | ||
562 | 49 | print self.live | ||
563 | 50 | print handle | ||
564 | 51 | print self.live[handle] | ||
565 | 52 | return self.live[handle] | ||
566 | 0 | 53 | ||
567 | === modified file 'openlp/core/ui/thememanager.py' | |||
568 | --- openlp/core/ui/thememanager.py 2009-06-24 05:17:41 +0000 | |||
569 | +++ openlp/core/ui/thememanager.py 2009-06-29 05:07:32 +0000 | |||
570 | @@ -175,30 +175,33 @@ | |||
571 | 175 | 175 | ||
572 | 176 | def onEditTheme(self): | 176 | def onEditTheme(self): |
573 | 177 | items = self.ThemeListView.selectedIndexes() | 177 | items = self.ThemeListView.selectedIndexes() |
578 | 178 | for item in items: | 178 | if len(items) > 0: |
579 | 179 | data = self.themeData.getValue(item) | 179 | for item in items: |
580 | 180 | self.amendThemeForm.loadTheme(data[3]) | 180 | print item |
581 | 181 | self.amendThemeForm.exec_() | 181 | data = self.themeData.getValue(item) |
582 | 182 | self.amendThemeForm.loadTheme(data[3]) | ||
583 | 183 | self.amendThemeForm.exec_() | ||
584 | 182 | 184 | ||
585 | 183 | def onDeleteTheme(self): | 185 | def onDeleteTheme(self): |
586 | 184 | items = self.ThemeListView.selectedIndexes() | 186 | items = self.ThemeListView.selectedIndexes() |
604 | 185 | theme = u'' | 187 | if len(items) > 0: |
605 | 186 | for item in items: | 188 | theme = u'' |
606 | 187 | data = self.themeData.getValue(item) | 189 | for item in items: |
607 | 188 | theme = data[3] | 190 | data = self.themeData.getValue(item) |
608 | 189 | th = theme + u'.png' | 191 | theme = data[3] |
609 | 190 | try: | 192 | th = theme + u'.png' |
610 | 191 | os.remove(os.path.join(self.path, th)) | 193 | try: |
611 | 192 | except: | 194 | os.remove(os.path.join(self.path, th)) |
612 | 193 | #if not present do not worry | 195 | except: |
613 | 194 | pass | 196 | #if not present do not worry |
614 | 195 | try: | 197 | pass |
615 | 196 | shutil.rmtree(os.path.join(self.path, theme)) | 198 | try: |
616 | 197 | except: | 199 | shutil.rmtree(os.path.join(self.path, theme)) |
617 | 198 | #if not present do not worry | 200 | except: |
618 | 199 | pass | 201 | #if not present do not worry |
619 | 200 | self.themeData.clearItems() | 202 | pass |
620 | 201 | self.loadThemes() | 203 | self.themeData.clearItems() |
621 | 204 | self.loadThemes() | ||
622 | 202 | 205 | ||
623 | 203 | def onExportTheme(self): | 206 | def onExportTheme(self): |
624 | 204 | pass | 207 | pass |
625 | 205 | 208 | ||
626 | === modified file 'openlp/plugins/bibles/lib/mediaitem.py' | |||
627 | --- openlp/plugins/bibles/lib/mediaitem.py 2009-06-26 17:51:43 +0000 | |||
628 | +++ openlp/plugins/bibles/lib/mediaitem.py 2009-06-29 05:07:32 +0000 | |||
629 | @@ -57,8 +57,6 @@ | |||
630 | 57 | self.TranslationContext = u'BiblePlugin' | 57 | self.TranslationContext = u'BiblePlugin' |
631 | 58 | self.PluginTextShort = u'Bible' | 58 | self.PluginTextShort = u'Bible' |
632 | 59 | self.ConfigSection = u'bibles' | 59 | self.ConfigSection = u'bibles' |
633 | 60 | # self.OnNewPrompt = u'Select Image(s)' | ||
634 | 61 | # self.OnNewFileMasks = u'Images (*.jpg *jpeg *.gif *.png *.bmp)' | ||
635 | 62 | MediaManagerItem.__init__(self, parent, icon, title) | 60 | MediaManagerItem.__init__(self, parent, icon, title) |
636 | 63 | self.search_results = {} # place to store the search results | 61 | self.search_results = {} # place to store the search results |
637 | 64 | QtCore.QObject.connect(Receiver().get_receiver(), | 62 | QtCore.QObject.connect(Receiver().get_receiver(), |
638 | @@ -192,11 +190,11 @@ | |||
639 | 192 | self.SearchTabWidget.addTab(self.AdvancedTab, u'Advanced') | 190 | self.SearchTabWidget.addTab(self.AdvancedTab, u'Advanced') |
640 | 193 | # Add the search tab widget to the page layout | 191 | # Add the search tab widget to the page layout |
641 | 194 | self.PageLayout.addWidget(self.SearchTabWidget) | 192 | self.PageLayout.addWidget(self.SearchTabWidget) |
647 | 195 | self.BibleListWidget = BibleList() | 193 | self.ListView = BibleList() |
648 | 196 | self.BibleListWidget.setAlternatingRowColors(True) | 194 | self.ListView.setAlternatingRowColors(True) |
649 | 197 | self.BibleListWidget.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) | 195 | self.ListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) |
650 | 198 | self.BibleListWidget.setDragEnabled(True) | 196 | self.ListView.setDragEnabled(True) |
651 | 199 | self.PageLayout.addWidget(self.BibleListWidget) | 197 | self.PageLayout.addWidget(self.ListView) |
652 | 200 | # Combo Boxes | 198 | # Combo Boxes |
653 | 201 | QtCore.QObject.connect(self.AdvancedVersionComboBox, | 199 | QtCore.QObject.connect(self.AdvancedVersionComboBox, |
654 | 202 | QtCore.SIGNAL(u'activated(int)'), self.onAdvancedVersionComboBox) | 200 | QtCore.SIGNAL(u'activated(int)'), self.onAdvancedVersionComboBox) |
655 | @@ -213,18 +211,18 @@ | |||
656 | 213 | QtCore.SIGNAL(u'pressed()'), self.onAdvancedSearchButton) | 211 | QtCore.SIGNAL(u'pressed()'), self.onAdvancedSearchButton) |
657 | 214 | QtCore.QObject.connect(self.QuickSearchButton, | 212 | QtCore.QObject.connect(self.QuickSearchButton, |
658 | 215 | QtCore.SIGNAL(u'pressed()'), self.onQuickSearchButton) | 213 | QtCore.SIGNAL(u'pressed()'), self.onQuickSearchButton) |
660 | 216 | QtCore.QObject.connect(self.BibleListWidget, | 214 | QtCore.QObject.connect(self.ListView, |
661 | 217 | QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onPreviewClick) | 215 | QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onPreviewClick) |
662 | 218 | # Context Menus | 216 | # Context Menus |
666 | 219 | self.BibleListWidget.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) | 217 | self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) |
667 | 220 | self.BibleListWidget.addAction(self.contextMenuAction( | 218 | self.ListView.addAction(self.contextMenuAction( |
668 | 221 | self.BibleListWidget, u':/system/system_preview.png', | 219 | self.ListView, u':/system/system_preview.png', |
669 | 222 | translate(u'BibleMediaItem',u'&Preview Verse'), self.onPreviewClick)) | 220 | translate(u'BibleMediaItem',u'&Preview Verse'), self.onPreviewClick)) |
672 | 223 | self.BibleListWidget.addAction(self.contextMenuAction( | 221 | self.ListView.addAction(self.contextMenuAction( |
673 | 224 | self.BibleListWidget, u':/system/system_live.png', | 222 | self.ListView, u':/system/system_live.png', |
674 | 225 | translate(u'BibleMediaItem',u'&Show Live'), self.onLiveClick)) | 223 | translate(u'BibleMediaItem',u'&Show Live'), self.onLiveClick)) |
677 | 226 | self.BibleListWidget.addAction(self.contextMenuAction( | 224 | self.ListView.addAction(self.contextMenuAction( |
678 | 227 | self.BibleListWidget, u':/system/system_add.png', | 225 | self.ListView, u':/system/system_add.png', |
679 | 228 | translate(u'BibleMediaItem',u'&Add to Service'), self.onAddClick)) | 226 | translate(u'BibleMediaItem',u'&Add to Service'), self.onAddClick)) |
680 | 229 | 227 | ||
681 | 230 | def retranslateUi(self): | 228 | def retranslateUi(self): |
682 | @@ -309,7 +307,7 @@ | |||
683 | 309 | self.search_results = self.parent.biblemanager.get_verse_text(bible, book, | 307 | self.search_results = self.parent.biblemanager.get_verse_text(bible, book, |
684 | 310 | chapter_from, chapter_to, verse_from, verse_to) | 308 | chapter_from, chapter_to, verse_from, verse_to) |
685 | 311 | if self.ClearAdvancedSearchComboBox.currentIndex() == 0: | 309 | if self.ClearAdvancedSearchComboBox.currentIndex() == 0: |
687 | 312 | self.BibleListWidget.clear() | 310 | self.ListView.clear() |
688 | 313 | self.displayResults(bible) | 311 | self.displayResults(bible) |
689 | 314 | 312 | ||
690 | 315 | def onAdvancedFromChapter(self): | 313 | def onAdvancedFromChapter(self): |
691 | @@ -327,7 +325,7 @@ | |||
692 | 327 | bible = unicode(self.QuickVersionComboBox.currentText()) | 325 | bible = unicode(self.QuickVersionComboBox.currentText()) |
693 | 328 | text = unicode(self.QuickSearchEdit.displayText()) | 326 | text = unicode(self.QuickSearchEdit.displayText()) |
694 | 329 | if self.ClearQuickSearchComboBox.currentIndex() == 0: | 327 | if self.ClearQuickSearchComboBox.currentIndex() == 0: |
696 | 330 | self.BibleListWidget.clear() | 328 | self.ListView.clear() |
697 | 331 | if self.QuickSearchComboBox.currentIndex() == 1: | 329 | if self.QuickSearchComboBox.currentIndex() == 1: |
698 | 332 | self.search_results = self.parent.biblemanager.get_verse_from_text(bible, text) | 330 | self.search_results = self.parent.biblemanager.get_verse_from_text(bible, text) |
699 | 333 | else: | 331 | else: |
700 | @@ -335,33 +333,15 @@ | |||
701 | 335 | if self.search_results is not None: | 333 | if self.search_results is not None: |
702 | 336 | self.displayResults(bible) | 334 | self.displayResults(bible) |
703 | 337 | 335 | ||
704 | 338 | # def onLiveClick(self): | ||
705 | 339 | # service_item = ServiceItem(self.parent) | ||
706 | 340 | # service_item.addIcon( u':/media/media_verse.png') | ||
707 | 341 | # self.generateSlideData(service_item) | ||
708 | 342 | # self.parent.live_controller.addServiceItem(service_item) | ||
709 | 343 | # | ||
710 | 344 | # def onAddClick(self): | ||
711 | 345 | # service_item = ServiceItem(self.parent) | ||
712 | 346 | # service_item.addIcon(u':/media/media_verse.png') | ||
713 | 347 | # self.generateSlideData(service_item) | ||
714 | 348 | # self.parent.service_manager.addServiceItem(service_item) | ||
715 | 349 | # | ||
716 | 350 | # def onPreviewClick(self): | ||
717 | 351 | # service_item = ServiceItem(self.parent) | ||
718 | 352 | # service_item.addIcon(u':/media/media_verse.png') | ||
719 | 353 | # self.generateSlideData(service_item) | ||
720 | 354 | # self.parent.preview_controller.addServiceItem(service_item) | ||
721 | 355 | |||
722 | 356 | def generateSlideData(self, service_item): | 336 | def generateSlideData(self, service_item): |
723 | 357 | log.debug(u'generating slide data') | 337 | log.debug(u'generating slide data') |
725 | 358 | items = self.BibleListWidget.selectedIndexes() | 338 | items = self.ListView.selectedIndexes() |
726 | 359 | old_chapter = u'' | 339 | old_chapter = u'' |
727 | 360 | raw_slides=[] | 340 | raw_slides=[] |
728 | 361 | raw_footer = [] | 341 | raw_footer = [] |
729 | 362 | bible_text = u'' | 342 | bible_text = u'' |
730 | 363 | for item in items: | 343 | for item in items: |
732 | 364 | bitem = self.BibleListWidget.item(item.row()) | 344 | bitem = self.ListView.item(item.row()) |
733 | 365 | text = unicode((bitem.data(QtCore.Qt.UserRole)).toString()) | 345 | text = unicode((bitem.data(QtCore.Qt.UserRole)).toString()) |
734 | 366 | verse = text[:text.find(u'(')] | 346 | verse = text[:text.find(u'(')] |
735 | 367 | bible = text[text.find(u'(') + 1:text.find(u')')] | 347 | bible = text[text.find(u'(') + 1:text.find(u')')] |
736 | @@ -440,7 +420,7 @@ | |||
737 | 440 | bible_text = unicode(u' %s %d:%d (%s)'%(book , chap,vse, bible)) | 420 | bible_text = unicode(u' %s %d:%d (%s)'%(book , chap,vse, bible)) |
738 | 441 | bible_verse = QtGui.QListWidgetItem(bible_text) | 421 | bible_verse = QtGui.QListWidgetItem(bible_text) |
739 | 442 | bible_verse.setData(QtCore.Qt.UserRole, QtCore.QVariant(bible_text)) | 422 | bible_verse.setData(QtCore.Qt.UserRole, QtCore.QVariant(bible_text)) |
741 | 443 | self.BibleListWidget.addItem(bible_verse) | 423 | self.ListView.addItem(bible_verse) |
742 | 444 | 424 | ||
743 | 445 | def searchByReference(self, bible, search): | 425 | def searchByReference(self, bible, search): |
744 | 446 | log.debug(u'searchByReference %s ,%s', bible, search) | 426 | log.debug(u'searchByReference %s ,%s', bible, search) |
745 | 447 | 427 | ||
746 | === modified file 'openlp/plugins/custom/lib/mediaitem.py' | |||
747 | --- openlp/plugins/custom/lib/mediaitem.py 2009-06-26 18:54:05 +0000 | |||
748 | +++ openlp/plugins/custom/lib/mediaitem.py 2009-06-27 19:55:55 +0000 | |||
749 | @@ -105,38 +105,38 @@ | |||
750 | 105 | self.CustomWidget.setObjectName(u'CustomWidget') | 105 | self.CustomWidget.setObjectName(u'CustomWidget') |
751 | 106 | # Add the Custom widget to the page layout | 106 | # Add the Custom widget to the page layout |
752 | 107 | self.PageLayout.addWidget(self.CustomWidget) | 107 | self.PageLayout.addWidget(self.CustomWidget) |
757 | 108 | self.CustomListWidget = CustomList() | 108 | self.ListView = CustomList() |
758 | 109 | self.CustomListWidget.setAlternatingRowColors(True) | 109 | self.ListView.setAlternatingRowColors(True) |
759 | 110 | self.CustomListWidget.setDragEnabled(True) | 110 | self.ListView.setDragEnabled(True) |
760 | 111 | self.PageLayout.addWidget(self.CustomListWidget) | 111 | self.PageLayout.addWidget(self.ListView) |
761 | 112 | # Signals | 112 | # Signals |
763 | 113 | QtCore.QObject.connect(self.CustomListWidget, | 113 | QtCore.QObject.connect(self.ListView, |
764 | 114 | QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onCustomPreviewClick) | 114 | QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onCustomPreviewClick) |
765 | 115 | #define and add the context menu | 115 | #define and add the context menu |
768 | 116 | self.CustomListWidget.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) | 116 | self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) |
769 | 117 | self.CustomListWidget.addAction(self.contextMenuAction(self.CustomListWidget, | 117 | self.ListView.addAction(self.contextMenuAction(self.ListView, |
770 | 118 | ':/custom/custom_edit.png', translate(u'CustomMediaItem', u'&Edit Custom'), | 118 | ':/custom/custom_edit.png', translate(u'CustomMediaItem', u'&Edit Custom'), |
771 | 119 | self.onCustomEditClick)) | 119 | self.onCustomEditClick)) |
775 | 120 | self.CustomListWidget.addAction(self.contextMenuSeparator(self.CustomListWidget)) | 120 | self.ListView.addAction(self.contextMenuSeparator(self.ListView)) |
776 | 121 | self.CustomListWidget.addAction(self.contextMenuAction( | 121 | self.ListView.addAction(self.contextMenuAction( |
777 | 122 | self.CustomListWidget, ':/system/system_preview.png', | 122 | self.ListView, ':/system/system_preview.png', |
778 | 123 | translate(u'CustomMediaItem',u'&Preview Custom'), self.onCustomPreviewClick)) | 123 | translate(u'CustomMediaItem',u'&Preview Custom'), self.onCustomPreviewClick)) |
781 | 124 | self.CustomListWidget.addAction(self.contextMenuAction( | 124 | self.ListView.addAction(self.contextMenuAction( |
782 | 125 | self.CustomListWidget, ':/system/system_live.png', | 125 | self.ListView, ':/system/system_live.png', |
783 | 126 | translate(u'CustomMediaItem',u'&Show Live'), self.onCustomLiveClick)) | 126 | translate(u'CustomMediaItem',u'&Show Live'), self.onCustomLiveClick)) |
786 | 127 | self.CustomListWidget.addAction(self.contextMenuAction( | 127 | self.ListView.addAction(self.contextMenuAction( |
787 | 128 | self.CustomListWidget, ':/system/system_add.png', | 128 | self.ListView, ':/system/system_add.png', |
788 | 129 | translate(u'CustomMediaItem',u'&Add to Service'), self.onCustomAddClick)) | 129 | translate(u'CustomMediaItem',u'&Add to Service'), self.onCustomAddClick)) |
789 | 130 | 130 | ||
790 | 131 | def initialise(self): | 131 | def initialise(self): |
791 | 132 | self.loadCustomList(self.parent.custommanager.get_all_slides()) | 132 | self.loadCustomList(self.parent.custommanager.get_all_slides()) |
792 | 133 | 133 | ||
793 | 134 | def loadCustomList(self, list): | 134 | def loadCustomList(self, list): |
795 | 135 | self.CustomListWidget.clear() | 135 | self.ListView.clear() |
796 | 136 | for CustomSlide in list: | 136 | for CustomSlide in list: |
797 | 137 | custom_name = QtGui.QListWidgetItem(CustomSlide.title) | 137 | custom_name = QtGui.QListWidgetItem(CustomSlide.title) |
798 | 138 | custom_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(CustomSlide.id)) | 138 | custom_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(CustomSlide.id)) |
800 | 139 | self.CustomListWidget.addItem(custom_name) | 139 | self.ListView.addItem(custom_name) |
801 | 140 | 140 | ||
802 | 141 | def onCustomNewClick(self): | 141 | def onCustomNewClick(self): |
803 | 142 | self.parent.edit_custom_form.loadCustom(0) | 142 | self.parent.edit_custom_form.loadCustom(0) |
804 | @@ -144,8 +144,7 @@ | |||
805 | 144 | self.initialise() | 144 | self.initialise() |
806 | 145 | 145 | ||
807 | 146 | def onCustomEditClick(self): | 146 | def onCustomEditClick(self): |
810 | 147 | item = self.CustomListWidget.currentItem() | 147 | item = self.ListView.currentItem() |
809 | 148 | item = self.CustomListWidget.currentItem() | ||
811 | 149 | if item is not None: | 148 | if item is not None: |
812 | 150 | item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] | 149 | item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] |
813 | 151 | self.parent.edit_custom_form.loadCustom(item_id) | 150 | self.parent.edit_custom_form.loadCustom(item_id) |
814 | @@ -153,12 +152,12 @@ | |||
815 | 153 | self.initialise() | 152 | self.initialise() |
816 | 154 | 153 | ||
817 | 155 | def onCustomDeleteClick(self): | 154 | def onCustomDeleteClick(self): |
819 | 156 | item = self.CustomListWidget.currentItem() | 155 | item = self.ListView.currentItem() |
820 | 157 | if item is not None: | 156 | if item is not None: |
821 | 158 | item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] | 157 | item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] |
822 | 159 | self.parent.custommanager.delete_custom(item_id) | 158 | self.parent.custommanager.delete_custom(item_id) |
825 | 160 | row = self.CustomListWidget.row(item) | 159 | row = self.ListView.row(item) |
826 | 161 | self.CustomListWidget.takeItem(row) | 160 | self.ListView.takeItem(row) |
827 | 162 | 161 | ||
828 | 163 | def onCustomPreviewClick(self): | 162 | def onCustomPreviewClick(self): |
829 | 164 | log.debug(u'Custom Preview Requested') | 163 | log.debug(u'Custom Preview Requested') |
830 | @@ -186,7 +185,7 @@ | |||
831 | 186 | raw_footer = [] | 185 | raw_footer = [] |
832 | 187 | slide = None | 186 | slide = None |
833 | 188 | theme = None | 187 | theme = None |
835 | 189 | item = self.CustomListWidget.currentItem() | 188 | item = self.ListView.currentItem() |
836 | 190 | item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] | 189 | item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] |
837 | 191 | customSlide = self.parent.custommanager.get_custom(item_id) | 190 | customSlide = self.parent.custommanager.get_custom(item_id) |
838 | 192 | title = customSlide.title | 191 | title = customSlide.title |
839 | 193 | 192 | ||
840 | === modified file 'openlp/plugins/images/imageplugin.py' | |||
841 | --- openlp/plugins/images/imageplugin.py 2009-06-26 17:51:43 +0000 | |||
842 | +++ openlp/plugins/images/imageplugin.py 2009-06-27 15:33:03 +0000 | |||
843 | @@ -47,4 +47,3 @@ | |||
844 | 47 | 47 | ||
845 | 48 | def initialise(self): | 48 | def initialise(self): |
846 | 49 | log.info(u'Plugin Initialising') | 49 | log.info(u'Plugin Initialising') |
847 | 50 | |||
848 | 51 | 50 | ||
849 | === modified file 'openlp/plugins/images/lib/__init__.py' | |||
850 | --- openlp/plugins/images/lib/__init__.py 2009-06-23 20:53:06 +0000 | |||
851 | +++ openlp/plugins/images/lib/__init__.py 2009-06-29 05:07:32 +0000 | |||
852 | @@ -17,6 +17,5 @@ | |||
853 | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
854 | 18 | Place, Suite 330, Boston, MA 02111-1307 USA | 18 | Place, Suite 330, Boston, MA 02111-1307 USA |
855 | 19 | """ | 19 | """ |
856 | 20 | |||
857 | 21 | from listwithpreviews import ListWithPreviews | ||
858 | 22 | from mediaitem import ImageMediaItem | 20 | from mediaitem import ImageMediaItem |
859 | 21 | from imageslidecontroller import ImageToolbar | ||
860 | 23 | 22 | ||
861 | === added file 'openlp/plugins/images/lib/imageslidecontroller.py' | |||
862 | --- openlp/plugins/images/lib/imageslidecontroller.py 1970-01-01 00:00:00 +0000 | |||
863 | +++ openlp/plugins/images/lib/imageslidecontroller.py 2009-06-29 05:07:32 +0000 | |||
864 | @@ -0,0 +1,103 @@ | |||
865 | 1 | # -*- coding: utf-8 -*- | ||
866 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | ||
867 | 3 | """ | ||
868 | 4 | OpenLP - Open Source Lyrics Projection | ||
869 | 5 | Copyright (c) 2008 Raoul Snyman | ||
870 | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, | ||
871 | 7 | |||
872 | 8 | This program is free software; you can redistribute it and/or modify it under | ||
873 | 9 | the terms of the GNU General Public License as published by the Free Software | ||
874 | 10 | Foundation; version 2 of the License. | ||
875 | 11 | |||
876 | 12 | This program is distributed in the hope that it will be useful, but WITHOUT ANY | ||
877 | 13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
878 | 14 | PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
879 | 15 | |||
880 | 16 | You should have received a copy of the GNU General Public License along with | ||
881 | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
882 | 18 | Place, Suite 330, Boston, MA 02111-1307 USA | ||
883 | 19 | """ | ||
884 | 20 | import logging | ||
885 | 21 | import os | ||
886 | 22 | |||
887 | 23 | from PyQt4 import QtCore, QtGui | ||
888 | 24 | from openlp.core.lib import OpenLPToolbar, translate | ||
889 | 25 | from openlp.core.ui.slidecontroller import BaseToolbar | ||
890 | 26 | |||
891 | 27 | class ImageToolbar(BaseToolbar): | ||
892 | 28 | |||
893 | 29 | def __init__(self, isLive): | ||
894 | 30 | self.Toolbar = None | ||
895 | 31 | self.PreviewListView = QtGui.QListWidget() | ||
896 | 32 | self.PreviewListData = None | ||
897 | 33 | self.isLive = isLive | ||
898 | 34 | self.defineToolbar() | ||
899 | 35 | |||
900 | 36 | def getToolbar(self): | ||
901 | 37 | return self.Toolbar | ||
902 | 38 | |||
903 | 39 | def defineToolbar(self): | ||
904 | 40 | # Controller toolbar | ||
905 | 41 | #self.Toolbar = OpenLPToolbar(self.Controller) | ||
906 | 42 | sizeToolbarPolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, | ||
907 | 43 | QtGui.QSizePolicy.Fixed) | ||
908 | 44 | sizeToolbarPolicy.setHorizontalStretch(0) | ||
909 | 45 | sizeToolbarPolicy.setVerticalStretch(0) | ||
910 | 46 | sizeToolbarPolicy.setHeightForWidth( | ||
911 | 47 | self.Toolbar.sizePolicy().hasHeightForWidth()) | ||
912 | 48 | if self.isLive: | ||
913 | 49 | self.Toolbar.addToolbarButton(u'First Slide', | ||
914 | 50 | u':/slides/slide_first.png', | ||
915 | 51 | translate(u'SlideController', u'Move to first'), | ||
916 | 52 | self.onSlideSelectedFirst) | ||
917 | 53 | self.Toolbar.addToolbarButton(u'Last Slide', | ||
918 | 54 | u':/slides/slide_previous.png', | ||
919 | 55 | translate(u'SlideController', u'Move to previous'), | ||
920 | 56 | self.onSlideSelectedPrevious) | ||
921 | 57 | self.Toolbar.addToolbarButton(u'First Slide', | ||
922 | 58 | u':/slides/slide_next.png', | ||
923 | 59 | translate(u'SlideController', u'Move to next'), | ||
924 | 60 | self.onSlideSelectedNext) | ||
925 | 61 | if self.isLive: | ||
926 | 62 | self.Toolbar.addToolbarButton(u'Last Slide', | ||
927 | 63 | u':/slides/slide_last.png', | ||
928 | 64 | translate(u'SlideController', u'Move to last'), | ||
929 | 65 | self.onSlideSelectedLast) | ||
930 | 66 | self.Toolbar.addSeparator() | ||
931 | 67 | self.Toolbar.addToolbarButton(u'Close Screen', | ||
932 | 68 | u':/slides/slide_close.png', | ||
933 | 69 | translate(u'SlideController', u'Close Screen'), | ||
934 | 70 | self.onBlankScreen) | ||
935 | 71 | self.Toolbar.addSeparator() | ||
936 | 72 | self.Toolbar.addToolbarButton(u'Start Loop', | ||
937 | 73 | u':/slides/slide_last.png', | ||
938 | 74 | translate(u'SlideController', u'Start continuous loop'), | ||
939 | 75 | self.onStartLoop) | ||
940 | 76 | self.Toolbar.addToolbarButton(u'Stop Loop', | ||
941 | 77 | u':/slides/slide_last.png', | ||
942 | 78 | translate(u'SlideController', u'Start continuous loop'), | ||
943 | 79 | self.onStopLoop) | ||
944 | 80 | self.Toolbar.setSizePolicy(sizeToolbarPolicy) | ||
945 | 81 | self.ControllerLayout.addWidget(self.Toolbar) | ||
946 | 82 | |||
947 | 83 | def onStartLoop(self): | ||
948 | 84 | """ | ||
949 | 85 | Go to the last slide. | ||
950 | 86 | """ | ||
951 | 87 | row = self.PreviewListData.createIndex( | ||
952 | 88 | self.PreviewListData.rowCount() - 1, 0) | ||
953 | 89 | if row.isValid(): | ||
954 | 90 | self.PreviewListView.selectionModel().setCurrentIndex(row, | ||
955 | 91 | QtGui.QItemSelectionModel.SelectCurrent) | ||
956 | 92 | self.onSlideSelected(row) | ||
957 | 93 | |||
958 | 94 | def onStopLoop(self): | ||
959 | 95 | """ | ||
960 | 96 | Go to the last slide. | ||
961 | 97 | """ | ||
962 | 98 | row = self.PreviewListData.createIndex( | ||
963 | 99 | self.PreviewListData.rowCount() - 1, 0) | ||
964 | 100 | if row.isValid(): | ||
965 | 101 | self.PreviewListView.selectionModel().setCurrentIndex(row, | ||
966 | 102 | QtGui.QItemSelectionModel.SelectCurrent) | ||
967 | 103 | self.onSlideSelected(row) | ||
968 | 0 | 104 | ||
969 | === modified file 'openlp/plugins/images/lib/mediaitem.py' | |||
970 | --- openlp/plugins/images/lib/mediaitem.py 2009-06-26 16:39:16 +0000 | |||
971 | +++ openlp/plugins/images/lib/mediaitem.py 2009-06-29 05:13:06 +0000 | |||
972 | @@ -21,10 +21,8 @@ | |||
973 | 21 | import os | 21 | import os |
974 | 22 | 22 | ||
975 | 23 | from PyQt4 import QtCore, QtGui | 23 | from PyQt4 import QtCore, QtGui |
980 | 24 | 24 | from openlp.core.lib import MediaManagerItem, ServiceItem, translate, BaseListWithDnD, buildIcon | |
981 | 25 | # from openlp.plugins.images.lib import ListWithPreviews | 25 | from openlp.plugins.images.lib.imageslidecontroller import ImageToolbar |
978 | 26 | from listwithpreviews import ListWithPreviews | ||
979 | 27 | from openlp.core.lib import MediaManagerItem, ServiceItem, translate, BaseListWithDnD | ||
982 | 28 | 26 | ||
983 | 29 | # We have to explicitly create separate classes for each plugin | 27 | # We have to explicitly create separate classes for each plugin |
984 | 30 | # in order for DnD to the Service manager to work correctly. | 28 | # in order for DnD to the Service manager to work correctly. |
985 | @@ -45,19 +43,50 @@ | |||
986 | 45 | self.TranslationContext = u'ImagePlugin' | 43 | self.TranslationContext = u'ImagePlugin' |
987 | 46 | self.PluginTextShort = u'Image' | 44 | self.PluginTextShort = u'Image' |
988 | 47 | self.ConfigSection = u'images' | 45 | self.ConfigSection = u'images' |
989 | 46 | self.IconPath = u'images/image' | ||
990 | 47 | self.hasFileIcon = True | ||
991 | 48 | self.hasNewIcon = False | ||
992 | 49 | self.hasEditIcon = False | ||
993 | 48 | self.OnNewPrompt = u'Select Image(s)' | 50 | self.OnNewPrompt = u'Select Image(s)' |
994 | 49 | self.OnNewFileMasks = u'Images (*.jpg *jpeg *.gif *.png *.bmp)' | 51 | self.OnNewFileMasks = u'Images (*.jpg *jpeg *.gif *.png *.bmp)' |
995 | 52 | self.slidecontroller = u'image' | ||
996 | 50 | # this next is a class, not an instance of a class - it will | 53 | # this next is a class, not an instance of a class - it will |
997 | 51 | # be instanced by the base MediaManagerItem | 54 | # be instanced by the base MediaManagerItem |
998 | 52 | self.ListViewWithDnD_class = ImageListView | 55 | self.ListViewWithDnD_class = ImageListView |
999 | 53 | MediaManagerItem.__init__(self, parent, icon, title) | 56 | MediaManagerItem.__init__(self, parent, icon, title) |
1000 | 57 | #create and install our own slide controllers | ||
1001 | 58 | #a=c | ||
1002 | 59 | # live_controller = ImageSlideController(self.parent.slideManager.parent, True) | ||
1003 | 60 | # preview_controller = ImageSlideController(self.parent.slideManager.parent) | ||
1004 | 61 | # self.parent.slideManager.add_controllers(u'image', preview_controller, live_controller) | ||
1005 | 62 | |||
1006 | 63 | def initialise(self): | ||
1007 | 64 | self.ListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) | ||
1008 | 65 | self.ListView.setIconSize(QtCore.QSize(88,50)) | ||
1009 | 66 | self.loadList(self.parent.config.load_list(self.ConfigSection)) | ||
1010 | 67 | |||
1011 | 68 | def onDeleteClick(self): | ||
1012 | 69 | item = self.ListView.currentItem() | ||
1013 | 70 | if item is not None: | ||
1014 | 71 | item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] | ||
1015 | 72 | row = self.ListView.row(item) | ||
1016 | 73 | self.ListView.takeItem(row) | ||
1017 | 74 | self.parent.config.set_list(self.ConfigSection, self.ListData.getFileList()) | ||
1018 | 75 | |||
1019 | 76 | def loadList(self, list): | ||
1020 | 77 | for file in list: | ||
1021 | 78 | (path, filename) = os.path.split(unicode(file)) | ||
1022 | 79 | item_name = QtGui.QListWidgetItem(filename) | ||
1023 | 80 | item_name.setIcon(buildIcon(file)) | ||
1024 | 81 | item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file)) | ||
1025 | 82 | self.ListView.addItem(item_name) | ||
1026 | 54 | 83 | ||
1027 | 55 | def generateSlideData(self, service_item): | 84 | def generateSlideData(self, service_item): |
1029 | 56 | indexes = self.ListView.selectedIndexes() | 85 | items = self.ListView.selectedIndexes() |
1030 | 57 | service_item.title = u'Image(s)' | 86 | service_item.title = u'Image(s)' |
1033 | 58 | for index in indexes: | 87 | for item in items: |
1034 | 59 | filename = self.ListData.getFilename(index) | 88 | bitem = self.ListView.item(item.row()) |
1035 | 89 | filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString()) | ||
1036 | 60 | frame = QtGui.QImage(unicode(filename)) | 90 | frame = QtGui.QImage(unicode(filename)) |
1037 | 61 | (path, name) = os.path.split(filename) | 91 | (path, name) = os.path.split(filename) |
1038 | 62 | service_item.add_from_image(path, name, frame) | 92 | service_item.add_from_image(path, name, frame) |
1039 | 63 | |||
1040 | 64 | 93 | ||
1041 | === modified file 'openlp/plugins/presentations/lib/mediaitem.py' | |||
1042 | --- openlp/plugins/presentations/lib/mediaitem.py 2009-06-26 16:39:16 +0000 | |||
1043 | +++ openlp/plugins/presentations/lib/mediaitem.py 2009-06-27 19:55:55 +0000 | |||
1044 | @@ -43,107 +43,52 @@ | |||
1045 | 43 | self.TranslationContext = u'PresentationPlugin' | 43 | self.TranslationContext = u'PresentationPlugin' |
1046 | 44 | self.PluginTextShort = u'Presentation' | 44 | self.PluginTextShort = u'Presentation' |
1047 | 45 | self.ConfigSection = u'presentation' | 45 | self.ConfigSection = u'presentation' |
1050 | 46 | self.OnNewPrompt = u'Select Image(s)' | 46 | self.hasFileIcon = True |
1051 | 47 | self.OnNewFileMasks = u'Images (*.ppt *.pps *.odp)' | 47 | self.hasNewIcon = False |
1052 | 48 | self.hasEditIcon = False | ||
1053 | 49 | self.IconPath = u'presentations/presentation' | ||
1054 | 50 | self.OnNewPrompt = u'Select Presentation(s)' | ||
1055 | 51 | self.OnNewFileMasks = u'Presentations (*.ppt *.pps *.odp)' | ||
1056 | 48 | # this next is a class, not an instance of a class - it will | 52 | # this next is a class, not an instance of a class - it will |
1057 | 49 | # be instanced by the base MediaManagerItem | 53 | # be instanced by the base MediaManagerItem |
1058 | 50 | self.ListViewWithDnD_class = PresentationListView | 54 | self.ListViewWithDnD_class = PresentationListView |
1059 | 51 | MediaManagerItem.__init__(self, parent, icon, title) | 55 | MediaManagerItem.__init__(self, parent, icon, title) |
1060 | 52 | 56 | ||
1134 | 53 | # def setupUi(self): | 57 | def addHeaderBar(self): |
1135 | 54 | # # Add a toolbar | 58 | self.PresentationWidget = QtGui.QWidget(self) |
1136 | 55 | # self.addToolbar() | 59 | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
1137 | 56 | # # Create buttons for the toolbar | 60 | sizePolicy.setHorizontalStretch(0) |
1138 | 57 | # ## New Presentation Button ## | 61 | sizePolicy.setVerticalStretch(0) |
1139 | 58 | # self.addToolbarButton( | 62 | sizePolicy.setHeightForWidth(self.PresentationWidget.sizePolicy().hasHeightForWidth()) |
1140 | 59 | # translate(u'PresentationsMediaItem',u'New presentations'), | 63 | self.PresentationWidget.setSizePolicy(sizePolicy) |
1141 | 60 | # translate(u'PresentationsMediaItem',u'Load presentations into openlp.org'), | 64 | self.PresentationWidget.setObjectName(u'PresentationWidget') |
1142 | 61 | # ':/presentations/presentation_load.png', self.onPresentationNewClick, 'PresentationNewItem') | 65 | self.DisplayLayout = QtGui.QGridLayout(self.PresentationWidget) |
1143 | 62 | # ## Delete Presentation Button ## | 66 | self.DisplayLayout.setObjectName(u'DisplayLayout') |
1144 | 63 | # self.addToolbarButton( | 67 | self.DisplayTypeComboBox = QtGui.QComboBox(self.PresentationWidget) |
1145 | 64 | # translate(u'PresentationsMediaItem',u'Delete Presentation'), | 68 | self.DisplayTypeComboBox.setObjectName(u'DisplayTypeComboBox') |
1146 | 65 | # translate(u'PresentationsMediaItem',u'Delete the selected presentation'), | 69 | self.DisplayLayout.addWidget(self.DisplayTypeComboBox, 0, 1, 1, 2) |
1147 | 66 | # ':/presentations/presentation_delete.png', self.onPresentationDeleteClick, 'PresentationDeleteItem') | 70 | self.DisplayTypeLabel = QtGui.QLabel(self.PresentationWidget) |
1148 | 67 | # ## Separator Line ## | 71 | self.DisplayTypeLabel.setObjectName(u'SearchTypeLabel') |
1149 | 68 | # self.addToolbarSeparator() | 72 | self.DisplayLayout.addWidget(self.DisplayTypeLabel, 0, 0, 1, 1) |
1150 | 69 | # ## Preview Presentation Button ## | 73 | |
1151 | 70 | # self.addToolbarButton( | 74 | self.DisplayTypeLabel.setText(translate(u'PresentationMediaItem', u'Present using:')) |
1152 | 71 | # translate(u'PresentationsMediaItem',u'Preview Presentation'), | 75 | |
1153 | 72 | # translate(u'PresentationsMediaItem',u'Preview the selected Presentation'), | 76 | # Add the Presentation widget to the page layout |
1154 | 73 | # ':/system/system_preview.png', self.onPresentationPreviewClick, 'PresentationPreviewItem') | 77 | self.PageLayout.addWidget(self.PresentationWidget) |
1082 | 74 | # ## Live Presentation Button ## | ||
1083 | 75 | # self.addToolbarButton( | ||
1084 | 76 | # translate(u'PresentationsMediaItem',u'Go Live'), | ||
1085 | 77 | # translate(u'PresentationsMediaItem',u'Send the selected presentation live'), | ||
1086 | 78 | # ':/system/system_live.png', self.onPresentationLiveClick, 'PresentationLiveItem') | ||
1087 | 79 | # ## Add Presentation Button ## | ||
1088 | 80 | # self.addToolbarButton( | ||
1089 | 81 | # translate(u'PresentationsMediaItem',u'Add Presentation To Service'), | ||
1090 | 82 | # translate(u'PresentationsMediaItem',u'Add the selected Presentations(s) to the service'), | ||
1091 | 83 | # ':/system/system_add.png',self.onPresentationAddClick, 'PresentationsAddItem') | ||
1092 | 84 | # ## Add the Presentationlist widget ## | ||
1093 | 85 | # | ||
1094 | 86 | # self.PresentationWidget = QtGui.QWidget(self) | ||
1095 | 87 | # sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | ||
1096 | 88 | # sizePolicy.setHorizontalStretch(0) | ||
1097 | 89 | # sizePolicy.setVerticalStretch(0) | ||
1098 | 90 | # sizePolicy.setHeightForWidth(self.PresentationWidget.sizePolicy().hasHeightForWidth()) | ||
1099 | 91 | # self.PresentationWidget.setSizePolicy(sizePolicy) | ||
1100 | 92 | # self.PresentationWidget.setObjectName(u'PresentationWidget') | ||
1101 | 93 | # self.DisplayLayout = QtGui.QGridLayout(self.PresentationWidget) | ||
1102 | 94 | # self.DisplayLayout.setObjectName(u'DisplayLayout') | ||
1103 | 95 | # self.DisplayTypeComboBox = QtGui.QComboBox(self.PresentationWidget) | ||
1104 | 96 | # self.DisplayTypeComboBox.setObjectName(u'DisplayTypeComboBox') | ||
1105 | 97 | # self.DisplayLayout.addWidget(self.DisplayTypeComboBox, 0, 1, 1, 2) | ||
1106 | 98 | # self.DisplayTypeLabel = QtGui.QLabel(self.PresentationWidget) | ||
1107 | 99 | # self.DisplayTypeLabel.setObjectName(u'SearchTypeLabel') | ||
1108 | 100 | # self.DisplayLayout.addWidget(self.DisplayTypeLabel, 0, 0, 1, 1) | ||
1109 | 101 | # | ||
1110 | 102 | # self.DisplayTypeLabel.setText(translate(u'PresentationMediaItem', u'Present using:')) | ||
1111 | 103 | # | ||
1112 | 104 | # # Add the song widget to the page layout | ||
1113 | 105 | # self.PageLayout.addWidget(self.PresentationWidget) | ||
1114 | 106 | # | ||
1115 | 107 | # self.PresentationsListView = QtGui.QListView() | ||
1116 | 108 | # self.PresentationsListView.setAlternatingRowColors(True) | ||
1117 | 109 | # self.PresentationsListData = FileListData() | ||
1118 | 110 | # self.PresentationsListView.setModel(self.PresentationsListData) | ||
1119 | 111 | # | ||
1120 | 112 | # self.PageLayout.addWidget(self.PresentationsListView) | ||
1121 | 113 | # | ||
1122 | 114 | # #define and add the context menu | ||
1123 | 115 | # self.PresentationsListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) | ||
1124 | 116 | # | ||
1125 | 117 | # self.PresentationsListView.addAction(self.contextMenuAction( | ||
1126 | 118 | # self.PresentationsListView, ':/system/system_preview.png', | ||
1127 | 119 | # translate(u'PresentationsMediaItem',u'&Preview presentations'), self.onPresentationPreviewClick)) | ||
1128 | 120 | # self.PresentationsListView.addAction(self.contextMenuAction( | ||
1129 | 121 | # self.PresentationsListView, ':/system/system_live.png', | ||
1130 | 122 | # translate(u'PresentationsMediaItem',u'&Show Live'), self.onPresentationLiveClick)) | ||
1131 | 123 | # self.PresentationsListView.addAction(self.contextMenuAction( | ||
1132 | 124 | # self.PresentationsListView, ':/system/system_add.png', | ||
1133 | 125 | # translate(u'PresentationsMediaItem',u'&Add to Service'), self.onPresentationAddClick)) | ||
1155 | 126 | 78 | ||
1156 | 127 | def initialise(self): | 79 | def initialise(self): |
1157 | 128 | list = self.parent.config.load_list(u'presentations') | 80 | list = self.parent.config.load_list(u'presentations') |
1158 | 129 | self.loadPresentationList(list) | 81 | self.loadPresentationList(list) |
1160 | 130 | # self.DisplayTypeComboBox.addItem(u'Impress') | 82 | self.DisplayTypeComboBox.addItem(u'Impress') |
1161 | 131 | # self.DisplayTypeComboBox.addItem(u'Powerpoint') | 83 | # self.DisplayTypeComboBox.addItem(u'Powerpoint') |
1162 | 132 | # self.DisplayTypeComboBox.addItem(u'Keynote') | 84 | # self.DisplayTypeComboBox.addItem(u'Keynote') |
1163 | 133 | 85 | ||
1177 | 134 | def onPresentationNewClick(self): | 86 | def loadList(self, list): |
1178 | 135 | files = QtGui.QFileDialog.getOpenFileNames(None, | 87 | for file in list: |
1179 | 136 | translate(u'PresentationsMediaItem', u'Select presentations(s)'), | 88 | (path, filename) = os.path.split(unicode(file)) |
1180 | 137 | self.parent.config.get_last_dir(), u'Presentations (*.ppt *.pps *.odp)') | 89 | item_name = QtGui.QListWidgetItem(filename) |
1181 | 138 | if len(files) > 0: | 90 | item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file)) |
1182 | 139 | self.loadPresentationList(files) | 91 | self.ListView.addItem(item_name) |
1170 | 140 | dir, filename = os.path.split(unicode(files[0])) | ||
1171 | 141 | self.parent.config.set_last_dir(dir) | ||
1172 | 142 | self.parent.config.set_list(u'Presentations', self.PresentationsListData.getFileList()) | ||
1173 | 143 | |||
1174 | 144 | def getFileList(self): | ||
1175 | 145 | filelist = [item[0] for item in self.PresentationsListView]; | ||
1176 | 146 | return filelist | ||
1183 | 147 | 92 | ||
1184 | 148 | def loadPresentationList(self, list): | 93 | def loadPresentationList(self, list): |
1185 | 149 | pass | 94 | pass |
1186 | 150 | 95 | ||
1187 | === modified file 'openlp/plugins/songs/forms/editsongform.py' | |||
1188 | --- openlp/plugins/songs/forms/editsongform.py 2009-06-17 05:11:16 +0000 | |||
1189 | +++ openlp/plugins/songs/forms/editsongform.py 2009-06-27 19:55:55 +0000 | |||
1190 | @@ -317,11 +317,6 @@ | |||
1191 | 317 | self.TitleEditItem.setStyleSheet(u'background-color: red; color: white') | 317 | self.TitleEditItem.setStyleSheet(u'background-color: red; color: white') |
1192 | 318 | else: | 318 | else: |
1193 | 319 | self.TitleEditItem.setStyleSheet(u'') | 319 | self.TitleEditItem.setStyleSheet(u'') |
1194 | 320 | if len(self.CopyrightEditItem.displayText()) == 0: | ||
1195 | 321 | valid = False | ||
1196 | 322 | self.CopyrightEditItem.setStyleSheet(u'background-color: red; color: white') | ||
1197 | 323 | else: | ||
1198 | 324 | self.CopyrightEditItem.setStyleSheet(u'') | ||
1199 | 325 | if self.VerseListWidget.count() == 0: | 320 | if self.VerseListWidget.count() == 0: |
1200 | 326 | valid = False | 321 | valid = False |
1201 | 327 | self.VerseListWidget.setStyleSheet(u'background-color: red; color: white') | 322 | self.VerseListWidget.setStyleSheet(u'background-color: red; color: white') |
1202 | 328 | 323 | ||
1203 | === modified file 'openlp/plugins/songs/lib/mediaitem.py' | |||
1204 | --- openlp/plugins/songs/lib/mediaitem.py 2009-06-26 18:54:05 +0000 | |||
1205 | +++ openlp/plugins/songs/lib/mediaitem.py 2009-06-27 19:55:55 +0000 | |||
1206 | @@ -121,12 +121,12 @@ | |||
1207 | 121 | self.SearchLayout.addWidget(self.SearchTextButton, 3, 2, 1, 1) | 121 | self.SearchLayout.addWidget(self.SearchTextButton, 3, 2, 1, 1) |
1208 | 122 | # Add the song widget to the page layout | 122 | # Add the song widget to the page layout |
1209 | 123 | self.PageLayout.addWidget(self.SongWidget) | 123 | self.PageLayout.addWidget(self.SongWidget) |
1216 | 124 | self.SongListWidget = SongList() | 124 | self.ListView = SongList() |
1217 | 125 | self.SongListWidget.setAlternatingRowColors(True) | 125 | self.ListView.setAlternatingRowColors(True) |
1218 | 126 | self.SongListWidget.setDragEnabled(True) | 126 | self.ListView.setDragEnabled(True) |
1219 | 127 | self.SongListWidget.setObjectName(u'SongListWidget') | 127 | self.ListView.setObjectName(u'ListView') |
1220 | 128 | self.PageLayout.addWidget(self.SongListWidget) | 128 | self.PageLayout.addWidget(self.ListView) |
1221 | 129 | self.SongListWidget.setDragEnabled(True) | 129 | self.ListView.setDragEnabled(True) |
1222 | 130 | # Signals and slots | 130 | # Signals and slots |
1223 | 131 | QtCore.QObject.connect(self.SearchTextButton, | 131 | QtCore.QObject.connect(self.SearchTextButton, |
1224 | 132 | QtCore.SIGNAL(u'pressed()'), self.onSearchTextButtonClick) | 132 | QtCore.SIGNAL(u'pressed()'), self.onSearchTextButtonClick) |
1225 | @@ -134,21 +134,21 @@ | |||
1226 | 134 | QtCore.SIGNAL(u'pressed()'), self.onClearTextButtonClick) | 134 | QtCore.SIGNAL(u'pressed()'), self.onClearTextButtonClick) |
1227 | 135 | QtCore.QObject.connect(self.SearchTextEdit, | 135 | QtCore.QObject.connect(self.SearchTextEdit, |
1228 | 136 | QtCore.SIGNAL(u'textChanged(const QString&)'), self.onSearchTextEditChanged) | 136 | QtCore.SIGNAL(u'textChanged(const QString&)'), self.onSearchTextEditChanged) |
1230 | 137 | QtCore.QObject.connect(self.SongListWidget, | 137 | QtCore.QObject.connect(self.ListView, |
1231 | 138 | QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onSongPreviewClick) | 138 | QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onSongPreviewClick) |
1232 | 139 | #define and add the context menu | 139 | #define and add the context menu |
1235 | 140 | self.SongListWidget.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) | 140 | self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) |
1236 | 141 | self.SongListWidget.addAction(self.contextMenuAction(self.SongListWidget, | 141 | self.ListView.addAction(self.contextMenuAction(self.ListView, |
1237 | 142 | ':/songs/song_new.png', translate(u'SongMediaItem', u'&Edit Song'), | 142 | ':/songs/song_new.png', translate(u'SongMediaItem', u'&Edit Song'), |
1238 | 143 | self.onSongEditClick)) | 143 | self.onSongEditClick)) |
1241 | 144 | self.SongListWidget.addAction(self.contextMenuSeparator(self.SongListWidget)) | 144 | self.ListView.addAction(self.contextMenuSeparator(self.ListView)) |
1242 | 145 | self.SongListWidget.addAction(self.contextMenuAction(self.SongListWidget, | 145 | self.ListView.addAction(self.contextMenuAction(self.ListView, |
1243 | 146 | ':/system/system_preview.png', translate(u'SongMediaItem', u'&Preview Song'), | 146 | ':/system/system_preview.png', translate(u'SongMediaItem', u'&Preview Song'), |
1244 | 147 | self.onSongPreviewClick)) | 147 | self.onSongPreviewClick)) |
1246 | 148 | self.SongListWidget.addAction(self.contextMenuAction(self.SongListWidget, | 148 | self.ListView.addAction(self.contextMenuAction(self.ListView, |
1247 | 149 | ':/system/system_live.png', translate(u'SongMediaItem', u'&Show Live'), | 149 | ':/system/system_live.png', translate(u'SongMediaItem', u'&Show Live'), |
1248 | 150 | self.onSongLiveClick)) | 150 | self.onSongLiveClick)) |
1250 | 151 | self.SongListWidget.addAction(self.contextMenuAction(self.SongListWidget, | 151 | self.ListView.addAction(self.contextMenuAction(self.ListView, |
1251 | 152 | ':/system/system_add.png', translate(u'SongMediaItem', u'&Add to Service'), | 152 | ':/system/system_add.png', translate(u'SongMediaItem', u'&Add to Service'), |
1252 | 153 | self.onSongAddClick)) | 153 | self.onSongAddClick)) |
1253 | 154 | 154 | ||
1254 | @@ -182,7 +182,7 @@ | |||
1255 | 182 | 182 | ||
1256 | 183 | def displayResultsSong(self, searchresults): | 183 | def displayResultsSong(self, searchresults): |
1257 | 184 | log.debug(u'display results Song') | 184 | log.debug(u'display results Song') |
1259 | 185 | self.SongListWidget.clear() | 185 | self.ListView.clear() |
1260 | 186 | #log.debug(u'Records returned from search %s", len(searchresults)) | 186 | #log.debug(u'Records returned from search %s", len(searchresults)) |
1261 | 187 | for song in searchresults: | 187 | for song in searchresults: |
1262 | 188 | author_list = u'' | 188 | author_list = u'' |
1263 | @@ -193,17 +193,17 @@ | |||
1264 | 193 | song_detail = unicode(u'%s (%s)' % (unicode(song.title), unicode(author_list))) | 193 | song_detail = unicode(u'%s (%s)' % (unicode(song.title), unicode(author_list))) |
1265 | 194 | song_name = QtGui.QListWidgetItem(song_detail) | 194 | song_name = QtGui.QListWidgetItem(song_detail) |
1266 | 195 | song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) | 195 | song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) |
1268 | 196 | self.SongListWidget.addItem(song_name) | 196 | self.ListView.addItem(song_name) |
1269 | 197 | 197 | ||
1270 | 198 | def displayResultsAuthor(self, searchresults): | 198 | def displayResultsAuthor(self, searchresults): |
1271 | 199 | log.debug(u'display results Author') | 199 | log.debug(u'display results Author') |
1273 | 200 | self.SongListWidget.clear() | 200 | self.ListView.clear() |
1274 | 201 | for author in searchresults: | 201 | for author in searchresults: |
1275 | 202 | for song in author.songs: | 202 | for song in author.songs: |
1276 | 203 | song_detail = unicode(u'%s (%s)' % (unicode(author.display_name), unicode(song.title))) | 203 | song_detail = unicode(u'%s (%s)' % (unicode(author.display_name), unicode(song.title))) |
1277 | 204 | song_name = QtGui.QListWidgetItem(song_detail) | 204 | song_name = QtGui.QListWidgetItem(song_detail) |
1278 | 205 | song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) | 205 | song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) |
1280 | 206 | self.SongListWidget.addItem(song_name) | 206 | self.ListView.addItem(song_name) |
1281 | 207 | 207 | ||
1282 | 208 | def onClearTextButtonClick(self): | 208 | def onClearTextButtonClick(self): |
1283 | 209 | """ | 209 | """ |
1284 | @@ -223,19 +223,19 @@ | |||
1285 | 223 | self.edit_song_form.exec_() | 223 | self.edit_song_form.exec_() |
1286 | 224 | 224 | ||
1287 | 225 | def onSongEditClick(self): | 225 | def onSongEditClick(self): |
1289 | 226 | item = self.SongListWidget.currentItem() | 226 | item = self.ListView.currentItem() |
1290 | 227 | if item is not None: | 227 | if item is not None: |
1291 | 228 | item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] | 228 | item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] |
1292 | 229 | self.edit_song_form.loadSong(item_id) | 229 | self.edit_song_form.loadSong(item_id) |
1293 | 230 | self.edit_song_form.exec_() | 230 | self.edit_song_form.exec_() |
1294 | 231 | 231 | ||
1295 | 232 | def onSongDeleteClick(self): | 232 | def onSongDeleteClick(self): |
1297 | 233 | item = self.SongListWidget.currentItem() | 233 | item = self.ListView.currentItem() |
1298 | 234 | if item is not None: | 234 | if item is not None: |
1299 | 235 | item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] | 235 | item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] |
1300 | 236 | self.parent.songmanager.delete_song(item_id) | 236 | self.parent.songmanager.delete_song(item_id) |
1303 | 237 | row = self.SongListWidget.row(item) | 237 | row = self.ListView.row(item) |
1304 | 238 | self.SongListWidget.takeItem(row) | 238 | self.ListView.takeItem(row) |
1305 | 239 | 239 | ||
1306 | 240 | def onSongPreviewClick(self): | 240 | def onSongPreviewClick(self): |
1307 | 241 | service_item = ServiceItem(self.parent) | 241 | service_item = ServiceItem(self.parent) |
1308 | @@ -248,7 +248,7 @@ | |||
1309 | 248 | raw_footer = [] | 248 | raw_footer = [] |
1310 | 249 | author_list = u'' | 249 | author_list = u'' |
1311 | 250 | ccl = u'' | 250 | ccl = u'' |
1313 | 251 | item = self.SongListWidget.currentItem() | 251 | item = self.ListView.currentItem() |
1314 | 252 | item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] | 252 | item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] |
1315 | 253 | song = self.parent.songmanager.get_song(item_id) | 253 | song = self.parent.songmanager.get_song(item_id) |
1316 | 254 | service_item.theme = song.theme_name | 254 | service_item.theme = song.theme_name |
Ok here it comes. eview from Images plugin. oller plugin toolbar thinggy.
Changes to mediamanger superclass to allow it to work better with all plugins
removal of imagelistwithpr
Fixes to thememanager so delete does not eat ALL you themes.
Start of ImageSlideContr