Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve help on the server connection screen #938

Merged
merged 3 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion XBMC Remote/HostViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
//

#import <UIKit/UIKit.h>
#import <SafariServices/SafariServices.h>

#define SERVERPOPUP_BOTTOMPADDING 10

@interface HostViewController : UIViewController <UITextFieldDelegate, NSNetServiceDelegate, NSNetServiceBrowserDelegate, UITableViewDataSource, UITableViewDelegate> {
@interface HostViewController : UIViewController <UITextFieldDelegate, NSNetServiceDelegate, NSNetServiceBrowserDelegate, UITableViewDataSource, UITableViewDelegate, SFSafariViewControllerDelegate> {
kambala-decapitator marked this conversation as resolved.
Show resolved Hide resolved
IBOutlet UITextField *descriptionUI;
IBOutlet UITextField *ipUI;
IBOutlet UITextField *portUI;
Expand Down Expand Up @@ -45,6 +46,8 @@
IBOutlet UILabel *howtoLaterLabel;
IBOutlet UIButton *saveButton;
IBOutlet UISegmentedControl *segmentServerType;
IBOutlet UIButton *helpWikiButton;
IBOutlet UIButton *helpForumButton;
}

@property (strong, nonatomic) id detailItem;
Expand Down
10 changes: 10 additions & 0 deletions XBMC Remote/HostViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,16 @@ - (IBAction)startDiscover:(id)sender {
timer = [NSTimer scheduledTimerWithTimeInterval:DISCOVER_TIMEOUT target:self selector:@selector(stopDiscovery) userInfo:nil repeats:NO];
}

#pragma mark - Help URLs

- (IBAction)openHelpWiki:(id)sender {
[Utilities SFloadURL:@"https://kodi.wiki/view/Smartphone/tablet_remotes" fromctrl:self];
}

- (IBAction)openHelpForum:(id)sender {
[Utilities SFloadURL:@"https://forum.kodi.tv/showthread.php?tid=372379" fromctrl:self];
}

#pragma mark - TableViewDelegate

- (NSInteger)numberOfSectionsInTableView:(UITableView*)tableView {
Expand Down
60 changes: 48 additions & 12 deletions XBMC Remote/HostViewController.xib
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -16,6 +16,8 @@
<outlet property="discoveredInstancesTableView" destination="46" id="53"/>
<outlet property="discoveredInstancesView" destination="47" id="54"/>
<outlet property="findLabel" destination="91" id="trV-T4-ywQ"/>
<outlet property="helpForumButton" destination="WjS-8Z-d9q" id="GPY-Vl-WOc"/>
<outlet property="helpWikiButton" destination="qfc-bq-JEV" id="ZHz-qm-evB"/>
<outlet property="hostLabel" destination="18" id="g9M-4W-xGi"/>
<outlet property="howtoLabel" destination="92" id="6rb-Qy-7ne"/>
<outlet property="howtoLaterLabel" destination="100" id="m1c-iF-3c7"/>
Expand Down Expand Up @@ -124,7 +126,7 @@ TCP port</string>
<size key="shadowOffset" width="1" height="1"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" fixedFrame="YES" text=":" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="80">
<rect key="frame" x="232" y="67" width="6" height="20"/>
<rect key="frame" x="234" y="67" width="6" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="0.89980614185333252" green="0.89980614185333252" blue="0.89980614185333252" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand Down Expand Up @@ -222,7 +224,7 @@ TCP port</string>
</connections>
</textField>
<textField clipsSubviews="YES" tag="7" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="00" textAlignment="center" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="64">
<rect key="frame" x="162" y="64" width="32" height="26"/>
<rect key="frame" x="164" y="64" width="32" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
Expand Down Expand Up @@ -255,7 +257,7 @@ TCP port</string>
</connections>
</textField>
<textField clipsSubviews="YES" tag="10" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="line" placeholder="00" textAlignment="center" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="73">
<rect key="frame" x="277" y="64" width="32" height="26"/>
<rect key="frame" x="278" y="64" width="32" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
Expand All @@ -277,7 +279,7 @@ TCP port</string>
</connections>
</textField>
<textField clipsSubviews="YES" tag="4" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="9090" borderStyle="line" placeholder="9090" textAlignment="center" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="93">
<rect key="frame" x="257" y="34" width="51" height="26"/>
<rect key="frame" x="259" y="34" width="51" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
Expand Down Expand Up @@ -365,15 +367,16 @@ TCP port</string>
</connections>
</button>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="z1M-ev-5kX" userLabel="View - tip">
<rect key="frame" x="0.0" y="285" width="320" height="130"/>
<rect key="frame" x="0.0" y="260" width="320" height="155"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" fixedFrame="YES" image="tip" translatesAutoresizingMaskIntoConstraints="NO" id="101">
<rect key="frame" x="5" y="4" width="15" height="14"/>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" fixedFrame="YES" image="button_info" translatesAutoresizingMaskIntoConstraints="NO" id="101">
<rect key="frame" x="2" y="6" width="20" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="tintColor" systemColor="linkColor"/>
</imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" fixedFrame="YES" text="How-to activate the remote app in Kodi" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumFontSize="11" translatesAutoresizingMaskIntoConstraints="NO" id="92">
<rect key="frame" x="25" y="0.0" width="285" height="20"/>
<rect key="frame" x="25" y="5" width="285" height="20"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="1" green="1" blue="1" alpha="0.65000000000000002" colorSpace="custom" customColorSpace="sRGB"/>
Expand All @@ -382,7 +385,7 @@ TCP port</string>
<size key="shadowOffset" width="0.0" height="1"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" fixedFrame="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumFontSize="11" translatesAutoresizingMaskIntoConstraints="NO" id="100">
<rect key="frame" x="25" y="22" width="285" height="105"/>
<rect key="frame" x="25" y="27" width="285" height="105"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<string key="text">Settings &gt; Services &gt; Control:
1. Web Server &gt; Allow remote control via HTTP
Expand All @@ -393,6 +396,35 @@ TCP port</string>
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="custom" customColorSpace="sRGB"/>
<size key="shadowOffset" width="0.0" height="1"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" alpha="0.80000000000000004" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="st_kodi_action" id="dVE-tO-jAs">
<rect key="frame" x="150" y="134" width="20" height="20"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<color key="tintColor" systemColor="linkColor"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="qfc-bq-JEV" userLabel="Help Wiki">
<rect key="frame" x="5" y="134" width="145" height="20"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Wiki (English)">
<color key="titleColor" systemColor="linkColor"/>
</state>
<connections>
<action selector="openHelpWiki:" destination="-1" eventType="touchUpInside" id="AXB-tR-uPi"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="WjS-8Z-d9q" userLabel="Help Forum">
<rect key="frame" x="170" y="134" width="145" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Forum (English)">
<color key="titleColor" systemColor="linkColor"/>
</state>
<connections>
<action selector="openHelpForum:" destination="-1" eventType="touchUpInside" id="7UJ-2W-qDp"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
Expand Down Expand Up @@ -448,8 +480,12 @@ TCP port</string>
</objects>
<resources>
<image name="button_find" width="104" height="28"/>
<image name="button_info" width="25" height="25"/>
<image name="shiny_black_back" width="240" height="408"/>
<image name="tip" width="15" height="15"/>
<image name="st_kodi_action" width="34" height="30"/>
<systemColor name="linkColor">
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemBlueColor">
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
Expand Down
3 changes: 3 additions & 0 deletions XBMC Remote/Utilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,9 @@ + (void)SFloadURL:(NSString*)url fromctrl:(UIViewController<SFSafariViewControll
ctrl = UIApplication.sharedApplication.keyWindow.rootViewController;
}
if (![svc isBeingPresented]) {
if (ctrl.presentedViewController) {
[ctrl dismissViewControllerAnimated:YES completion:nil];
}
[ctrl presentViewController:svc animated:YES completion:nil];
}
}
Expand Down