author_information_widget.cpp
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2012, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 /* Author: Dave Coleman, Michael 'v4hn' Goerner */
36 
37 // Qt
38 #include <QVBoxLayout>
39 #include <QPushButton>
40 #include <QMessageBox>
41 #include <QApplication>
42 #include <QSplitter>
43 // ROS
45 #include <srdfdom/model.h> // use their struct datastructures
46 #include <ros/ros.h>
47 // Boost
48 #include <boost/algorithm/string.hpp> // for trimming whitespace from user input
49 #include <boost/filesystem.hpp> // for creating folders/files
50 // Read write files
51 #include <iostream> // For writing yaml and launch files
52 #include <fstream>
53 
54 namespace moveit_setup_assistant
55 {
56 // Boost file system
57 namespace fs = boost::filesystem;
58 
59 // ******************************************************************************************
60 // Outer User Interface for MoveIt! Configuration Assistant
61 // ******************************************************************************************
63  moveit_setup_assistant::MoveItConfigDataPtr config_data)
64  : SetupScreenWidget(parent), config_data_(config_data)
65 {
66  // Basic widget container
67  QVBoxLayout* layout = new QVBoxLayout();
68  layout->setAlignment(Qt::AlignTop);
69 
70  // Top Header Area ------------------------------------------------
71 
72  HeaderWidget* header = new HeaderWidget("Specify Author Information",
73  "Input contact information of the author and initial maintainer of the "
74  "generated package. catkin requires valid details in the package's "
75  "package.xml",
76  this);
77  layout->addWidget(header);
78 
79  QLabel* name_title = new QLabel(this);
80  name_title->setText("Name of the maintainer this MoveIt! configuration:");
81  layout->addWidget(name_title);
82 
83  name_edit_ = new QLineEdit(this);
84  connect(name_edit_, SIGNAL(editingFinished()), this, SLOT(edited_name()));
85  layout->addWidget(name_edit_);
86 
87  QLabel* email_title = new QLabel(this);
88  email_title->setText("Email of the maintainer of this MoveIt! configuration:");
89  layout->addWidget(email_title);
90 
91  email_edit_ = new QLineEdit(this);
92  connect(email_edit_, SIGNAL(editingFinished()), this, SLOT(edited_email()));
93  layout->addWidget(email_edit_);
94 
95  // Finish Layout --------------------------------------------------
96  this->setLayout(layout);
97 }
98 
99 // ******************************************************************************************
100 // Called when setup assistant navigation switches to this screen
101 // ******************************************************************************************
103 {
104  // Allow list box to populate
105  this->name_edit_->setText(QString::fromStdString(config_data_->author_name_));
106  this->email_edit_->setText(QString::fromStdString(config_data_->author_email_));
107 }
108 
110 {
111  config_data_->author_name_ = this->name_edit_->text().toStdString();
113 }
114 
116 {
117  config_data_->author_email_ = this->email_edit_->text().toStdString();
119 }
120 
121 } // namespace
virtual void focusGiven()
Received when this widget is chosen from the navigation menu.
AuthorInformationWidget(QWidget *parent, moveit_setup_assistant::MoveItConfigDataPtr config_data)
moveit_setup_assistant::MoveItConfigDataPtr config_data_
Contains all the configuration data for the setup assistant.


moveit_setup_assistant
Author(s): Dave Coleman
autogenerated on Sun Oct 18 2020 13:19:28