Skip to content

Commit

Permalink
Beta 17/18
Browse files Browse the repository at this point in the history
  • Loading branch information
briandunnington committed Jul 17, 2009
1 parent 436a1aa commit 2798efc
Show file tree
Hide file tree
Showing 78 changed files with 3,549 additions and 1,173 deletions.
Binary file modified Growl Connectors/NET/libraries/Growl.Connector.dll
Binary file not shown.
Binary file modified Growl Connectors/NET/libraries/Growl.CoreLibrary.dll
Binary file not shown.
Binary file modified Growl Extras/Growl Display SDK/libraries/Growl.CoreLibrary.dll
Binary file not shown.
Binary file modified Growl Extras/Growl Display SDK/libraries/Growl.DisplayStyle.dll
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Growl/Growl.Connector/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.16")]
[assembly: AssemblyFileVersion("2.0.0.18")]
[assembly: AssemblyInformationalVersion("2.0")]
2 changes: 1 addition & 1 deletion Growl/Growl.CoreLibrary/Detector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public static bool DetectIfGrowlIsRunning()
Mutex mutex = new Mutex(true, String.Format(@"Global\{0}", Growl.CoreLibrary.Detector.MUTEX_NAME), out createdNew);
using (mutex)
{
mutex.ReleaseMutex();
// do nothing (DONT call mutex.ReleaseMutex() - it can cause and exception
}
return !createdNew;
}
Expand Down
2 changes: 1 addition & 1 deletion Growl/Growl.CoreLibrary/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.16")]
[assembly: AssemblyFileVersion("2.0.0.18")]
[assembly: AssemblyInformationalVersion("2.0")]
27 changes: 26 additions & 1 deletion Growl/Growl.Daemon/BonjourService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Growl.Daemon
/// <summary>
/// Provides methods for advertising a service via Bonjour
/// </summary>
public class BonjourService
public class BonjourService : IDisposable
{
private static bool isSupported;

Expand Down Expand Up @@ -173,5 +173,30 @@ private NetService Publish(string domain, string type, string name, int port)
service.Publish();
return service;
}

#region IDisposable Members

public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}

protected void Dispose(bool disposing)
{
if (disposing)
{
try
{
if (this.service != null) this.service.Dispose();
}
catch
{
// suppress
}
}
}

