repositories
/
deb_libcec.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
75b61df
)
CecTray: don't use lazy loading for the main controller, but pass the instance. bugzi...
author
Lars Op den Kamp
<lars@opdenkamp.eu>
Tue, 12 Mar 2013 23:12:32 +0000
(
00:12
+0100)
committer
Lars Op den Kamp
<lars@opdenkamp.eu>
Tue, 12 Mar 2013 23:47:56 +0000
(
00:47
+0100)
src/LibCecTray/Program.cs
patch
|
blob
|
blame
|
history
src/LibCecTray/controller/applications/ApplicationController.cs
patch
|
blob
|
blame
|
history
src/LibCecTray/controller/applications/Applications.cs
patch
|
blob
|
blame
|
history
src/LibCecTray/controller/applications/ConfigureApplication.cs
patch
|
blob
|
blame
|
history
src/LibCecTray/controller/applications/internal/WMCController.cs
patch
|
blob
|
blame
|
history
src/LibCecTray/controller/applications/internal/XBMCController.cs
patch
|
blob
|
blame
|
history
src/LibCecTray/ui/CECTray.Designer.cs
patch
|
blob
|
blame
|
history
src/LibCecTray/ui/CECTray.cs
patch
|
blob
|
blame
|
history
diff --git
a/src/LibCecTray/Program.cs
b/src/LibCecTray/Program.cs
index 32dc7af2b8675f7207703931933d17fe2183ef89..3ab9cf7317e7d5f6a9827768d720ecf4c5f1bdf1 100644
(file)
--- a/
src/LibCecTray/Program.cs
+++ b/
src/LibCecTray/Program.cs
@@
-42,7
+42,15
@@
namespace LibCECTray
private static CECTray _instance;
public static CECTray Instance
{
private static CECTray _instance;
public static CECTray Instance
{
- get { return _instance ?? (_instance = new CECTray()); }
+ get
+ {
+ if (_instance == null)
+ {
+ _instance = new CECTray();
+ _instance.Initialise();
+ }
+ return _instance;
+ }
}
[STAThread]
}
[STAThread]
diff --git
a/src/LibCecTray/controller/applications/ApplicationController.cs
b/src/LibCecTray/controller/applications/ApplicationController.cs
index ae9a226f26cfba18f7bc84b94ee68404d08ff710..3c7b83f1a0657054993c9862d6168e77c6987248 100644
(file)
--- a/
src/LibCecTray/controller/applications/ApplicationController.cs
+++ b/
src/LibCecTray/controller/applications/ApplicationController.cs
@@
-49,9
+49,9
@@
namespace LibCECTray.controller.applications
/// </summary>
class ApplicationController
{
/// </summary>
class ApplicationController
{
- public ApplicationController(CEC
Settings settings
, string uiName, string processName, string filename, string workingDirectory)
+ public ApplicationController(CEC
Controller controller
, string uiName, string processName, string filename, string workingDirectory)
{
{
-
Settings = settings
;
+
Controller = controller
;
UiName = uiName;
ProcessName = processName;
ApplicationFilename = filename;
UiName = uiName;
ProcessName = processName;
ApplicationFilename = filename;
@@
-60,13
+60,13
@@
namespace LibCECTray.controller.applications
IsInternal = false;
}
IsInternal = false;
}
- public static ApplicationController FromString(CECSettings settings, string serialisedConfig)
+ public static ApplicationController FromString(CEC
Controller controller, CEC
Settings settings, string serialisedConfig)
{
var splitString = serialisedConfig.Split(';');
if (splitString.Length != 4)
throw new InvalidDataException("incorrect number of parameters");
{
var splitString = serialisedConfig.Split(';');
if (splitString.Length != 4)
throw new InvalidDataException("incorrect number of parameters");
- return new ApplicationController(
settings
, splitString[0], splitString[1], splitString[2], splitString[3]);
+ return new ApplicationController(
controller
, splitString[0], splitString[1], splitString[2], splitString[3]);
}
public string AsString()
}
public string AsString()
@@
-383,7
+383,10
@@
namespace LibCECTray.controller.applications
get { return _buttonConfig ?? (_buttonConfig = new CecButtonConfig(this)); }
}
get { return _buttonConfig ?? (_buttonConfig = new CecButtonConfig(this)); }
}
- public CECSettings Settings;
+ public CECSettings Settings
+ {
+ get { return Controller.Settings; }
+ }
protected DataGridView CecButtonGridView;
public virtual ApplicationAction DefaultValue(CecKeypress key)
protected DataGridView CecButtonGridView;
public virtual ApplicationAction DefaultValue(CecKeypress key)
@@
-407,6
+410,8
@@
namespace LibCECTray.controller.applications
private bool _applicationRunning;
private bool _applicationRunning;
+ protected readonly CECController Controller;
+
#endregion
}
}
#endregion
}
}
diff --git
a/src/LibCecTray/controller/applications/Applications.cs
b/src/LibCecTray/controller/applications/Applications.cs
index 2835f1c16baa11b54c0ca9f53a822519efda5ff1..3f3a359b136d877d3ac2ea0f11e9a4ffefdc0fbb 100644
(file)
--- a/
src/LibCecTray/controller/applications/Applications.cs
+++ b/
src/LibCecTray/controller/applications/Applications.cs
@@
-74,7
+74,7
@@
namespace LibCECTray.controller.applications
{
if (item.Length > 0)
{
{
if (item.Length > 0)
{
- var app = ApplicationController.FromString(_controller.Settings, item);
+ var app = ApplicationController.FromString(_controller
, _controller
.Settings, item);
if (app != null)
_controllers.Add(app.ProcessName, app);
}
if (app != null)
_controllers.Add(app.ProcessName, app);
}
@@
-100,9
+100,9
@@
namespace LibCECTray.controller.applications
get
{
var defaultValues = new Dictionary<string, ApplicationController>();
get
{
var defaultValues = new Dictionary<string, ApplicationController>();
- WMCController wmcController = new WMCController(_controller
.Settings
);
+ WMCController wmcController = new WMCController(_controller);
defaultValues.Add(wmcController.ProcessName, wmcController);
defaultValues.Add(wmcController.ProcessName, wmcController);
- XBMCController xbmcController = new XBMCController(_controller
.Settings
);
+ XBMCController xbmcController = new XBMCController(_controller);
defaultValues.Add(xbmcController.ProcessName, xbmcController);
return defaultValues;
defaultValues.Add(xbmcController.ProcessName, xbmcController);
return defaultValues;
diff --git
a/src/LibCecTray/controller/applications/ConfigureApplication.cs
b/src/LibCecTray/controller/applications/ConfigureApplication.cs
index 2e5897709dca21958797e3aa5491bd0163e371d8..ad0682057b0c7b38bbd9cc01f015d96514b5dc55 100644
(file)
--- a/
src/LibCecTray/controller/applications/ConfigureApplication.cs
+++ b/
src/LibCecTray/controller/applications/ConfigureApplication.cs
@@
-132,7
+132,7
@@
namespace LibCECTray.controller.applications
}
else if (_cecController != null)
{
}
else if (_cecController != null)
{
- ApplicationController newController = new ApplicationController(_
settings
, tbUiName.Text, tbProcessName.Text, tbFilename.Text, tbWorkingDir.Text);
+ ApplicationController newController = new ApplicationController(_
cecController
, tbUiName.Text, tbProcessName.Text, tbFilename.Text, tbWorkingDir.Text);
if (_cecController.RegisterApplication(newController))
newController.Settings.Persist();
}
if (_cecController.RegisterApplication(newController))
newController.Settings.Persist();
}
@@
-145,8
+145,8
@@
namespace LibCECTray.controller.applications
Dispose();
}
Dispose();
}
- private ApplicationController _controller;
- private CECController _cecController;
- private CECSettings _settings;
+ private
readonly
ApplicationController _controller;
+ private
readonly
CECController _cecController;
+ private
readonly
CECSettings _settings;
}
}
}
}
diff --git
a/src/LibCecTray/controller/applications/internal/WMCController.cs
b/src/LibCecTray/controller/applications/internal/WMCController.cs
index 17d7cc73297f814a22afef6b5c7073a68e7c494e..201fcda0705d993625835adbee4c217e819dfc12 100644
(file)
--- a/
src/LibCecTray/controller/applications/internal/WMCController.cs
+++ b/
src/LibCecTray/controller/applications/internal/WMCController.cs
@@
-39,8
+39,8
@@
namespace LibCECTray.controller.applications.@internal
{
internal class WMCController : ApplicationController
{
{
internal class WMCController : ApplicationController
{
- public WMCController(CEC
Settings settings
) :
- base(
settings
,
+ public WMCController(CEC
Controller controller
) :
+ base(
controller
,
Resources.application_windows_media_center,
"ehshell",
"ehshell.exe",
Resources.application_windows_media_center,
"ehshell",
"ehshell.exe",
diff --git
a/src/LibCecTray/controller/applications/internal/XBMCController.cs
b/src/LibCecTray/controller/applications/internal/XBMCController.cs
index 075178c3c47f69db8a692eb4f01154444dacedf0..b4801e2e62a40252f3aef5e7060639e3c6aa81e7 100644
(file)
--- a/
src/LibCecTray/controller/applications/internal/XBMCController.cs
+++ b/
src/LibCecTray/controller/applications/internal/XBMCController.cs
@@
-44,8
+44,8
@@
namespace LibCECTray.controller.applications.@internal
{
internal class XBMCController : ApplicationController
{
{
internal class XBMCController : ApplicationController
{
- public XBMCController(CEC
Settings settings
) :
- base(
settings
,
+ public XBMCController(CEC
Controller controller
) :
+ base(
controller
,
Resources.application_xbmc,
"XBMC",
"XBMC.exe",
Resources.application_xbmc,
"XBMC",
"XBMC.exe",
diff --git
a/src/LibCecTray/ui/CECTray.Designer.cs
b/src/LibCecTray/ui/CECTray.Designer.cs
index 34db4123f4213faec88e1e68c6d5429f3d43881e..b153957fa27c8145417154ad9a2a030ad94ebdba 100644
(file)
--- a/
src/LibCecTray/ui/CECTray.Designer.cs
+++ b/
src/LibCecTray/ui/CECTray.Designer.cs
@@
-742,7
+742,6
@@
this.MaximizeBox = false;
this.Name = "CECTray";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.MaximizeBox = false;
this.Name = "CECTray";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- this.Load += new System.EventHandler(this.CECTrayLoad);
this.Resize += new System.EventHandler(this.CECTrayResize);
this.trayIconMenu.ResumeLayout(false);
this.LogOutput.ResumeLayout(false);
this.Resize += new System.EventHandler(this.CECTrayResize);
this.trayIconMenu.ResumeLayout(false);
this.LogOutput.ResumeLayout(false);
diff --git
a/src/LibCecTray/ui/CECTray.cs
b/src/LibCecTray/ui/CECTray.cs
index 6703e5f8d76e6a9a22c825678bf7b7ccb0a4fcd8..7c08eec2304f4fa8b5749cbbeeb72d9f389c380f 100644
(file)
--- a/
src/LibCecTray/ui/CECTray.cs
+++ b/
src/LibCecTray/ui/CECTray.cs
@@
-78,7
+78,7
@@
namespace LibCECTray.ui
set { base.Text = value; }
}
set { base.Text = value; }
}
- p
rivate void CECTrayLoad(object sender, EventArgs e
)
+ p
ublic void Initialise(
)
{
Controller.Initialise();
}
{
Controller.Initialise();
}
@@
-484,7
+484,10
@@
namespace LibCECTray.ui
private CECController _controller;
public CECController Controller
{
private CECController _controller;
public CECController Controller
{
- get { return _controller ?? (_controller = new CECController(this)); }
+ get
+ {
+ return _controller ?? (_controller = new CECController(this));
+ }
}
public Control.ControlCollection TabControls
{
}
public Control.ControlCollection TabControls
{