2015-12-05 03:45:27 +00:00
|
|
|
#include "applesoftfileviewer.h"
|
|
|
|
#include "ui_applesoftfileviewer.h"
|
2015-12-14 10:48:19 +00:00
|
|
|
#include "applesoftformatter.h"
|
2015-12-05 03:45:27 +00:00
|
|
|
|
|
|
|
ApplesoftFileViewer::ApplesoftFileViewer(QWidget *parent) :
|
|
|
|
QWidget(parent),
|
|
|
|
ui(new Ui::ApplesoftFileViewer)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2015-12-14 10:48:19 +00:00
|
|
|
QString title = QString("AppleSoft Viewer");
|
|
|
|
setWindowTitle(title);
|
|
|
|
|
|
|
|
m_formatter = new ApplesoftFormatter(this);
|
|
|
|
m_formatter->setFlags(ApplesoftFormatter::PrettyFlags);
|
2015-12-05 03:45:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ApplesoftFileViewer::~ApplesoftFileViewer()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
2015-12-14 10:48:19 +00:00
|
|
|
void ApplesoftFileViewer::setFile(ApplesoftFile *file) {
|
|
|
|
m_file = file;
|
|
|
|
m_formatter->setFile(file);
|
|
|
|
|
|
|
|
QString title = QString("AppleSoft Viewer: %1").arg(m_file->filename());
|
|
|
|
setWindowTitle(title);
|
|
|
|
|
|
|
|
ui->textArea->setText(m_formatter->formatText());
|
|
|
|
}
|
|
|
|
|
2015-12-05 03:45:27 +00:00
|
|
|
void ApplesoftFileViewer::setData(QByteArray data)
|
|
|
|
{
|
|
|
|
ui->textArea->setText(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ApplesoftFileViewer::setText(QString text)
|
|
|
|
{
|
|
|
|
ui->textArea->setHtml(text);
|
|
|
|
}
|