diff --git a/AppleSAWS.pro b/AppleSAWS.pro index 389045e..47a3321 100644 --- a/AppleSAWS.pro +++ b/AppleSAWS.pro @@ -39,6 +39,7 @@ SOURCES += \ src/diskfiles/dos33/tracksectorlist.cxx \ src/diskfiles/dos33/filedescriptiveentry.cxx \ src/diskfiles/dos33/genericfile.cxx \ + src/ui/startupdialog.cpp \ src/ui/viewers/intbasicfileviewer.cxx \ src/ui/widgets/notesdialog.cpp \ src/util/applestring.cxx \ @@ -88,6 +89,7 @@ HEADERS += \ src/diskfiles/dos33/filedescriptiveentry.h \ src/diskfiles/dos33/genericfile.h \ src/intbasic/IntBasicFile.h \ + src/ui/startupdialog.h \ src/ui/viewers/intbasicfileviewer.h \ src/ui/widgets/notesdialog.h \ src/util/util.h \ @@ -136,6 +138,7 @@ HEADERS += \ FORMS += \ src/ui/catalogwidget.ui \ + src/ui/startupdialog.ui \ src/ui/viewers/applesoftfileviewer.ui \ src/ui/viewers/disassemblerviewer.ui \ src/ui/viewers/hexdumpviewer.ui \ diff --git a/src/main.cpp b/src/main.cpp index 64ab42b..a445200 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,7 +9,8 @@ #include "diskfile.h" #include "catalogsector.h" #include "applesoftfile.h" -#include "DiskExplorer.h" +//#include "DiskExplorer.h" +#include "startupdialog.h" int main(int argc, char** argv) { @@ -21,18 +22,12 @@ int main(int argc, char** argv) qDebug("Adding fonts"); auto x = QFontDatabase::addApplicationFont(":/fonts/A2_40Col.ttf"); auto y = QFontDatabase::addApplicationFont(":/fonts/A2_80Col.ttf"); - qDebug("40Col: %d 80Col: %d",x,y); - qDebug() << "40: " << QFontDatabase::applicationFontFamilies(0); - qDebug() << "80: " << QFontDatabase::applicationFontFamilies(1); +// qDebug("40Col: %d 80Col: %d",x,y); +// qDebug() << "40: " << QFontDatabase::applicationFontFamilies(0); +// qDebug() << "80: " << QFontDatabase::applicationFontFamilies(1); - DiskExplorer w; - QSettings settings; - QString lastOpened = settings.value("lastOpened").toString(); - if (!lastOpened.isEmpty()) - { - w.loadDiskFile(lastOpened); - } + StartupDialog w; w.show(); return a.exec(); diff --git a/src/resource/notes.txt b/src/resource/notes.txt index ebae99f..f30fc42 100644 --- a/src/resource/notes.txt +++ b/src/resource/notes.txt @@ -5,7 +5,7 @@ https://github.com/markdavidlong/AppleSAWS ### Welcome -This is a toolkit for exploring DOS 3.3 disk contents. I started this because +This is a toolkit for exploring DOS 3.3 disk images and their contents. I started this because I had become interested in a game that I used to play a long time ago and I wanted to dig deeper into the internals of how it worked. Since it was a nice combination of a series of Applesoft and Binary files, I decided that a tool diff --git a/src/ui/diskexplorer/DiskExplorer.cpp b/src/ui/diskexplorer/DiskExplorer.cpp index 567fb24..8eeafd9 100644 --- a/src/ui/diskexplorer/DiskExplorer.cpp +++ b/src/ui/diskexplorer/DiskExplorer.cpp @@ -15,13 +15,16 @@ DiskExplorer::DiskExplorer(QWidget *parent) : QMainWindow(parent) { m_action_Unload_Disk_Image = nullptr; + m_hexConverter = nullptr; m_disk = nullptr; m_horizSizePref = -1; m_toolsHidden = true; - m_notesDialog = nullptr; + // m_notesDialog = nullptr; m_AsciiInfoDialog = nullptr; m_hrcgDialog = nullptr; + m_action_Unload_Disk_Image = nullptr; + resize(300,800); initUi(); } @@ -37,20 +40,20 @@ void DiskExplorer::initUi() QMenu *menu = new QMenu(tr("&File"),this); menuBar->addMenu(menu); - QAction *action_Load_Disk_Image = new QAction(tr("&Load Disk Image..."),this); - menu->addAction(action_Load_Disk_Image); +// QAction *action_Load_Disk_Image = new QAction(tr("&Load Disk Image..."),this); +// menu->addAction(action_Load_Disk_Image); - connect(action_Load_Disk_Image, &QAction::triggered, - this, &DiskExplorer::showLoadDialog); +// connect(action_Load_Disk_Image, &QAction::triggered, +// this, &DiskExplorer::showLoadDialog); - m_action_Unload_Disk_Image = new QAction(tr("&Unload Disk Image"),this); - m_action_Unload_Disk_Image->setEnabled(false); - menu->addAction(m_action_Unload_Disk_Image); +// m_action_Unload_Disk_Image = new QAction(tr("&Unload Disk Image"),this); +// m_action_Unload_Disk_Image->setEnabled(false); +// menu->addAction(m_action_Unload_Disk_Image); - connect(m_action_Unload_Disk_Image, &QAction::triggered, - this, &DiskExplorer::unloadDiskFile); +// connect(m_action_Unload_Disk_Image, &QAction::triggered, +// this, &DiskExplorer::unloadDiskFile); - menu->addSeparator(); +// menu->addSeparator(); QAction *action_Quit = new QAction(tr("&Quit"),this); menu->addAction(action_Quit); @@ -90,12 +93,12 @@ void DiskExplorer::initUi() m_AsciiInfoDialog = new AsciiInfoDialog(this); connect(action_Ascii_Info, &QAction::triggered, m_AsciiInfoDialog, &AsciiInfoDialog::show); - menu->addSeparator(); +// menu->addSeparator(); - QAction *action_Notes = new QAction(tr("&Notes..."), this); - menu->addAction(action_Notes); - if (!m_notesDialog) m_notesDialog = new NotesDialog(this); - connect(action_Notes, &QAction::triggered, m_notesDialog, &NotesDialog::show); +// QAction *action_Notes = new QAction(tr("&Notes..."), this); +// menu->addAction(action_Notes); +// if (!m_notesDialog) m_notesDialog = new NotesDialog(this); +// connect(action_Notes, &QAction::triggered, m_notesDialog, &NotesDialog::show); QWidget *widget = new QWidget(0); m_gridLayout = new QGridLayout(); @@ -157,7 +160,7 @@ void DiskExplorer::loadDiskFile(QString filename) m_disk = new DiskFile(); m_cw->prepForNewDisk(filename,m_disk); if (m_disk->read(filename)) { - m_action_Unload_Disk_Image->setEnabled(true); + if (m_action_Unload_Disk_Image) { m_action_Unload_Disk_Image->setEnabled(true); } QSettings settings; settings.setValue("lastOpened",filename); m_cw->processNewlyLoadedDisk(filename,m_disk); @@ -177,15 +180,16 @@ void DiskExplorer::handleShowSectorData(QByteArray data, int track, int sector, m_hdv->setRawData(data,0); } -void DiskExplorer::showLoadDialog() +void DiskExplorer::showLoadDialog(bool parentToThis) { QSettings settings; QString last = settings.value("lastOpened",".").toString(); - QString filename = QFileDialog::getOpenFileName(this, + QString filename = QFileDialog::getOpenFileName(parentToThis?this:nullptr, tr("Open Disk Image"), last, "Disk Images (*.do *.dsk)"); if (!filename.isEmpty()) { + if (!parentToThis) { this->show(); } loadDiskFile(filename); } } diff --git a/src/ui/diskexplorer/DiskExplorer.h b/src/ui/diskexplorer/DiskExplorer.h index c0fecc8..a238a64 100644 --- a/src/ui/diskexplorer/DiskExplorer.h +++ b/src/ui/diskexplorer/DiskExplorer.h @@ -11,7 +11,7 @@ #include "hexdumpviewer.h" #include "viewerbase.h" #include "asciiinfodialog.h" -#include "notesdialog.h" +//#include "notesdialog.h" #include #include @@ -34,7 +34,7 @@ signals: public slots: void unloadDiskFile(); void loadDiskFile(QString filename); - void showLoadDialog(); + void showLoadDialog(bool parentToThis = true); private slots: void handleShowSectorData(QByteArray data, int track, int sector, QVariant metadata); @@ -69,7 +69,7 @@ private: HRCGControlsInfo *m_hrcgDialog; HexConverter *m_hexConverter; AsciiInfoDialog *m_AsciiInfoDialog; - NotesDialog *m_notesDialog; +// NotesDialog *m_notesDialog; QAction *m_action_Unload_Disk_Image; diff --git a/src/ui/startupdialog.cpp b/src/ui/startupdialog.cpp new file mode 100644 index 0000000..d233e19 --- /dev/null +++ b/src/ui/startupdialog.cpp @@ -0,0 +1,43 @@ +#include "startupdialog.h" +#include "ui_startupdialog.h" + +#include "diskexplorer/DiskExplorer.h" + +#include + +StartupDialog::StartupDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::StartupDialog) +{ + m_notes = new NotesDialog(this); + ui->setupUi(this); +} + +StartupDialog::~StartupDialog() +{ + delete ui; +} + +void StartupDialog::on_exploreContentsBtn_clicked() +{ + DiskExplorer *w = new DiskExplorer(this); + w->showLoadDialog(false); + + + +} + +void StartupDialog::on_exploreDiskImageBtn_clicked() +{ + +} + +void StartupDialog::on_bootSectorCompareBtn_clicked() +{ + +} + +void StartupDialog::on_infoBtn_clicked() +{ + m_notes->show(); +} diff --git a/src/ui/startupdialog.h b/src/ui/startupdialog.h new file mode 100644 index 0000000..dc4199b --- /dev/null +++ b/src/ui/startupdialog.h @@ -0,0 +1,41 @@ +#ifndef STARTUPDIALOG_H +#define STARTUPDIALOG_H + +#include "notesdialog.h" +#include "hrcgcontrolsinfo.h" +#include "hexconverter.h" +#include "hexdumpviewer.h" +#include +#include "asciiinfodialog.h" + +namespace Ui { +class StartupDialog; +} + +class StartupDialog : public QDialog +{ + Q_OBJECT + +public: + explicit StartupDialog(QWidget *parent = nullptr); + ~StartupDialog(); + +private slots: + void on_exploreContentsBtn_clicked(); + + void on_exploreDiskImageBtn_clicked(); + + void on_bootSectorCompareBtn_clicked(); + + void on_infoBtn_clicked(); + +private: + Ui::StartupDialog *ui; + + NotesDialog *m_notes; + HRCGControlsInfo *m_hrcgDialog; + HexConverter *m_hexConverter; + AsciiInfoDialog *m_AsciiInfoDialog; +}; + +#endif // STARTUPDIALOG_H diff --git a/src/ui/startupdialog.ui b/src/ui/startupdialog.ui new file mode 100644 index 0000000..4d3795b --- /dev/null +++ b/src/ui/startupdialog.ui @@ -0,0 +1,147 @@ + + + StartupDialog + + + + 0 + 0 + 312 + 197 + + + + AppleSAWS + + + + + + Qt::Horizontal + + + + 122 + 20 + + + + + + + + + + Explore Disk Image Contents ... + + + + + + + Explore Disk Image File ... + + + + + + + Boot Sector Comparison ... + + + + + + + + + Qt::Vertical + + + + 20 + 18 + + + + + + + + 20 + + + + + + Arial + 18 + 75 + true + true + + + + AppleSAWS + + + + + + + + 10 + + + + V. 0.0.3pr + + + + + + + Qt::Horizontal + + + + 13 + 20 + + + + + + + + ? + + + + + + + + + (C) 2015-2021 Mark D. Long + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + +