Crossfire Server, Trunk
AssetOriginAndCreationDialog.h
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2022 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #ifndef ASSET_ORIGIN_AND_CREATION_DIALOG_H
14 #define ASSET_ORIGIN_AND_CREATION_DIALOG_H
15 
16 #include <QtWidgets>
17 
21 class AssetOriginAndCreationDialog : public QDialog {
22 public:
23  enum Type { Quest = 0, Treasure = 1 };
25 
34  AssetOriginAndCreationDialog(Type type, Mode mode, const QString &code, const std::vector<std::string> &origins, const std::vector<std::string> &assets);
35 
36  QString code() const { return myCode->text(); }
37  QString file() const { return myNewFile->isEnabled() ? myNewFile->text() : myExistingFile->currentText(); }
38 
39 private:
41  QString myRootDirectory;
42  QLineEdit *myCode;
43  QComboBox *myExistingFile;
44  QLineEdit *myNewFile;
45  std::vector<std::string> myAssets;
51  void validate();
52 };
53 
54 #endif /* ASSET_ORIGIN_AND_CREATION_DIALOG_H */
AssetOriginAndCreationDialog::myAssets
std::vector< std::string > myAssets
Definition: AssetOriginAndCreationDialog.h:45
AssetOriginAndCreationDialog::AssetOriginAndCreationDialog
AssetOriginAndCreationDialog(Type type, Mode mode, const QString &code, const std::vector< std::string > &origins, const std::vector< std::string > &assets)
Definition: AssetOriginAndCreationDialog.cpp:37
AssetOriginAndCreationDialog::DefineOrigin
@ DefineOrigin
Definition: AssetOriginAndCreationDialog.h:24
AssetOriginAndCreationDialog::CreateAsset
@ CreateAsset
Definition: AssetOriginAndCreationDialog.h:24
AssetOriginAndCreationDialog::myNewFile
QLineEdit * myNewFile
Definition: AssetOriginAndCreationDialog.h:44
AssetOriginAndCreationDialog::Mode
Mode
Definition: AssetOriginAndCreationDialog.h:24
AssetOriginAndCreationDialog::myCode
QLineEdit * myCode
Definition: AssetOriginAndCreationDialog.h:42
AssetOriginAndCreationDialog
Definition: AssetOriginAndCreationDialog.h:21
AssetOriginAndCreationDialog::Treasure
@ Treasure
Definition: AssetOriginAndCreationDialog.h:23
AssetOriginAndCreationDialog::validate
void validate()
Definition: AssetOriginAndCreationDialog.cpp:102
AssetOriginAndCreationDialog::myRootDirectory
QString myRootDirectory
Definition: AssetOriginAndCreationDialog.h:41
AssetOriginAndCreationDialog::Type
Type
Definition: AssetOriginAndCreationDialog.h:23
AssetOriginAndCreationDialog::Quest
@ Quest
Definition: AssetOriginAndCreationDialog.h:23
AssetOriginAndCreationDialog::myType
Type myType
Definition: AssetOriginAndCreationDialog.h:40
AssetOriginAndCreationDialog::code
QString code() const
Definition: AssetOriginAndCreationDialog.h:36
is_valid_types_gen.type
list type
Definition: is_valid_types_gen.py:25
AssetOriginAndCreationDialog::myExistingFile
QComboBox * myExistingFile
Definition: AssetOriginAndCreationDialog.h:43
AssetOriginAndCreationDialog::file
QString file() const
Definition: AssetOriginAndCreationDialog.h:37