comparison MainWindow.cs @ 12:4a724378d66a

Re #247: Implement menu options in Qt# app * Hook up army close (can now create, save and close armies) Re #242: Create Qt# UI for WarFoundry * Fix initial window title
author IBBoard <dev@ibboard.co.uk>
date Fri, 05 Feb 2010 20:57:44 +0000
parents 72bcf6457227
children dbe784f0802c
comparison
equal deleted inserted replaced
11:72bcf6457227 12:4a724378d66a
27 public MainWindow () 27 public MainWindow ()
28 { 28 {
29 layout = new Ui_MainWindowLayout(); 29 layout = new Ui_MainWindowLayout();
30 layout.SetupUi(this); 30 layout.SetupUi(this);
31 WindowIcon = new QIcon("icons/App.png"); 31 WindowIcon = new QIcon("icons/App.png");
32 SetAppTitle();
32 saveArmyDialog = new QFileDialog(this); 33 saveArmyDialog = new QFileDialog(this);
33 saveArmyDialog.acceptMode = QFileDialog.AcceptMode.AcceptSave; 34 saveArmyDialog.acceptMode = QFileDialog.AcceptMode.AcceptSave;
34 SetUpActionIcons(); 35 SetUpActionIcons();
35 ConnectMenuActions(); 36 ConnectMenuActions();
36 SetUpToolbar(); 37 SetUpToolbar();
58 QObject.Connect(layout.actionCreateArmy, SIGNAL("triggered()"), CreateNewArmy); 59 QObject.Connect(layout.actionCreateArmy, SIGNAL("triggered()"), CreateNewArmy);
59 QObject.Connect(layout.actionUndo, SIGNAL("triggered()"), UndoAction); 60 QObject.Connect(layout.actionUndo, SIGNAL("triggered()"), UndoAction);
60 QObject.Connect(layout.actionRedo, SIGNAL("triggered()"), RedoAction); 61 QObject.Connect(layout.actionRedo, SIGNAL("triggered()"), RedoAction);
61 QObject.Connect(layout.actionSaveArmyAs, SIGNAL("triggered()"), DoSaveCurrentArmyAs); 62 QObject.Connect(layout.actionSaveArmyAs, SIGNAL("triggered()"), DoSaveCurrentArmyAs);
62 QObject.Connect(layout.actionSaveArmy, SIGNAL("triggered()"), DoSaveCurrentArmy); 63 QObject.Connect(layout.actionSaveArmy, SIGNAL("triggered()"), DoSaveCurrentArmy);
64 QObject.Connect(layout.actionCloseArmy, SIGNAL("triggered()"), CloseArmy);
63 } 65 }
64 66
65 private void CreateNewArmy() 67 private void CreateNewArmy()
66 { 68 {
67 NewArmyDialog dialog = new NewArmyDialog(this); 69 NewArmyDialog dialog = new NewArmyDialog(this);
359 361
360 void EnableCategoryButtons () 362 void EnableCategoryButtons ()
361 { 363 {
362 //TODO enable category buttons 364 //TODO enable category buttons
363 } 365 }
366
367 private void CloseArmy()
368 {
369 CurrentArmy = null;
370 }
364 } 371 }
365 } 372 }