mirror of
https://github.com/markdavidlong/AppleSAWS.git
synced 2024-11-24 14:30:56 +00:00
Removed deprecated call to QComboBox::currentIndexChanged(const QString &)
This commit is contained in:
parent
cccaa4ff2e
commit
ad0fe34b64
@ -55,35 +55,43 @@ void ViewerBase::setFile(GenericFile *file)
|
|||||||
m_file = file;
|
m_file = file;
|
||||||
|
|
||||||
QString descriptor;
|
QString descriptor;
|
||||||
QString defaultViewerDescriptor;
|
int defaultViewerDescriptor;
|
||||||
|
|
||||||
|
QString hexdumpviewerstring = "Hex Dump Viewer";
|
||||||
|
QString applesoftviewerstring = "Applesoft File Viewer";
|
||||||
|
QString intbasicfileviewerstring = "Integer Basic File Viewer";
|
||||||
|
QString hrcgcharsetviewerstring = "HRCG Character Set Viewer";
|
||||||
|
QString hiresviewerstring = "HiRes Image Viewer";
|
||||||
|
QString mrmazeviewerstring = "MissingRing Maze Viewer";
|
||||||
|
QString disassemblerviewerstring = "Diassembler Viewer";
|
||||||
|
QString texthexviewstring = "Text/Hex Dump Viewer";
|
||||||
|
QString relocatableviewerstring = "Relocatable Disassembler Viewer";
|
||||||
|
|
||||||
HexDumpViewer *hdv = new HexDumpViewer(0);
|
HexDumpViewer *hdv = new HexDumpViewer(0);
|
||||||
if (dynamic_cast<ApplesoftFile*>(file))
|
if (dynamic_cast<ApplesoftFile*>(file))
|
||||||
hdv->setFile(file,0x801); //TODO: Double check this offset.
|
hdv->setFile(file,0x801); //TODO: Double check this offset.
|
||||||
else
|
else
|
||||||
hdv->setFile(file,m_file->address());
|
hdv->setFile(file,m_file->address());
|
||||||
descriptor = ("Hex Dump Viewer");
|
descriptor = (hexdumpviewerstring);
|
||||||
addViewer(descriptor,hdv);
|
addViewer(descriptor,hdv);
|
||||||
defaultViewerDescriptor = descriptor;
|
defaultViewerDescriptor = m_viewercombo->findText(descriptor);
|
||||||
|
|
||||||
if (dynamic_cast<ApplesoftFile*>(file))
|
if (dynamic_cast<ApplesoftFile*>(file))
|
||||||
{
|
{
|
||||||
ApplesoftFileViewer *afv = new ApplesoftFileViewer(0);
|
ApplesoftFileViewer *afv = new ApplesoftFileViewer(0);
|
||||||
afv->setFile(file);
|
afv->setFile(file);
|
||||||
descriptor="Applesoft File Viewer";
|
descriptor=applesoftviewerstring;
|
||||||
addViewer(descriptor,afv);
|
addViewer(descriptor,afv);
|
||||||
defaultViewerDescriptor = descriptor;
|
defaultViewerDescriptor = m_viewercombo->findText(descriptor);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (dynamic_cast<IntBasicFile*>(file))
|
else if (dynamic_cast<IntBasicFile*>(file))
|
||||||
{
|
{
|
||||||
IntBasicFileViewer *ibf = new IntBasicFileViewer(0);
|
IntBasicFileViewer *ibf = new IntBasicFileViewer(0);
|
||||||
ibf->setFile(file);
|
ibf->setFile(file);
|
||||||
descriptor="Integer Basic File Viewer";
|
descriptor=intbasicfileviewerstring;
|
||||||
addViewer(descriptor, ibf);
|
addViewer(descriptor, ibf);
|
||||||
defaultViewerDescriptor = descriptor;
|
defaultViewerDescriptor = m_viewercombo->findText(descriptor);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (dynamic_cast<BinaryFile*>(file))
|
else if (dynamic_cast<BinaryFile*>(file))
|
||||||
{
|
{
|
||||||
@ -91,37 +99,39 @@ void ViewerBase::setFile(GenericFile *file)
|
|||||||
|
|
||||||
CharSetViewer *csv = new CharSetViewer();
|
CharSetViewer *csv = new CharSetViewer();
|
||||||
csv->setFile(bf);
|
csv->setFile(bf);
|
||||||
descriptor ="HRCG Character Set Viewer";
|
descriptor = hrcgcharsetviewerstring;
|
||||||
addViewer(descriptor,csv);
|
addViewer(descriptor,csv);
|
||||||
|
|
||||||
HiresViewWidget *hrvw = new HiresViewWidget();
|
HiresViewWidget *hrvw = new HiresViewWidget();
|
||||||
hrvw->setFile(bf);
|
hrvw->setFile(bf);
|
||||||
descriptor = "HiRes Image Viewer";
|
descriptor = hiresviewerstring;
|
||||||
addViewer(descriptor,hrvw);
|
addViewer(descriptor,hrvw);
|
||||||
|
|
||||||
MazeViewer *mv = new MazeViewer();
|
MazeViewer *mv = new MazeViewer();
|
||||||
mv->setFile(file);
|
mv->setFile(file);
|
||||||
descriptor = "MissingRing Maze Viewer";
|
descriptor = mrmazeviewerstring;
|
||||||
addViewer(descriptor,mv);
|
addViewer(descriptor,mv);
|
||||||
|
|
||||||
DisassemblerViewer *dv = new DisassemblerViewer();
|
DisassemblerViewer *dv = new DisassemblerViewer();
|
||||||
dv->setFile(bf);
|
dv->setFile(bf);
|
||||||
descriptor = "Disassembler Viewer";
|
descriptor = disassemblerviewerstring;
|
||||||
addViewer(descriptor,dv);
|
addViewer(descriptor,dv);
|
||||||
defaultViewerDescriptor = descriptor;
|
defaultViewerDescriptor = m_viewercombo->findText(descriptor);
|
||||||
|
|
||||||
if (bf->filename().toUpper().endsWith(".SET"))
|
if (bf->filename().toUpper().endsWith(".SET"))
|
||||||
{
|
{
|
||||||
defaultViewerDescriptor ="HRCG Character Set Viewer";
|
defaultViewerDescriptor = m_viewercombo->findText(hrcgcharsetviewerstring);
|
||||||
}
|
}
|
||||||
if (bf->filename().toUpper().startsWith("MAZE"))
|
if (bf->filename().toUpper().startsWith("MAZE"))
|
||||||
{
|
{
|
||||||
defaultViewerDescriptor = "MissingRing Maze Viewer";
|
defaultViewerDescriptor = m_viewercombo->findText(mrmazeviewerstring);
|
||||||
|
|
||||||
}
|
}
|
||||||
if ((bf->address() == 0x2000 || bf->address() == 0x4000)
|
if ((bf->address() == 0x2000 || bf->address() == 0x4000)
|
||||||
&& bf->length() == 0x2000)
|
&& bf->length() == 0x2000)
|
||||||
{
|
{
|
||||||
defaultViewerDescriptor = "HiRes Image Viewer";
|
defaultViewerDescriptor = m_viewercombo->findText(hiresviewerstring);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -131,21 +141,22 @@ void ViewerBase::setFile(GenericFile *file)
|
|||||||
|
|
||||||
TextHexDumpViewer *thdv = new TextHexDumpViewer();
|
TextHexDumpViewer *thdv = new TextHexDumpViewer();
|
||||||
thdv->setFile(bf);
|
thdv->setFile(bf);
|
||||||
descriptor = QString("Text/Hex Dump Viewer");
|
descriptor = QString(texthexviewstring);
|
||||||
addViewer(descriptor,thdv);
|
addViewer(descriptor,thdv);
|
||||||
|
|
||||||
defaultViewerDescriptor = descriptor;
|
defaultViewerDescriptor = m_viewercombo->findText(descriptor);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (dynamic_cast<RelocatableFile*>(file))
|
else if (dynamic_cast<RelocatableFile*>(file))
|
||||||
{
|
{
|
||||||
DisassemblerViewer *dv = new DisassemblerViewer();
|
DisassemblerViewer *dv = new DisassemblerViewer();
|
||||||
dv->setFile(file);
|
dv->setFile(file);
|
||||||
descriptor = "Relocatable Disassembler Viewer";
|
descriptor = relocatableviewerstring;
|
||||||
addViewer(descriptor,dv);
|
addViewer(descriptor,dv);
|
||||||
defaultViewerDescriptor = descriptor;
|
defaultViewerDescriptor = m_viewercombo->findText(descriptor);
|
||||||
|
|
||||||
}
|
}
|
||||||
connect(m_viewercombo, static_cast<void (QComboBox::*)(const QString &)>(&QComboBox::currentIndexChanged),
|
connect(m_viewercombo,
|
||||||
|
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
this, &ViewerBase::showViewer);
|
this, &ViewerBase::showViewer);
|
||||||
showViewer(defaultViewerDescriptor);
|
showViewer(defaultViewerDescriptor);
|
||||||
}
|
}
|
||||||
@ -165,8 +176,9 @@ void ViewerBase::addViewer(QString descriptor, FileViewerInterface *viewer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewerBase::showViewer(const QString& descriptor)
|
void ViewerBase::showViewer(int index)
|
||||||
{
|
{
|
||||||
|
QString descriptor = m_viewercombo->itemText(index);
|
||||||
FileViewerInterface *fvi = m_viewers[descriptor];
|
FileViewerInterface *fvi = m_viewers[descriptor];
|
||||||
if (fvi)
|
if (fvi)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ signals:
|
|||||||
void viewerClosing(ViewerBase *me);
|
void viewerClosing(ViewerBase *me);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void showViewer(const QString &descriptor);
|
void showViewer(int index);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent *event);
|
void closeEvent(QCloseEvent *event);
|
||||||
|
Loading…
Reference in New Issue
Block a user