Ind.ie is now
Small Technology Foundation
.
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Heartbeat Cocoa
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Adam Procter
Heartbeat Cocoa
Commits
e27da2b2
Commit
e27da2b2
authored
Aug 09, 2015
by
Aral Balkan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handling form element state better now on Waystone account creation. Closes #116
parent
bfb07a3c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
13 deletions
+29
-13
Heartbeat/Base.lproj/Main.storyboard
Heartbeat/Base.lproj/Main.storyboard
+1
-1
Heartbeat/ProfileImageComponentViewController.swift
Heartbeat/ProfileImageComponentViewController.swift
+6
-1
Heartbeat/SetupStepTwoViewController.swift
Heartbeat/SetupStepTwoViewController.swift
+13
-9
Heartbeat/SetupStepViewController.swift
Heartbeat/SetupStepViewController.swift
+1
-0
Heartbeat/SetupViewController.swift
Heartbeat/SetupViewController.swift
+8
-2
No files found.
Heartbeat/Base.lproj/Main.storyboard
View file @
e27da2b2
...
...
@@ -1132,7 +1132,7 @@
</subviews>
<nil
key=
"backgroundColor"
/>
</clipView>
<scroller
key=
"horizontalScroller"
hidden=
"YES"
verticalHuggingPriority=
"750"
horizontal=
"YES"
id=
"b4B-VU-vU0"
>
<scroller
key=
"horizontalScroller"
verticalHuggingPriority=
"750"
horizontal=
"YES"
id=
"b4B-VU-vU0"
>
<rect
key=
"frame"
x=
"1"
y=
"119"
width=
"223"
height=
"15"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
</scroller>
...
...
Heartbeat/ProfileImageComponentViewController.swift
View file @
e27da2b2
...
...
@@ -99,6 +99,9 @@ class ProfileImageComponentViewController: NSViewController, NSComboBoxDataSourc
self
.
changePhotoButton
.
layer
!.
opacity
=
0.0
self
.
slider
.
layer
!.
opacity
=
0.0
self
.
changePhotoButton
.
enabled
=
false
self
.
slider
.
enabled
=
false
}
else
{
...
...
@@ -114,7 +117,9 @@ class ProfileImageComponentViewController: NSViewController, NSComboBoxDataSourc
self
.
changePhotoButton
.
layer
!.
opacity
=
1.0
self
.
slider
.
layer
!.
opacity
=
1.0
self
.
changePhotoButton
.
enabled
=
true
self
.
slider
.
enabled
=
true
}
}
...
...
Heartbeat/SetupStepTwoViewController.swift
View file @
e27da2b2
...
...
@@ -71,16 +71,15 @@ class SetupStepTwoViewController: SetupStepViewController
// TODO: Refactor to remove redundancies with animateFormWhenDoneEditing
//
// Mark the Profile Image Component as not editable
// (This will gracefully remove its controls).
// Restore the controls
profileImageComponent
.
editable
=
true
self
.
personNameTextField
.
drawsBackground
=
false
self
.
bioTextField
.
drawsBackground
=
false
self
.
personNameTextField
.
editable
=
true
self
.
bioTextField
.
editable
=
true
self
.
delegate
?
.
enableAllButtons
(
true
)
// // This is a workaround to a visual glitch that otherwise draws boxes around the components.
// self.personNameTextField.drawsBackground = true
// self.personNameTextField.backgroundColor = NSColor(calibratedWhite: 100.0, alpha: 0.0)
// self.bioTextField.drawsBackground = true
// self.bioTextField.backgroundColor = NSColor(calibratedWhite: 100.0, alpha: 0.0)
//
// End animation values for the constraints.
self
.
profileImagePickerTopSpaceToContainerConstraint
.
constant
=
self
.
profileImagePickerTopSpaceToContainerConstraintOriginalConstant
self
.
nameTextFieldTopSpaceToProfileImagePickerComponentConstraint
.
constant
=
self
.
nameTextFieldTopSpaceToProfileImagePickerComponentConstraintOriginalConstant
...
...
@@ -109,12 +108,17 @@ class SetupStepTwoViewController: SetupStepViewController
// (This will gracefully remove its controls).
profileImageComponent
.
editable
=
false
// Disable all buttons.
self
.
delegate
?
.
enableAllButtons
(
false
)
// This is a workaround to a visual glitch that otherwise draws boxes around the components.
self
.
personNameTextField
.
drawsBackground
=
true
self
.
personNameTextField
.
backgroundColor
=
NSColor
(
calibratedWhite
:
100.0
,
alpha
:
0.0
)
self
.
personNameTextField
.
editable
=
false
self
.
bioTextField
.
drawsBackground
=
true
self
.
bioTextField
.
backgroundColor
=
NSColor
(
calibratedWhite
:
100.0
,
alpha
:
0.0
)
self
.
bioTextField
.
editable
=
false
// Save the current constraint constants so we can revert the form back
// if we need to (i.e., if there’s an error while creating the account).
self
.
profileImagePickerTopSpaceToContainerConstraintOriginalConstant
=
self
.
profileImagePickerTopSpaceToContainerConstraint
.
constant
...
...
Heartbeat/SetupStepViewController.swift
View file @
e27da2b2
...
...
@@ -25,6 +25,7 @@ protocol SetupDelegate
func
showMessage
(
title
:
String
,
body
:
String
)
func
showMessage
(
title
:
String
,
body
:
String
,
nextButtonTitle
:
String
)
func
hideMessage
()
func
enableAllButtons
(
state
:
Bool
)
}
...
...
Heartbeat/SetupViewController.swift
View file @
e27da2b2
...
...
@@ -309,7 +309,6 @@ class SetupViewController: NSViewController, SetupDelegate
/* and handle */
response
in
println
(
"ℹ️ Call to initialise Heartbeat with Waystone Account returned from Node.
\n
"
)
println
(
response
)
if
response
[
"error"
]
.
boolValue
...
...
@@ -326,7 +325,7 @@ class SetupViewController: NSViewController, SetupDelegate
self
.
hideProgress
()
let
errorSheet
=
NSAlert
()
errorSheet
.
messageText
=
"Sorry, could not set up your account
on Ind.ie
."
errorSheet
.
messageText
=
"Sorry, could not set up your account."
errorSheet
.
informativeText
=
prettyErrorMessage
errorSheet
.
alertStyle
=
NSAlertStyle
.
CriticalAlertStyle
errorSheet
.
addButtonWithTitle
(
"OK"
)
...
...
@@ -507,6 +506,13 @@ class SetupViewController: NSViewController, SetupDelegate
showBackButton
(
false
)
}
func
enableAllButtons
(
state
:
Bool
)
{
backButton
.
enabled
=
state
nextButton
.
enabled
=
state
doneButton
.
enabled
=
state
}
//
// MARK: - Notification handlers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment