|
| 1 | +/* |
| 2 | + * nextpnr -- Next Generation Place and Route |
| 3 | + * |
| 4 | + * Copyright (C) 2018 Miodrag Milanovic <[email protected]> |
| 5 | + * |
| 6 | + * Permission to use, copy, modify, and/or distribute this software for any |
| 7 | + * purpose with or without fee is hereby granted, provided that the above |
| 8 | + * copyright notice and this permission notice appear in all copies. |
| 9 | + * |
| 10 | + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 11 | + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 12 | + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 13 | + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 14 | + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 15 | + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 16 | + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 17 | + * |
| 18 | + */ |
| 19 | + |
| 20 | +#include "mainwindow.h" |
| 21 | + |
| 22 | +#include <QMessageBox> |
| 23 | +#include <cstdlib> |
| 24 | + |
| 25 | +static void initMainResource() { Q_INIT_RESOURCE(nextpnr); } |
| 26 | + |
| 27 | +NEXTPNR_NAMESPACE_BEGIN |
| 28 | + |
| 29 | +MainWindow::MainWindow(std::unique_ptr<Context> context, CommandHandler *handler, QWidget *parent) |
| 30 | + : BaseMainWindow(std::move(context), handler, parent) |
| 31 | +{ |
| 32 | + initMainResource(); |
| 33 | +} |
| 34 | + |
| 35 | +MainWindow::~MainWindow() {} |
| 36 | + |
| 37 | +void MainWindow::newContext(Context *ctx) |
| 38 | +{ |
| 39 | + std::string title = "nextpnr-himbächel - " + ctx->getChipName(); |
| 40 | + setWindowTitle(title.c_str()); |
| 41 | +} |
| 42 | + |
| 43 | +void MainWindow::createMenu() {} |
| 44 | + |
| 45 | +void MainWindow::new_proj() |
| 46 | +{ |
| 47 | + QMessageBox::critical(0, "Error", |
| 48 | + "Creating a new project not supported in himbächel mode, please re-start from command line."); |
| 49 | + std::exit(1); |
| 50 | +} |
| 51 | + |
| 52 | +NEXTPNR_NAMESPACE_END |
0 commit comments