mirror of
https://github.com/markdavidlong/AppleSAWS.git
synced 2024-11-22 00:31:04 +00:00
Added word wrap to Applesoft Viewer
This commit is contained in:
parent
823ae4dd57
commit
441dc4613e
@ -24,7 +24,7 @@ ApplesoftFileViewer::ApplesoftFileViewer(QWidget *parent) :
|
||||
m_isFirstFind = true;
|
||||
ui->textArea->setUndoRedoEnabled(false);
|
||||
ui->textArea->setUndoRedoEnabled(true);
|
||||
|
||||
ui->textArea->setWordWrapMode(QTextOption::NoWrap);
|
||||
}
|
||||
|
||||
ApplesoftFileViewer::~ApplesoftFileViewer()
|
||||
@ -59,6 +59,14 @@ bool ApplesoftFileViewer::makeMenuOptions(QMenu *menu)
|
||||
connect(action, SIGNAL(triggered(bool)), SLOT(launchVarBrowser()));
|
||||
menu->addAction(action);
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
action = new QAction("&Word Wrap");
|
||||
action->setCheckable(true);
|
||||
action->setChecked(settings.value("ASViewer.WordWrap",true).toBool());
|
||||
connect(action, SIGNAL(toggled(bool)), SLOT(toggleWordWrap(bool)));
|
||||
menu->addAction(action);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -67,6 +75,20 @@ bool ApplesoftFileViewer::optionsMenuItems(QMenu *menu)
|
||||
return makeMenuOptions(menu);
|
||||
}
|
||||
|
||||
void ApplesoftFileViewer::toggleWordWrap(bool enabled)
|
||||
{
|
||||
if (enabled)
|
||||
{
|
||||
ui->textArea->setWordWrapMode(QTextOption::WordWrap);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->textArea->setWordWrapMode(QTextOption::NoWrap);
|
||||
}
|
||||
QSettings settings;
|
||||
settings.setValue("ASViewer.WordWrap",enabled);
|
||||
}
|
||||
|
||||
void ApplesoftFileViewer::setIndentCode(bool enabled)
|
||||
{
|
||||
if (enabled)
|
||||
|
@ -33,8 +33,8 @@ public slots:
|
||||
void findText();
|
||||
|
||||
|
||||
protected:
|
||||
protected slots:
|
||||
void toggleWordWrap(bool enabled);
|
||||
void setIndentCode(bool enabled);
|
||||
void setIntsAsHex(bool enabled);
|
||||
void launchVarBrowser();
|
||||
|
Loading…
Reference in New Issue
Block a user