namelocationview.cpp
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package ArmarXCore::core
19 * @author Cedric Seehausen (usdnr at kit dot edu)
20 * @date 2016
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24
25
26#include "namelocationview.h"
27
28#include <QFileDialog>
29
30#include <ArmarXGui/gui-plugins/ScenarioManager/gui/ui_namelocationview.h>
31
32NameLocationView::NameLocationView(QWidget* parent) : QDialog(parent), ui(new Ui::NameLocationView)
33{
34 ui->setupUi(this);
35 ui->okButton->setDefault(true);
36}
37
42
43void
44NameLocationView::on_locationChooserButton_clicked()
45{
46 QDir directory(".");
47 QString path = QFileDialog::getExistingDirectory(this, tr("Directory"), directory.path());
48 if (path.isNull() == false)
49 {
50 this->path = path.toStdString();
51 }
52}
53
54void
55NameLocationView::on_nameLineEdit_textChanged(const QString& text)
56{
57 name = text.toStdString();
58}
59
60void
61NameLocationView::on_okButton_clicked()
62{
63 if (name.length() != 0 && path.length() != 0)
64 {
65 emit created(name, path);
66 accept();
67 }
68}
69
70void
71NameLocationView::on_cancelButton_clicked()
72{
73 reject();
74}
75
76void
77NameLocationView::on_nameLineEdit_editingFinished()
78{
79}
~NameLocationView() override
Destructor.
void created(std::string name, std::string path)
NameLocationView(QWidget *parent=0)
Constructor that sets up the ui.
ArmarX Headers.