# HG changeset patch # User IBBoard # Date 1266760427 0 # Node ID f1be1b5091340b943e8dab1bcf19a750376860c7 # Parent fc205d5e0c529d41d2cdc875d1c1d699a9fe449b Re #242: Create Qt# UI for WarFoundry * Add preferences and translations (based on GTK# app) diff -r fc205d5e0c52 -r f1be1b509134 IBBoard.WarFoundry.GUI.QtSharp.csproj --- a/IBBoard.WarFoundry.GUI.QtSharp.csproj Sat Feb 20 15:58:17 2010 +0000 +++ b/IBBoard.WarFoundry.GUI.QtSharp.csproj Sun Feb 21 13:53:47 2010 +0000 @@ -94,6 +94,13 @@ PreserveNewest + + false + PreserveNewest + + + PreserveNewest + diff -r fc205d5e0c52 -r f1be1b509134 Main.cs --- a/Main.cs Sat Feb 20 15:58:17 2010 +0000 +++ b/Main.cs Sun Feb 21 13:53:47 2010 +0000 @@ -33,6 +33,7 @@ catch(Exception ex) { logger.Fatal(ex); + QMessageBox.Critical(null, "Unhandled exception", ex.Message+"\n\nPlease see log for more details"); } } diff -r fc205d5e0c52 -r f1be1b509134 MainWindow.cs --- a/MainWindow.cs Sat Feb 20 15:58:17 2010 +0000 +++ b/MainWindow.cs Sun Feb 21 13:53:47 2010 +0000 @@ -26,12 +26,25 @@ private CommandStack commandStack; private QFileDialog saveArmyDialog; private QFileDialog openArmyDialog; + private Preferences preferences; public MainWindow () { layout = new Ui_MainWindowLayout(); layout.SetupUi(this); WindowIcon = new QIcon("icons/App.png"); + Preferences = new Preferences("WarFoundryQt"); + + try + { + Translation.InitialiseTranslations(Constants.ExecutablePath, Preferences["language"].ToString()); + } + catch (TranslationLoadException ex) + { + log.Error(ex); + QMessageBox.Critical(this, "Translation loading failed", ex.Message); + } + SetAppTitle(); saveArmyDialog = new QFileDialog(this); saveArmyDialog.acceptMode = QFileDialog.AcceptMode.AcceptSave; @@ -525,5 +538,11 @@ return closed; } + + public Preferences Preferences + { + get { return preferences; } + set { preferences = value; } + } } } \ No newline at end of file diff -r fc205d5e0c52 -r f1be1b509134 WarFoundryQtPref.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WarFoundryQtPref.xml Sun Feb 21 13:53:47 2010 +0000 @@ -0,0 +1,13 @@ + + + + + + +]> + +en + +Info + diff -r fc205d5e0c52 -r f1be1b509134 translations/en.translation --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/translations/en.translation Sun Feb 21 13:53:47 2010 +0000 @@ -0,0 +1,40 @@ + + +File +Edit +Help +Create army +Open army +Exit +About +Save army +Save army as... +Close army +Change game system +Undo +Redo +WarFoundry Army Files (*.army) +Create army +Cancel +Create unit +Unit types: +Races: +Army name: +Select system +Game systems: +Game system selection +Army tree +Create new army +Save army +Army size: +Unit of {0} {1} +Create army +Open army +Save army +{0} pts / {1} pts +Reload files +Debug information +Add New {0} Choice + \ No newline at end of file