mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-27 00:00:07 -06:00
here, have more code
This commit is contained in:
@ -56,6 +56,8 @@ TitleManagerDialog::TitleManagerDialog(QWidget* parent) : QDialog(parent), ui(ne
|
|||||||
|
|
||||||
ui->lstTitleList->sortItems();
|
ui->lstTitleList->sortItems();
|
||||||
|
|
||||||
|
ui->btnImportTitleData->setEnabled(false);
|
||||||
|
ui->btnExportTitleData->setEnabled(false);
|
||||||
ui->btnDeleteTitle->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[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];
|
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);
|
bool importres = DSi_NAND::ImportTitle(importAppPath.toStdString().c_str(), importTmdData, importReadOnly);
|
||||||
if (!importres)
|
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)
|
if (!cur)
|
||||||
{
|
{
|
||||||
|
ui->btnImportTitleData->setEnabled(false);
|
||||||
|
ui->btnExportTitleData->setEnabled(false);
|
||||||
ui->btnDeleteTitle->setEnabled(false);
|
ui->btnDeleteTitle->setEnabled(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
ui->btnImportTitleData->setEnabled(true);
|
||||||
|
ui->btnExportTitleData->setEnabled(true);
|
||||||
ui->btnDeleteTitle->setEnabled(true);
|
ui->btnDeleteTitle->setEnabled(true);
|
||||||
|
|
||||||
|
//
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,8 +313,6 @@ void TitleImportDialog::accept()
|
|||||||
QMessageBox::StandardButtons(QMessageBox::Yes|QMessageBox::No),
|
QMessageBox::StandardButtons(QMessageBox::Yes|QMessageBox::No),
|
||||||
QMessageBox::No) != QMessageBox::Yes)
|
QMessageBox::No) != QMessageBox::Yes)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DSi_NAND::DeleteTitle(titleid[1], titleid[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tmdfromfile)
|
if (!tmdfromfile)
|
||||||
@ -316,6 +330,12 @@ void TitleImportDialog::accept()
|
|||||||
|
|
||||||
setEnabled(false);
|
setEnabled(false);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
appPath = ui->txtAppFile->text();
|
||||||
|
readOnly = ui->cbReadOnly->isChecked();
|
||||||
|
QDialog::accept();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TitleImportDialog::tmdDownloaded()
|
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()
|
void TitleImportDialog::on_btnAppBrowse_clicked()
|
||||||
{
|
{
|
||||||
QString file = QFileDialog::getOpenFileName(this,
|
QString file = QFileDialog::getOpenFileName(this,
|
||||||
|
@ -62,7 +62,7 @@ public:
|
|||||||
{
|
{
|
||||||
QMessageBox::critical(parent,
|
QMessageBox::critical(parent,
|
||||||
"DSi title manager - melonDS",
|
"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;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,8 +81,8 @@ private slots:
|
|||||||
|
|
||||||
void on_btnImportTitle_clicked();
|
void on_btnImportTitle_clicked();
|
||||||
void onImportTitleFinished(int res);
|
void onImportTitleFinished(int res);
|
||||||
|
void on_btnImportTitleData_clicked();
|
||||||
void on_btnExportTitle_clicked();
|
void on_btnExportTitleData_clicked();
|
||||||
void on_btnDeleteTitle_clicked();
|
void on_btnDeleteTitle_clicked();
|
||||||
void on_lstTitleList_currentItemChanged(QListWidgetItem* cur, QListWidgetItem* prev);
|
void on_lstTitleList_currentItemChanged(QListWidgetItem* cur, QListWidgetItem* prev);
|
||||||
|
|
||||||
@ -93,6 +93,9 @@ private:
|
|||||||
u8 importTmdData[0x208];
|
u8 importTmdData[0x208];
|
||||||
bool importReadOnly;
|
bool importReadOnly;
|
||||||
|
|
||||||
|
QAction* importAction[3];
|
||||||
|
QAction* exportAction[3];
|
||||||
|
|
||||||
void createTitleItem(u32 category, u32 titleid);
|
void createTitleItem(u32 category, u32 titleid);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -108,10 +111,6 @@ private slots:
|
|||||||
void accept() override;
|
void accept() override;
|
||||||
void tmdDownloaded();
|
void tmdDownloaded();
|
||||||
|
|
||||||
void on_TitleImportDialog_accepted();
|
|
||||||
void on_TitleImportDialog_rejected();
|
|
||||||
void on_TitleImportDialog_reject();
|
|
||||||
|
|
||||||
void on_btnAppBrowse_clicked();
|
void on_btnAppBrowse_clicked();
|
||||||
void on_btnTmdBrowse_clicked();
|
void on_btnTmdBrowse_clicked();
|
||||||
void onChangeTmdSource(int id);
|
void onChangeTmdSource(int id);
|
||||||
|
@ -30,20 +30,39 @@
|
|||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnImportTitle">
|
<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">
|
<property name="text">
|
||||||
<string>Import title...</string>
|
<string>Import title...</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<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">
|
<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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnDeleteTitle">
|
<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">
|
<property name="text">
|
||||||
<string>Delete title</string>
|
<string>Delete title</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -1381,9 +1381,6 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
|
|||||||
actROMInfo = menu->addAction("ROM info");
|
actROMInfo = menu->addAction("ROM info");
|
||||||
connect(actROMInfo, &QAction::triggered, this, &MainWindow::onROMInfo);
|
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");
|
actTitleManager = menu->addAction("Manage DSi titles");
|
||||||
connect(actTitleManager, &QAction::triggered, this, &MainWindow::onOpenTitleManager);
|
connect(actTitleManager, &QAction::triggered, this, &MainWindow::onOpenTitleManager);
|
||||||
}
|
}
|
||||||
@ -1587,6 +1584,7 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
|
|||||||
actFrameStep->setEnabled(false);
|
actFrameStep->setEnabled(false);
|
||||||
|
|
||||||
actSetupCheats->setEnabled(false);
|
actSetupCheats->setEnabled(false);
|
||||||
|
actTitleManager->setEnabled(strlen(Config::DSiNANDPath) > 0);
|
||||||
|
|
||||||
actEnableCheats->setChecked(Config::EnableCheats != 0);
|
actEnableCheats->setChecked(Config::EnableCheats != 0);
|
||||||
|
|
||||||
@ -2417,6 +2415,9 @@ void MainWindow::onEmuSettingsDialogFinished(int res)
|
|||||||
|
|
||||||
if (EmuSettingsDialog::needsReset)
|
if (EmuSettingsDialog::needsReset)
|
||||||
onReset();
|
onReset();
|
||||||
|
|
||||||
|
if (!RunningSomething)
|
||||||
|
actTitleManager->setEnabled(strlen(Config::DSiNANDPath) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onOpenInputConfig()
|
void MainWindow::onOpenInputConfig()
|
||||||
@ -2668,6 +2669,7 @@ void MainWindow::onEmuStart()
|
|||||||
actImportSavefile->setEnabled(true);
|
actImportSavefile->setEnabled(true);
|
||||||
|
|
||||||
actSetupCheats->setEnabled(true);
|
actSetupCheats->setEnabled(true);
|
||||||
|
actTitleManager->setEnabled(false);
|
||||||
|
|
||||||
actROMInfo->setEnabled(true);
|
actROMInfo->setEnabled(true);
|
||||||
}
|
}
|
||||||
@ -2690,6 +2692,7 @@ void MainWindow::onEmuStop()
|
|||||||
actFrameStep->setEnabled(false);
|
actFrameStep->setEnabled(false);
|
||||||
|
|
||||||
actSetupCheats->setEnabled(false);
|
actSetupCheats->setEnabled(false);
|
||||||
|
actTitleManager->setEnabled(strlen(Config::DSiNANDPath) > 0);
|
||||||
|
|
||||||
actROMInfo->setEnabled(false);
|
actROMInfo->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user