Make buttons toggleable by single clicking
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <QTextStream>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
|
||||
#include "Scene.h"
|
||||
#include "Part.h"
|
||||
#include "Wire.h"
|
||||
@@ -14,8 +15,6 @@
|
||||
|
||||
#include "Parts/IntegratedCircuit.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
FileHandler::FileHandler(Logic* logic)
|
||||
:m_logic(logic)
|
||||
{
|
||||
@@ -74,11 +73,12 @@ bool FileHandler::open(QString filename)
|
||||
|
||||
enum Sector
|
||||
{
|
||||
None,
|
||||
Parts,
|
||||
Wires
|
||||
};
|
||||
|
||||
Sector currentSector;
|
||||
Sector currentSector = None;
|
||||
|
||||
// A .csim file stores all parts with IDs, this map simply keeps track of which ID corresponds to which pointer
|
||||
QMap<QString, Part*> idPartPointerMap;
|
||||
@@ -116,6 +116,9 @@ bool FileHandler::open(QString filename)
|
||||
if(words.length() < 4)
|
||||
return false;
|
||||
|
||||
if(currentSector == None)
|
||||
return false;
|
||||
|
||||
if(currentSector == Parts)
|
||||
{
|
||||
PartType::PartType type = (PartType::PartType)words[1].toInt();
|
||||
|
||||
Reference in New Issue
Block a user