From 5216e488639fc8420d38c35177b796e1cf56ac8b Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Jul 2018 14:06:05 +0200 Subject: join python and info into one tab --- gui/ice40/mainwindow.cc | 6 ------ 1 file changed, 6 deletions(-) (limited to 'gui/ice40/mainwindow.cc') diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc index bea5fce7..4ade1f1f 100644 --- a/gui/ice40/mainwindow.cc +++ b/gui/ice40/mainwindow.cc @@ -253,7 +253,6 @@ void MainWindow::new_proj() void MainWindow::load_json(std::string filename, std::string pcf) { - tabWidget->setCurrentWidget(info); preload_pcf = pcf; disableActions(); Q_EMIT task->loadfile(filename); @@ -261,8 +260,6 @@ void MainWindow::load_json(std::string filename, std::string pcf) void MainWindow::load_pcf(std::string filename) { - tabWidget->setCurrentWidget(info); - disableActions(); Q_EMIT task->loadpcf(filename); } @@ -271,15 +268,12 @@ void MainWindow::newContext(Context *ctx) { std::string title = "nextpnr-ice40 - " + ctx->getChipName() + " ( " + chipArgs.package + " )"; setWindowTitle(title.c_str()); - info->clearBuffer(); } void MainWindow::open_proj() { QString fileName = QFileDialog::getOpenFileName(this, QString("Open Project"), QString(), QString("*.proj")); if (!fileName.isEmpty()) { - tabWidget->setCurrentWidget(info); - std::string fn = fileName.toStdString(); disableActions(); } -- cgit v1.2.3 From f339f796a1bd7e98be184085e831e9d44ea85dd1 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Jul 2018 17:58:58 +0200 Subject: simplified Icon allocation --- gui/ice40/mainwindow.cc | 80 +++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 50 deletions(-) (limited to 'gui/ice40/mainwindow.cc') diff --git a/gui/ice40/mainwindow.cc b/gui/ice40/mainwindow.cc index 4ade1f1f..772ca6ac 100644 --- a/gui/ice40/mainwindow.cc +++ b/gui/ice40/mainwindow.cc @@ -71,61 +71,47 @@ void MainWindow::createMenu() QMenu *menu_Design = new QMenu("&Design", menuBar); menuBar->addAction(menu_Design->menuAction()); - actionLoadJSON = new QAction("Open JSON", this); - QIcon iconLoadJSON; - iconLoadJSON.addFile(QStringLiteral(":/icons/resources/open_json.png")); - actionLoadJSON->setIcon(iconLoadJSON); + actionLoadJSON = new QAction("Open JSON", this); + actionLoadJSON->setIcon(QIcon(":/icons/resources/open_json.png")); actionLoadJSON->setStatusTip("Open an existing JSON file"); - connect(actionLoadJSON, SIGNAL(triggered()), this, SLOT(open_json())); actionLoadJSON->setEnabled(true); + connect(actionLoadJSON, SIGNAL(triggered()), this, SLOT(open_json())); - actionLoadPCF = new QAction("Open PCF", this); - QIcon iconLoadPCF; - iconLoadPCF.addFile(QStringLiteral(":/icons/resources/open_pcf.png")); - actionLoadPCF->setIcon(iconLoadPCF); + actionLoadPCF = new QAction("Open PCF", this); + actionLoadPCF->setIcon(QIcon(":/icons/resources/open_pcf.png")); actionLoadPCF->setStatusTip("Open PCF file"); - connect(actionLoadPCF, SIGNAL(triggered()), this, SLOT(open_pcf())); actionLoadPCF->setEnabled(false); + connect(actionLoadPCF, SIGNAL(triggered()), this, SLOT(open_pcf())); - actionPack = new QAction("Pack", this); - QIcon iconPack; - iconPack.addFile(QStringLiteral(":/icons/resources/pack.png")); - actionPack->setIcon(iconPack); + actionPack = new QAction("Pack", this); + actionPack->setIcon(QIcon(":/icons/resources/pack.png")); actionPack->setStatusTip("Pack current design"); - connect(actionPack, SIGNAL(triggered()), task, SIGNAL(pack())); actionPack->setEnabled(false); + connect(actionPack, SIGNAL(triggered()), task, SIGNAL(pack())); - actionAssignBudget = new QAction("Assign Budget", this); - QIcon iconAssignBudget; - iconAssignBudget.addFile(QStringLiteral(":/icons/resources/time_add.png")); - actionAssignBudget->setIcon(iconAssignBudget); + actionAssignBudget = new QAction("Assign Budget", this); + actionAssignBudget->setIcon(QIcon(":/icons/resources/time_add.png")); actionAssignBudget->setStatusTip("Assign time budget for current design"); - connect(actionAssignBudget, SIGNAL(triggered()), this, SLOT(budget())); actionAssignBudget->setEnabled(false); + connect(actionAssignBudget, SIGNAL(triggered()), this, SLOT(budget())); - actionPlace = new QAction("Place", this); - QIcon iconPlace; - iconPlace.addFile(QStringLiteral(":/icons/resources/place.png")); - actionPlace->setIcon(iconPlace); + actionPlace = new QAction("Place", this); + actionPlace->setIcon(QIcon(":/icons/resources/place.png")); actionPlace->setStatusTip("Place current design"); - connect(actionPlace, SIGNAL(triggered()), this, SLOT(place())); actionPlace->setEnabled(false); + connect(actionPlace, SIGNAL(triggered()), this, SLOT(place())); - actionRoute = new QAction("Route", this); - QIcon iconRoute; - iconRoute.addFile(QStringLiteral(":/icons/resources/route.png")); - actionRoute->setIcon(iconRoute); + actionRoute = new QAction("Route", this); + actionRoute->setIcon(QIcon(":/icons/resources/route.png")); actionRoute->setStatusTip("Route current design"); - connect(actionRoute, SIGNAL(triggered()), task, SIGNAL(route())); actionRoute->setEnabled(false); + connect(actionRoute, SIGNAL(triggered()), task, SIGNAL(route())); - actionSaveAsc = new QAction("Save ASC", this); - QIcon iconSaveAsc; - iconSaveAsc.addFile(QStringLiteral(":/icons/resources/save_asc.png")); - actionSaveAsc->setIcon(iconSaveAsc); + actionSaveAsc = new QAction("Save ASC", this); + actionSaveAsc->setIcon(QIcon(":/icons/resources/save_asc.png")); actionSaveAsc->setStatusTip("Save ASC file"); - connect(actionSaveAsc, SIGNAL(triggered()), this, SLOT(save_asc())); actionSaveAsc->setEnabled(false); + connect(actionSaveAsc, SIGNAL(triggered()), this, SLOT(save_asc())); QToolBar *taskFPGABar = new QToolBar(); addToolBar(Qt::TopToolBarArea, taskFPGABar); @@ -146,29 +132,23 @@ void MainWindow::createMenu() menu_Design->addAction(actionRoute); menu_Design->addAction(actionSaveAsc); - actionPlay = new QAction("Play", this); - QIcon iconPlay; - iconPlay.addFile(QStringLiteral(":/icons/resources/control_play.png")); - actionPlay->setIcon(iconPlay); + actionPlay = new QAction("Play", this); + actionPlay->setIcon(QIcon(":/icons/resources/control_play.png")); actionPlay->setStatusTip("Continue running task"); - connect(actionPlay, SIGNAL(triggered()), task, SLOT(continue_thread())); actionPlay->setEnabled(false); + connect(actionPlay, SIGNAL(triggered()), task, SLOT(continue_thread())); - actionPause = new QAction("Pause", this); - QIcon iconPause; - iconPause.addFile(QStringLiteral(":/icons/resources/control_pause.png")); - actionPause->setIcon(iconPause); + actionPause = new QAction("Pause", this); + actionPause->setIcon(QIcon(":/icons/resources/control_pause.png")); actionPause->setStatusTip("Pause running task"); - connect(actionPause, SIGNAL(triggered()), task, SLOT(pause_thread())); actionPause->setEnabled(false); + connect(actionPause, SIGNAL(triggered()), task, SLOT(pause_thread())); - actionStop = new QAction("Stop", this); - QIcon iconStop; - iconStop.addFile(QStringLiteral(":/icons/resources/control_stop.png")); - actionStop->setIcon(iconStop); + actionStop = new QAction("Stop", this); + actionStop->setIcon(QIcon(":/icons/resources/control_stop.png")); actionStop->setStatusTip("Stop running task"); - connect(actionStop, SIGNAL(triggered()), task, SLOT(terminate_thread())); actionStop->setEnabled(false); + connect(actionStop, SIGNAL(triggered()), task, SLOT(terminate_thread())); QToolBar *taskToolBar = new QToolBar(); addToolBar(Qt::TopToolBarArea, taskToolBar); -- cgit v1.2.3