From 4e09da56d0817a1fb369805b996b12969d36c3cd Mon Sep 17 00:00:00 2001 From: Michael Puhl Date: Tue, 11 Nov 2014 16:12:04 +0100 Subject: [PATCH] New Button for applying a duration change to all frames. --- blinkcomponents.py | 4 + blinkgui.py | 5 + color_transition_dialog.py | 2 +- ethernet_dialog.py | 2 +- lg_dialog.py | 2 +- mainwindow.py | 12 +- mainwindow.ui | 22 +++ res_rc.py | 2 +- text_dialog.py | 2 +- translations/blinkgui_de.qm | Bin 9613 -> 9720 bytes translations/blinkgui_de.ts | 276 ++++++++++++++++++------------------ 11 files changed, 188 insertions(+), 141 deletions(-) diff --git a/blinkcomponents.py b/blinkcomponents.py index 1fe19d4..5ae6928 100644 --- a/blinkcomponents.py +++ b/blinkcomponents.py @@ -187,6 +187,10 @@ def get_current_frame(self): def set_current_duration(self, duration): self.frames[self.current_frame_num].duration = duration + def set_all_duration(self, duration): + for f in self.frames: + f.duration = duration + def get_current_duration(self): return self.frames[self.current_frame_num].duration diff --git a/blinkgui.py b/blinkgui.py index 89327f2..325d7ec 100755 --- a/blinkgui.py +++ b/blinkgui.py @@ -39,6 +39,10 @@ def _color_button_clicked(self): color = QtGui.QColorDialog.getColor(QtGui.QColor.fromRgb(*self.__grid.current_color)) if color.isValid(): self._set_working_color(color.getRgb()[:3]) + + def _duration_button_clicked(self): + self.__grid.set_all_duration(self.durationSpinBox.value()) + self.update_frame_controls() def _create_frame_button_clicked(self): self.__grid.create_new_frame(self.durationSpinBox.value()) @@ -398,6 +402,7 @@ def _connect_slots(self): self._connect_slot(self.actionDelete_colors.triggered, self.__grid.delete_selected) self._connect_slot(self.actionAbout.triggered, self._show_about) self._connect_slot(self.actionAbout_Qt.triggered, QtGui.QApplication.aboutQt) + self._connect_slot(self.durationButton.clicked, self._duration_button_clicked) def _connect_ethernet(self): from simple_dialogs import EthernetDialog diff --git a/color_transition_dialog.py b/color_transition_dialog.py index eccad32..870a27f 100644 --- a/color_transition_dialog.py +++ b/color_transition_dialog.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'color_transition_dialog.ui' # -# Created: Thu Oct 30 16:33:24 2014 +# Created: Tue Nov 11 16:07:36 2014 # by: pyside-uic 0.2.15 running on PySide 1.2.2 # # WARNING! All changes made in this file will be lost! diff --git a/ethernet_dialog.py b/ethernet_dialog.py index 7f5aeb9..6f60fd5 100644 --- a/ethernet_dialog.py +++ b/ethernet_dialog.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'ethernet_dialog.ui' # -# Created: Thu Oct 30 16:33:24 2014 +# Created: Tue Nov 11 16:07:36 2014 # by: pyside-uic 0.2.15 running on PySide 1.2.2 # # WARNING! All changes made in this file will be lost! diff --git a/lg_dialog.py b/lg_dialog.py index d17493e..1c7275e 100644 --- a/lg_dialog.py +++ b/lg_dialog.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'lg_dialog.ui' # -# Created: Thu Oct 30 16:33:24 2014 +# Created: Tue Nov 11 16:07:36 2014 # by: pyside-uic 0.2.15 running on PySide 1.2.2 # # WARNING! All changes made in this file will be lost! diff --git a/mainwindow.py b/mainwindow.py index c2dbfd3..db5ea37 100644 --- a/mainwindow.py +++ b/mainwindow.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'mainwindow.ui' # -# Created: Thu Oct 30 16:33:24 2014 +# Created: Tue Nov 11 16:07:36 2014 # by: pyside-uic 0.2.15 running on PySide 1.2.2 # # WARNING! All changes made in this file will be lost! @@ -232,6 +232,15 @@ def setupUi(self, MainWindow): self.durationSpinBox.setProperty("value", 100) self.durationSpinBox.setObjectName("durationSpinBox") self.verticalLayout.addWidget(self.durationSpinBox) + self.durationButton = QtGui.QPushButton(self.currentFrameBox) + self.durationButton.setMinimumSize(QtCore.QSize(0, 25)) + font = QtGui.QFont() + font.setWeight(50) + font.setBold(False) + self.durationButton.setFont(font) + self.durationButton.setFocusPolicy(QtCore.Qt.TabFocus) + self.durationButton.setObjectName("durationButton") + self.verticalLayout.addWidget(self.durationButton) self.verticalLayout_9.addLayout(self.verticalLayout) self.verticalLayout_3.addWidget(self.currentFrameBox) self.playerBox = QtGui.QGroupBox(self.dockWidgetContents) @@ -688,6 +697,7 @@ def retranslateUi(self, MainWindow): self.tintButton.setText(QtGui.QApplication.translate("MainWindow", "Tint selected tiles", None, QtGui.QApplication.UnicodeUTF8)) self.currentFrameBox.setTitle(QtGui.QApplication.translate("MainWindow", "Current Frame", None, QtGui.QApplication.UnicodeUTF8)) self.label.setText(QtGui.QApplication.translate("MainWindow", "Duration (ms)", None, QtGui.QApplication.UnicodeUTF8)) + self.durationButton.setText(QtGui.QApplication.translate("MainWindow", "Apply for all frames", None, QtGui.QApplication.UnicodeUTF8)) self.playerBox.setTitle(QtGui.QApplication.translate("MainWindow", "Player", None, QtGui.QApplication.UnicodeUTF8)) self.loopCheckbox.setText(QtGui.QApplication.translate("MainWindow", "Loop playback", None, QtGui.QApplication.UnicodeUTF8)) self.playButton.setText(QtGui.QApplication.translate("MainWindow", "Playback", None, QtGui.QApplication.UnicodeUTF8)) diff --git a/mainwindow.ui b/mainwindow.ui index 9e7bf1f..a5da389 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -568,6 +568,28 @@ + + + + + 0 + 25 + + + + + 50 + false + + + + Qt::TabFocus + + + Apply for all frames + + + diff --git a/res_rc.py b/res_rc.py index 076586b..28b0433 100644 --- a/res_rc.py +++ b/res_rc.py @@ -2,7 +2,7 @@ # Resource object code # -# Created: Do. Okt 30 16:33:24 2014 +# Created: Di. Nov 11 16:07:36 2014 # by: The Resource Compiler for PySide (Qt v4.8.6) # # WARNING! All changes made in this file will be lost! diff --git a/text_dialog.py b/text_dialog.py index 5242a78..203aa4e 100644 --- a/text_dialog.py +++ b/text_dialog.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'text_dialog.ui' # -# Created: Thu Oct 30 16:33:24 2014 +# Created: Tue Nov 11 16:07:36 2014 # by: pyside-uic 0.2.15 running on PySide 1.2.2 # # WARNING! All changes made in this file will be lost! diff --git a/translations/blinkgui_de.qm b/translations/blinkgui_de.qm index 220222bf748e45ef4ae8fd4d6880afda0710077c..407d4136e2c1ad3b07234e9ca38aaa362bf27def 100644 GIT binary patch delta 753 zcmX9+ZAepL6n^e?yPNZF%egt-T$>*$nU$hRW`Uv(b4F9w^Yx8@cIxCQtZlzYVaa+umlKpBCDhr2+$$B zlOmgfeU>voXb$q?WkBF399jDTXzw6@oa$kE6f`~|vSpMhS^;$e9_CJwfE7lv8Usj` zOt`BV@abkOKW_p02*zoe2V_mm`S^0cZ;iQn?-Jme^G|xpigbNMk<1=&tN?r)Ta}vy zh)3DBb8~ljb=J;$)daPnhn+u^NBV=^JD5a;Axsc?gOJ1(|6^#YyN*#eOb9yd z9mG2;bflA>pn9RhzK6_!u*FEtYpq=3-7iEo$)!nD0JE7(OQ5JJ;*76pU0%xNdp^@X zhAXNh)AR*gc}OoH5_8U$1VA^&)z5q&e|WC9YY9-+aS+aC$mC@vI76HSM^kX8E*_*Qrqi6q8d z$Ld2}lGs%0S34m|=57+!w8Z?2B&ZaUvgJmi9&rz{+Z*2bb$iJ@$xgq~8melRc&;l0 z5R~w`!_zdVt$f5x4d8#7&w6l$2G+)Bx16Ln%sV`N0QZt_;x`f6HvZZx3+;>MpEIOX zcai^{?jb`SNmCYv=zz3Kdn%e~3XF6ijXF?$m1RFut~YFQ+kEu0Qu$bYCzWfD(;?a4 z-{n)Q$c%*%tEhqjW?1RAP-diWGi;Ps|Et?^igG)SuD`{gi=#)GT3Km5Z8&zK%3!uy N-Hb-tuLyL?{{jl~zn1_2 delta 686 zcmXAmdq|T}7{;IPY&-k*`EAR&d7n!xBeSa}*#!(QlrAWp6;ebk)3iiNMP`MDCh?M5oLuj!y?SIdZoV}&ikJCJ-_EUGa2<6O~$on0M$bv z;uv6i0t9!0-6qvaWdy3Co4ZTIa!NHEgvhXBJ6tnH*M z2|IF61B-pI#p!^+3hbT#K|@K%c}Dffd)QZXhaPK1zM-D_&v7gBJps%L(p)T{H40J9 zHGrZ^$o<((_Z|sl89qQ)E!4&p0DkjA%eC`B^Q3>Gjj7GOfax{c>6iuNMs^}I9T2^& z@$4j_J!bA{>a!v?7(}ZU^)O$yjZg+$>xBe^<$*H#GHntI|7&E7t6T_j7AxC}S^-O~ z%8^1m!C@*#(H05=s=BlV^BSIT^%Ffd&XXk*AS~y}@uVShJZ+5n`aGV~_L0Ks<_C%? zw1{84Alwb8MP61H518|K#l&06=Q?+He5Y_t{7cqGI@|fTT~P!ZP~|c)%XUe9{LND! zJYIc67@^plqPa4HaE8UiEAMDsnz&z#ARgAT&!;I5pOimSMS9rfVXK`beqDo)CYg7n z0!q7V-u;2lN8}|FC4m10IsIk>S&Wsfb)}?s+0oVu@L{=HUJ3+^$`?m-X)Z>-E1aac zX!%b{8%5KnO`7shf2Fpku!jCa&`u?jC(}8db;wB84WC`53X4vuAE{`kvgs)K{@U+W MoHF#62bSso0gJh` - + + @default - + Save file Datei speichern - + Export frame Frame exportieren - + Open file Datei öffnen - + New file Neue Datei - + Please enter the grid dimensions: Maße eingeben (HxB): - + Undo Rückgängig - + Undo "%s" "%s" rückgängig machen - + SHIFT: Left-Click on a tile to record its color SHIFT: Links-Klicken auf eine Kachel, um die Farbe zu speichern - + CTRL: Left-Click to select multiple tiles CTRL: Links-Klicken um mehrere Kacheln auszuwählen - + Error Fehler @@ -58,67 +59,67 @@ Verbindung konnte nicht aufgebaut werden - + Delete frame Frame löschen - + Color tile Kachel färben - + Set color Farbe wählen - + Frame: %d/%d, Total duration: %dms Frame: %d/%d, Gesamtdauer: %dms - + Go to frame Gehe zu Frame - + Please enter the frame number: Frame-Nummer: - + Play on device Auf Gerät abspielen - + Play preview Vorschau abspielen - + Stop playback Abspielen stoppen - + A connection already exists. Es besteht bereits eine Verbindung. - + Import frame Frame importieren - + Connection could not be established. Verbindung konnte nicht aufgebaut werden. - + File does not exist. Datei wurde nicht gefunden. @@ -212,12 +213,12 @@ MainWindow - + Blink - + (CTRL+) Left-click to select a tile, right-click to tint (STRG+) Links-Klick,, um eine Kachel auszuwählen, Rechts-Klick zum Färben @@ -227,7 +228,7 @@ Farbeinstellungen - + Tint selected tiles Markierte Kacheln färben @@ -237,7 +238,7 @@ Frameeinstellungen - + Duration (ms) Dauer (ms) @@ -247,7 +248,7 @@ Playeroptionen - + Loop playback Endlosschleife @@ -257,42 +258,42 @@ Dateiinformationen - + Property Eigenschaft - + Value Wert - + &File &Datei - + &Frame - + &Selection &Auswahl - + &Edit &Bearbeiten - + &Coloring &Färben - + &Player @@ -302,7 +303,7 @@ Gerät - + Generate Generieren @@ -312,7 +313,7 @@ &Neuen, leeren Frame erstellen - + F @@ -322,42 +323,42 @@ Frame entfernen - + R - + E&xit &Beenden - + Ctrl+Q - + &Load BLM BML &laden - + Load BML BML laden - + Ctrl+L - + &Duplicate current frame Aktuellen Frame &duplizieren - + D @@ -367,17 +368,17 @@ Sequenz abs&pielen - + Ctrl+P - + &New &Neu - + Ctrl+N @@ -387,7 +388,7 @@ &Speichern als BML - + Ctrl+S @@ -407,72 +408,72 @@ Zu &nächstem Frame springen - + Select &all &Alle auswählen - + Ctrl+A - + &Deselect all Alle &deselektieren - + Ctrl+Shift+A - + &Invert &Invertieren - + Ctrl+I - + Select by &color Nach &Farbe selektieren - + Ctrl+Shift+C - + &Undo &Rückgängig machen - + Ctrl+Z - + Choose &color Farbe &wählen - + C - + &Tint selected tiles Ausgewählte &Kacheln färben - + T @@ -482,12 +483,12 @@ Nach links bewegen - + Shift content left Inhalt nach links bewegen - + Shift+Left @@ -497,7 +498,7 @@ Nach rechts bewegen - + Shift+Right @@ -512,17 +513,17 @@ Live-Modus aktivieren - + Play on device Auf Gerät abspielen - + Randomize selected tiles Ausgewählte Kacheln randomisieren - + Z @@ -532,7 +533,7 @@ Nach oben bewegen - + Shift+Up @@ -542,72 +543,72 @@ Nach unten bewegen - + Shift+Down - + Copy colors Farben kopieren - + Ctrl+C - + Paste selection Markierung einfügen - + Ctrl+V - + Persist changes Änderungen übernehmen - + Return - + Cut colors Farben ausschneiden - + Ctrl+X - + Export as image Als Bild exportieren - + Color gradient Farbübergang - + &Save as... &Speichern unter... - + Save as... Speichern unter... - + Save Speichern @@ -617,122 +618,122 @@ Gehe zu Frame... - + Zoom in Einzoomen - + Ctrl+= - + Zoom out Auszoomen - + Ctrl+- - + Fit zoom Größe automatisch anpassen - + Ctrl+0 - + Playback Abspielen - + Playback on Device Auf Gerät abspielen - + &Play preview &Vorschau abspielen - + Connect to device Mit Gerät verbinden - + Ctrl+F - + Function Funktion - + Settings Einstellungen - + Color Farbe - + Current Frame Aktueller Frame - + Player - + Toolbar - + File information Dateiinformationen - + Ctrl+Return - + Import from image Bild importieren - + Rotate right Rechts rotieren - + Ctrl+Right - + Rotate left Links rotieren - + Ctrl+Left @@ -742,77 +743,77 @@ Farben löschen - + Del - + Export frames Frames exportieren - + &Go to... &Gehe zu... - + &Shift - + &Previous frame &Vorheriger Frame - + &Next frame &Nächster Frame - + Left Links - + Right Rechts - + Up Hoch - + Down Runter - + Enter frame... Frame eingeben... - + D&elete colors Farben &löschen - + New Neu - + &Empty frame &Leerer Frame - + Remove Entfernen @@ -822,55 +823,60 @@ Lauftext - + Ticker text Laufschrift - + %p% (Frame %v/%m) - + USB - + Bluetooth - + Disconnect Trennen - + Info - + About Qt - + Ethernet - + P - + N + + + Apply for all frames + Für alle Frames anwenden + TickerDialog