Merge lp:~davidpeterson/mymote/dpchanges into lp:mymote

Proposed by David Peterson
Status: Merged
Merged at revision: 196
Proposed branch: lp:~davidpeterson/mymote/dpchanges
Merge into: lp:mymote
Diff against target: 56 lines (+12/-1)
4 files modified
Classes/FrontendSelect.m (+1/-1)
Classes/SettingsViewController.m (+5/-0)
Classes/TelnetRemote.h (+1/-0)
Classes/TelnetRemote.m (+5/-0)
To merge this branch: bzr merge lp:~davidpeterson/mymote/dpchanges
Reviewer Review Type Date Requested Status
Chase Douglas Approve
Review via email: mp+46442@code.launchpad.net

Description of the change

Fixes changing the frontend server.

Changing the frontend doesn't work all the time in the release version. It only seems to work when the telnet connection times out and is re-established.

- Creates new TelnetRemote:NewFrontend method that closes istream before running setup. This ensures setup connects to the new frontend.
- Reloads the settings UITableView when it reappears so new frontend is shown immediately.

To post a comment you must log in.
Revision history for this message
Chase Douglas (chasedouglas) wrote :

Hi David,

This looks great! I just tested it out here and the changes seem to work well.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Classes/FrontendSelect.m'
--- Classes/FrontendSelect.m 2009-09-08 21:37:27 +0000
+++ Classes/FrontendSelect.m 2011-01-17 06:24:57 +0000
@@ -191,7 +191,7 @@
191 [DEFAULTS setObject:[[frontends allKeys] objectAtIndex:indexPath.row] forKey:FRONTEND_KEY];191 [DEFAULTS setObject:[[frontends allKeys] objectAtIndex:indexPath.row] forKey:FRONTEND_KEY];
192 [DEFAULTS setObject:[[frontends allValues] objectAtIndex:indexPath.row] forKey:FRONTEND_PORT_KEY];192 [DEFAULTS setObject:[[frontends allValues] objectAtIndex:indexPath.row] forKey:FRONTEND_PORT_KEY];
193193
194 [TELNETREMOTE setup];194 [TELNETREMOTE NewFrontend];
195 195
196 [PROGRAM_GUIDE loadView];196 [PROGRAM_GUIDE loadView];
197 197
198198
=== modified file 'Classes/SettingsViewController.m'
--- Classes/SettingsViewController.m 2010-06-27 01:09:04 +0000
+++ Classes/SettingsViewController.m 2011-01-17 06:24:57 +0000
@@ -44,6 +44,11 @@
44 activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];44 activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
45}45}
4646
47- (void)viewWillAppear:(BOOL)animated {
48 [self.tableView reloadData];
49}
50
51
47- (void)info {52- (void)info {
48 NSMutableString *message = [NSMutableString stringWithFormat:@"Author: Chase Douglas\nVersion: %@\nRevision: %d", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"], MYMOTE_REVISION];53 NSMutableString *message = [NSMutableString stringWithFormat:@"Author: Chase Douglas\nVersion: %@\nRevision: %d", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"], MYMOTE_REVISION];
49#if !MYMOTE_REVISION_CLEAN54#if !MYMOTE_REVISION_CLEAN
5055
=== modified file 'Classes/TelnetRemote.h'
--- Classes/TelnetRemote.h 2010-06-27 16:22:55 +0000
+++ Classes/TelnetRemote.h 2011-01-17 06:24:57 +0000
@@ -42,6 +42,7 @@
42- (void)processWrites;42- (void)processWrites;
43- (void)queryLocationWithTarget:(id)target selector:(SEL)selector;43- (void)queryLocationWithTarget:(id)target selector:(SEL)selector;
44- (void)sendCommand:(NSString *)command;44- (void)sendCommand:(NSString *)command;
45- (void)NewFrontend;
4546
46@end47@end
4748
4849
=== modified file 'Classes/TelnetRemote.m'
--- Classes/TelnetRemote.m 2010-06-28 01:13:10 +0000
+++ Classes/TelnetRemote.m 2011-01-17 06:24:57 +0000
@@ -140,6 +140,11 @@
140 [self setup];140 [self setup];
141}141}
142142
143- (void)NewFrontend {
144 [istream close];
145 [self setup];
146}
147
143- (void)connectTimerFired:(NSTimer *)timer {148- (void)connectTimerFired:(NSTimer *)timer {
144 if (([istream streamStatus] == NSStreamStatusOpen || [istream streamStatus] == NSStreamStatusReading) && ([ostream streamStatus] == NSStreamStatusOpen || [ostream streamStatus] == NSStreamStatusWriting)) {149 if (([istream streamStatus] == NSStreamStatusOpen || [istream streamStatus] == NSStreamStatusReading) && ([ostream streamStatus] == NSStreamStatusOpen || [ostream streamStatus] == NSStreamStatusWriting)) {
145 return;150 return;

Subscribers

People subscribed via source and target branches