diff --git a/buildPy2exe.py b/buildPy2exe.py index 403bd4a..0d72229 100644 --- a/buildPy2exe.py +++ b/buildPy2exe.py @@ -657,6 +657,7 @@ guiIcons = ['resources/accept.png', 'resources/arrow_undo.png', 'resources/clock 'resources/film_go.png', 'resources/world_go.png', 'resources/arrow_refresh.png', 'resources/bullet_right_grey.png', 'resources/film_folder_edit.png', 'resources/shield_edit.png', + 'resources/email_go.png', 'resources/world_add.png', 'resources/film_add.png', 'resources/delete.png', 'resources/spinner.mng' ] resources = ["resources/icon.ico", "resources/syncplay.png"] diff --git a/resources/email_go.png b/resources/email_go.png new file mode 100644 index 0000000..4a6c5d3 Binary files /dev/null and b/resources/email_go.png differ diff --git a/syncplay/__init__.py b/syncplay/__init__.py index 31a5492..8e7ceec 100644 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,4 +1,4 @@ -version = '1.4.0' +version = '1.5.0' milestone = 'Yoitsu' release_number = '28' projectURL = 'http://syncplay.pl/' diff --git a/syncplay/client.py b/syncplay/client.py index a79e465..d363db2 100644 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -1703,7 +1703,6 @@ class FileSwitchManager(object): if highPriority and self.folderSearchEnabled: directoryList = self.mediaDirectories # Spin up hard drives to prevent premature timeout - randomFilename = u"RandomFile"+unicode(random.randrange(10000, 99999))+u".txt" for directory in directoryList: startTime = time.time() if os.path.isfile(os.path.join(directory, randomFilename)): diff --git a/syncplay/constants.py b/syncplay/constants.py index d5cbb7d..dfbab0c 100644 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -79,6 +79,7 @@ MPV_UNRESPONSIVE_THRESHOLD = 60.0 CONTROLLED_ROOMS_MIN_VERSION = "1.3.0" USER_READY_MIN_VERSION = "1.3.0" SHARED_PLAYLIST_MIN_VERSION = "1.4.0" +CHAT_MIN_VERSION = "1.5.0" MPC_PATHS = [ r"c:\program files (x86)\mpc-hc\mpc-hc.exe", r"c:\program files\mpc-hc\mpc-hc.exe", diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index f8f560e..6529800 100644 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -248,6 +248,8 @@ de = { "autoplay-guipushbuttonlabel" : u"Automatisch abspielen wenn alle bereit sind", "autoplay-minimum-label" : u"Minimum an Nutzern:", + "sendmessage-label" : u"Send", # TODO: Translate + "ready-guipushbuttonlabel" : u"Ich bin bereit den Film anzuschauen!", "roomuser-heading-label" : u"Raum / Benutzer", @@ -350,6 +352,7 @@ de = { "ready-tooltip" : u"Zeigt an, ob du bereit zum anschauen bist", "autoplay-tooltip" : u"Automatisch abspielen, wenn alle Nutzer bereit sind oder die minimale Nutzerzahl erreicht ist.", "switch-to-file-tooltip" : u"Doppelklicken um zu {} zu wechseln", # Filename + "sendmessage-tooltip" : u"Send message to room", # TODO: Translate # In-userlist notes (GUI) "differentsize-note" : u"Verschiedene Größe!", diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index e31ffb7..7bb63c6 100644 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -250,6 +250,8 @@ en = { "autoplay-guipushbuttonlabel" : u"Play when all ready", "autoplay-minimum-label" : u"Min users:", + "sendmessage-label" : u"Send", + "ready-guipushbuttonlabel" : u"I'm ready to watch!", "roomuser-heading-label" : "Room / User", @@ -350,6 +352,7 @@ en = { "ready-tooltip" : "Indicates whether you are ready to watch.", "autoplay-tooltip" : "Auto-play when all users who have readiness indicator are ready and minimum user threshold met.", "switch-to-file-tooltip" : u"Double click to switch to {}", # Filename + "sendmessage-tooltip" : u"Send message to room", # In-userlist notes (GUI) "differentsize-note" : "Different size!", diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 94804e4..81ecf7c 100644 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -250,6 +250,8 @@ ru = { "autoplay-guipushbuttonlabel" : u"Воспроизвести автоматически, когда все будут готовы", "autoplay-minimum-label" : u"Минимум пользователей:", + "sendmessage-label" : u"Send", # TODO: Translate + "ready-guipushbuttonlabel" : u"Я готов к просмотру!", "roomuser-heading-label" : u"Комната / Пользователь", @@ -350,6 +352,7 @@ ru = { "ready-tooltip" : u"Показывает, готовы ли Вы к просмотру или нет.", "autoplay-tooltip" : u"Автоматическое воспроизведение, когда все пользователи с индикаторами готовности будут готовы и присутствует достаточное число пользователей.", "switch-to-file-tooltip" : u"Double click to switch to {}", # Filename # TODO: Translate to Russian + "sendmessage-tooltip" : u"Send message to room", # TODO: Translate # In-userlist notes (GUI) "differentsize-note" : u"Размер файла не совпадает!", diff --git a/syncplay/protocols.py b/syncplay/protocols.py index 3c6c17e..096f19d 100644 --- a/syncplay/protocols.py +++ b/syncplay/protocols.py @@ -246,7 +246,8 @@ class SyncClientProtocol(JSONCommandProtocol): } }) def handleChat(self,message): - messageString = '<'+message['username']+'>'+message['message'] + userMessage = message['message'].replace(u"<",u"<<").replace(u">",u">>") + messageString = u"<{}> {}".format(message['username'], userMessage) self._client.ui.showMessage(messageString) #TODO diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index dc62c85..40eb494 100644 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -328,8 +328,12 @@ class MainWindow(QtGui.QMainWindow): def showMessage(self, message, noTimestamp=False): message = unicode(message) message = message.replace(u"&", u"&").replace(u'"', u""").replace(u"<", u"<").replace(">", u">") + message = message.replace(u"<<", u"") + message = message.replace(u">>", u"") message = message.replace(u"<", u"<".format(constants.STYLE_USERNAME)) message = message.replace(u">", u">") + message = message.replace(u";", u"<") + message = message.replace(u"", u">") message = message.replace(u"\n", u"
") if noTimestamp: self.newMessage(u"{}
".format(message)) @@ -962,6 +966,11 @@ class MainWindow(QtGui.QMainWindow): self._syncplayClient.playlist.changePlaylist(newPlaylist) self._syncplayClient.fileSwitch.updateInfo() + def sendChatMessage(self): + if self.chatInput.text() <> "": + self._syncplayClient.sendChat(self.chatInput.text()) + self.chatInput.setText("") + def addTopLayout(self, window): window.topSplit = self.topSplitter(Qt.Horizontal, self) @@ -977,12 +986,28 @@ class MainWindow(QtGui.QMainWindow): window.outputbox.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) window.outputlabel = QtGui.QLabel(getMessage("notifications-heading-label")) + window.chatInput = QtGui.QLineEdit() + window.chatInput.returnPressed.connect(self.sendChatMessage) + window.chatButton = QtGui.QPushButton(QtGui.QIcon(self.resourcespath + 'email_go.png'), + getMessage("sendmessage-label")) + window.chatButton.pressed.connect(self.sendChatMessage) + window.chatLayout = QtGui.QHBoxLayout() + window.chatFrame = QtGui.QFrame() + window.chatFrame.setLayout(self.chatLayout) + window.chatFrame.setContentsMargins(0,0,0,0) + window.chatFrame.setSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum) + window.chatLayout.setContentsMargins(0,0,0,0) + self.chatButton.setToolTip(getMessage("sendmessage-tooltip")) + window.chatLayout.addWidget(window.chatInput) + window.chatLayout.addWidget(window.chatButton) + window.chatFrame.setMaximumHeight(window.chatFrame.sizeHint().height()) window.outputFrame = QtGui.QFrame() window.outputFrame.setLineWidth(0) window.outputFrame.setMidLineWidth(0) window.outputLayout.setContentsMargins(0, 0, 0, 0) window.outputLayout.addWidget(window.outputlabel) window.outputLayout.addWidget(window.outputbox) + window.outputLayout.addWidget(window.chatFrame) window.outputFrame.setLayout(window.outputLayout) window.listLayout = QtGui.QVBoxLayout()