#endregion
}
}
1 change: 1 addition & 0 deletions Growl/Growl.Daemon/GrowlServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,7 @@ protected void Dispose(bool disposing)
try
{
if (this.socketCleanupTimer != null) this.socketCleanupTimer.Close();
if (this.bonjour != null) this.bonjour.Dispose();
}
catch
{
Expand Down
2 changes: 1 addition & 1 deletion Growl/Growl.Daemon/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.16")]
[assembly: AssemblyFileVersion("2.0.0.18")]
[assembly: AssemblyInformationalVersion("2.0")]
2 changes: 1 addition & 1 deletion Growl/Growl.DisplayStyle/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.16")]
[assembly: AssemblyFileVersion("2.0.0.18")]
[assembly: AssemblyInformationalVersion("2.0")]
2 changes: 1 addition & 1 deletion Growl/Growl.Displays.Plain/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.16")]
[assembly: AssemblyFileVersion("2.0.0.18")]
[assembly: AssemblyInformationalVersion("2.0")]
2 changes: 1 addition & 1 deletion Growl/Growl.Displays.Smokestack/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.16")]
[assembly: AssemblyFileVersion("2.0.0.18")]
[assembly: AssemblyInformationalVersion("2.0")]
2 changes: 1 addition & 1 deletion Growl/Growl.Displays.Standard/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.16")]
[assembly: AssemblyFileVersion("2.0.0.18")]
[assembly: AssemblyInformationalVersion("2.0")]
2 changes: 1 addition & 1 deletion Growl/Growl.Displays.Toast/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.16")]
[assembly: AssemblyFileVersion("2.0.0.18")]
[assembly: AssemblyInformationalVersion("2.0")]
2 changes: 1 addition & 1 deletion Growl/Growl.Displays.Visor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.16")]
[assembly: AssemblyFileVersion("2.0.0.18")]
[assembly: AssemblyInformationalVersion("2.0")]
2 changes: 1 addition & 1 deletion Growl/Growl.UDPLegacy/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.16")]
[assembly: AssemblyFileVersion("2.0.0.18")]
[assembly: AssemblyInformationalVersion("2.0")]
14 changes: 7 additions & 7 deletions Growl/Growl/AddComputer.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 57 additions & 57 deletions Growl/Growl/AddComputer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ namespace Growl
public partial class AddComputer : Form
{
private Controller controller;
private DetectedService selectedService;
private bool isBonjour;
private bool isSubscription;
private IForwardInputs inputs;
private IForwardDestinationHandler handler;
private ForwardDestinationSettingsPanel settingsPanel;
private ForwardDestination fdEdit;

public AddComputer()
{
Expand All @@ -32,78 +32,72 @@ public AddComputer(bool isSubscription)
: this()
{
this.isSubscription = isSubscription;
if (this.isSubscription)
{
IForwardDestinationHandler handler = ForwardDestinationManager.GetHandler(typeof(Subscription));
ShowInputs(null, handler);
}
}

public AddComputer(ForwardDestination fd)
: this()
{
this.fdEdit = fd;
if (fd is Subscription) this.isSubscription = true;
IForwardDestinationHandler handler = ForwardDestinationManager.GetHandler(fd);
ShowInputs(null, handler);
}

private void AddComputer_Load(object sender, EventArgs e)
{
this.BackColor = Color.FromArgb(240, 240, 240);

if (this.controller != null)
List<ForwardDestinationListItem> list = ForwardDestinationManager.GetListItems();
foreach (ForwardDestinationListItem fdli in list)
{
Dictionary<string, DetectedService> availableServices = controller.DetectedServices;
foreach (DetectedService ds in availableServices.Values)
{
BonjourListItem bli = new BonjourListItem(ds);
bli.Selected += new EventHandler(bli_Selected);
this.bonjourListBox1.AddItem(bli);
}
fdli.Selected += new EventHandler(fdli_Selected);
this.bonjourListBox1.AddItem(fdli);
}

// add manual option
ForwardListItem manual = new ForwardListItem(Properties.Resources.AddComputer_ManualAdd, ForwardComputerPlatformType.Other.Icon);
manual.Selected += new EventHandler(manual_Selected);
this.bonjourListBox1.AddItem(manual);

// add iphone/Prowl option
ProwlListItem prowl = new ProwlListItem();
prowl.Selected += new EventHandler(prowl_Selected);
this.bonjourListBox1.AddItem(prowl);

if (this.isSubscription)
{
this.Text = Properties.Resources.AddComputer_FormTitle_Subscriptions;
ForwardListItem subscriptionInputs = new ForwardListItem(null, null);
ShowInputs(subscriptionInputs);
}
if (this.isSubscription) this.Text = Properties.Resources.AddComputer_FormTitle_Subscriptions;
}

private void ShowInputs(ForwardListItem fli)
void fdli_Selected(object sender, EventArgs e)
{
this.inputs = fli.Inputs;
fli.Inputs.ValidChanged += new ValidChangedEventHandler(Inputs_ValidChanged);
fli.Inputs.Initialize(this.isSubscription, fli);
UserControl c = fli.Inputs.GetControl();
c.Visible = true;
this.panelDetails.Controls.Add(c);

this.panelBonjour.Visible = false;
this.panelDetails.Visible = true;
this.buttonSave.Visible = true;
ForwardDestinationListItem fdli = (ForwardDestinationListItem)sender;
ShowInputs(fdli);
}

void Inputs_ValidChanged(bool isValid)
private void ShowInputs(ForwardDestinationListItem fdli)
{
this.buttonSave.Enabled = isValid;
ShowInputs(fdli, fdli.Handler);
}

void manual_Selected(object sender, EventArgs args)
private void ShowInputs(ForwardDestinationListItem fdli, IForwardDestinationHandler handler)
{
ForwardListItem fli = (ForwardListItem)sender;
ShowInputs(fli);
this.panelBonjour.Visible = false;
this.panelDetails.Visible = true;

ForwardDestinationSettingsPanel panel = handler.GetSettingsPanel(this.fdEdit);
this.settingsPanel = panel;
panel.ValidChanged += new ForwardDestinationSettingsPanel.ValidChangedEventHandler(panel_ValidChanged);
panel.Initialize(this.isSubscription, fdli, this.fdEdit);
this.panelDetails.Controls.Add(panel);
panel.Visible = true;

this.buttonSave.Visible = true;
}

void prowl_Selected(object sender, EventArgs args)
void panel_ValidChanged(bool isValid)
{
ProwlListItem pli = (ProwlListItem)sender;
ShowInputs(pli);
this.buttonSave.Enabled = isValid;
}

void bli_Selected(object sender, EventArgs args)
internal void Initialize(Controller controller, ForwardDestination fdEdit, bool isSubscription)
{
BonjourListItem bli = (BonjourListItem)sender;
this.isBonjour = true;
this.selectedService = bli.DetectedService;
ShowInputs(bli);
this.controller = controller;
this.fdEdit = fdEdit;
this.isSubscription = isSubscription;
}

internal void SetController(Controller controller)
Expand All @@ -118,16 +112,22 @@ private void buttonCancel_Click(object sender, EventArgs e)

private void buttonSave_Click(object sender, EventArgs e)
{
ForwardComputer fc = this.inputs.Save();

if (this.isSubscription)
if (this.fdEdit != null)
{
Subscription subscription = (Subscription)fc;
this.controller.AddSubscription(subscription);
this.settingsPanel.Update(this.fdEdit);
}
else
{
this.controller.AddForwardComputer(fc);
ForwardDestination fd = this.settingsPanel.Create();
if (this.isSubscription)
{
Subscription subscription = (Subscription)fd;
this.controller.AddSubscription(subscription);
}
else
{
this.controller.AddForwardDestination(fd);
}
}
this.Close();
}
Expand Down
11 changes: 5 additions & 6 deletions Growl/Growl/ChooseForwarding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ private void ChooseForwarding_Load(object sender, EventArgs e)

if (this.controller != null && this.prefs != null)
{
if (this.controller.ForwardComputers != null && this.controller.ForwardComputers.Count > 0)
if (this.controller.ForwardDestinations != null && this.controller.ForwardDestinations.Count > 0)
{
Dictionary<string, ForwardComputer> computers = new Dictionary<string,ForwardComputer>();
foreach (ForwardComputer fc in this.controller.ForwardComputers.Values)
Dictionary<string, ForwardDestination> computers = new Dictionary<string,ForwardDestination>();
foreach (ForwardDestination fc in this.controller.ForwardDestinations.Values)
{
bool enabled = this.prefs.PrefForwardCustomList.Contains(fc.Description);
//ForwardComputer clone = new ForwardComputer(fc.Description, enabled, fc.IPAddress, fc.Port, fc.Password, fc.UseUDP);
ForwardComputer clone = fc.Clone();
ForwardDestination clone = fc.Clone();
fc.Enabled = enabled;
computers.Add(clone.Description, clone);
}
Expand Down Expand Up @@ -79,7 +78,7 @@ private void buttonCancel_Click(object sender, EventArgs e)
private void buttonSave_Click(object sender, EventArgs e)
{
List<string> computers = new List<string>();
foreach (ForwardComputer fc in this.forwardListView1.Computers.Values)
foreach (ForwardDestination fc in this.forwardListView1.Computers.Values)
{
if (fc.Enabled) computers.Add(fc.Description);
}
Expand Down
Loading

0 comments on commit 2798efc

Please sign in to comment.