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 <QLabel>
43 #include <QLineEdit>
45 #include "header_widget.h"
46 
47 namespace moveit_setup_assistant
48 {
49 // ******************************************************************************************
50 // Outer User Interface for MoveIt Configuration Assistant
51 // ******************************************************************************************
52 AuthorInformationWidget::AuthorInformationWidget(QWidget* parent, const MoveItConfigDataPtr& config_data)
53  : SetupScreenWidget(parent), config_data_(config_data)
54 {
55  // Basic widget container
56  QVBoxLayout* layout = new QVBoxLayout();
57  layout->setAlignment(Qt::AlignTop);
58 
59  // Top Header Area ------------------------------------------------
60 
61  HeaderWidget* header = new HeaderWidget("Specify Author Information",
62  "Input contact information of the author and initial maintainer of the "
63  "generated package. catkin requires valid details in the package's "
64  "package.xml",
65  this);
66  layout->addWidget(header);
67 
68  QLabel* name_title = new QLabel(this);
69  name_title->setText("Name of the maintainer of this MoveIt configuration:");
70  layout->addWidget(name_title);
71 
72  name_edit_ = new QLineEdit(this);
73  connect(name_edit_, SIGNAL(editingFinished()), this, SLOT(editedName()));
74  layout->addWidget(name_edit_);
75 
76  QLabel* email_title = new QLabel(this);
77  email_title->setText("Email of the maintainer of this MoveIt configuration:");
78  layout->addWidget(email_title);
79 
80  email_edit_ = new QLineEdit(this);
81  connect(email_edit_, SIGNAL(editingFinished()), this, SLOT(editedEmail()));
82  layout->addWidget(email_edit_);
83 
84  // Finish Layout --------------------------------------------------
85  this->setLayout(layout);
86 }
87 
88 // ******************************************************************************************
89 // Called when setup assistant navigation switches to this screen
90 // ******************************************************************************************
91 void AuthorInformationWidget::focusGiven()
92 {
93  // Allow list box to populate
94  this->name_edit_->setText(QString::fromStdString(config_data_->author_name_));
95  this->email_edit_->setText(QString::fromStdString(config_data_->author_email_));
96 }
97 
98 void AuthorInformationWidget::editedName()
99 {
100  config_data_->author_name_ = this->name_edit_->text().toStdString();
101  config_data_->changes |= MoveItConfigData::AUTHOR_INFO;
102 }
103 
104 void AuthorInformationWidget::editedEmail()
105 {
106  config_data_->author_email_ = this->email_edit_->text().toStdString();
107  config_data_->changes |= MoveItConfigData::AUTHOR_INFO;
108 }
109 
110 } // namespace moveit_setup_assistant
moveit_setup_assistant::AuthorInformationWidget::AuthorInformationWidget
AuthorInformationWidget(QWidget *parent, const MoveItConfigDataPtr &config_data)
Definition: author_information_widget.cpp:84
SetupScreenWidget
Definition: setup_screen_widget.h:44
header_widget.h
moveit_setup_assistant
Definition: compute_default_collisions.h:46
author_information_widget.h
header
const std::string header


moveit_setup_assistant
Author(s): Dave Coleman
autogenerated on Sat May 3 2025 02:28:04