1 |
commit: 705539c86962a41740499bc7197fb44ccb255764 |
2 |
Author: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net> |
3 |
AuthorDate: Wed Oct 7 12:27:13 2020 +0000 |
4 |
Commit: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net> |
5 |
CommitDate: Wed Oct 7 12:27:13 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=705539c8 |
7 |
|
8 |
media-video/syncplay: patch gui to work with PyQt5 |
9 |
|
10 |
Package-Manager: Portage-3.0.8, Repoman-3.0.1 |
11 |
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net> |
12 |
|
13 |
.../syncplay/files/syncplay-allow-PyQt5.patch | 474 +++++++++++++++++++++ |
14 |
...cplay-1.6.5.ebuild => syncplay-1.6.5-r1.ebuild} | 7 +- |
15 |
2 files changed, 476 insertions(+), 5 deletions(-) |
16 |
|
17 |
diff --git a/media-video/syncplay/files/syncplay-allow-PyQt5.patch b/media-video/syncplay/files/syncplay-allow-PyQt5.patch |
18 |
new file mode 100644 |
19 |
index 00000000..89c9de33 |
20 |
--- /dev/null |
21 |
+++ b/media-video/syncplay/files/syncplay-allow-PyQt5.patch |
22 |
@@ -0,0 +1,474 @@ |
23 |
+From c759525889f303195e677f9341cf325decf74809 Mon Sep 17 00:00:00 2001 |
24 |
+From: Andrew Ammerlaan <andrewammerlaan@××××××.net> |
25 |
+Date: Wed, 7 Oct 2020 13:31:46 +0200 |
26 |
+Subject: [PATCH] PyQt5 compatability |
27 |
+ |
28 |
+--- |
29 |
+ syncplay/ui/ConfigurationGetter.py | 4 +- |
30 |
+ syncplay/ui/GuiConfiguration.py | 16 ++-- |
31 |
+ syncplay/ui/gui.py | 130 ++++++++++++++++------------- |
32 |
+ 3 files changed, 82 insertions(+), 68 deletions(-) |
33 |
+ |
34 |
+diff --git a/syncplay/ui/ConfigurationGetter.py b/syncplay/ui/ConfigurationGetter.py |
35 |
+index dd1d8ec0..6d83c650 100755 |
36 |
+--- a/syncplay/ui/ConfigurationGetter.py |
37 |
++++ b/syncplay/ui/ConfigurationGetter.py |
38 |
+@@ -513,10 +513,10 @@ def getConfiguration(self): |
39 |
+ self._overrideConfigWithArgs(args) |
40 |
+ if not self._config['noGui']: |
41 |
+ try: |
42 |
+- from syncplay.vendor.Qt import QtWidgets, IsPySide, IsPySide2 |
43 |
++ from syncplay.vendor.Qt import QtWidgets, IsPySide, IsPySide2, IsPyQt5 |
44 |
+ from syncplay.vendor.Qt.QtCore import QCoreApplication |
45 |
+ from syncplay.vendor import qt5reactor |
46 |
+- if not (IsPySide2 or IsPySide): |
47 |
++ if not (IsPySide2 or IsPySide or IsPyQt5): |
48 |
+ raise ImportError |
49 |
+ if QCoreApplication.instance() is None: |
50 |
+ self.app = QtWidgets.QApplication(sys.argv) |
51 |
+diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py |
52 |
+index 96915814..cfe51b26 100755 |
53 |
+--- a/syncplay/ui/GuiConfiguration.py |
54 |
++++ b/syncplay/ui/GuiConfiguration.py |
55 |
+@@ -11,7 +11,7 @@ |
56 |
+ from syncplay.utils import isBSD, isLinux, isMacOS, isWindows |
57 |
+ from syncplay.utils import resourcespath, posixresourcespath |
58 |
+ |
59 |
+-from syncplay.vendor.Qt import QtCore, QtWidgets, QtGui, __binding__, IsPySide, IsPySide2 |
60 |
++from syncplay.vendor.Qt import QtCore, QtWidgets, QtGui, __binding__, IsPySide, IsPySide2, IsPyQt5 |
61 |
+ from syncplay.vendor.Qt.QtCore import Qt, QSettings, QCoreApplication, QSize, QPoint, QUrl, QLine, QEventLoop, Signal |
62 |
+ from syncplay.vendor.Qt.QtWidgets import QApplication, QLineEdit, QLabel, QCheckBox, QButtonGroup, QRadioButton, QDoubleSpinBox, QPlainTextEdit |
63 |
+ from syncplay.vendor.Qt.QtGui import QCursor, QIcon, QImage, QDesktopServices |
64 |
+@@ -21,6 +21,8 @@ |
65 |
+ QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, True) |
66 |
+ if IsPySide2: |
67 |
+ from PySide2.QtCore import QStandardPaths |
68 |
++elif IsPyQt5: |
69 |
++ from PyQt5.QtCore import QStandardPaths |
70 |
+ |
71 |
+ |
72 |
+ class GuiConfiguration: |
73 |
+@@ -445,7 +447,7 @@ def browseMediapath(self): |
74 |
+ defaultdirectory = QDesktopServices.storageLocation(QDesktopServices.HomeLocation) |
75 |
+ else: |
76 |
+ defaultdirectory = "" |
77 |
+- elif IsPySide2: |
78 |
++ elif IsPySide2 or IsPyQt5: |
79 |
+ if self.config["mediaSearchDirectories"] and os.path.isdir(self.config["mediaSearchDirectories"][0]): |
80 |
+ defaultdirectory = self.config["mediaSearchDirectories"][0] |
81 |
+ elif os.path.isdir(self.mediadirectory): |
82 |
+@@ -1181,7 +1183,7 @@ def addMessageTab(self): |
83 |
+ |
84 |
+ self.displaySettingsGroup = QtWidgets.QGroupBox(getMessage("messages-other-title")) |
85 |
+ self.displaySettingsLayout = QtWidgets.QVBoxLayout() |
86 |
+- self.displaySettingsLayout.setAlignment(Qt.AlignTop & Qt.AlignLeft) |
87 |
++ self.displaySettingsLayout.setAlignment(Qt.AlignTop | Qt.AlignLeft) |
88 |
+ self.displaySettingsFrame = QtWidgets.QFrame() |
89 |
+ |
90 |
+ self.showDurationNotificationCheckbox = QCheckBox(getMessage("showdurationnotification-label")) |
91 |
+@@ -1193,7 +1195,7 @@ def addMessageTab(self): |
92 |
+ self.languageLayout.setContentsMargins(0, 0, 0, 0) |
93 |
+ self.languageFrame.setLayout(self.languageLayout) |
94 |
+ self.languageFrame.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) |
95 |
+- self.languageLayout.setAlignment(Qt.AlignTop & Qt.AlignLeft) |
96 |
++ self.languageLayout.setAlignment(Qt.AlignTop | Qt.AlignLeft) |
97 |
+ self.languageLabel = QLabel(getMessage("language-label"), self) |
98 |
+ self.languageCombobox = QtWidgets.QComboBox(self) |
99 |
+ self.languageCombobox.addItem(getMessage("automatic-language").format(getMessage("LANGUAGE", getInitialLanguage()))) |
100 |
+@@ -1214,7 +1216,7 @@ def addMessageTab(self): |
101 |
+ |
102 |
+ self.displaySettingsGroup.setLayout(self.displaySettingsLayout) |
103 |
+ self.displaySettingsGroup.setMaximumHeight(self.displaySettingsGroup.minimumSizeHint().height()) |
104 |
+- self.displaySettingsLayout.setAlignment(Qt.AlignTop & Qt.AlignLeft) |
105 |
++ self.displaySettingsLayout.setAlignment(Qt.AlignTop | Qt.AlignLeft) |
106 |
+ self.messageLayout.addWidget(self.displaySettingsGroup) |
107 |
+ |
108 |
+ # messageFrame |
109 |
+@@ -1394,7 +1396,9 @@ def __init__(self, config, playerpaths, error, defaultConfig): |
110 |
+ self.publicServerAddresses = [] |
111 |
+ |
112 |
+ self._playerProbeThread = GetPlayerIconThread() |
113 |
+- self._playerProbeThread.done.connect(self._updateExecutableIcon) |
114 |
++ # To-Do: Why does this not work with PyQt5 |
115 |
++ if not IsPyQt5: |
116 |
++ self._playerProbeThread.done.connect(self._updateExecutableIcon) |
117 |
+ self._playerProbeThread.start() |
118 |
+ |
119 |
+ if self.config['clearGUIData'] == True: |
120 |
+diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py |
121 |
+index c59c5697..a8fe427d 100755 |
122 |
+--- a/syncplay/ui/gui.py |
123 |
++++ b/syncplay/ui/gui.py |
124 |
+@@ -18,8 +18,7 @@ |
125 |
+ from syncplay.utils import resourcespath |
126 |
+ from syncplay.utils import isLinux, isWindows, isMacOS |
127 |
+ from syncplay.utils import formatTime, sameFilename, sameFilesize, sameFileduration, RoomPasswordProvider, formatSize, isURL |
128 |
+-from syncplay.vendor import Qt |
129 |
+-from syncplay.vendor.Qt import QtCore, QtWidgets, QtGui, __binding__, __binding_version__, __qt_version__, IsPySide, IsPySide2 |
130 |
++from syncplay.vendor.Qt import QtCore, QtWidgets, QtGui, __binding__, __binding_version__, __qt_version__, IsPySide, IsPySide2, IsPyQt5 |
131 |
+ from syncplay.vendor.Qt.QtCore import Qt, QSettings, QSize, QPoint, QUrl, QLine, QDateTime |
132 |
+ applyDPIScaling = True |
133 |
+ if isLinux(): |
134 |
+@@ -32,15 +31,17 @@ |
135 |
+ QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps, applyDPIScaling) |
136 |
+ if IsPySide2: |
137 |
+ from PySide2.QtCore import QStandardPaths |
138 |
++elif IsPyQt5: |
139 |
++ from PyQt5.QtCore import QStandardPaths |
140 |
+ if isMacOS() and IsPySide: |
141 |
+ from Foundation import NSURL |
142 |
+ from Cocoa import NSString, NSUTF8StringEncoding |
143 |
+ lastCheckedForUpdates = None |
144 |
+ from syncplay.vendor import darkdetect |
145 |
+ if isMacOS(): |
146 |
+- isDarkMode = darkdetect.isDark() |
147 |
++ isDarkMode = darkdetect.isDark() |
148 |
+ else: |
149 |
+- isDarkMode = None |
150 |
++ isDarkMode = None |
151 |
+ |
152 |
+ |
153 |
+ class ConsoleInGUI(ConsoleUI): |
154 |
+@@ -139,7 +140,7 @@ def __init__(self, parent=None): |
155 |
+ self.setWindowTitle(getMessage("about-dialog-title")) |
156 |
+ if isWindows(): |
157 |
+ self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) |
158 |
+- self.setWindowIcon(QtGui.QPixmap(resourcespath + 'syncplay.png')) |
159 |
++ self.setWindowIcon(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'syncplay.png'))) |
160 |
+ nameLabel = QtWidgets.QLabel("<center><strong>Syncplay</strong></center>") |
161 |
+ nameLabel.setFont(QtGui.QFont("Helvetica", 18)) |
162 |
+ linkLabel = QtWidgets.QLabel() |
163 |
+@@ -202,7 +203,7 @@ def __init__(self, tlsData, parent=None): |
164 |
+ self.setWindowTitle(getMessage("tls-information-title")) |
165 |
+ if isWindows(): |
166 |
+ self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) |
167 |
+- self.setWindowIcon(QtGui.QPixmap(resourcespath + 'syncplay.png')) |
168 |
++ self.setWindowIcon(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'syncplay.png'))) |
169 |
+ statusLabel = QtWidgets.QLabel(getMessage("tls-dialog-status-label").format(tlsData["subject"])) |
170 |
+ descLabel = QtWidgets.QLabel(getMessage("tls-dialog-desc-label").format(tlsData["subject"])) |
171 |
+ connDataLabel = QtWidgets.QLabel(getMessage("tls-dialog-connection-label").format(tlsData["protocolVersion"], tlsData["cipher"])) |
172 |
+@@ -454,6 +455,15 @@ def mouseMoveEvent(self, event): |
173 |
+ def needsClient(f): # @NoSelf |
174 |
+ @wraps(f) |
175 |
+ def wrapper(self, *args, **kwds): |
176 |
++ # To-Do: For some strange reason the args tumple contains False |
177 |
++ # for some functions, resulting in a crash as the function only accepts |
178 |
++ # one argument (self). I do not understand where this 'False' is coming |
179 |
++ # from, it does not seem to be added when the function is called. |
180 |
++ # This very ugly workaround fixes the problem |
181 |
++ if IsPyQt5: |
182 |
++ if len(args)>0: |
183 |
++ if not args[0]: |
184 |
++ args = () |
185 |
+ if not self._syncplayClient: |
186 |
+ self.showDebugMessage("Tried to use client before it was ready!") |
187 |
+ return |
188 |
+@@ -614,11 +624,11 @@ def showUserList(self, currentUser, rooms): |
189 |
+ |
190 |
+ if isControlledRoom: |
191 |
+ if room == currentUser.room and currentUser.isController(): |
192 |
+- roomitem.setIcon(QtGui.QPixmap(resourcespath + 'lock_open.png')) |
193 |
++ roomitem.setIcon(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'lock_open.png'))) |
194 |
+ else: |
195 |
+- roomitem.setIcon(QtGui.QPixmap(resourcespath + 'lock.png')) |
196 |
++ roomitem.setIcon(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'lock.png'))) |
197 |
+ else: |
198 |
+- roomitem.setIcon(QtGui.QPixmap(resourcespath + 'chevrons_right.png')) |
199 |
++ roomitem.setIcon(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'chevrons_right.png'))) |
200 |
+ |
201 |
+ for user in rooms[room]: |
202 |
+ useritem = QtGui.QStandardItem(user.username) |
203 |
+@@ -719,31 +729,31 @@ def openPlaylistMenu(self, position): |
204 |
+ pathFound = self._syncplayClient.fileSwitch.findFilepath(firstFile) if not isURL(firstFile) else None |
205 |
+ if self._syncplayClient.userlist.currentUser.file is None or firstFile != self._syncplayClient.userlist.currentUser.file["name"]: |
206 |
+ if isURL(firstFile): |
207 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "world_go.png"), getMessage("openstreamurl-menu-label"), lambda: self.openFile(firstFile, resetPosition=True, fromUser=True)) |
208 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "world_go.png")), getMessage("openstreamurl-menu-label"), lambda: self.openFile(firstFile, resetPosition=True, fromUser=True)) |
209 |
+ elif pathFound: |
210 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "film_go.png"), getMessage("openmedia-menu-label"), lambda: self.openFile(pathFound, resetPosition=True, fromUser=True)) |
211 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "film_go.png")), getMessage("openmedia-menu-label"), lambda: self.openFile(pathFound, resetPosition=True, fromUser=True)) |
212 |
+ if pathFound: |
213 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "folder_film.png"), |
214 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "folder_film.png")), |
215 |
+ getMessage('open-containing-folder'), |
216 |
+ lambda: utils.open_system_file_browser(pathFound)) |
217 |
+ if self._syncplayClient.isUntrustedTrustableURI(firstFile): |
218 |
+ domain = utils.getDomainFromURL(firstFile) |
219 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "shield_add.png"), getMessage("addtrusteddomain-menu-label").format(domain), lambda: self.addTrustedDomain(domain)) |
220 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "delete.png"), getMessage("removefromplaylist-menu-label"), lambda: self.deleteSelectedPlaylistItems()) |
221 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "shield_add.png")), getMessage("addtrusteddomain-menu-label").format(domain), lambda: self.addTrustedDomain(domain)) |
222 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "delete.png")), getMessage("removefromplaylist-menu-label"), lambda: self.deleteSelectedPlaylistItems()) |
223 |
+ menu.addSeparator() |
224 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "arrow_switch.png"), getMessage("shuffleremainingplaylist-menu-label"), lambda: self.shuffleRemainingPlaylist()) |
225 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "arrow_switch.png"), getMessage("shuffleentireplaylist-menu-label"), lambda: self.shuffleEntirePlaylist()) |
226 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "arrow_undo.png"), getMessage("undoplaylist-menu-label"), lambda: self.undoPlaylistChange()) |
227 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "film_edit.png"), getMessage("editplaylist-menu-label"), lambda: self.openEditPlaylistDialog()) |
228 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "film_add.png"), getMessage("addfilestoplaylist-menu-label"), lambda: self.OpenAddFilesToPlaylistDialog()) |
229 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "world_add.png"), getMessage("addurlstoplaylist-menu-label"), lambda: self.OpenAddURIsToPlaylistDialog()) |
230 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "arrow_switch.png")), getMessage("shuffleremainingplaylist-menu-label"), lambda: self.shuffleRemainingPlaylist()) |
231 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "arrow_switch.png")), getMessage("shuffleentireplaylist-menu-label"), lambda: self.shuffleEntirePlaylist()) |
232 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "arrow_undo.png")), getMessage("undoplaylist-menu-label"), lambda: self.undoPlaylistChange()) |
233 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "film_edit.png")), getMessage("editplaylist-menu-label"), lambda: self.openEditPlaylistDialog()) |
234 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "film_add.png")), getMessage("addfilestoplaylist-menu-label"), lambda: self.OpenAddFilesToPlaylistDialog()) |
235 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "world_add.png")), getMessage("addurlstoplaylist-menu-label"), lambda: self.OpenAddURIsToPlaylistDialog()) |
236 |
+ menu.addSeparator() |
237 |
+ menu.addAction(getMessage("loadplaylistfromfile-menu-label"),lambda: self.OpenLoadPlaylistFromFileDialog()) # TODO: Add icon |
238 |
+ menu.addAction("Load and shuffle playlist from file",lambda: self.OpenLoadPlaylistFromFileDialog(shuffle=True)) # TODO: Add icon and messages_en |
239 |
+ menu.addAction(getMessage("saveplaylisttofile-menu-label"),lambda: self.OpenSavePlaylistToFileDialog()) # TODO: Add icon |
240 |
+ menu.addSeparator() |
241 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "film_folder_edit.png"), getMessage("setmediadirectories-menu-label"), lambda: self.openSetMediaDirectoriesDialog()) |
242 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "shield_edit.png"), getMessage("settrusteddomains-menu-label"), lambda: self.openSetTrustedDomainsDialog()) |
243 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "film_folder_edit.png")), getMessage("setmediadirectories-menu-label"), lambda: self.openSetMediaDirectoriesDialog()) |
244 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "shield_edit.png")), getMessage("settrusteddomains-menu-label"), lambda: self.openSetTrustedDomainsDialog()) |
245 |
+ menu.exec_(self.playlist.viewport().mapToGlobal(position)) |
246 |
+ |
247 |
+ def openRoomMenu(self, position): |
248 |
+@@ -778,25 +788,25 @@ def openRoomMenu(self, position): |
249 |
+ elif username and filename and filename != getMessage("nofile-note"): |
250 |
+ if self.config['sharedPlaylistEnabled'] and not self.isItemInPlaylist(filename): |
251 |
+ if isURL(filename): |
252 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "world_add.png"), addUsersStreamToPlaylistLabelText, lambda: self.addStreamToPlaylist(filename)) |
253 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "world_add.png")), addUsersStreamToPlaylistLabelText, lambda: self.addStreamToPlaylist(filename)) |
254 |
+ else: |
255 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "film_add.png"), addUsersFileToPlaylistLabelText, lambda: self.addStreamToPlaylist(filename)) |
256 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "film_add.png")), addUsersFileToPlaylistLabelText, lambda: self.addStreamToPlaylist(filename)) |
257 |
+ |
258 |
+ if self._syncplayClient.userlist.currentUser.file is None or filename != self._syncplayClient.userlist.currentUser.file["name"]: |
259 |
+ if isURL(filename): |
260 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "world_go.png"), getMessage("openusersstream-menu-label").format(shortUsername), lambda: self.openFile(filename, resetPosition=False, fromUser=True)) |
261 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "world_go.png")), getMessage("openusersstream-menu-label").format(shortUsername), lambda: self.openFile(filename, resetPosition=False, fromUser=True)) |
262 |
+ else: |
263 |
+ pathFound = self._syncplayClient.fileSwitch.findFilepath(filename) |
264 |
+ if pathFound: |
265 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "film_go.png"), getMessage("openusersfile-menu-label").format(shortUsername), lambda: self.openFile(pathFound, resetPosition=False, fromUser=True)) |
266 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "film_go.png")), getMessage("openusersfile-menu-label").format(shortUsername), lambda: self.openFile(pathFound, resetPosition=False, fromUser=True)) |
267 |
+ if self._syncplayClient.isUntrustedTrustableURI(filename): |
268 |
+ domain = utils.getDomainFromURL(filename) |
269 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "shield_add.png"), getMessage("addtrusteddomain-menu-label").format(domain), lambda: self.addTrustedDomain(domain)) |
270 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "shield_add.png")), getMessage("addtrusteddomain-menu-label").format(domain), lambda: self.addTrustedDomain(domain)) |
271 |
+ |
272 |
+ if not isURL(filename) and filename != getMessage("nofile-note"): |
273 |
+ path = self._syncplayClient.fileSwitch.findFilepath(filename) |
274 |
+ if path: |
275 |
+- menu.addAction(QtGui.QPixmap(resourcespath + "folder_film.png"), getMessage('open-containing-folder'), lambda: utils.open_system_file_browser(path)) |
276 |
++ menu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + "folder_film.png")), getMessage('open-containing-folder'), lambda: utils.open_system_file_browser(path)) |
277 |
+ else: |
278 |
+ return |
279 |
+ menu.exec_(self.listTreeView.viewport().mapToGlobal(position)) |
280 |
+@@ -808,7 +818,7 @@ def updateListGeometry(self): |
281 |
+ self.listTreeView.setFirstColumnSpanned(roomtocheck, self.listTreeView.rootIndex(), True) |
282 |
+ roomtocheck += 1 |
283 |
+ self.listTreeView.header().setStretchLastSection(False) |
284 |
+- if IsPySide2: |
285 |
++ if IsPySide2 or IsPyQt5: |
286 |
+ self.listTreeView.header().setSectionResizeMode(0, QtWidgets.QHeaderView.ResizeToContents) |
287 |
+ self.listTreeView.header().setSectionResizeMode(1, QtWidgets.QHeaderView.ResizeToContents) |
288 |
+ self.listTreeView.header().setSectionResizeMode(2, QtWidgets.QHeaderView.ResizeToContents) |
289 |
+@@ -822,7 +832,7 @@ def updateListGeometry(self): |
290 |
+ if self.listTreeView.header().width() < (NarrowTabsWidth+self.listTreeView.header().sectionSize(3)): |
291 |
+ self.listTreeView.header().resizeSection(3, self.listTreeView.header().width()-NarrowTabsWidth) |
292 |
+ else: |
293 |
+- if IsPySide2: |
294 |
++ if IsPySide2 or IsPyQt5: |
295 |
+ self.listTreeView.header().setSectionResizeMode(3, QtWidgets.QHeaderView.Stretch) |
296 |
+ if IsPySide: |
297 |
+ self.listTreeView.header().setResizeMode(3, QtWidgets.QHeaderView.Stretch) |
298 |
+@@ -1003,7 +1013,7 @@ def getInitialMediaDirectory(self, includeUserSpecifiedDirectories=True): |
299 |
+ defaultdirectory = QtGui.QDesktopServices.storageLocation(QtGui.QDesktopServices.HomeLocation) |
300 |
+ else: |
301 |
+ defaultdirectory = "" |
302 |
+- elif IsPySide2: |
303 |
++ elif IsPySide2 or IsPyQt5: |
304 |
+ if self.config["mediaSearchDirectories"] and os.path.isdir(self.config["mediaSearchDirectories"][0]) and includeUserSpecifiedDirectories: |
305 |
+ defaultdirectory = self.config["mediaSearchDirectories"][0] |
306 |
+ elif includeUserSpecifiedDirectories and os.path.isdir(self.mediadirectory): |
307 |
+@@ -1410,7 +1420,7 @@ def addTopLayout(self, window): |
308 |
+ window.chatInput.setMaxLength(constants.MAX_CHAT_MESSAGE_LENGTH) |
309 |
+ window.chatInput.returnPressed.connect(self.sendChatMessage) |
310 |
+ window.chatButton = QtWidgets.QPushButton( |
311 |
+- QtGui.QPixmap(resourcespath + 'email_go.png'), |
312 |
++ QtGui.QIcon(QtGui.QPixmap(resourcespath + 'email_go.png')), |
313 |
+ getMessage("sendmessage-label")) |
314 |
+ window.chatButton.pressed.connect(self.sendChatMessage) |
315 |
+ window.chatLayout = QtWidgets.QHBoxLayout() |
316 |
+@@ -1445,7 +1455,7 @@ def addTopLayout(self, window): |
317 |
+ window.listlabel = QtWidgets.QLabel(getMessage("userlist-heading-label")) |
318 |
+ if isMacOS: |
319 |
+ window.listlabel.setMinimumHeight(21) |
320 |
+- window.sslButton = QtWidgets.QPushButton(QtGui.QPixmap(resourcespath + 'lock_green.png').scaled(14, 14),"") |
321 |
++ window.sslButton = QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'lock_green.png').scaled(14, 14)),"") |
322 |
+ window.sslButton.setVisible(False) |
323 |
+ window.sslButton.setFixedHeight(21) |
324 |
+ window.sslButton.setFixedWidth(21) |
325 |
+@@ -1453,7 +1463,7 @@ def addTopLayout(self, window): |
326 |
+ window.sslButton.setStyleSheet("QPushButton:!hover{border: 1px solid gray;} QPushButton:hover{border:2px solid black;}") |
327 |
+ else: |
328 |
+ window.listlabel.setMinimumHeight(27) |
329 |
+- window.sslButton = QtWidgets.QPushButton(QtGui.QPixmap(resourcespath + 'lock_green.png'),"") |
330 |
++ window.sslButton = QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'lock_green.png')),"") |
331 |
+ window.sslButton.setVisible(False) |
332 |
+ window.sslButton.setFixedHeight(27) |
333 |
+ window.sslButton.setFixedWidth(27) |
334 |
+@@ -1485,7 +1495,7 @@ def addTopLayout(self, window): |
335 |
+ window.roomsCombobox.setEditable(True) |
336 |
+ #window.roomsCombobox.setMaxLength(constants.MAX_ROOM_NAME_LENGTH) |
337 |
+ window.roomButton = QtWidgets.QPushButton( |
338 |
+- QtGui.QPixmap(resourcespath + 'door_in.png'), |
339 |
++ QtGui.QIcon(QtGui.QPixmap(resourcespath + 'door_in.png')), |
340 |
+ getMessage("joinroom-label")) |
341 |
+ window.roomButton.pressed.connect(self.joinRoom) |
342 |
+ window.roomButton.setFixedWidth(window.roomButton.sizeHint().width()+3) |
343 |
+@@ -1620,24 +1630,24 @@ def addPlaybackLayout(self, window): |
344 |
+ window.playbackFrame.setLayout(window.playbackLayout) |
345 |
+ window.seekInput = QtWidgets.QLineEdit() |
346 |
+ window.seekInput.returnPressed.connect(self.seekFromButton) |
347 |
+- window.seekButton = QtWidgets.QPushButton(QtGui.QPixmap(resourcespath + 'clock_go.png'), "") |
348 |
++ window.seekButton = QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'clock_go.png')), "") |
349 |
+ window.seekButton.setToolTip(getMessage("seektime-menu-label")) |
350 |
+ window.seekButton.pressed.connect(self.seekFromButton) |
351 |
+ window.seekInput.setText("0:00") |
352 |
+ window.seekInput.setFixedWidth(60) |
353 |
+ window.playbackLayout.addWidget(window.seekInput) |
354 |
+ window.playbackLayout.addWidget(window.seekButton) |
355 |
+- window.unseekButton = QtWidgets.QPushButton(QtGui.QPixmap(resourcespath + 'arrow_undo.png'), "") |
356 |
++ window.unseekButton = QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'arrow_undo.png')), "") |
357 |
+ window.unseekButton.setToolTip(getMessage("undoseek-menu-label")) |
358 |
+ window.unseekButton.pressed.connect(self.undoSeek) |
359 |
+ |
360 |
+ window.miscLayout = QtWidgets.QHBoxLayout() |
361 |
+ window.playbackLayout.addWidget(window.unseekButton) |
362 |
+- window.playButton = QtWidgets.QPushButton(QtGui.QPixmap(resourcespath + 'control_play_blue.png'), "") |
363 |
++ window.playButton = QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'control_play_blue.png')), "") |
364 |
+ window.playButton.setToolTip(getMessage("play-menu-label")) |
365 |
+ window.playButton.pressed.connect(self.play) |
366 |
+ window.playbackLayout.addWidget(window.playButton) |
367 |
+- window.pauseButton = QtWidgets.QPushButton(QtGui.QPixmap(resourcespath + 'control_pause_blue.png'), "") |
368 |
++ window.pauseButton = QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'control_pause_blue.png')), "") |
369 |
+ window.pauseButton.setToolTip(getMessage("pause-menu-label")) |
370 |
+ window.pauseButton.pressed.connect(self.pause) |
371 |
+ window.playbackLayout.addWidget(window.pauseButton) |
372 |
+@@ -1657,13 +1667,13 @@ def populateMenubar(self, window): |
373 |
+ # File menu |
374 |
+ |
375 |
+ window.fileMenu = QtWidgets.QMenu(getMessage("file-menu-label"), self) |
376 |
+- window.openAction = window.fileMenu.addAction(QtGui.QPixmap(resourcespath + 'folder_explore.png'), |
377 |
++ window.openAction = window.fileMenu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'folder_explore.png')), |
378 |
+ getMessage("openmedia-menu-label")) |
379 |
+ window.openAction.triggered.connect(self.browseMediapath) |
380 |
+- window.openAction = window.fileMenu.addAction(QtGui.QPixmap(resourcespath + 'world_explore.png'), |
381 |
++ window.openAction = window.fileMenu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'world_explore.png')), |
382 |
+ getMessage("openstreamurl-menu-label")) |
383 |
+ window.openAction.triggered.connect(self.promptForStreamURL) |
384 |
+- window.openAction = window.fileMenu.addAction(QtGui.QPixmap(resourcespath + 'film_folder_edit.png'), |
385 |
++ window.openAction = window.fileMenu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'film_folder_edit.png')), |
386 |
+ getMessage("setmediadirectories-menu-label")) |
387 |
+ window.openAction.triggered.connect(self.openSetMediaDirectoriesDialog) |
388 |
+ |
389 |
+@@ -1671,7 +1681,7 @@ def populateMenubar(self, window): |
390 |
+ if isMacOS(): |
391 |
+ window.exitAction.setMenuRole(QtWidgets.QAction.QuitRole) |
392 |
+ else: |
393 |
+- window.exitAction.setIcon(QtGui.QPixmap(resourcespath + 'cross.png')) |
394 |
++ window.exitAction.setIcon(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'cross.png'))) |
395 |
+ window.exitAction.triggered.connect(self.exitSyncplay) |
396 |
+ |
397 |
+ if(window.editMenu is not None): |
398 |
+@@ -1683,19 +1693,19 @@ def populateMenubar(self, window): |
399 |
+ |
400 |
+ window.playbackMenu = QtWidgets.QMenu(getMessage("playback-menu-label"), self) |
401 |
+ window.playAction = window.playbackMenu.addAction( |
402 |
+- QtGui.QPixmap(resourcespath + 'control_play_blue.png'), |
403 |
++ QtGui.QIcon(QtGui.QPixmap(resourcespath + 'control_play_blue.png')), |
404 |
+ getMessage("play-menu-label")) |
405 |
+ window.playAction.triggered.connect(self.play) |
406 |
+ window.pauseAction = window.playbackMenu.addAction( |
407 |
+- QtGui.QPixmap(resourcespath + 'control_pause_blue.png'), |
408 |
++ QtGui.QIcon(QtGui.QPixmap(resourcespath + 'control_pause_blue.png')), |
409 |
+ getMessage("pause-menu-label")) |
410 |
+ window.pauseAction.triggered.connect(self.pause) |
411 |
+ window.seekAction = window.playbackMenu.addAction( |
412 |
+- QtGui.QPixmap(resourcespath + 'clock_go.png'), |
413 |
++ QtGui.QIcon(QtGui.QPixmap(resourcespath + 'clock_go.png')), |
414 |
+ getMessage("seektime-menu-label")) |
415 |
+ window.seekAction.triggered.connect(self.seekPositionDialog) |
416 |
+ window.unseekAction = window.playbackMenu.addAction( |
417 |
+- QtGui.QPixmap(resourcespath + 'arrow_undo.png'), |
418 |
++ QtGui.QIcon(QtGui.QPixmap(resourcespath + 'arrow_undo.png')), |
419 |
+ getMessage("undoseek-menu-label")) |
420 |
+ window.unseekAction.triggered.connect(self.undoSeek) |
421 |
+ |
422 |
+@@ -1705,17 +1715,17 @@ def populateMenubar(self, window): |
423 |
+ |
424 |
+ window.advancedMenu = QtWidgets.QMenu(getMessage("advanced-menu-label"), self) |
425 |
+ window.setoffsetAction = window.advancedMenu.addAction( |
426 |
+- QtGui.QPixmap(resourcespath + 'timeline_marker.png'), |
427 |
++ QtGui.QIcon(QtGui.QPixmap(resourcespath + 'timeline_marker.png')), |
428 |
+ getMessage("setoffset-menu-label")) |
429 |
+ window.setoffsetAction.triggered.connect(self.setOffset) |
430 |
+ window.setTrustedDomainsAction = window.advancedMenu.addAction( |
431 |
+- QtGui.QPixmap(resourcespath + 'shield_edit.png'), |
432 |
++ QtGui.QIcon(QtGui.QPixmap(resourcespath + 'shield_edit.png')), |
433 |
+ getMessage("settrusteddomains-menu-label")) |
434 |
+ window.setTrustedDomainsAction.triggered.connect(self.openSetTrustedDomainsDialog) |
435 |
+ window.createcontrolledroomAction = window.advancedMenu.addAction( |
436 |
+- QtGui.QPixmap(resourcespath + 'page_white_key.png'), getMessage("createcontrolledroom-menu-label")) |
437 |
++ QtGui.QIcon(QtGui.QPixmap(resourcespath + 'page_white_key.png')), getMessage("createcontrolledroom-menu-label")) |
438 |
+ window.createcontrolledroomAction.triggered.connect(self.createControlledRoom) |
439 |
+- window.identifyascontroller = window.advancedMenu.addAction(QtGui.QPixmap(resourcespath + 'key_go.png'), |
440 |
++ window.identifyascontroller = window.advancedMenu.addAction(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'key_go.png')), |
441 |
+ getMessage("identifyascontroller-menu-label")) |
442 |
+ window.identifyascontroller.triggered.connect(self.identifyAsController) |
443 |
+ |
444 |
+@@ -1743,18 +1753,18 @@ def populateMenubar(self, window): |
445 |
+ window.helpMenu = QtWidgets.QMenu(getMessage("help-menu-label"), self) |
446 |
+ |
447 |
+ window.userguideAction = window.helpMenu.addAction( |
448 |
+- QtGui.QPixmap(resourcespath + 'help.png'), |
449 |
++ QtGui.QIcon(QtGui.QPixmap(resourcespath + 'help.png')), |
450 |
+ getMessage("userguide-menu-label")) |
451 |
+ window.userguideAction.triggered.connect(self.openUserGuide) |
452 |
+ window.updateAction = window.helpMenu.addAction( |
453 |
+- QtGui.QPixmap(resourcespath + 'application_get.png'), |
454 |
++ QtGui.QIcon(QtGui.QPixmap(resourcespath + 'application_get.png')), |
455 |
+ getMessage("update-menu-label")) |
456 |
+ window.updateAction.triggered.connect(self.userCheckForUpdates) |
457 |
+ |
458 |
+ if not isMacOS(): |
459 |
+ window.helpMenu.addSeparator() |
460 |
+ window.about = window.helpMenu.addAction( |
461 |
+- QtGui.QPixmap(resourcespath + 'syncplay.png'), |
462 |
++ QtGui.QIcon(QtGui.QPixmap(resourcespath + 'syncplay.png')), |
463 |
+ getMessage("about-menu-label")) |
464 |
+ else: |
465 |
+ window.about = window.helpMenu.addAction("&About") |
466 |
+@@ -1835,16 +1845,16 @@ def changeAutoplayState(self, source=None): |
467 |
+ def updateReadyIcon(self): |
468 |
+ ready = self.readyPushButton.isChecked() |
469 |
+ if ready: |
470 |
+- self.readyPushButton.setIcon(QtGui.QPixmap(resourcespath + 'tick_checkbox.png')) |
471 |
++ self.readyPushButton.setIcon(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'tick_checkbox.png'))) |
472 |
+ else: |
473 |
+- self.readyPushButton.setIcon(QtGui.QPixmap(resourcespath + 'empty_checkbox.png')) |
474 |
++ self.readyPushButton.setIcon(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'empty_checkbox.png'))) |
475 |
+ |
476 |
+ def updateAutoPlayIcon(self): |
477 |
+ ready = self.autoplayPushButton.isChecked() |
478 |
+ if ready: |
479 |
+- self.autoplayPushButton.setIcon(QtGui.QPixmap(resourcespath + 'tick_checkbox.png')) |
480 |
++ self.autoplayPushButton.setIcon(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'tick_checkbox.png'))) |
481 |
+ else: |
482 |
+- self.autoplayPushButton.setIcon(QtGui.QPixmap(resourcespath + 'empty_checkbox.png')) |
483 |
++ self.autoplayPushButton.setIcon(QtGui.QIcon(QtGui.QPixmap(resourcespath + 'empty_checkbox.png'))) |
484 |
+ |
485 |
+ def automaticUpdateCheck(self): |
486 |
+ currentDateTimeValue = QDateTime.currentDateTime() |
487 |
+@@ -2060,7 +2070,7 @@ def __init__(self, passedBar=None): |
488 |
+ self.populateMenubar(self) |
489 |
+ self.addMainFrame(self) |
490 |
+ self.loadSettings() |
491 |
+- self.setWindowIcon(QtGui.QPixmap(resourcespath + "syncplay.png")) |
492 |
++ self.setWindowIcon(QtGui.QIcon(QtGui.QPixmap(resourcespath + "syncplay.png"))) |
493 |
+ self.setWindowFlags(self.windowFlags() & Qt.WindowCloseButtonHint & Qt.WindowMinimizeButtonHint & ~Qt.WindowContextHelpButtonHint) |
494 |
+ self.show() |
495 |
+ self.setAcceptDrops(True) |
496 |
+ |
497 |
|
498 |
diff --git a/media-video/syncplay/syncplay-1.6.5.ebuild b/media-video/syncplay/syncplay-1.6.5-r1.ebuild |
499 |
similarity index 84% |
500 |
rename from media-video/syncplay/syncplay-1.6.5.ebuild |
501 |
rename to media-video/syncplay/syncplay-1.6.5-r1.ebuild |
502 |
index fe57aa04..7f1ad024 100644 |
503 |
--- a/media-video/syncplay/syncplay-1.6.5.ebuild |
504 |
+++ b/media-video/syncplay/syncplay-1.6.5-r1.ebuild |
505 |
@@ -30,11 +30,10 @@ RDEPEND=" |
506 |
vlc? ( media-video/vlc[lua] ) |
507 |
mpv? ( media-video/mpv[lua] ) |
508 |
mplayer? ( media-video/mplayer ) |
509 |
+ client? ( dev-python/QtPy[${PYTHON_USEDEP},gui] ) |
510 |
" |
511 |
|
512 |
-# RDEPEND on PySide2 for gui, but not packaged here at the moment |
513 |
-# It is a too big and complex package for me to maintain |
514 |
-# You can find PySide2 in the ::raiagent overlay |
515 |
+PATCHES=( "${FILESDIR}/${PN}-allow-PyQt5.patch" ) |
516 |
|
517 |
python_install() { |
518 |
local MY_MAKEOPTS=( DESTDIR="${D}" PREFIX=/usr ) |
519 |
@@ -51,8 +50,6 @@ python_install() { |
520 |
pkg_postinst() { |
521 |
xdg_pkg_postinst |
522 |
|
523 |
- optfeature "using the GUI (you can find it in the raiagent overlay)\n" dev-python/pyside2 |
524 |
- |
525 |
if use client; then |
526 |
elog "Syncplay supports the following players:" |
527 |
elog "media-video/mpv, media-video/mplayer, media-video/vlc\n" |