RenameStateDialog.h
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* ArmarX is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License version 2 as
6* published by the Free Software Foundation.
7*
8* ArmarX is distributed in the hope that it will be useful, but
9* WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15*
16* @package ArmarX::
17* @author Valerij Wittenbeck (valerij.wittenbeck at student dot kit dot edu
18* @date 2015
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#pragma once
24
25#include <QDialog>
26#include <QList>
27#include <QTableWidgetItem>
28
30
33
34namespace armarx::Ui
35{
36 class RenameStateDialog;
37}
38
39namespace armarx
40{
41 class RenameStateDialog : public QDialog
42 {
43 Q_OBJECT
44
45 public:
46 explicit RenameStateDialog(const StateTreeModelPtr& treeModel,
47 const StatechartGroupPtr& sourceGroup,
48 const statechartmodel::StatePtr& sourceState,
49 QWidget* parent = 0);
50 ~RenameStateDialog() override;
53 QVector<StateRenamer::InstanceRenameInfo> getInstanceRenameInfos() const;
54 bool isSaveAllRequested() const;
55 QString getNewStateName() const;
56
57 public slots:
59 void verifyNewName(QString newName);
60 void verifyInstanceName(QTableWidgetItem* item);
61
62 private:
63 void setOkButtonsEnabled(bool enabled);
64 Ui::RenameStateDialog* ui;
65 StatechartGroupPtr sourceGroup;
66 statechartmodel::StatePtr sourceState;
67 QRegExp validStateNameRegExp;
68 QRegExp validInstanceNameRegExp;
69
70 QVector<statechartmodel::StatePtr> localStates;
71 QVector<StateRenamer::InstanceRenameInfo> instanceRenameInfos;
72 bool validNewName;
73 bool validInstanceNames;
74
75 QColor colorGreen;
76 QColor colorRed;
77 QColor colorYellow;
78
79 bool saveAll;
80 bool alreadyChecking;
81 };
82
83
84} // namespace armarx
void verifyNewName(QString newName)
void verifyInstanceName(QTableWidgetItem *item)
statechartmodel::StatePtr getState() const
QVector< StateRenamer::InstanceRenameInfo > getInstanceRenameInfos() const
StatechartGroupPtr getGroup() const
RenameStateDialog(const StateTreeModelPtr &treeModel, const StatechartGroupPtr &sourceGroup, const statechartmodel::StatePtr &sourceState, QWidget *parent=0)
std::shared_ptr< State > StatePtr
Definition State.h:48
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< StatechartGroup > StatechartGroupPtr
std::shared_ptr< StateTreeModel > StateTreeModelPtr