mirror of
https://github.com/mupen64plus/mupen64plus-ui-python.git
synced 2025-04-02 10:51:53 -04:00
add Limit FPS action
This commit is contained in:
parent
b0cb5be057
commit
c9c9475603
4 changed files with 41 additions and 1 deletions
|
@ -275,6 +275,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||||
self.actionMute.setEnabled(action)
|
self.actionMute.setEnabled(action)
|
||||||
self.actionStop.setEnabled(action)
|
self.actionStop.setEnabled(action)
|
||||||
self.actionReset.setEnabled(action)
|
self.actionReset.setEnabled(action)
|
||||||
|
self.actionLimitFPS.setEnabled(action)
|
||||||
self.actionSlowDown.setEnabled(action)
|
self.actionSlowDown.setEnabled(action)
|
||||||
self.actionSpeedUp.setEnabled(action)
|
self.actionSpeedUp.setEnabled(action)
|
||||||
self.actionFullscreen.setEnabled(action)
|
self.actionFullscreen.setEnabled(action)
|
||||||
|
@ -299,6 +300,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||||
self.stack.setCurrentWidget(self.view)
|
self.stack.setCurrentWidget(self.view)
|
||||||
self.actionMute.setChecked(False)
|
self.actionMute.setChecked(False)
|
||||||
self.actionPause.setChecked(False)
|
self.actionPause.setChecked(False)
|
||||||
|
self.actionLimitFPS.setChecked(True)
|
||||||
self.on_set_caption("M64Py")
|
self.on_set_caption("M64Py")
|
||||||
self.update_status("ROM closed.")
|
self.update_status("ROM closed.")
|
||||||
del self.cheats
|
del self.cheats
|
||||||
|
@ -393,6 +395,11 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||||
"""Resets emulator."""
|
"""Resets emulator."""
|
||||||
self.worker.reset()
|
self.worker.reset()
|
||||||
|
|
||||||
|
@pyqtSignature("")
|
||||||
|
def on_actionLimitFPS_triggered(self):
|
||||||
|
"""Toggles speed limit."""
|
||||||
|
self.worker.toggle_speed_limit()
|
||||||
|
|
||||||
@pyqtSignature("")
|
@pyqtSignature("")
|
||||||
def on_actionSlowDown_triggered(self):
|
def on_actionSlowDown_triggered(self):
|
||||||
"""Speeds down emulator."""
|
"""Speeds down emulator."""
|
||||||
|
|
|
@ -264,6 +264,15 @@ class Worker(QThread):
|
||||||
else:
|
else:
|
||||||
self.core_state_set(M64CORE_AUDIO_MUTE, 1)
|
self.core_state_set(M64CORE_AUDIO_MUTE, 1)
|
||||||
|
|
||||||
|
def toggle_speed_limit(self):
|
||||||
|
"""Toggles speed limiter."""
|
||||||
|
if self.core_state_query(M64CORE_SPEED_LIMITER):
|
||||||
|
self.core_state_set(M64CORE_SPEED_LIMITER, 0)
|
||||||
|
log.info("Speed limiter disabled")
|
||||||
|
else:
|
||||||
|
self.core_state_set(M64CORE_SPEED_LIMITER, 1)
|
||||||
|
log.info("Speed limiter enabled")
|
||||||
|
|
||||||
def toggle_actions(self):
|
def toggle_actions(self):
|
||||||
"""Toggles actions state."""
|
"""Toggles actions state."""
|
||||||
self.state = self.core_state_query(M64CORE_EMU_STATE)
|
self.state = self.core_state_query(M64CORE_EMU_STATE)
|
||||||
|
|
|
@ -119,6 +119,8 @@
|
||||||
<addaction name="actionStop"/>
|
<addaction name="actionStop"/>
|
||||||
<addaction name="actionReset"/>
|
<addaction name="actionReset"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionLimitFPS"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
<addaction name="actionSlowDown"/>
|
<addaction name="actionSlowDown"/>
|
||||||
<addaction name="actionSpeedUp"/>
|
<addaction name="actionSpeedUp"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
|
@ -576,6 +578,20 @@ QStatusBar { margin:0px; }</string>
|
||||||
<string>Save As...</string>
|
<string>Save As...</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionLimitFPS">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Limit FPS</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="images.qrc"/>
|
<include location="images.qrc"/>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Form implementation generated from reading ui file 'mainwindow.ui'
|
# Form implementation generated from reading ui file 'mainwindow.ui'
|
||||||
#
|
#
|
||||||
# Created: Fri Jun 7 14:15:00 2013
|
# Created: Fri Jun 7 16:09:00 2013
|
||||||
# by: PyQt4 UI code generator 4.10.1
|
# by: PyQt4 UI code generator 4.10.1
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
|
@ -248,6 +248,11 @@ class Ui_MainWindow(object):
|
||||||
self.actionSaveAs.setEnabled(False)
|
self.actionSaveAs.setEnabled(False)
|
||||||
self.actionSaveAs.setIcon(icon9)
|
self.actionSaveAs.setIcon(icon9)
|
||||||
self.actionSaveAs.setObjectName(_fromUtf8("actionSaveAs"))
|
self.actionSaveAs.setObjectName(_fromUtf8("actionSaveAs"))
|
||||||
|
self.actionLimitFPS = QtGui.QAction(MainWindow)
|
||||||
|
self.actionLimitFPS.setCheckable(True)
|
||||||
|
self.actionLimitFPS.setChecked(True)
|
||||||
|
self.actionLimitFPS.setEnabled(False)
|
||||||
|
self.actionLimitFPS.setObjectName(_fromUtf8("actionLimitFPS"))
|
||||||
self.menuLoad.addAction(self.actionManually)
|
self.menuLoad.addAction(self.actionManually)
|
||||||
self.menuLoad.addAction(self.actionFromList)
|
self.menuLoad.addAction(self.actionFromList)
|
||||||
self.menuFile.addAction(self.menuLoad.menuAction())
|
self.menuFile.addAction(self.menuLoad.menuAction())
|
||||||
|
@ -276,6 +281,8 @@ class Ui_MainWindow(object):
|
||||||
self.menuEmulation.addAction(self.actionStop)
|
self.menuEmulation.addAction(self.actionStop)
|
||||||
self.menuEmulation.addAction(self.actionReset)
|
self.menuEmulation.addAction(self.actionReset)
|
||||||
self.menuEmulation.addSeparator()
|
self.menuEmulation.addSeparator()
|
||||||
|
self.menuEmulation.addAction(self.actionLimitFPS)
|
||||||
|
self.menuEmulation.addSeparator()
|
||||||
self.menuEmulation.addAction(self.actionSlowDown)
|
self.menuEmulation.addAction(self.actionSlowDown)
|
||||||
self.menuEmulation.addAction(self.actionSpeedUp)
|
self.menuEmulation.addAction(self.actionSpeedUp)
|
||||||
self.menuEmulation.addSeparator()
|
self.menuEmulation.addSeparator()
|
||||||
|
@ -356,6 +363,7 @@ class Ui_MainWindow(object):
|
||||||
self.actionCheats.setShortcut(_translate("MainWindow", "F2", None))
|
self.actionCheats.setShortcut(_translate("MainWindow", "F2", None))
|
||||||
self.actionLoadFrom.setText(_translate("MainWindow", "Load From...", None))
|
self.actionLoadFrom.setText(_translate("MainWindow", "Load From...", None))
|
||||||
self.actionSaveAs.setText(_translate("MainWindow", "Save As...", None))
|
self.actionSaveAs.setText(_translate("MainWindow", "Save As...", None))
|
||||||
|
self.actionLimitFPS.setText(_translate("MainWindow", "Limit FPS", None))
|
||||||
|
|
||||||
import images_rc
|
import images_rc
|
||||||
import icons_rc
|
import icons_rc
|
||||||
|
|
Loading…
Add table
Reference in a new issue