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  Q_OBJECT
23 public:
24  enum Type { Quest = 0, Treasure = 1 };
26 
35  AssetOriginAndCreationDialog(Type type, Mode mode, const QString &code, const std::vector<std::string> &origins, const std::vector<std::string> &assets);
36 
37  QString code() const { return myCode->text(); }
38  QString file() const { return myNewFile->isEnabled() ? myNewFile->text() : myExistingFile->currentText(); }
39 
40 private:
42  QString myRootDirectory;
43  QLineEdit *myCode;
44  QComboBox *myExistingFile;
45  QLineEdit *myNewFile;
46  std::vector<std::string> myAssets;
52  void validate();
53 };
54 
55 #endif /* ASSET_ORIGIN_AND_CREATION_DIALOG_H */
AssetOriginAndCreationDialog::myAssets
std::vector< std::string > myAssets
Definition: AssetOriginAndCreationDialog.h:46
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:25
AssetOriginAndCreationDialog::CreateAsset
@ CreateAsset
Definition: AssetOriginAndCreationDialog.h:25
AssetOriginAndCreationDialog::myNewFile
QLineEdit * myNewFile
Definition: AssetOriginAndCreationDialog.h:45
AssetOriginAndCreationDialog::Mode
Mode
Definition: AssetOriginAndCreationDialog.h:25
AssetOriginAndCreationDialog::myCode
QLineEdit * myCode
Definition: AssetOriginAndCreationDialog.h:43
AssetOriginAndCreationDialog
Definition: AssetOriginAndCreationDialog.h:21
AssetOriginAndCreationDialog::Treasure
@ Treasure
Definition: AssetOriginAndCreationDialog.h:24
AssetOriginAndCreationDialog::validate
void validate()
Definition: AssetOriginAndCreationDialog.cpp:102
AssetOriginAndCreationDialog::myRootDirectory
QString myRootDirectory
Definition: AssetOriginAndCreationDialog.h:42
AssetOriginAndCreationDialog::Type
Type
Definition: AssetOriginAndCreationDialog.h:24
AssetOriginAndCreationDialog::Quest
@ Quest
Definition: AssetOriginAndCreationDialog.h:24
AssetOriginAndCreationDialog::myType
Type myType
Definition: AssetOriginAndCreationDialog.h:41
AssetOriginAndCreationDialog::code
QString code() const
Definition: AssetOriginAndCreationDialog.h:37
is_valid_types_gen.type
list type
Definition: is_valid_types_gen.py:25
AssetOriginAndCreationDialog::myExistingFile
QComboBox * myExistingFile
Definition: AssetOriginAndCreationDialog.h:44
AssetOriginAndCreationDialog::file
QString file() const
Definition: AssetOriginAndCreationDialog.h:38