mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-18 09:35:45 -04:00
CommonHostInterface: Add undo load state feature
This commit is contained in:
@ -993,6 +993,9 @@ void QtHostInterface::populateSaveStateMenus(const char* game_code, QMenu* load_
|
||||
|
||||
loadState(path);
|
||||
});
|
||||
QAction* load_from_state = load_menu->addAction(tr("Undo Load State"));
|
||||
load_from_state->setEnabled(CanUndoLoadState());
|
||||
connect(load_from_state, &QAction::triggered, this, &QtHostInterface::undoLoadState);
|
||||
load_menu->addSeparator();
|
||||
|
||||
connect(save_menu->addAction(tr("Save To File...")), &QAction::triggered, [this]() {
|
||||
@ -1341,6 +1344,17 @@ void QtHostInterface::saveState(bool global, qint32 slot, bool block_until_done
|
||||
SaveState(global, slot);
|
||||
}
|
||||
|
||||
void QtHostInterface::undoLoadState()
|
||||
{
|
||||
if (!isOnWorkerThread())
|
||||
{
|
||||
QMetaObject::invokeMethod(this, "undoLoadState", Qt::QueuedConnection);
|
||||
return;
|
||||
}
|
||||
|
||||
UndoLoadState();
|
||||
}
|
||||
|
||||
void QtHostInterface::setAudioOutputVolume(int volume, int fast_forward_volume)
|
||||
{
|
||||
if (!isOnWorkerThread())
|
||||
|
@ -165,6 +165,7 @@ public Q_SLOTS:
|
||||
void loadState(bool global, qint32 slot);
|
||||
void saveState(const QString& filename, bool block_until_done = false);
|
||||
void saveState(bool global, qint32 slot, bool block_until_done = false);
|
||||
void undoLoadState();
|
||||
void setAudioOutputVolume(int volume, int fast_forward_volume);
|
||||
void setAudioOutputMuted(bool muted);
|
||||
void startDumpingAudio();
|
||||
|
Reference in New Issue
Block a user