diff --git a/DMX-2.0/Conduite.cs b/DMX-2.0/Conduite.cs
index 8adff38..c47e956 100644
--- a/DMX-2.0/Conduite.cs
+++ b/DMX-2.0/Conduite.cs
@@ -74,7 +74,7 @@ namespace DMX2
u.Nom = "Univers par Défaut";
// La conduite peux recevoir des evenements midi
- MidiEventProvider midip = new MidiEventProvider (eventManager);
+ /*MidiEventProvider midip = */new MidiEventProvider (eventManager);
masterEventTarget = new actionEventTarget (
delegate(EventData data) {
diff --git a/DMX-2.0/DMX-2.0.csproj b/DMX-2.0/DMX-2.0.csproj
index 3ec2c06..4b716d3 100644
--- a/DMX-2.0/DMX-2.0.csproj
+++ b/DMX-2.0/DMX-2.0.csproj
@@ -20,7 +20,6 @@
prompt
4
false
- aguibtn nows
none
diff --git a/DMX-2.0/Main.cs b/DMX-2.0/Main.cs
index 0fa43aa..71c36fc 100644
--- a/DMX-2.0/Main.cs
+++ b/DMX-2.0/Main.cs
@@ -26,7 +26,8 @@ namespace DMX2
public static void Main (string[] args)
{
bool fullscreen = false, aguibtn = false;
- WebServer ws = null; bool webserv = true;
+ WebServer ws = null; bool webserv = false;
+ System.IO.FileInfo openfile=null;
// Traitement des options en ligne de commande :
@@ -39,10 +40,12 @@ namespace DMX2
case "aguibtn":
aguibtn=true;
break;
- case "nows":
- webserv = false;
+ case "ws":
+ webserv = true;
break;
default:
+ if(System.IO.File.Exists(arg))
+ openfile = new System.IO.FileInfo(arg);
break;
}
}
@@ -68,7 +71,7 @@ namespace DMX2
Gtk.Rc.ParseString (reader.ReadToEnd ());
// Force l'instanciation du handle midi.
- IntPtr ptr = MidiEventProvider.MidiSeqHandle.Handle;
+ //IntPtr ptr = MidiEventProvider.MidiSeqHandle.Handle;
// Creation de la fenetre principale
MainWindow win = new MainWindow ();
@@ -76,6 +79,8 @@ namespace DMX2
if(fullscreen) win.ToggleFullscreen();
if(aguibtn) win.AfficheBoutonACGUI();
+ if (openfile!=null) win.OpenFile(openfile);
+
// Gestion des erreurs non traitées dans l'interface
GLib.ExceptionManager.UnhandledException += HandleUnhandledException;
diff --git a/DMX-2.0/MainWindow.cs b/DMX-2.0/MainWindow.cs
index 6ab270f..848da74 100644
--- a/DMX-2.0/MainWindow.cs
+++ b/DMX-2.0/MainWindow.cs
@@ -438,41 +438,39 @@ namespace DMX2
return;
}
- FileInfo openFile = new FileInfo (fcd.Filename);
+ FileInfo file = new FileInfo (fcd.Filename);
fcd.Destroy ();
- if (!openFile.Exists)
+ OpenFile (file);
+ }
+
+ public void OpenFile (FileInfo file)
+ {
+ if (!file.Exists)
return;
System.Xml.XmlDocument doc;
-
try {
- using(FileStream stream = openFile.OpenRead())
- {
- doc = new System.Xml.XmlDocument();
- doc.Load(stream);
- stream.Close();
+ using (FileStream stream = file.OpenRead ()) {
+ doc = new System.Xml.XmlDocument ();
+ doc.Load (stream);
+ stream.Close ();
}
- Conduite cond = new Conduite(doc);
- if (cond==null)
- {
- // TODO Message erreur au chargement
- return;
- }
+ new Conduite (doc);
- conduiteFile = openFile;
- lastSaveHash = doc.InnerXml.GetHashCode();
-
- } catch (IOException) {
+ conduiteFile = file;
+ lastSaveHash = doc.InnerXml.GetHashCode ();
}
-
- foreach (Sequenceur s in Conduite.Courante.Sequenceurs)
+ catch (Exception) {
+ //TODO : display error
+ Conduite.Courante.Dispose();
+ return;
+ }
+ foreach (Sequenceur s in Conduite.Courante.Sequenceurs)
AddSeqUI (s);
-
- MajWidgets();
- NextUpdateFull();
- }
-
+ MajWidgets ();
+ NextUpdateFull ();
+ }
#endregion
#region Gestion des Circuits
diff --git a/DMX-2.0/gtk-gui/gui.stetic b/DMX-2.0/gtk-gui/gui.stetic
index bab35b5..2bb4830 100644
--- a/DMX-2.0/gtk-gui/gui.stetic
+++ b/DMX-2.0/gtk-gui/gui.stetic
@@ -5,7 +5,7 @@
2.12
-
+