Qt: Enable verification for unscanned files

old-dev
Stenzek 4 weeks ago
parent f5e22bc71a
commit 88e4ca5333
No known key found for this signature in database

@ -7,6 +7,7 @@
#include "mainwindow.h" #include "mainwindow.h"
#include "qthost.h" #include "qthost.h"
#include "qtprogresscallback.h" #include "qtprogresscallback.h"
#include "qtutils.h"
#include "settingswindow.h" #include "settingswindow.h"
#include "core/achievements.h" #include "core/achievements.h"
@ -302,9 +303,12 @@ void GameSummaryWidget::populateUi(const GameList::Entry* entry)
m_ui.inputProfile->addItem(QString::fromStdString(name)); m_ui.inputProfile->addItem(QString::fromStdString(name));
reloadGameSettings(); reloadGameSettings();
if (!entry->is_runtime_populated)
// Don't populate tracks when we're running from disc, because the core might have exclusive access.
if (!entry->is_runtime_populated || !CDImage::IsDeviceName(m_path.c_str()))
populateTracksInfo(); populateTracksInfo();
else
if (entry->is_runtime_populated)
disableWidgetsForRuntimeScannedEntry(); disableWidgetsForRuntimeScannedEntry();
} }
@ -487,16 +491,32 @@ void GameSummaryWidget::populateTracksInfo()
void GameSummaryWidget::disableWidgetsForRuntimeScannedEntry() void GameSummaryWidget::disableWidgetsForRuntimeScannedEntry()
{ {
m_ui.tracks->setEnabled(false);
m_ui.computeHashes->setEnabled(false);
m_ui.title->setReadOnly(true); m_ui.title->setReadOnly(true);
m_ui.restoreTitle->setEnabled(false); m_ui.restoreTitle->setEnabled(false);
m_ui.region->setEnabled(false); m_ui.region->setEnabled(false);
m_ui.restoreRegion->setEnabled(false); m_ui.restoreRegion->setEnabled(false);
m_ui.changeSerial->setEnabled(false);
m_ui.languages->setReadOnly(true); m_ui.languages->setReadOnly(true);
m_ui.customLanguage->setEnabled(false); m_ui.customLanguage->setEnabled(false);
m_ui.revision->setText(tr("This game was not scanned by DuckStation. Some functionality is not available."));
m_ui.tracks->setVisible(false); // Need to re-add the spacer, ugh.
const int insert_row = m_ui.mainLayout->rowCount() - 1;
QLayoutItem* const spacer_item = m_ui.mainLayout->itemAtPosition(insert_row, 0);
if (spacer_item)
m_ui.mainLayout->removeItem(spacer_item);
QHBoxLayout* const warning_layout = new QHBoxLayout();
QLabel* const icon = new QLabel(this);
icon->setPixmap(QIcon(QtHost::GetResourceQPath("images/warning.svg", true)).pixmap(16, 16));
warning_layout->addWidget(icon);
QLabel* const warning =
new QLabel(tr("This game was not scanned by DuckStation. Some functionality is not available."), this);
warning_layout->addWidget(warning, 1);
m_ui.mainLayout->addLayout(warning_layout, insert_row, 0, 1, 3);
if (spacer_item)
m_ui.mainLayout->addItem(spacer_item, insert_row + 1, 0, 1, 3);
} }
void GameSummaryWidget::onCompatibilityCommentsClicked() void GameSummaryWidget::onCompatibilityCommentsClicked()

@ -24,7 +24,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="pathLabel">
<property name="text"> <property name="text">
<string>Image Path:</string> <string>Image Path:</string>
</property> </property>
@ -38,7 +38,7 @@
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="titleLabel">
<property name="text"> <property name="text">
<string>Title:</string> <string>Title:</string>
</property> </property>
@ -86,7 +86,7 @@
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="serialLabel">
<property name="text"> <property name="text">
<string>Serial:</string> <string>Serial:</string>
</property> </property>
@ -111,7 +111,7 @@
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="regionLabel">
<property name="text"> <property name="text">
<string>Region:</string> <string>Region:</string>
</property> </property>
@ -142,14 +142,14 @@
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="5" column="0">
<widget class="QLabel" name="label_5"> <widget class="QLabel" name="languagesLabel">
<property name="text"> <property name="text">
<string>Languages:</string> <string>Languages:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1" colspan="2"> <item row="5" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3" stretch="1,0"> <layout class="QHBoxLayout" name="languagesLayout" stretch="1,0">
<item> <item>
<widget class="QLineEdit" name="languages"> <widget class="QLineEdit" name="languages">
<property name="readOnly"> <property name="readOnly">
@ -163,7 +163,7 @@
</layout> </layout>
</item> </item>
<item row="6" column="0"> <item row="6" column="0">
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="compatibilityLabel">
<property name="text"> <property name="text">
<string>Compatibility:</string> <string>Compatibility:</string>
</property> </property>
@ -185,14 +185,14 @@
</widget> </widget>
</item> </item>
<item row="7" column="0"> <item row="7" column="0">
<widget class="QLabel" name="label_10"> <widget class="QLabel" name="entryTypeLabel">
<property name="text"> <property name="text">
<string>Type:</string> <string>Type:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1" colspan="2"> <item row="7" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_4" stretch="1,0"> <layout class="QHBoxLayout" name="entryTypeLayout" stretch="1,0">
<item> <item>
<widget class="QComboBox" name="entryType"> <widget class="QComboBox" name="entryType">
<property name="enabled"> <property name="enabled">
@ -227,7 +227,7 @@
</widget> </widget>
</item> </item>
<item row="9" column="0"> <item row="9" column="0">
<widget class="QLabel" name="label_11"> <widget class="QLabel" name="metadataLabel">
<property name="text"> <property name="text">
<string>Metadata:</string> <string>Metadata:</string>
</property> </property>
@ -241,7 +241,7 @@
</widget> </widget>
</item> </item>
<item row="10" column="0"> <item row="10" column="0">
<widget class="QLabel" name="label_14"> <widget class="QLabel" name="releaseInfoLabel">
<property name="text"> <property name="text">
<string>Release Info:</string> <string>Release Info:</string>
</property> </property>
@ -255,7 +255,7 @@
</widget> </widget>
</item> </item>
<item row="11" column="0"> <item row="11" column="0">
<widget class="QLabel" name="label_15"> <widget class="QLabel" name="controllersLabel">
<property name="text"> <property name="text">
<string>Controllers:</string> <string>Controllers:</string>
</property> </property>
@ -269,14 +269,14 @@
</widget> </widget>
</item> </item>
<item row="12" column="0"> <item row="12" column="0">
<widget class="QLabel" name="label_9"> <widget class="QLabel" name="inputProfileLabel">
<property name="text"> <property name="text">
<string>Controller Preset:</string> <string>Controller Preset:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="12" column="1" colspan="2"> <item row="12" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,0"> <layout class="QHBoxLayout" name="inputProfileLayout" stretch="1,0">
<item> <item>
<widget class="QComboBox" name="inputProfile"/> <widget class="QComboBox" name="inputProfile"/>
</item> </item>
@ -294,7 +294,7 @@
</layout> </layout>
</item> </item>
<item row="13" column="0"> <item row="13" column="0">
<widget class="QLabel" name="label_8"> <widget class="QLabel" name="tracksLabel">
<property name="text"> <property name="text">
<string>Tracks:</string> <string>Tracks:</string>
</property> </property>

Loading…
Cancel
Save