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 
34 namespace armarx::Ui
35 {
36  class RenameStateDialog;
37 }
38 
39 namespace 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
armarx::Ui
Definition: GuiUseCaseSelector.h:33
armarx::StateTreeModelPtr
std::shared_ptr< StateTreeModel > StateTreeModelPtr
Definition: StateTreeModel.h:46
armarx::RenameStateDialog::RenameStateDialog
RenameStateDialog(const StateTreeModelPtr &treeModel, const StatechartGroupPtr &sourceGroup, const statechartmodel::StatePtr &sourceState, QWidget *parent=0)
Definition: RenameStateDialog.cpp:40
armarx::RenameStateDialog::getNewStateName
QString getNewStateName() const
Definition: RenameStateDialog.cpp:196
armarx::RenameStateDialog::isSaveAllRequested
bool isSaveAllRequested() const
Definition: RenameStateDialog.cpp:190
StateRenamer.h
armarx::RenameStateDialog
Definition: RenameStateDialog.h:41
armarx::RenameStateDialog::verifyInstanceName
void verifyInstanceName(QTableWidgetItem *item)
Definition: RenameStateDialog.cpp:209
armarx::RenameStateDialog::saveAllProceedButtonClicked
void saveAllProceedButtonClicked()
Definition: RenameStateDialog.cpp:202
armarx::RenameStateDialog::~RenameStateDialog
~RenameStateDialog() override
Definition: RenameStateDialog.cpp:159
enabled
std::atomic< bool > * enabled
Definition: RemoteGuiWidgetController.cpp:75
armarx::RenameStateDialog::verifyNewName
void verifyNewName(QString newName)
Definition: RenameStateDialog.cpp:278
StateTreeModel.h
armarx::StatechartGroupPtr
std::shared_ptr< StatechartGroup > StatechartGroupPtr
Definition: StatechartGroupDefs.h:34
armarx::RenameStateDialog::getInstanceRenameInfos
QVector< StateRenamer::InstanceRenameInfo > getInstanceRenameInfos() const
Definition: RenameStateDialog.cpp:184
armarx::statechartmodel::StatePtr
std::shared_ptr< State > StatePtr
Definition: State.h:48
armarx::RenameStateDialog::getGroup
StatechartGroupPtr getGroup() const
Definition: RenameStateDialog.cpp:172
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::RenameStateDialog::getState
statechartmodel::StatePtr getState() const
Definition: RenameStateDialog.cpp:178
VariantInfo.h