author_information_widget.cpp
Go to the documentation of this file.
00001 /*********************************************************************
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Copyright (c) 2012, Willow Garage, Inc.
00005  *  All rights reserved.
00006  *
00007  *  Redistribution and use in source and binary forms, with or without
00008  *  modification, are permitted provided that the following conditions
00009  *  are met:
00010  *
00011  *   * Redistributions of source code must retain the above copyright
00012  *     notice, this list of conditions and the following disclaimer.
00013  *   * Redistributions in binary form must reproduce the above
00014  *     copyright notice, this list of conditions and the following
00015  *     disclaimer in the documentation and/or other materials provided
00016  *     with the distribution.
00017  *   * Neither the name of Willow Garage nor the names of its
00018  *     contributors may be used to endorse or promote products derived
00019  *     from this software without specific prior written permission.
00020  *
00021  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00024  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00025  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00026  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00027  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00028  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00029  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00030  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00031  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00032  *  POSSIBILITY OF SUCH DAMAGE.
00033  *********************************************************************/
00034 
00035 /* Author: Dave Coleman, Michael 'v4hn' Goerner */
00036 
00037 // Qt
00038 #include <QVBoxLayout>
00039 #include <QPushButton>
00040 #include <QMessageBox>
00041 #include <QApplication>
00042 #include <QSplitter>
00043 // ROS
00044 #include "author_information_widget.h"
00045 #include <srdfdom/model.h>  // use their struct datastructures
00046 #include <ros/ros.h>
00047 // Boost
00048 #include <boost/algorithm/string.hpp>  // for trimming whitespace from user input
00049 #include <boost/filesystem.hpp>        // for creating folders/files
00050 // Read write files
00051 #include <iostream>  // For writing yaml and launch files
00052 #include <fstream>
00053 
00054 namespace moveit_setup_assistant
00055 {
00056 // Boost file system
00057 namespace fs = boost::filesystem;
00058 
00059 // ******************************************************************************************
00060 // Outer User Interface for MoveIt Configuration Assistant
00061 // ******************************************************************************************
00062 AuthorInformationWidget::AuthorInformationWidget(QWidget* parent,
00063                                                  moveit_setup_assistant::MoveItConfigDataPtr config_data)
00064   : SetupScreenWidget(parent), config_data_(config_data)
00065 {
00066   // Basic widget container
00067   QVBoxLayout* layout = new QVBoxLayout();
00068   layout->setAlignment(Qt::AlignTop);
00069 
00070   // Top Header Area ------------------------------------------------
00071 
00072   HeaderWidget* header =
00073       new HeaderWidget("Author Information", "Specify contact information of the author and initial maintainer of the "
00074                                              "generated package. catkin requires valid details in the package's "
00075                                              "package.xml",
00076                        this);
00077   layout->addWidget(header);
00078 
00079   QLabel* name_title = new QLabel(this);
00080   name_title->setText("Name of the maintainer this MoveIt! configuration:");
00081   layout->addWidget(name_title);
00082 
00083   name_edit_ = new QLineEdit(this);
00084   connect(name_edit_, SIGNAL(editingFinished()), this, SLOT(edited_name()));
00085   layout->addWidget(name_edit_);
00086 
00087   QLabel* email_title = new QLabel(this);
00088   email_title->setText("Email of the maintainer of this MoveIt! configuration:");
00089   layout->addWidget(email_title);
00090 
00091   email_edit_ = new QLineEdit(this);
00092   connect(email_edit_, SIGNAL(editingFinished()), this, SLOT(edited_email()));
00093   layout->addWidget(email_edit_);
00094 
00095   // Finish Layout --------------------------------------------------
00096   this->setLayout(layout);
00097 }
00098 
00099 // ******************************************************************************************
00100 // Called when setup assistant navigation switches to this screen
00101 // ******************************************************************************************
00102 void AuthorInformationWidget::focusGiven()
00103 {
00104   // Allow list box to populate
00105   this->name_edit_->setText(QString::fromStdString(config_data_->author_name_));
00106   this->email_edit_->setText(QString::fromStdString(config_data_->author_email_));
00107 }
00108 
00109 void AuthorInformationWidget::edited_name()
00110 {
00111   config_data_->author_name_ = this->name_edit_->text().toStdString();
00112   config_data_->changes |= MoveItConfigData::AUTHOR_INFO;
00113 }
00114 
00115 void AuthorInformationWidget::edited_email()
00116 {
00117   config_data_->author_email_ = this->email_edit_->text().toStdString();
00118   config_data_->changes |= MoveItConfigData::AUTHOR_INFO;
00119 }
00120 
00121 }  // namespace


moveit_setup_assistant
Author(s): Dave Coleman
autogenerated on Wed Jun 19 2019 19:25:13