Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions pcsx2-qt/Settings/EmulationSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ EmulationSettingsWidget::EmulationSettingsWidget(SettingsWindow* settings_dialog
m_ui.rtcDateTime->setDateRange(QDate(2000, 1, 1), QDate(2099, 12, 31));
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.manuallySetRealTimeClock, "EmuCore", "ManuallySetRealTimeClock", false);
connect(m_ui.manuallySetRealTimeClock, &QCheckBox::checkStateChanged, this, &EmulationSettingsWidget::onManuallySetRealTimeClockChanged);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.rtcUseSystemLocaleFormat, "EmuCore", "UseSystemLocaleFormat", false);
connect(m_ui.rtcUseSystemLocaleFormat, &QCheckBox::checkStateChanged, this, &EmulationSettingsWidget::onUseSystemLocaleFormatChanged);
EmulationSettingsWidget::onManuallySetRealTimeClockChanged();
EmulationSettingsWidget::onUseSystemLocaleFormatChanged();

m_ui.eeCycleRate->insertItem(0,
tr("Use Global Setting [%1]")
Expand Down Expand Up @@ -159,10 +162,12 @@ EmulationSettingsWidget::EmulationSettingsWidget(SettingsWindow* settings_dialog
dialog()->registerWidgetHelp(m_ui.manuallySetRealTimeClock, tr("Manually Set Real-Time Clock"), tr("Unchecked"),
tr("Manually set a real-time clock to use for the virtual PlayStation 2 instead of using your OS' system clock."));
dialog()->registerWidgetHelp(m_ui.rtcDateTime, tr("Real-Time Clock"), tr("Current date and time"),
tr("Real-time clock (RTC) used by the virtual PlayStation 2. Date format is the same as the one used by your OS. "
"This time is only applied upon booting the PS2; changing it while in-game will have no effect. "
"NOTE: This assumes you have your PS2 set to the default timezone of GMT+0 and default DST of Summer Time. "
tr("Real-time clock (RTC) used by the virtual PlayStation 2.<br>"
"This time is only applied upon booting the PS2; changing it while in-game will have no effect.<br>"
"NOTE: This assumes you have your PS2 set to the default timezone of GMT+0 and default DST of Summer Time.<br>"
"Some games require an RTC date/time set after their release date."));
dialog()->registerWidgetHelp(m_ui.rtcUseSystemLocaleFormat, tr("Use System Locale Format"), tr("User Preference"),
tr("Uses the operating system's date/time format rather than \"yyyy-MM-dd HH:mm:ss\". May exclude seconds."));

updateOptimalFramePacing();
updateUseVSyncForTimingEnabled();
Expand Down Expand Up @@ -314,4 +319,11 @@ void EmulationSettingsWidget::onManuallySetRealTimeClockChanged()
{
const bool enabled = dialog()->getEffectiveBoolValue("EmuCore", "ManuallySetRealTimeClock", false);
m_ui.rtcDateTime->setEnabled(enabled);
m_ui.rtcUseSystemLocaleFormat->setEnabled(enabled);
}

void EmulationSettingsWidget::onUseSystemLocaleFormatChanged()
{
const bool enabled = dialog()->getEffectiveBoolValue("EmuCore", "UseSystemLocaleFormat", false);
m_ui.rtcDateTime->setDisplayFormat(enabled ? QLocale::system().dateTimeFormat(QLocale::ShortFormat) : "yyyy-MM-dd HH:mm:ss");
}
1 change: 1 addition & 0 deletions pcsx2-qt/Settings/EmulationSettingsWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ private Q_SLOTS:
void updateOptimalFramePacing();
void updateUseVSyncForTimingEnabled();
void onManuallySetRealTimeClockChanged();
void onUseSystemLocaleFormatChanged();

Ui::EmulationSettingsWidget m_ui;
};
7 changes: 7 additions & 0 deletions pcsx2-qt/Settings/EmulationSettingsWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,13 @@
<item row="0" column="1">
<widget class="QDateTimeEdit" name="rtcDateTime"/>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="rtcUseSystemLocaleFormat">
<property name="text">
<string>Use System Locale Format</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down
1 change: 1 addition & 0 deletions pcsx2/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,7 @@ struct Pcsx2Config
BackupSavestate : 1,
McdFolderAutoManage : 1,
ManuallySetRealTimeClock : 1,
UseSystemLocaleFormat : 1, // presents OS time format instead of yyyy-MM-dd HH:mm:ss for manual RTC

HostFs : 1,

Expand Down
2 changes: 2 additions & 0 deletions pcsx2/Pcsx2Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,7 @@ Pcsx2Config::Pcsx2Config()
WarnAboutUnsafeSettings = true;
EnableDiscordPresence = false;
ManuallySetRealTimeClock = false;
UseSystemLocaleFormat = false;

// To be moved to FileMemoryCard pluign (someday)
for (uint slot = 0; slot < 8; ++slot)
Expand Down Expand Up @@ -1973,6 +1974,7 @@ void Pcsx2Config::LoadSaveCore(SettingsWrapper& wrap)
SettingsWrapBitBool(WarnAboutUnsafeSettings);

SettingsWrapBitBool(ManuallySetRealTimeClock);
SettingsWrapBitBool(UseSystemLocaleFormat);

// Process various sub-components:

Expand Down
Loading