mac setup: Fix crash on second form try
This commit is contained in:
parent
bde2931853
commit
8b02a628a9
|
@ -276,11 +276,12 @@ namespace SparkleShare {
|
||||||
AddressTextField = new NSTextField () {
|
AddressTextField = new NSTextField () {
|
||||||
Frame = new RectangleF (190, Frame.Height - 336, 196, 22),
|
Frame = new RectangleF (190, Frame.Height - 336, 196, 22),
|
||||||
Font = SparkleUI.Font,
|
Font = SparkleUI.Font,
|
||||||
StringValue = Controller.PreviousAddress,
|
|
||||||
Enabled = (Controller.SelectedPlugin.Address == null),
|
Enabled = (Controller.SelectedPlugin.Address == null),
|
||||||
Delegate = new SparkleTextFieldDelegate ()
|
Delegate = new SparkleTextFieldDelegate ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (Controller.PreviousAddress != null)
|
||||||
|
AddressTextField.StringValue = Controller.PreviousAddress;
|
||||||
|
|
||||||
PathLabel = new NSTextField () {
|
PathLabel = new NSTextField () {
|
||||||
Alignment = NSTextAlignment.Left,
|
Alignment = NSTextAlignment.Left,
|
||||||
|
@ -294,11 +295,12 @@ namespace SparkleShare {
|
||||||
|
|
||||||
PathTextField = new NSTextField () {
|
PathTextField = new NSTextField () {
|
||||||
Frame = new RectangleF (190 + 196 + 16, Frame.Height - 336, 196, 22),
|
Frame = new RectangleF (190 + 196 + 16, Frame.Height - 336, 196, 22),
|
||||||
StringValue = Controller.PreviousPath,
|
|
||||||
Enabled = (Controller.SelectedPlugin.Path == null),
|
Enabled = (Controller.SelectedPlugin.Path == null),
|
||||||
Delegate = new SparkleTextFieldDelegate ()
|
Delegate = new SparkleTextFieldDelegate ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (Controller.PreviousPath != null)
|
||||||
|
PathTextField.StringValue = Controller.PreviousPath;
|
||||||
|
|
||||||
AddressTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
|
AddressTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
|
||||||
PathTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
|
PathTextField.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
|
||||||
|
@ -310,22 +312,26 @@ namespace SparkleShare {
|
||||||
TextColor = NSColor.DisabledControlText,
|
TextColor = NSColor.DisabledControlText,
|
||||||
Editable = false,
|
Editable = false,
|
||||||
Frame = new RectangleF (190 + 196 + 16, Frame.Height - 355, 204, 17),
|
Frame = new RectangleF (190 + 196 + 16, Frame.Height - 355, 204, 17),
|
||||||
StringValue = Controller.SelectedPlugin.PathExample,
|
|
||||||
Font = NSFontManager.SharedFontManager.FontWithFamily
|
Font = NSFontManager.SharedFontManager.FontWithFamily
|
||||||
("Lucida Grande", NSFontTraitMask.Condensed, 0, 11)
|
("Lucida Grande", NSFontTraitMask.Condensed, 0, 11)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (Controller.SelectedPlugin.PathExample != null)
|
||||||
|
PathHelpLabel.StringValue = Controller.SelectedPlugin.PathExample;
|
||||||
|
|
||||||
AddressHelpLabel = new NSTextField () {
|
AddressHelpLabel = new NSTextField () {
|
||||||
BackgroundColor = NSColor.WindowBackground,
|
BackgroundColor = NSColor.WindowBackground,
|
||||||
Bordered = false,
|
Bordered = false,
|
||||||
TextColor = NSColor.DisabledControlText,
|
TextColor = NSColor.DisabledControlText,
|
||||||
Editable = false,
|
Editable = false,
|
||||||
Frame = new RectangleF (190, Frame.Height - 355, 204, 17),
|
Frame = new RectangleF (190, Frame.Height - 355, 204, 17),
|
||||||
StringValue = Controller.SelectedPlugin.AddressExample,
|
|
||||||
Font = NSFontManager.SharedFontManager.FontWithFamily
|
Font = NSFontManager.SharedFontManager.FontWithFamily
|
||||||
("Lucida Grande", NSFontTraitMask.Condensed, 0, 11)
|
("Lucida Grande", NSFontTraitMask.Condensed, 0, 11)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (Controller.SelectedPlugin.AddressExample != null)
|
||||||
|
AddressHelpLabel.StringValue = Controller.SelectedPlugin.AddressExample;
|
||||||
|
|
||||||
|
|
||||||
TableView = new NSTableView () {
|
TableView = new NSTableView () {
|
||||||
Frame = new RectangleF (0, 0, 0, 0),
|
Frame = new RectangleF (0, 0, 0, 0),
|
||||||
|
@ -866,16 +872,9 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public override void Changed (NSNotification notification)
|
public override void Changed (NSNotification notification)
|
||||||
{
|
{
|
||||||
if (StringValueChanged!= null)
|
if (StringValueChanged != null)
|
||||||
StringValueChanged ();
|
StringValueChanged ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override string [] GetCompletions (NSControl control, NSTextView text_view,
|
|
||||||
string [] a, MonoMac.Foundation.NSRange range, int b)
|
|
||||||
{
|
|
||||||
return new string [0];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue