Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/atcoreinstancewidget.cpp
1 | /* Atelier KDE Printer Host for 3D Printing | 1 | /* Atelier KDE Printer Host for 3D Printing | ||
---|---|---|---|---|---|
2 | Copyright (C) <2017> | 2 | Copyright (C) <2017> | ||
3 | Author: Lays Rodrigues - laysrodriguessilva@gmail.com | 3 | Author: Lays Rodrigues - laysrodriguessilva@gmail.com | ||
4 | Chris Rizzitello - rizzitello@kde.org | ||||
4 | 5 | | |||
5 | This program is free software: you can redistribute it and/or modify | 6 | This program is free software: you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation, either version 3 of the License, or | 8 | the Free Software Foundation, either version 3 of the License, or | ||
8 | (at your option) any later version. | 9 | (at your option) any later version. | ||
9 | 10 | | |||
10 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
Show All 37 Lines | 49 | { | |||
49 | m_core.closeConnection(); | 50 | m_core.closeConnection(); | ||
50 | delete ui; | 51 | delete ui; | ||
51 | } | 52 | } | ||
52 | 53 | | |||
53 | void AtCoreInstanceWidget::buildToolbar() | 54 | void AtCoreInstanceWidget::buildToolbar() | ||
54 | { | 55 | { | ||
55 | m_toolBar = new QToolBar(); | 56 | m_toolBar = new QToolBar(); | ||
56 | 57 | | |||
57 | auto lb = new QAction; | 58 | auto lb = new QLabel; | ||
58 | lb->setIcon(QIcon::fromTheme("go-home", QIcon(QString(":/%1/home").arg(m_theme)))); | 59 | QIcon icon = QIcon::fromTheme("go-home", QIcon(QString(":/%1/home").arg(m_theme))); | ||
59 | 60 | lb->setPixmap(icon.pixmap(fontMetrics().height())); | |||
60 | lb->setDisabled(true); | 61 | m_toolBar->addWidget(lb); | ||
61 | m_toolBar->addAction(lb); | 62 | lb = new QLabel(i18n("Home:")); | ||
63 | m_toolBar->addWidget(lb); | ||||
62 | 64 | | |||
63 | auto homeAll = new QAction("All"); | 65 | auto homeAll = new QAction("All"); | ||
64 | connect(homeAll, &QAction::triggered, [this]{ | 66 | connect(homeAll, &QAction::triggered, [this]{ | ||
65 | m_core.home(); | 67 | m_core.home(); | ||
66 | }); | 68 | }); | ||
67 | m_toolBar->addAction(homeAll); | 69 | m_toolBar->addAction(homeAll); | ||
68 | 70 | | |||
69 | for(auto homes : std::map<QString, int>{{"X", AtCore::X}, {"Y", AtCore::Y}, {"Z", AtCore::Z}}) { | 71 | for(auto homes : std::map<QString, int>{{"X", AtCore::X}, {"Y", AtCore::Y}, {"Z", AtCore::Z}}) { | ||
▲ Show 20 Lines • Show All 398 Lines • Show Last 20 Lines |