clangformat
This commit is contained in:
parent
e40b61e87e
commit
23a7d96f4c
@ -25,13 +25,13 @@
|
||||
#include <QIcon>
|
||||
#include <QInputDialog>
|
||||
#include <QSplitter>
|
||||
#include <fstream>
|
||||
#include "designwidget.h"
|
||||
#include "fpgaviewwidget.h"
|
||||
#include "jsonparse.h"
|
||||
#include "log.h"
|
||||
#include "mainwindow.h"
|
||||
#include "pythontab.h"
|
||||
#include "jsonparse.h"
|
||||
#include <fstream>
|
||||
|
||||
static void initBasenameResource() { Q_INIT_RESOURCE(base); }
|
||||
|
||||
@ -85,7 +85,7 @@ BaseMainWindow::BaseMainWindow(std::unique_ptr<Context> context, QWidget *parent
|
||||
splitter_v->addWidget(centralTabWidget);
|
||||
splitter_v->addWidget(tabWidget);
|
||||
|
||||
// Connect Worker
|
||||
// Connect Worker
|
||||
connect(task, SIGNAL(log(std::string)), this, SLOT(writeInfo(std::string)));
|
||||
connect(task, SIGNAL(pack_finished(bool)), this, SLOT(pack_finished(bool)));
|
||||
connect(task, SIGNAL(budget_finish(bool)), this, SLOT(budget_finish(bool)));
|
||||
@ -95,7 +95,7 @@ BaseMainWindow::BaseMainWindow(std::unique_ptr<Context> context, QWidget *parent
|
||||
connect(task, SIGNAL(taskStarted()), this, SLOT(taskStarted()));
|
||||
connect(task, SIGNAL(taskPaused()), this, SLOT(taskPaused()));
|
||||
|
||||
// Events for context change
|
||||
// Events for context change
|
||||
connect(this, SIGNAL(contextChanged(Context *)), task, SIGNAL(contextChanged(Context *)));
|
||||
connect(this, SIGNAL(contextChanged(Context *)), console, SLOT(newContext(Context *)));
|
||||
connect(this, SIGNAL(contextChanged(Context *)), fpgaView, SLOT(newContext(Context *)));
|
||||
@ -104,7 +104,7 @@ BaseMainWindow::BaseMainWindow(std::unique_ptr<Context> context, QWidget *parent
|
||||
// Catch close tab events
|
||||
connect(centralTabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
|
||||
|
||||
// Propagate events from design view to device view
|
||||
// Propagate events from design view to device view
|
||||
connect(designview, SIGNAL(selected(std::vector<DecalXY>, bool)), fpgaView,
|
||||
SLOT(onSelectedArchItem(std::vector<DecalXY>, bool)));
|
||||
connect(designview, SIGNAL(zoomSelected()), fpgaView, SLOT(zoomSelected()));
|
||||
|
@ -50,15 +50,16 @@ class BaseMainWindow : public QMainWindow
|
||||
Context *getContext() { return ctx.get(); }
|
||||
|
||||
void load_json(std::string filename);
|
||||
|
||||
protected:
|
||||
void createMenusAndBars();
|
||||
void disableActions();
|
||||
virtual void onDisableActions() {};
|
||||
virtual void onJsonLoaded() {};
|
||||
virtual void onPackFinished() {};
|
||||
virtual void onBudgetFinished() {};
|
||||
virtual void onPlaceFinished() {};
|
||||
virtual void onRouteFinished() {};
|
||||
virtual void onDisableActions(){};
|
||||
virtual void onJsonLoaded(){};
|
||||
virtual void onPackFinished(){};
|
||||
virtual void onBudgetFinished(){};
|
||||
virtual void onPlaceFinished(){};
|
||||
virtual void onRouteFinished(){};
|
||||
|
||||
protected Q_SLOTS:
|
||||
void writeInfo(std::string text);
|
||||
@ -105,7 +106,7 @@ class BaseMainWindow : public QMainWindow
|
||||
QStatusBar *statusBar;
|
||||
QToolBar *mainActionBar;
|
||||
QProgressBar *progressBar;
|
||||
|
||||
|
||||
QAction *actionNew;
|
||||
QAction *actionOpen;
|
||||
QAction *actionSave;
|
||||
|
@ -317,7 +317,7 @@ QtProperty *DesignWidget::addSubGroup(QtProperty *topItem, const QString &name)
|
||||
|
||||
void DesignWidget::onClickedBel(BelId bel, bool keep)
|
||||
{
|
||||
boost::optional<TreeModel::Item*> item;
|
||||
boost::optional<TreeModel::Item *> item;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock_ui(ctx->ui_mutex);
|
||||
std::lock_guard<std::mutex> lock(ctx->mutex);
|
||||
@ -334,7 +334,7 @@ void DesignWidget::onClickedBel(BelId bel, bool keep)
|
||||
|
||||
void DesignWidget::onClickedWire(WireId wire, bool keep)
|
||||
{
|
||||
boost::optional<TreeModel::Item*> item;
|
||||
boost::optional<TreeModel::Item *> item;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock_ui(ctx->ui_mutex);
|
||||
std::lock_guard<std::mutex> lock(ctx->mutex);
|
||||
@ -351,7 +351,7 @@ void DesignWidget::onClickedWire(WireId wire, bool keep)
|
||||
|
||||
void DesignWidget::onClickedPip(PipId pip, bool keep)
|
||||
{
|
||||
boost::optional<TreeModel::Item*> item;
|
||||
boost::optional<TreeModel::Item *> item;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock_ui(ctx->ui_mutex);
|
||||
std::lock_guard<std::mutex> lock(ctx->mutex);
|
||||
|
@ -54,8 +54,8 @@ MainWindow::MainWindow(std::unique_ptr<Context> context, ArchArgs args, QWidget
|
||||
MainWindow::~MainWindow() {}
|
||||
|
||||
void MainWindow::createMenu()
|
||||
{
|
||||
// Add arch specific actions
|
||||
{
|
||||
// Add arch specific actions
|
||||
actionLoadPCF = new QAction("Open PCF", this);
|
||||
actionLoadPCF->setIcon(QIcon(":/icons/resources/open_pcf.png"));
|
||||
actionLoadPCF->setStatusTip("Open PCF file");
|
||||
@ -72,7 +72,7 @@ void MainWindow::createMenu()
|
||||
mainActionBar->addSeparator();
|
||||
mainActionBar->addAction(actionLoadPCF);
|
||||
mainActionBar->addAction(actionSaveAsc);
|
||||
|
||||
|
||||
menuDesign->addSeparator();
|
||||
menuDesign->addAction(actionLoadPCF);
|
||||
menuDesign->addAction(actionSaveAsc);
|
||||
@ -157,7 +157,7 @@ void MainWindow::load_pcf(std::string filename)
|
||||
{
|
||||
disableActions();
|
||||
currentPCF = filename;
|
||||
std::ifstream f(filename);
|
||||
std::ifstream f(filename);
|
||||
if (apply_pcf(ctx.get(), f)) {
|
||||
log("Loading PCF successful.\n");
|
||||
actionPack->setEnabled(true);
|
||||
@ -309,14 +309,7 @@ void MainWindow::onDisableActions()
|
||||
actionSaveAsc->setEnabled(false);
|
||||
}
|
||||
|
||||
void MainWindow::onJsonLoaded()
|
||||
{
|
||||
actionLoadPCF->setEnabled(true);
|
||||
}
|
||||
void MainWindow::onRouteFinished()
|
||||
{
|
||||
actionSaveAsc->setEnabled(true);
|
||||
}
|
||||
|
||||
void MainWindow::onJsonLoaded() { actionLoadPCF->setEnabled(true); }
|
||||
void MainWindow::onRouteFinished() { actionSaveAsc->setEnabled(true); }
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
@ -35,6 +35,7 @@ class MainWindow : public BaseMainWindow
|
||||
public:
|
||||
void createMenu();
|
||||
void load_pcf(std::string filename);
|
||||
|
||||
protected:
|
||||
void onDisableActions() override;
|
||||
void onJsonLoaded() override;
|
||||
|
Loading…
Reference in New Issue
Block a user