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 
30 
32 #include <QTableWidgetItem>
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 
47  explicit RenameStateDialog(const StateTreeModelPtr& treeModel, const StatechartGroupPtr& sourceGroup, const statechartmodel::StatePtr& sourceState, QWidget* parent = 0);
48  ~RenameStateDialog() override;
51  QVector<StateRenamer::InstanceRenameInfo> getInstanceRenameInfos() const;
52  bool isSaveAllRequested() const;
53  QString getNewStateName() const;
54 
55  public slots:
57  void verifyNewName(QString newName);
58  void verifyInstanceName(QTableWidgetItem* item);
59 
60  private:
61  void setOkButtonsEnabled(bool enabled);
62  Ui::RenameStateDialog* ui;
63  StatechartGroupPtr sourceGroup;
64  statechartmodel::StatePtr sourceState;
65  QRegExp validStateNameRegExp;
66  QRegExp validInstanceNameRegExp;
67 
68  QVector<statechartmodel::StatePtr> localStates;
69  QVector<StateRenamer::InstanceRenameInfo> instanceRenameInfos;
70  bool validNewName;
71  bool validInstanceNames;
72 
73  QColor colorGreen;
74  QColor colorRed;
75  QColor colorYellow;
76 
77  bool saveAll;
78  bool alreadyChecking;
79  };
80 
81 
82 }
armarx::Ui
Definition: GuiUseCaseSelector.h:33
armarx::StateTreeModelPtr
std::shared_ptr< StateTreeModel > StateTreeModelPtr
Definition: StateTreeModel.h:44
armarx::RenameStateDialog::RenameStateDialog
RenameStateDialog(const StateTreeModelPtr &treeModel, const StatechartGroupPtr &sourceGroup, const statechartmodel::StatePtr &sourceState, QWidget *parent=0)
Definition: RenameStateDialog.cpp:39
armarx::RenameStateDialog::getNewStateName
QString getNewStateName() const
Definition: RenameStateDialog.cpp:172
armarx::RenameStateDialog::isSaveAllRequested
bool isSaveAllRequested() const
Definition: RenameStateDialog.cpp:167
StateRenamer.h
armarx::RenameStateDialog
Definition: RenameStateDialog.h:41
armarx::RenameStateDialog::verifyInstanceName
void verifyInstanceName(QTableWidgetItem *item)
Definition: RenameStateDialog.cpp:183
armarx::RenameStateDialog::saveAllProceedButtonClicked
void saveAllProceedButtonClicked()
Definition: RenameStateDialog.cpp:177
armarx::RenameStateDialog::~RenameStateDialog
~RenameStateDialog() override
Definition: RenameStateDialog.cpp:141
enabled
std::atomic< bool > * enabled
Definition: RemoteGuiWidgetController.cpp:75
armarx::RenameStateDialog::verifyNewName
void verifyNewName(QString newName)
Definition: RenameStateDialog.cpp:249
StateTreeModel.h
armarx::StatechartGroupPtr
std::shared_ptr< StatechartGroup > StatechartGroupPtr
Definition: StatechartGroupDefs.h:34
armarx::RenameStateDialog::getInstanceRenameInfos
QVector< StateRenamer::InstanceRenameInfo > getInstanceRenameInfos() const
Definition: RenameStateDialog.cpp:162
armarx::statechartmodel::StatePtr
std::shared_ptr< State > StatePtr
Definition: State.h:46
armarx::RenameStateDialog::getGroup
StatechartGroupPtr getGroup() const
Definition: RenameStateDialog.cpp:152
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::RenameStateDialog::getState
statechartmodel::StatePtr getState() const
Definition: RenameStateDialog.cpp:157
VariantInfo.h