OpenClonk
C4ConsoleQtLocalizeString.h
Go to the documentation of this file.
1 /*
2 * OpenClonk, http://www.openclonk.org
3 *
4 * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
5 * Copyright (c) 2013, The OpenClonk Team and contributors
6 *
7 * Distributed under the terms of the ISC license; see accompanying file
8 * "COPYING" for details.
9 *
10 * "Clonk" is a registered trademark of Matthes Bender, used with permission.
11 * See accompanying file "TRADEMARK" for details.
12 *
13 * To redistribute this file separately, substitute the full license texts
14 * for the above references.
15 */
16 
17 /* String localization editors */
18 
19 #ifndef INC_C4ConsoleQtLocalizeString
20 #define INC_C4ConsoleQtLocalizeString
21 #ifdef WITH_QT_EDITOR
22 
23 #include "C4Include.h" // needed for automoc
24 #include "editor/C4ConsoleGUI.h" // for OpenGL
25 #include "editor/C4ConsoleQt.h"
26 #include "ui_C4ConsoleQtLocalizeString.h"
27 
28 class C4ConsoleQtLocalizeStringDlg : public QDialog
29 {
30  Q_OBJECT
31 
32  Ui::LocalizeStringDialog ui;
33  C4Value translations;
34 
35  struct EditedLanguage
36  {
37  char language[3];
38  QLineEdit *value_editor;
39  };
40  std::list<EditedLanguage> edited_languages;
41 
42 public:
43  C4ConsoleQtLocalizeStringDlg(class QMainWindow *parent_window, const C4Value &translations);
44  C4PropList *GetTranslations() const { return translations.getPropList(); }
45 
46 private:
47  void DoError(const char *msg);
48  QLineEdit *AddEditor(const char *language, const char *language_name);
49  QLineEdit *GetEditorByLanguage(const char *language);
50  void done(int r) override;
51 
52 protected slots:
53  void AddLanguagePressed();
54 };
55 
56 #endif // WITH_QT_EDITOR
57 #endif // INC_C4ConsoleQtLocalizeString
C4PropList * getPropList() const
Definition: C4Value.h:116