diff --git a/src/cutter.cpp b/src/cutter.cpp
index d457e643..e4062e0e 100644
--- a/src/cutter.cpp
+++ b/src/cutter.cpp
@@ -515,6 +515,7 @@ void CutterCore::resetDefaultAsmOptions()
setConfig("asm.bytes", Config()->getAsmBytes());
setConfig("asm.bytespace", Config()->getAsmBytespace());
setConfig("asm.lbytes", Config()->getAsmLBytes());
+ setConfig("asm.nbytes", Config()->getAsmNBytes());
setConfig("asm.syntax", Config()->getAsmSyntax());
setConfig("asm.ucase", Config()->getAsmUppercase());
setConfig("asm.bbline", Config()->getAsmBBLine());
@@ -539,6 +540,7 @@ void CutterCore::saveDefaultAsmOptions()
Config()->setAsmBytes(getConfigb("asm.bytes"));
Config()->setAsmBytespace(getConfigb("asm.bytespace"));
Config()->setAsmLBytes(getConfigb("asm.lbytes"));
+ Config()->setAsmNBytes(getConfigi("asm.nbytes"));
Config()->setAsmSyntax(getConfig("asm.syntax"));
Config()->setAsmUppercase(getConfigb("asm.ucase"));
Config()->setAsmBBLine(getConfigb("asm.bbline"));
@@ -784,7 +786,6 @@ void CutterCore::setSettings()
setConfig("asm.tabsonce", true);
setConfig("asm.tabsoff", 5);
- setConfig("asm.nbytes", 10);
setConfig("asm.midflags", 2);
//setConfig("asm.bbline", "true");
diff --git a/src/dialogs/preferences/AsmOptionsWidget.cpp b/src/dialogs/preferences/AsmOptionsWidget.cpp
index 843b5cf5..e4849086 100644
--- a/src/dialogs/preferences/AsmOptionsWidget.cpp
+++ b/src/dialogs/preferences/AsmOptionsWidget.cpp
@@ -52,6 +52,12 @@ void AsmOptionsWidget::updateAsmOptionsFromVars()
ui->bytespaceCheckBox->setEnabled(bytesEnabled);
qhelpers::setCheckedWithoutSignals(ui->lbytesCheckBox, Core()->getConfigb("asm.lbytes"));
ui->lbytesCheckBox->setEnabled(bytesEnabled);
+ ui->nbytesSpinBox->blockSignals(true);
+ ui->nbytesSpinBox->setValue(Core()->getConfigi("asm.nbytes"));
+ ui->nbytesSpinBox->blockSignals(false);
+ ui->nbytesLabel->setEnabled(bytesEnabled);
+ ui->nbytesSpinBox->setEnabled(bytesEnabled);
+
QString currentSyntax = Core()->getConfig("asm.syntax");
for (int i = 0; i < ui->syntaxComboBox->count(); i++)
@@ -178,6 +184,8 @@ void AsmOptionsWidget::on_bytesCheckBox_toggled(bool checked)
Core()->setConfig("asm.bytes", checked);
ui->bytespaceCheckBox->setEnabled(checked);
ui->lbytesCheckBox->setEnabled(checked);
+ ui->nbytesLabel->setEnabled(checked);
+ ui->nbytesSpinBox->setEnabled(checked);
triggerAsmOptionsChanged();
}
@@ -193,6 +201,12 @@ void AsmOptionsWidget::on_lbytesCheckBox_toggled(bool checked)
triggerAsmOptionsChanged();
}
+void AsmOptionsWidget::on_nbytesSpinBox_valueChanged(int value)
+{
+ Core()->setConfig("asm.nbytes", value);
+ triggerAsmOptionsChanged();
+}
+
void AsmOptionsWidget::on_syntaxComboBox_currentIndexChanged(int index)
{
Core()->setConfig("asm.syntax", ui->syntaxComboBox->itemData(index).toString().toUtf8().constData());
diff --git a/src/dialogs/preferences/AsmOptionsWidget.h b/src/dialogs/preferences/AsmOptionsWidget.h
index f93c0def..36edbc92 100644
--- a/src/dialogs/preferences/AsmOptionsWidget.h
+++ b/src/dialogs/preferences/AsmOptionsWidget.h
@@ -50,6 +50,7 @@ private slots:
void on_syntaxComboBox_currentIndexChanged(int index);
void on_caseComboBox_currentIndexChanged(int index);
void on_asmTabsSpinBox_valueChanged(int value);
+ void on_nbytesSpinBox_valueChanged(int value);
void on_bblineCheckBox_toggled(bool checked);
void on_varsubCheckBox_toggled(bool checked);
void on_varsubOnlyCheckBox_toggled(bool checked);
diff --git a/src/dialogs/preferences/AsmOptionsWidget.ui b/src/dialogs/preferences/AsmOptionsWidget.ui
index 5081d6ac..264fcd2f 100644
--- a/src/dialogs/preferences/AsmOptionsWidget.ui
+++ b/src/dialogs/preferences/AsmOptionsWidget.ui
@@ -7,7 +7,7 @@
0
0
545
- 638
+ 710
@@ -112,6 +112,30 @@
+ -
+
+
+ 16
+
+
-
+
+
+ true
+
+
+ Number of bytes to display (asm.nbytes):
+
+
+
+ -
+
+
+ true
+
+
+
+
+
-
-
@@ -148,7 +172,7 @@
-
-
-
+
Tabs in assembly (asm.tabs):
diff --git a/src/utils/Configuration.h b/src/utils/Configuration.h
index 8d3748f8..38e6dc16 100644
--- a/src/utils/Configuration.h
+++ b/src/utils/Configuration.h
@@ -70,8 +70,8 @@ public:
bool getAsmCmtRight() const { return s.value("asm.cmtright", true).toBool(); }
void setAsmCmtRight(bool v) { s.setValue("asm.cmtright", v); }
- bool getAsmVarSum() const { return s.value("asm.varsum", false).toBool(); }
- void setAsmVarSum(bool v) { s.setValue("asm.varsum", v); }
+ bool getAsmVarSum() const { return s.value("asm.varsum", false).toBool(); }
+ void setAsmVarSum(bool v) { s.setValue("asm.varsum", v); }
bool getAsmBytes() const { return s.value("asm.bytes", false).toBool(); }
void setAsmBytes(bool v) { s.setValue("asm.bytes", v); }
@@ -82,6 +82,9 @@ public:
bool getAsmLBytes() const { return s.value("asm.lbytes", true).toBool(); }
void setAsmLBytes(bool v) { s.setValue("asm.lbytes", v); }
+ int getAsmNBytes() const { return s.value("asm.nbytes", 10).toInt(); }
+ void setAsmNBytes(int v) { s.setValue("asm.nbytes", v); }
+
QString getAsmSyntax() const { return s.value("asm.syntax", "intel").toString(); }
void setAsmSyntax(const QString &v) { s.setValue("asm.syntax", v); }