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
1=== modified file 'Classes/FrontendSelect.m'
2--- Classes/FrontendSelect.m 2009-09-08 21:37:27 +0000
3+++ Classes/FrontendSelect.m 2011-01-17 06:24:57 +0000
4@@ -191,7 +191,7 @@
5 [DEFAULTS setObject:[[frontends allKeys] objectAtIndex:indexPath.row] forKey:FRONTEND_KEY];
6 [DEFAULTS setObject:[[frontends allValues] objectAtIndex:indexPath.row] forKey:FRONTEND_PORT_KEY];
7
8- [TELNETREMOTE setup];
9+ [TELNETREMOTE NewFrontend];
10
11 [PROGRAM_GUIDE loadView];
12
13
14=== modified file 'Classes/SettingsViewController.m'
15--- Classes/SettingsViewController.m 2010-06-27 01:09:04 +0000
16+++ Classes/SettingsViewController.m 2011-01-17 06:24:57 +0000
17@@ -44,6 +44,11 @@
18 activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
19 }
20
21+- (void)viewWillAppear:(BOOL)animated {
22+ [self.tableView reloadData];
23+}
24+
25+
26 - (void)info {
27 NSMutableString *message = [NSMutableString stringWithFormat:@"Author: Chase Douglas\nVersion: %@\nRevision: %d", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"], MYMOTE_REVISION];
28 #if !MYMOTE_REVISION_CLEAN
29
30=== modified file 'Classes/TelnetRemote.h'
31--- Classes/TelnetRemote.h 2010-06-27 16:22:55 +0000
32+++ Classes/TelnetRemote.h 2011-01-17 06:24:57 +0000
33@@ -42,6 +42,7 @@
34 - (void)processWrites;
35 - (void)queryLocationWithTarget:(id)target selector:(SEL)selector;
36 - (void)sendCommand:(NSString *)command;
37+- (void)NewFrontend;
38
39 @end
40
41
42=== modified file 'Classes/TelnetRemote.m'
43--- Classes/TelnetRemote.m 2010-06-28 01:13:10 +0000
44+++ Classes/TelnetRemote.m 2011-01-17 06:24:57 +0000
45@@ -140,6 +140,11 @@
46 [self setup];
47 }
48
49+- (void)NewFrontend {
50+ [istream close];
51+ [self setup];
52+}
53+
54 - (void)connectTimerFired:(NSTimer *)timer {
55 if (([istream streamStatus] == NSStreamStatusOpen || [istream streamStatus] == NSStreamStatusReading) && ([ostream streamStatus] == NSStreamStatusOpen || [ostream streamStatus] == NSStreamStatusWriting)) {
56 return;

Subscribers

People subscribed via source and target branches