From 0fad2e7f406d9bfb0fbf1300a51f2b2581ce8c64 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sat, 20 Jul 2013 13:46:56 +0200 Subject: [PATCH] restructured main menu --- apps/opencs/view/doc/view.cpp | 94 ++++++++++++++++++++--------------- apps/opencs/view/doc/view.hpp | 4 ++ 2 files changed, 58 insertions(+), 40 deletions(-) diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index da896ea51..63fab56db 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -84,50 +84,10 @@ void CSVDoc::View::setupWorldMenu() { QMenu *world = menuBar()->addMenu (tr ("&World")); - QAction *globals = new QAction (tr ("Globals"), this); - connect (globals, SIGNAL (triggered()), this, SLOT (addGlobalsSubView())); - world->addAction (globals); - - QAction *gmsts = new QAction (tr ("Game settings"), this); - connect (gmsts, SIGNAL (triggered()), this, SLOT (addGmstsSubView())); - world->addAction (gmsts); - - QAction *skills = new QAction (tr ("Skills"), this); - connect (skills, SIGNAL (triggered()), this, SLOT (addSkillsSubView())); - world->addAction (skills); - - QAction *classes = new QAction (tr ("Classes"), this); - connect (classes, SIGNAL (triggered()), this, SLOT (addClassesSubView())); - world->addAction (classes); - - QAction *factions = new QAction (tr ("Factions"), this); - connect (factions, SIGNAL (triggered()), this, SLOT (addFactionsSubView())); - world->addAction (factions); - - QAction *races = new QAction (tr ("Races"), this); - connect (races, SIGNAL (triggered()), this, SLOT (addRacesSubView())); - world->addAction (races); - - QAction *sounds = new QAction (tr ("Sounds"), this); - connect (sounds, SIGNAL (triggered()), this, SLOT (addSoundsSubView())); - world->addAction (sounds); - - QAction *scripts = new QAction (tr ("Scripts"), this); - connect (scripts, SIGNAL (triggered()), this, SLOT (addScriptsSubView())); - world->addAction (scripts); - QAction *regions = new QAction (tr ("Regions"), this); connect (regions, SIGNAL (triggered()), this, SLOT (addRegionsSubView())); world->addAction (regions); - QAction *birthsigns = new QAction (tr ("Birthsigns"), this); - connect (birthsigns, SIGNAL (triggered()), this, SLOT (addBirthsignsSubView())); - world->addAction (birthsigns); - - QAction *spells = new QAction (tr ("Spells"), this); - connect (spells, SIGNAL (triggered()), this, SLOT (addSpellsSubView())); - world->addAction (spells); - QAction *cells = new QAction (tr ("Cells"), this); connect (cells, SIGNAL (triggered()), this, SLOT (addCellsSubView())); world->addAction (cells); @@ -140,17 +100,71 @@ void CSVDoc::View::setupWorldMenu() connect (references, SIGNAL (triggered()), this, SLOT (addReferencesSubView())); world->addAction (references); + world->addSeparator(); // items that don't represent single record lists follow here + QAction *regionMap = new QAction (tr ("Region Map"), this); connect (regionMap, SIGNAL (triggered()), this, SLOT (addRegionMapSubView())); world->addAction (regionMap); } +void CSVDoc::View::setupMechanicsMenu() +{ + QMenu *mechanics = menuBar()->addMenu (tr ("&Mechanics")); + + QAction *globals = new QAction (tr ("Globals"), this); + connect (globals, SIGNAL (triggered()), this, SLOT (addGlobalsSubView())); + mechanics->addAction (globals); + + QAction *gmsts = new QAction (tr ("Game settings"), this); + connect (gmsts, SIGNAL (triggered()), this, SLOT (addGmstsSubView())); + mechanics->addAction (gmsts); + + QAction *skills = new QAction (tr ("Skills"), this); + connect (skills, SIGNAL (triggered()), this, SLOT (addSkillsSubView())); + mechanics->addAction (skills); + + QAction *classes = new QAction (tr ("Classes"), this); + connect (classes, SIGNAL (triggered()), this, SLOT (addClassesSubView())); + mechanics->addAction (classes); + + QAction *factions = new QAction (tr ("Factions"), this); + connect (factions, SIGNAL (triggered()), this, SLOT (addFactionsSubView())); + mechanics->addAction (factions); + + QAction *races = new QAction (tr ("Races"), this); + connect (races, SIGNAL (triggered()), this, SLOT (addRacesSubView())); + mechanics->addAction (races); + + QAction *scripts = new QAction (tr ("Scripts"), this); + connect (scripts, SIGNAL (triggered()), this, SLOT (addScriptsSubView())); + mechanics->addAction (scripts); + + QAction *birthsigns = new QAction (tr ("Birthsigns"), this); + connect (birthsigns, SIGNAL (triggered()), this, SLOT (addBirthsignsSubView())); + mechanics->addAction (birthsigns); + + QAction *spells = new QAction (tr ("Spells"), this); + connect (spells, SIGNAL (triggered()), this, SLOT (addSpellsSubView())); + mechanics->addAction (spells); +} + +void CSVDoc::View::setupAssetsMenu() +{ + QMenu *assets = menuBar()->addMenu (tr ("&Assets")); + + QAction *sounds = new QAction (tr ("Sounds"), this); + connect (sounds, SIGNAL (triggered()), this, SLOT (addSoundsSubView())); + assets->addAction (sounds); +} + void CSVDoc::View::setupUi() { setupFileMenu(); setupEditMenu(); setupViewMenu(); setupWorldMenu(); + setupMechanicsMenu(); + setupAssetsMenu(); } void CSVDoc::View::updateTitle() diff --git a/apps/opencs/view/doc/view.hpp b/apps/opencs/view/doc/view.hpp index ff81f8223..4e6b216a1 100644 --- a/apps/opencs/view/doc/view.hpp +++ b/apps/opencs/view/doc/view.hpp @@ -60,6 +60,10 @@ namespace CSVDoc void setupWorldMenu(); + void setupMechanicsMenu(); + + void setupAssetsMenu(); + void setupUi(); void updateTitle();