here, have more code
This commit is contained in:
parent
11d716394e
commit
5e5fb09b0e
|
@ -56,6 +56,8 @@ TitleManagerDialog::TitleManagerDialog(QWidget* parent) : QDialog(parent), ui(ne
|
|||
|
||||
ui->lstTitleList->sortItems();
|
||||
|
||||
ui->btnImportTitleData->setEnabled(false);
|
||||
ui->btnExportTitleData->setEnabled(false);
|
||||
ui->btnDeleteTitle->setEnabled(false);
|
||||
}
|
||||
|
||||
|
@ -160,6 +162,9 @@ void TitleManagerDialog::onImportTitleFinished(int res)
|
|||
titleid[0] = (importTmdData[0x18C] << 24) | (importTmdData[0x18D] << 16) | (importTmdData[0x18E] << 8) | importTmdData[0x18F];
|
||||
titleid[1] = (importTmdData[0x190] << 24) | (importTmdData[0x191] << 16) | (importTmdData[0x192] << 8) | importTmdData[0x193];
|
||||
|
||||
// remove anything that might hinder the install
|
||||
DSi_NAND::DeleteTitle(titleid[0], titleid[1]);
|
||||
|
||||
bool importres = DSi_NAND::ImportTitle(importAppPath.toStdString().c_str(), importTmdData, importReadOnly);
|
||||
if (!importres)
|
||||
{
|
||||
|
@ -178,7 +183,12 @@ void TitleManagerDialog::onImportTitleFinished(int res)
|
|||
}
|
||||
}
|
||||
|
||||
void TitleManagerDialog::on_btnExportTitle_clicked()
|
||||
void TitleManagerDialog::on_btnImportTitleData_clicked()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
void TitleManagerDialog::on_btnExportTitleData_clicked()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
@ -205,11 +215,17 @@ void TitleManagerDialog::on_lstTitleList_currentItemChanged(QListWidgetItem* cur
|
|||
{
|
||||
if (!cur)
|
||||
{
|
||||
ui->btnImportTitleData->setEnabled(false);
|
||||
ui->btnExportTitleData->setEnabled(false);
|
||||
ui->btnDeleteTitle->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->btnImportTitleData->setEnabled(true);
|
||||
ui->btnExportTitleData->setEnabled(true);
|
||||
ui->btnDeleteTitle->setEnabled(true);
|
||||
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -297,8 +313,6 @@ void TitleImportDialog::accept()
|
|||
QMessageBox::StandardButtons(QMessageBox::Yes|QMessageBox::No),
|
||||
QMessageBox::No) != QMessageBox::Yes)
|
||||
return;
|
||||
|
||||
DSi_NAND::DeleteTitle(titleid[1], titleid[0]);
|
||||
}
|
||||
|
||||
if (!tmdfromfile)
|
||||
|
@ -316,6 +330,12 @@ void TitleImportDialog::accept()
|
|||
|
||||
setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
appPath = ui->txtAppFile->text();
|
||||
readOnly = ui->cbReadOnly->isChecked();
|
||||
QDialog::accept();
|
||||
}
|
||||
}
|
||||
|
||||
void TitleImportDialog::tmdDownloaded()
|
||||
|
@ -363,21 +383,6 @@ void TitleImportDialog::tmdDownloaded()
|
|||
}
|
||||
}
|
||||
|
||||
void TitleImportDialog::on_TitleImportDialog_accepted()
|
||||
{
|
||||
setEnabled(false);
|
||||
}
|
||||
|
||||
void TitleImportDialog::on_TitleImportDialog_rejected()
|
||||
{
|
||||
printf("rejected\n");
|
||||
}
|
||||
|
||||
void TitleImportDialog::on_TitleImportDialog_reject()
|
||||
{
|
||||
printf("reject\n");
|
||||
}
|
||||
|
||||
void TitleImportDialog::on_btnAppBrowse_clicked()
|
||||
{
|
||||
QString file = QFileDialog::getOpenFileName(this,
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
{
|
||||
QMessageBox::critical(parent,
|
||||
"DSi title manager - melonDS",
|
||||
"Failed to mount the DSi NAND. Check that your NAND dump is valid.");
|
||||
"Failed to mount the DSi NAND. Check that your NAND dump is accessible and valid.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -81,8 +81,8 @@ private slots:
|
|||
|
||||
void on_btnImportTitle_clicked();
|
||||
void onImportTitleFinished(int res);
|
||||
|
||||
void on_btnExportTitle_clicked();
|
||||
void on_btnImportTitleData_clicked();
|
||||
void on_btnExportTitleData_clicked();
|
||||
void on_btnDeleteTitle_clicked();
|
||||
void on_lstTitleList_currentItemChanged(QListWidgetItem* cur, QListWidgetItem* prev);
|
||||
|
||||
|
@ -93,6 +93,9 @@ private:
|
|||
u8 importTmdData[0x208];
|
||||
bool importReadOnly;
|
||||
|
||||
QAction* importAction[3];
|
||||
QAction* exportAction[3];
|
||||
|
||||
void createTitleItem(u32 category, u32 titleid);
|
||||
};
|
||||
|
||||
|
@ -108,10 +111,6 @@ private slots:
|
|||
void accept() override;
|
||||
void tmdDownloaded();
|
||||
|
||||
void on_TitleImportDialog_accepted();
|
||||
void on_TitleImportDialog_rejected();
|
||||
void on_TitleImportDialog_reject();
|
||||
|
||||
void on_btnAppBrowse_clicked();
|
||||
void on_btnTmdBrowse_clicked();
|
||||
void onChangeTmdSource(int id);
|
||||
|
|
|
@ -30,20 +30,39 @@
|
|||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnImportTitle">
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>Import a DSiware title to your emulated DSi system.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Import title...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnExportTitle">
|
||||
<widget class="QPushButton" name="btnImportTitleData">
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>Import data (save, banner...) for the selected title.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Export title...</string>
|
||||
<string>Import title data...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnExportTitleData">
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>Export the data (save, banner...) associated with the selected title.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Export title data...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnDeleteTitle">
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>Permanently delete the selected title and its associated data from your emulated DSi.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delete title</string>
|
||||
</property>
|
||||
|
|
|
@ -1381,9 +1381,6 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
|
|||
actROMInfo = menu->addAction("ROM info");
|
||||
connect(actROMInfo, &QAction::triggered, this, &MainWindow::onROMInfo);
|
||||
|
||||
// TODO: menu item should be disabled:
|
||||
// * if no DSi NAND is specified
|
||||
// * if something is running (even paused)
|
||||
actTitleManager = menu->addAction("Manage DSi titles");
|
||||
connect(actTitleManager, &QAction::triggered, this, &MainWindow::onOpenTitleManager);
|
||||
}
|
||||
|
@ -1587,6 +1584,7 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
|
|||
actFrameStep->setEnabled(false);
|
||||
|
||||
actSetupCheats->setEnabled(false);
|
||||
actTitleManager->setEnabled(strlen(Config::DSiNANDPath) > 0);
|
||||
|
||||
actEnableCheats->setChecked(Config::EnableCheats != 0);
|
||||
|
||||
|
@ -2417,6 +2415,9 @@ void MainWindow::onEmuSettingsDialogFinished(int res)
|
|||
|
||||
if (EmuSettingsDialog::needsReset)
|
||||
onReset();
|
||||
|
||||
if (!RunningSomething)
|
||||
actTitleManager->setEnabled(strlen(Config::DSiNANDPath) > 0);
|
||||
}
|
||||
|
||||
void MainWindow::onOpenInputConfig()
|
||||
|
@ -2668,6 +2669,7 @@ void MainWindow::onEmuStart()
|
|||
actImportSavefile->setEnabled(true);
|
||||
|
||||
actSetupCheats->setEnabled(true);
|
||||
actTitleManager->setEnabled(false);
|
||||
|
||||
actROMInfo->setEnabled(true);
|
||||
}
|
||||
|
@ -2690,6 +2692,7 @@ void MainWindow::onEmuStop()
|
|||
actFrameStep->setEnabled(false);
|
||||
|
||||
actSetupCheats->setEnabled(false);
|
||||
actTitleManager->setEnabled(strlen(Config::DSiNANDPath) > 0);
|
||||
|
||||
actROMInfo->setEnabled(false);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue