Crossfire Server, Branches 1.12  R18729
CREMainWindow.cpp
Go to the documentation of this file.
1 #include <Qt>
2 #include <QtGui>
3 #include <CREMainWindow.h>
4 #include <CREResourcesWindow.h>
5 
6 extern "C" {
7 #include "global.h"
8 }
9 
11 {
12  myArea = new QMdiArea();
13  setCentralWidget(myArea);
14 
15  createActions();
16  createMenus();
17 
18  statusBar()->showMessage(tr("Ready"));
19 
20  setWindowTitle(tr("Crossfire Resource Editor"));
21 }
22 
24 {
25  myOpenArtifacts = new QAction(tr("Artifacts"), this);
26  connect(myOpenArtifacts, SIGNAL(triggered()), this, SLOT(onOpenArtifacts()));
27 
28  myOpenArchetypes = new QAction(tr("Archetypes"), this);
29  connect(myOpenArchetypes, SIGNAL(triggered()), this, SLOT(onOpenArchetypes()));
30 
31  myOpenTreasures = new QAction(tr("Treasures"), this);
32  connect(myOpenTreasures, SIGNAL(triggered()), this, SLOT(onOpenTreasures()));
33 
34  myOpenAnimations = new QAction(tr("Animations"), this);
35  connect(myOpenAnimations, SIGNAL(triggered()), this, SLOT(onOpenAnimations()));
36 
37  myOpenFormulae = new QAction(tr("Formulae"), this);
38  connect(myOpenFormulae, SIGNAL(triggered()), this, SLOT(onOpenFormulae()));
39 
40  myOpenResources = new QAction(tr("Resources"), this);
41  connect(myOpenResources, SIGNAL(triggered()), this, SLOT(onOpenResources()));
42 
43  myOpenFaces = new QAction(tr("Faces"), this);
44  connect(myOpenFaces, SIGNAL(triggered()), this, SLOT(onOpenFaces()));
45 
46  mySaveFormulae = new QAction(tr("Formulae"), this);
47  connect(mySaveFormulae, SIGNAL(triggered()), this, SLOT(onSaveFormulae()));
48 }
49 
51 {
52  myOpenMenu = menuBar()->addMenu(tr("&Open"));
53  myOpenMenu->addAction(myOpenResources);
54  myOpenMenu->addAction(myOpenArtifacts);
55  myOpenMenu->addAction(myOpenArchetypes);
56  myOpenMenu->addAction(myOpenTreasures);
57  myOpenMenu->addAction(myOpenAnimations);
58  myOpenMenu->addAction(myOpenFormulae);
59  myOpenMenu->addAction(myOpenFaces);
60 
61  mySaveMenu = menuBar()->addMenu(tr("&Save"));
62  mySaveMenu->addAction(mySaveFormulae);
63 }
64 
66 {
67  QWidget* artifacts = new CREResourcesWindow(DisplayArtifacts);
68  myArea->addSubWindow(artifacts);
69  artifacts->show();
70 }
71 
73 {
74  QWidget* archetypes = new CREResourcesWindow(DisplayArchetypes);
75  myArea->addSubWindow(archetypes);
76  archetypes->show();
77 }
78 
80 {
81  QWidget* myTreasures = new CREResourcesWindow(DisplayTreasures);
82  myArea->addSubWindow(myTreasures);
83  myTreasures->show();
84 }
85 
87 {
88  QWidget* myAnimations = new CREResourcesWindow(DisplayAnimations);
89  myArea->addSubWindow(myAnimations);
90  myAnimations->show();
91 }
92 
94 {
95  QWidget* myFormulae = new CREResourcesWindow(DisplayFormulae);
96  myArea->addSubWindow(myFormulae);
97  myFormulae->show();
98 }
99 
101 {
102  QWidget* myResources = new CREResourcesWindow(DisplayFaces);
103  myArea->addSubWindow(myResources);
104  myResources->show();
105 }
106 
108 {
109  QWidget* myResources = new CREResourcesWindow();
110  myArea->addSubWindow(myResources);
111  myResources->show();
112 }
113 
115 {
116 }
void onOpenArchetypes()
QMdiArea * myArea
Definition: CREMainWindow.h:23
QAction * myOpenAnimations
Definition: CREMainWindow.h:34
void onOpenFormulae()
QMenu * myOpenMenu
Definition: CREMainWindow.h:28
QAction * myOpenFormulae
Definition: CREMainWindow.h:35
void onOpenTreasures()
QAction * myOpenTreasures
Definition: CREMainWindow.h:33
void onOpenArtifacts()
void onOpenAnimations()
QAction * myOpenArtifacts
Definition: CREMainWindow.h:31
QAction * myOpenResources
Definition: CREMainWindow.h:37
QAction * myOpenArchetypes
Definition: CREMainWindow.h:32
QMenu * mySaveMenu
Definition: CREMainWindow.h:29
QAction * myOpenFaces
Definition: CREMainWindow.h:36
void onOpenResources()
QAction * mySaveFormulae
Definition: CREMainWindow.h:38
void createActions()