diff --git a/openbis-ipad/Research/BisMac.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate b/openbis-ipad/Research/BisMac.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate index 4ab4ac45e5a3fbb10800e55c4a20e54be6698d40..f6ff82374c9cd9d07ca21b1b72cd3df7d36a445c 100644 Binary files a/openbis-ipad/Research/BisMac.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate and b/openbis-ipad/Research/BisMac.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate b/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate index e66c0d7a00eecc673e61dde594116623eca9aa15..ac21caa06d0ad62ad5075ae01579c0f52ac5ffbd 100644 Binary files a/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate and b/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.h b/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.h index 54d500b3e772e0d783a06777e4fdc3ac47a0fac2..673669e873ffba8f33ea49e651f3c0f9e410593d 100644 --- a/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.h +++ b/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.h @@ -36,6 +36,7 @@ @property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator; @property (readonly, strong, nonatomic) CISDOBOpenBisModel *rootOpenBisModel; @property (readonly, strong, nonatomic) CISDOBIpadServiceManager *serviceManager; +@property (nonatomic, getter=isOnline) BOOL online; // User Settings @property (copy, nonatomic) NSString *username; diff --git a/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.m b/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.m index 70bec49017e143d79bb2a28690a1a136889820ce..194489f432acc3635fc603ce1f06da0350d48262 100644 --- a/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.m +++ b/openbis-ipad/openBIS/openBIS/CISDOBAppDelegate.m @@ -73,17 +73,16 @@ return; } - CISDOBMasterViewController *masterViewController = [self masterViewController]; - // Initialize the connection to openBIS CISDOBAsyncCall *call = [self.serviceManager loginUser: username password: password]; + __weak CISDOBAppDelegate *weakSelf = self; call.success = ^(id result) { - self.username = username; - self.password = password; - self.openbisUrl = openbisUrl; - [self synchronizeUserSettings]; - [self loginControllerDidComplete: controller]; - [masterViewController didConnectServiceManager: self.serviceManager]; + weakSelf.username = username; + weakSelf.password = password; + weakSelf.openbisUrl = openbisUrl; + [weakSelf synchronizeUserSettings]; + [weakSelf loginControllerDidComplete: controller]; + [weakSelf didConnectToServer]; }; call.fail = ^(NSError *error) { [controller showError: error]; @@ -132,17 +131,25 @@ return (CISDOBDetailViewController *)[[splitViewController.viewControllers lastObject] topViewController]; } -- (void)initializeOpenBisConnection +- (void)didConnectToServer { + self.online = YES; CISDOBMasterViewController *controller = [self masterViewController]; + [controller didConnectServiceManager: self.serviceManager]; +} +- (void)initializeOpenBisConnection +{ + self.online = NO; + // Initialize the connection to openBIS CISDOBAsyncCall *call = [self.serviceManager loginUser: [self username] password: [self password]]; + __weak CISDOBAppDelegate *weakSelf = self; call.success = ^(id result) { - [controller didConnectServiceManager: self.serviceManager]; + [weakSelf didConnectToServer]; }; call.fail = ^(NSError *error) { - [[self detailViewController] performSegueWithIdentifier: @"ShowLoginDialog" sender: self]; + [[weakSelf detailViewController] performSegueWithIdentifier: @"ShowLoginDialog" sender: self]; }; [call start]; } diff --git a/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m b/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m index 84077a677979c2468e8aca8f3df4ef44c5ca8904..0024e8ce33deb76d11588e275560b63483f783ee 100644 --- a/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m +++ b/openbis-ipad/openBIS/openBIS/CISDOBDetailViewController.m @@ -109,10 +109,18 @@ [call start]; } +- (NSString *)titleString +{ + if (!self.openBisModel) return @""; + NSString *titleRoot = (self.detailItem) ? self.detailItem.summaryHeader : @""; + NSString *onlineStatus = (self.openBisModel.online) ? @"" : @"(offline)"; + return [NSString stringWithFormat: @"%@ %@", titleRoot, onlineStatus]; +} + - (void)configureView { + self.title = [self titleString]; if (!self.detailItem) { - self.title = @""; self.summaryHeaderLabel.text = @""; self.summaryLabel.text = @""; self.identifierLabel.text = @""; @@ -121,7 +129,6 @@ } // The detail item is now up-to-date. Update the user interface. - self.title = self.detailItem.summaryHeader; self.summaryHeaderLabel.text = self.detailItem.summaryHeader; self.summaryLabel.text = self.detailItem.summary; self.identifierLabel.text = self.detailItem.identifier; diff --git a/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.h b/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.h index 01d983d1b8eeb8a8880e876db3e3e3921eb3effd..f026686c1b53f18d34cb57e1323e00b66c659346 100644 --- a/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.h +++ b/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.h @@ -40,6 +40,7 @@ @property (weak, nonatomic) CISDOBOpenBisModel *parentModel; @property (readonly) CISDOBIpadServiceManager *serviceManager; @property (strong, nonatomic) CISDOBIpadEntity *selectedObject; +@property (readonly, getter=isOnline) BOOL online; // Initialize - (id)initWithParentModel:(CISDOBOpenBisModel *)parentModel; //!< The designated initializer diff --git a/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.m b/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.m index 744ee11ce896475b747c0678bf038e5140aabad7..e841c5e292d64f68bc17d911a679d34a91a8e356 100644 --- a/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.m +++ b/openbis-ipad/openBIS/openBIS/CISDOBOpenBisModel.m @@ -53,6 +53,7 @@ #pragma mark - Accessor - (CISDOBIpadServiceManager *)serviceManager { return self.appDelegate.serviceManager; } - (NSManagedObjectContext *)managedObjectContext { return self.appDelegate.managedObjectContext; } +- (BOOL)isOnline { return self.appDelegate.online; } #pragma mark - Model - (NSInteger)numberOfSections diff --git a/openbis-ipad/openBIS/openBIS/en.lproj/MainStoryboard_iPad.storyboard b/openbis-ipad/openBIS/openBIS/en.lproj/MainStoryboard_iPad.storyboard index a9c740aef7341623a021f9198f8e44c67fdef730..fd36164dfaf3fb868297f5decdcee85cc8a14ae5 100644 --- a/openbis-ipad/openBIS/openBIS/en.lproj/MainStoryboard_iPad.storyboard +++ b/openbis-ipad/openBIS/openBIS/en.lproj/MainStoryboard_iPad.storyboard @@ -166,7 +166,7 @@ <outlet property="summaryHeaderLabel" destination="27" id="f5M-Ao-eBL"/> <outlet property="summaryLabel" destination="T4E-dH-b3j" id="qVC-t4-llZ"/> <outlet property="webView" destination="rUU-Fj-t5t" id="N50-LI-vy0"/> - <segue destination="JpU-kO-AZv" kind="modal" identifier="ShowLoginDialog" id="Ptf-UL-Gbm"/> + <segue destination="JpU-kO-AZv" kind="modal" identifier="ShowLoginDialog" animates="NO" id="Ptf-UL-Gbm"/> </connections> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="15" sceneMemberID="firstResponder"/> @@ -224,9 +224,6 @@ <nil key="highlightedColor"/> </label> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="openBIS Server" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LRp-55-gt6"> - <constraints> - <constraint firstAttribute="height" constant="22" id="BJL-72-egS"/> - </constraints> <fontDescription key="fontDescription" type="system" pointSize="17"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <nil key="highlightedColor"/> @@ -239,10 +236,11 @@ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" lineBreakMode="tailTruncation" numberOfLines="6" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="518" translatesAutoresizingMaskIntoConstraints="NO" id="7Aq-O2-MYr"> <constraints> <constraint firstAttribute="height" constant="82" id="TlM-Xl-NTi"/> + <constraint firstAttribute="width" constant="518" id="sEK-mV-gLe"/> </constraints> <string key="text">This iPad app is designed to give users of openBIS access to their data from their iPad. -If you are a user of an openBIS server, plese enter the URL and your login details in the space provided below. If you are just curious and want to try out the iPad app, click the "Browse Offline" button to bypass log in.</string> +If you are a user of an openBIS server, plese enter the URL and your login details in the space provided below. If you believe the server is temporarily having problems, click "Browse Offline" button to bypass log in.</string> <fontDescription key="fontDescription" type="system" pointSize="12"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <nil key="highlightedColor"/> @@ -281,7 +279,8 @@ If you are a user of an openBIS server, plese enter the URL and your login detai </button> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5qJ-y2-Sq5"> <constraints> - <constraint firstAttribute="width" constant="481" id="f2T-Tb-bZF"/> + <constraint firstAttribute="height" constant="276" id="3iS-JL-stA"/> + <constraint firstAttribute="width" constant="480" id="821-GF-pXb"/> </constraints> <fontDescription key="fontDescription" type="system" pointSize="17"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> @@ -291,26 +290,26 @@ If you are a user of an openBIS server, plese enter the URL and your login detai <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <constraints> <constraint firstAttribute="trailing" secondItem="3rW-ET-vQX" secondAttribute="trailing" constant="93" id="0Wa-cx-Rpu"/> - <constraint firstItem="y8r-6g-CzC" firstAttribute="top" secondItem="RL9-Rf-b7S" secondAttribute="top" constant="77" id="0ob-Dv-vCz"/> <constraint firstItem="sWb-wa-6qu" firstAttribute="top" secondItem="LRp-55-gt6" secondAttribute="bottom" constant="8" symbolic="YES" type="user" id="28F-qF-pyr"/> <constraint firstItem="t1Z-Hl-UZu" firstAttribute="trailing" secondItem="156-KK-cHv" secondAttribute="trailing" type="default" id="3Cm-ZJ-4ej"/> <constraint firstItem="LRp-55-gt6" firstAttribute="top" secondItem="RL9-Rf-b7S" secondAttribute="top" constant="263" type="user" id="4Tt-tZ-zJQ"/> <constraint firstItem="IEY-Jd-Yi1" firstAttribute="baseline" secondItem="156-KK-cHv" secondAttribute="baseline" type="user" id="7HG-Jt-IJz"/> <constraint firstItem="y8r-6g-CzC" firstAttribute="leading" secondItem="RL9-Rf-b7S" secondAttribute="leading" constant="31" id="DtS-bD-LhH"/> - <constraint firstAttribute="bottom" secondItem="5qJ-y2-Sq5" secondAttribute="bottom" constant="20" symbolic="YES" type="user" id="IAL-sF-ZOa"/> + <constraint firstAttribute="bottom" secondItem="t1Z-Hl-UZu" secondAttribute="bottom" constant="307" id="J8t-rT-8nM"/> + <constraint firstItem="IEY-Jd-Yi1" firstAttribute="top" secondItem="RL9-Rf-b7S" secondAttribute="top" constant="362" id="Kjh-AU-ab5"/> <constraint firstItem="156-KK-cHv" firstAttribute="leading" secondItem="IEY-Jd-Yi1" secondAttribute="trailing" constant="8" symbolic="YES" type="default" id="MMa-ki-yYc"/> - <constraint firstItem="3rW-ET-vQX" firstAttribute="top" secondItem="RL9-Rf-b7S" secondAttribute="top" constant="125" id="N4K-n3-cea"/> + <constraint firstItem="sWb-wa-6qu" firstAttribute="top" secondItem="RL9-Rf-b7S" secondAttribute="top" constant="293" id="OKf-tb-ndc"/> <constraint firstItem="7Aq-O2-MYr" firstAttribute="top" secondItem="y8r-6g-CzC" secondAttribute="bottom" constant="8" symbolic="YES" type="default" id="RJ0-gw-cc5"/> <constraint firstItem="Fv2-LT-eNm" firstAttribute="leading" secondItem="IEY-Jd-Yi1" secondAttribute="leading" type="default" id="W0P-8D-xEd"/> - <constraint firstItem="5qJ-y2-Sq5" firstAttribute="top" secondItem="t1Z-Hl-UZu" secondAttribute="bottom" constant="8" symbolic="YES" type="user" id="WCy-gs-2y4"/> - <constraint firstItem="Fv2-LT-eNm" firstAttribute="top" secondItem="sWb-wa-6qu" secondAttribute="bottom" constant="8" symbolic="YES" type="user" id="cC5-xK-V5C"/> + <constraint firstItem="3rW-ET-vQX" firstAttribute="top" secondItem="RL9-Rf-b7S" secondAttribute="top" constant="126" id="bF1-sU-35U"/> <constraint firstItem="5qJ-y2-Sq5" firstAttribute="leading" secondItem="IEY-Jd-Yi1" secondAttribute="leading" type="default" id="diM-o0-wZw"/> - <constraint firstItem="IEY-Jd-Yi1" firstAttribute="top" secondItem="Fv2-LT-eNm" secondAttribute="bottom" constant="8" symbolic="YES" type="user" id="g8C-I7-Kju"/> + <constraint firstItem="Fv2-LT-eNm" firstAttribute="top" secondItem="RL9-Rf-b7S" secondAttribute="top" constant="329" id="h0H-Uy-I6a"/> <constraint firstItem="Fv2-LT-eNm" firstAttribute="leading" secondItem="sWb-wa-6qu" secondAttribute="leading" type="default" id="iAC-ad-Bwq"/> <constraint firstItem="sWb-wa-6qu" firstAttribute="trailing" secondItem="156-KK-cHv" secondAttribute="trailing" type="default" id="kFD-Ip-DpD"/> <constraint firstItem="LRp-55-gt6" firstAttribute="leading" secondItem="sWb-wa-6qu" secondAttribute="leading" type="default" id="sJ8-Gb-txC"/> <constraint firstItem="7Aq-O2-MYr" firstAttribute="leading" secondItem="LRp-55-gt6" secondAttribute="leading" type="default" id="tgp-P1-o0q"/> - <constraint firstItem="t1Z-Hl-UZu" firstAttribute="top" secondItem="156-KK-cHv" secondAttribute="bottom" constant="8" symbolic="YES" type="user" id="wRp-wD-diw"/> + <constraint firstAttribute="bottom" secondItem="5qJ-y2-Sq5" secondAttribute="bottom" constant="21" id="tjb-h2-b5S"/> + <constraint firstItem="y8r-6g-CzC" firstAttribute="top" secondItem="RL9-Rf-b7S" secondAttribute="top" constant="76" id="yXB-7i-tkJ"/> <constraint firstItem="7Aq-O2-MYr" firstAttribute="leading" secondItem="y8r-6g-CzC" secondAttribute="leading" type="default" id="ybM-Ej-2gb"/> </constraints> <simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/> @@ -413,7 +412,7 @@ If you are a user of an openBIS server, plese enter the URL and your login detai </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="NUF-R7-bDU" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> - <point key="canvasLocation" x="1516" y="-1092"/> + <point key="canvasLocation" x="1516" y="-1160"/> </scene> <!--Navigation Controller--> <scene sceneID="50">