Skip to content

Commit

Permalink
New Button for applying a duration change to all frames.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Puhl committed Nov 11, 2014
1 parent 797d4e1 commit 4e09da5
Show file tree
Hide file tree
Showing 11 changed files with 188 additions and 141 deletions.
4 changes: 4 additions & 0 deletions blinkcomponents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions blinkgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion color_transition_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion ethernet_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion lg_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
12 changes: 11 additions & 1 deletion mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down
22 changes: 22 additions & 0 deletions mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,28 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="durationButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>25</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="focusPolicy">
<enum>Qt::TabFocus</enum>
</property>
<property name="text">
<string>Apply for all frames</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
Expand Down
2 changes: 1 addition & 1 deletion res_rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion text_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
Binary file modified translations/blinkgui_de.qm
Binary file not shown.
Loading

0 comments on commit 4e09da5

Please sign in to comment.