Skip to content

Commit

Permalink
Removed simulator enabled setting.
Browse files Browse the repository at this point in the history
Kjell Morgenstern authored and Kjell Morgenstern committed Mar 1, 2024
1 parent 9d15ba4 commit 9b78c66
Showing 4 changed files with 3 additions and 50 deletions.
28 changes: 0 additions & 28 deletions src/dialogs/prefsdialog.cpp
Original file line number Diff line number Diff line change
@@ -167,7 +167,6 @@ void PrefsDialog::initCode(QWidget * widget, QList<Platform *> platforms)
void PrefsDialog::initBetaFeatures(QWidget * widget)
{
QVBoxLayout * vLayout = new QVBoxLayout();
vLayout->addWidget(createSimulatorBetaFeaturesForm());
vLayout->addWidget(createGerberBetaFeaturesForm());
vLayout->addWidget(createProjectPropertiesForm());
vLayout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Preferred, QSizePolicy::Expanding));
@@ -468,33 +467,6 @@ QWidget * PrefsDialog::createGerberBetaFeaturesForm() {
return gerberGroup;
}

QWidget * PrefsDialog::createSimulatorBetaFeaturesForm() {
QSettings settings;
QGroupBox * simulator = new QGroupBox(tr("Simulator"), this);

QVBoxLayout * layout = new QVBoxLayout();

QLabel * label = new QLabel(tr("The simulator is now enabled by default."));

label->setWordWrap(true);
layout->addWidget(label);
layout->addSpacing(10);

QCheckBox * box = new QCheckBox(tr("Enable simulator"));
box->setFixedWidth(FORMLABELWIDTH);

box->setChecked(settings.value("simulatorEnabled", false).toBool()); // Initialize the value of box using m_settings
layout->addWidget(box);

simulator->setLayout(layout);

connect(box, &QCheckBox::clicked, this, [this](bool checked) {
m_settings.insert("simulatorEnabled", QString::number(checked));
});

return simulator;
}

QWidget *PrefsDialog::createProjectPropertiesForm() {
QGroupBox * projectPropertiesBox = new QGroupBox(tr("Project properties"), this );

1 change: 0 additions & 1 deletion src/dialogs/prefsdialog.h
Original file line number Diff line number Diff line change
@@ -66,7 +66,6 @@ class PrefsDialog : public QDialog
QWidget * createZoomerForm();
QWidget * createAutosaveForm();
QWidget *createProgrammerForm(QList<Platform *> platforms);
QWidget *createSimulatorBetaFeaturesForm();
QWidget *createGerberBetaFeaturesForm();
QWidget *createProjectPropertiesForm();
void updateWheelText();
14 changes: 0 additions & 14 deletions src/fapplication.cpp
Original file line number Diff line number Diff line change
@@ -1297,22 +1297,13 @@ int FApplication::startup()
if (prevVersion != currVersion) {
QVariant pid = settings.value("pid");
QVariant language = settings.value("language");
QVariant simulatorEnabled = settings.value("simulatorEnabled");
settings.clear();
if (!pid.isNull()) {
settings.setValue("pid", pid);
}
if (!language.isNull()) {
settings.setValue("language", language);
}
if (!simulatorEnabled.isNull()) {
settings.setValue("simulatorEnabled", simulatorEnabled);
}

// Check if prevVersion is smaller than "1.0.0" or not set (new install)
if (prevVersion.isEmpty() || Version::greaterThan(prevVersion, "1.0.0")) {
settings.setValue("simulatorEnabled", "1");
}
}
}

@@ -1474,11 +1465,6 @@ void FApplication::updatePrefs(PrefsDialog & prefsDialog)
}
}
}
else if (key.compare("simulatorEnabled") == 0) {
foreach (MainWindow * mainWindow, mainWindows) {
mainWindow->enableSimulator(hash.value(key).toInt());
}
}
}

}
10 changes: 3 additions & 7 deletions src/simulation/simulator.cpp
Original file line number Diff line number Diff line change
@@ -67,16 +67,12 @@ Simulator::Simulator(MainWindow *mainWindow) : QObject(mainWindow) {
m_simTimer->setSingleShot(true);
connect(m_simTimer, &QTimer::timeout, this, &Simulator::simulate);

// Configure the timer to show the simulation results
m_showResultsTimer = new QTimer(this);
connect(m_showResultsTimer, &QTimer::timeout, this, &Simulator::showSimulationResults);
// Configure the timer to show the simulation results
m_showResultsTimer = new QTimer(this);
connect(m_showResultsTimer, &QTimer::timeout, this, &Simulator::showSimulationResults);

QSettings settings;
int enabled = settings.value("simulatorEnabled", 0).toInt();
enable(true);
m_simulating = false;


}

Simulator::~Simulator() {

0 comments on commit 9b78c66

Please sign in to comment.