merge fixes

This commit is contained in:
Tim Bentley 2012-12-30 19:49:48 +00:00
parent 8f7c53c1fc
commit 44a9f96c87
3 changed files with 8 additions and 13 deletions

View File

@ -43,11 +43,7 @@ log = logging.getLogger(__name__)
class MediaSlider(QtGui.QSlider):
"""
Set up key bindings and mouse behaviour for the Qslider
Let's say the user clicks at (100, 50), and the slider geometry is (30, 40, 200, 60).
Then the slider width is 200-30=170px.
Now, clicking at 100 pixels(relative to the slider) means the knob should be moved at 58.82% from the slider value.
So if the slider value goes from 1 to 440, then you should use QSlider:setValue(440*58.82/100).
Allows the mouse events of a slider to be overridden and extra functionality added
"""
def __init__(self, direction, manager, controller, parent=None):
QtGui.QSlider.__init__(self, direction)

View File

@ -190,7 +190,7 @@ class VlcPlayer(MediaPlayer):
return False
self.volume(display, controller.media_info.volume)
if start_time > 0:
self.seek(display, controller.media_info.start_time * 1000)
self.seek(display, controller.media_info.start_time * 1000)
controller.media_info.length = int(display.vlcMediaPlayer.get_media().get_duration() / 1000)
controller.seekSlider.setMaximum(controller.media_info.length * 1000)
self.state = MediaState.Playing

View File

@ -116,8 +116,9 @@ class MediaMediaItem(MediaManagerItem):
self.displayLayout.addRow(self.displayTypeLabel, self.displayTypeComboBox)
# Add the Media widget to the page layout
self.pageLayout.addWidget(self.mediaWidget)
QtCore.QObject.connect(self.displayTypeComboBox,
QtCore.SIGNAL(u'currentIndexChanged (int)'), self.overridePlayerChanged)
QtCore.QObject.connect(self.displayTypeComboBox, QtCore.SIGNAL(u'currentIndexChanged (int)'),
self.overridePlayerChanged)
def overridePlayerChanged(self, index):
player = get_media_players()[0]
if index == 0:
@ -198,9 +199,7 @@ class MediaMediaItem(MediaManagerItem):
def initialise(self):
self.listView.clear()
self.listView.setIconSize(QtCore.QSize(88, 50))
self.servicePath = os.path.join(
AppLocation.get_section_data_path(self.settingsSection),
u'thumbnails')
self.servicePath = os.path.join(AppLocation.get_section_data_path(self.settingsSection), u'thumbnails')
check_directory_exists(self.servicePath)
self.loadList(SettingsManager.load_list(self.settingsSection, u'media'))
self.populateDisplayTypes()
@ -248,8 +247,8 @@ class MediaMediaItem(MediaManagerItem):
"""
Remove a media item from the list.
"""
if check_item_selected(self.listView, translate('MediaPlugin.MediaItem',
'You must select a media file to delete.')):
if check_item_selected(self.listView,
translate('MediaPlugin.MediaItem', 'You must select a media file to delete.')):
row_list = [item.row() for item in self.listView.selectedIndexes()]
row_list.sort(reverse=True)
for row in row_list: