Skip to content

Commit 062fe0d

Browse files
committed
Finish Implementing Settings Page
1 parent 30d32af commit 062fe0d

17 files changed

+322
-155
lines changed

Deluge Remote.xcodeproj/project.pbxproj

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
470F5CFE2594A0E700B7155D /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = 470F5CFD2594A0E700B7155D /* FirebaseCrashlytics */; };
1212
470F5D022594A14600B7155D /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 470F5D012594A14600B7155D /* FirebaseAnalytics */; };
1313
470F5D092594A29400B7155D /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 470F5D082594A29400B7155D /* GoogleService-Info.plist */; };
14+
470F5D192595689100B7155D /* CrashReportingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 470F5D182595689100B7155D /* CrashReportingViewController.swift */; };
15+
470F5D1D2595701200B7155D /* AcknowledgementsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 470F5D1C2595701200B7155D /* AcknowledgementsTableViewController.swift */; };
16+
470F5D2625957DFB00B7155D /* MenuTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 470F5D2425957DFB00B7155D /* MenuTableViewCell.xib */; };
1417
4714775825869DF00019A278 /* TorrentFileStructure.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4714775725869DF00019A278 /* TorrentFileStructure.swift */; };
1518
4714775B25869F810019A278 /* DelugeTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4714775A25869F810019A278 /* DelugeTypes.swift */; };
1619
471477622586A1270019A278 /* TorrentUploadInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 471477612586A1270019A278 /* TorrentUploadInfo.swift */; };
@@ -79,6 +82,9 @@
7982
/* Begin PBXFileReference section */
8083
470F5CF5259460D500B7155D /* MenuTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuTableViewCell.swift; sourceTree = "<group>"; };
8184
470F5D082594A29400B7155D /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
85+
470F5D182595689100B7155D /* CrashReportingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrashReportingViewController.swift; sourceTree = "<group>"; };
86+
470F5D1C2595701200B7155D /* AcknowledgementsTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AcknowledgementsTableViewController.swift; sourceTree = "<group>"; };
87+
470F5D2425957DFB00B7155D /* MenuTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MenuTableViewCell.xib; sourceTree = "<group>"; };
8288
4714775725869DF00019A278 /* TorrentFileStructure.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TorrentFileStructure.swift; sourceTree = "<group>"; };
8389
4714775A25869F810019A278 /* DelugeTypes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DelugeTypes.swift; sourceTree = "<group>"; };
8490
471477612586A1270019A278 /* TorrentUploadInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TorrentUploadInfo.swift; sourceTree = "<group>"; };
@@ -167,6 +173,16 @@
167173
name = Frameworks;
168174
sourceTree = "<group>";
169175
};
176+
470F5D172595682700B7155D /* Settings View Controllers */ = {
177+
isa = PBXGroup;
178+
children = (
179+
472595DC2594578100BBFE10 /* SettingsViewController.swift */,
180+
470F5D182595689100B7155D /* CrashReportingViewController.swift */,
181+
470F5D1C2595701200B7155D /* AcknowledgementsTableViewController.swift */,
182+
);
183+
name = "Settings View Controllers";
184+
sourceTree = "<group>";
185+
};
170186
4714775525869D890019A278 /* Protocols */ = {
171187
isa = PBXGroup;
172188
children = (
@@ -221,6 +237,7 @@
221237
4716027E1DD433D800727CBD /* View Controllers */ = {
222238
isa = PBXGroup;
223239
children = (
240+
470F5D172595682700B7155D /* Settings View Controllers */,
224241
47C800F72590966200A01831 /* Detail View Controllers */,
225242
47ED996525842A93002EB8DA /* MainSplitViewController.swift */,
226243
47D035621DD81B34003BB2A0 /* MainTableViewController.swift */,
@@ -229,7 +246,6 @@
229246
47F9C73521DC6EB80017281C /* AddTorrentViewController.swift */,
230247
47ED996E25848F8C002EB8DA /* PlaceholderViewController.swift */,
231248
472AA9662593FE4200529B45 /* TorrentSortingPopup.swift */,
232-
472595DC2594578100BBFE10 /* SettingsViewController.swift */,
233249
);
234250
path = "View Controllers";
235251
sourceTree = "<group>";
@@ -310,6 +326,7 @@
310326
47B0E3CC21E07A1900E3056A /* MainTableViewCell.swift */,
311327
473D1F7B258B1F6F00045DB0 /* TorrentConnectedClientCell.swift */,
312328
470F5CF5259460D500B7155D /* MenuTableViewCell.swift */,
329+
470F5D2425957DFB00B7155D /* MenuTableViewCell.xib */,
313330
);
314331
path = Cells;
315332
sourceTree = "<group>";
@@ -450,6 +467,7 @@
450467
files = (
451468
4716023C1DD4305800727CBD /* LaunchScreen.storyboard in Resources */,
452469
471602391DD4305800727CBD /* Assets.xcassets in Resources */,
470+
470F5D2625957DFB00B7155D /* MenuTableViewCell.xib in Resources */,
453471
47A716B421DEB9B300C7650C /* [email protected] in Resources */,
454472
47A716B221DEB7E200C7650C /* [email protected] in Resources */,
455473
471602371DD4305800727CBD /* Main.storyboard in Resources */,
@@ -533,10 +551,12 @@
533551
472AA9672593FE4200529B45 /* TorrentSortingPopup.swift in Sources */,
534552
47F9C73621DC6EB80017281C /* AddTorrentViewController.swift in Sources */,
535553
47B0E3D721E07C0A00E3056A /* CustomAlert.swift in Sources */,
554+
470F5D1D2595701200B7155D /* AcknowledgementsTableViewController.swift in Sources */,
536555
472595E02594589A00BBFE10 /* Bundle.swift in Sources */,
537556
472AA96D25940B8C00529B45 /* SlideInPresentationController .swift in Sources */,
538557
47ED997925858440002EB8DA /* RepeatingTimer.swift in Sources */,
539558
47ED995E2584282C002EB8DA /* Storyboarded.swift in Sources */,
559+
470F5D192595689100B7155D /* CrashReportingViewController.swift in Sources */,
540560
);
541561
runOnlyForDeploymentPostprocessing = 0;
542562
};

Deluge Remote/Resources/Base.lproj/Main.storyboard

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -844,57 +844,6 @@
844844
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" translatesAutoresizingMaskIntoConstraints="NO" id="OTG-zX-gyj">
845845
<rect key="frame" x="0.0" y="238" width="414" height="624"/>
846846
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
847-
<prototypes>
848-
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="default" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="menuCell" id="LlU-rD-ikO" customClass="MenuTableViewCell" customModule="Deluge_Remote" customModuleProvider="target">
849-
<rect key="frame" x="0.0" y="55.333332061767578" width="414" height="43.666667938232422"/>
850-
<autoresizingMask key="autoresizingMask"/>
851-
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="LlU-rD-ikO" id="LoK-C4-tR8">
852-
<rect key="frame" x="0.0" y="0.0" width="414" height="43.666667938232422"/>
853-
<autoresizingMask key="autoresizingMask"/>
854-
<subviews>
855-
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="menu/twitter" translatesAutoresizingMaskIntoConstraints="NO" id="Hd9-3p-eKp">
856-
<rect key="frame" x="20" y="7" width="30" height="30"/>
857-
<constraints>
858-
<constraint firstAttribute="width" constant="30" id="tv0-cT-Lif"/>
859-
<constraint firstAttribute="height" constant="30" id="zvW-eu-PLB"/>
860-
</constraints>
861-
<userDefinedRuntimeAttributes>
862-
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
863-
<integer key="value" value="5"/>
864-
</userDefinedRuntimeAttribute>
865-
</userDefinedRuntimeAttributes>
866-
</imageView>
867-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="@RudyBermudez" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kuv-Pw-PRJ">
868-
<rect key="frame" x="65.000000000000014" y="11.666666666666666" width="132.33333333333337" height="20.333333333333336"/>
869-
<fontDescription key="fontDescription" type="system" pointSize="17"/>
870-
<nil key="textColor"/>
871-
<nil key="highlightedColor"/>
872-
</label>
873-
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="chevron.right" catalog="system" translatesAutoresizingMaskIntoConstraints="NO" id="g1x-oB-rvA">
874-
<rect key="frame" x="374" y="13.999999999999998" width="20" height="16.333333333333329"/>
875-
<color key="tintColor" systemColor="secondaryLabelColor"/>
876-
<constraints>
877-
<constraint firstAttribute="height" constant="20" id="5he-24-3Qk"/>
878-
<constraint firstAttribute="width" constant="20" id="CWI-e6-xPP"/>
879-
</constraints>
880-
</imageView>
881-
</subviews>
882-
<constraints>
883-
<constraint firstItem="g1x-oB-rvA" firstAttribute="centerY" secondItem="LoK-C4-tR8" secondAttribute="centerY" id="8lO-4w-mct"/>
884-
<constraint firstItem="Hd9-3p-eKp" firstAttribute="leading" secondItem="LoK-C4-tR8" secondAttribute="leadingMargin" id="G4w-Kl-Bv3"/>
885-
<constraint firstItem="g1x-oB-rvA" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="kuv-Pw-PRJ" secondAttribute="trailing" constant="15" id="VpG-7q-987"/>
886-
<constraint firstItem="Hd9-3p-eKp" firstAttribute="centerY" secondItem="LoK-C4-tR8" secondAttribute="centerY" id="guL-uS-aeQ"/>
887-
<constraint firstAttribute="trailingMargin" secondItem="g1x-oB-rvA" secondAttribute="trailing" id="hjx-Vj-q7L"/>
888-
<constraint firstItem="kuv-Pw-PRJ" firstAttribute="centerY" secondItem="LoK-C4-tR8" secondAttribute="centerY" id="qUO-wg-Crs"/>
889-
<constraint firstItem="kuv-Pw-PRJ" firstAttribute="leading" secondItem="Hd9-3p-eKp" secondAttribute="trailing" constant="15" id="vlf-47-Xhx"/>
890-
</constraints>
891-
</tableViewCellContentView>
892-
<connections>
893-
<outlet property="icon" destination="Hd9-3p-eKp" id="kpu-gI-YJl"/>
894-
<outlet property="label" destination="kuv-Pw-PRJ" id="irL-sq-vSn"/>
895-
</connections>
896-
</tableViewCell>
897-
</prototypes>
898847
</tableView>
899848
</subviews>
900849
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
@@ -930,7 +879,6 @@
930879
<image name="flags/us" width="16" height="11"/>
931880
<image name="icon" width="40" height="40"/>
932881
<image name="line.horizontal.3.decrease.circle" catalog="system" width="128" height="121"/>
933-
<image name="menu/twitter" width="40" height="40"/>
934882
<image name="settings" width="33.333332061767578" height="33.333332061767578"/>
935883
<systemColor name="groupTableViewBackgroundColor">
936884
<color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>

Deluge Remote/Sources/API/DelugeClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ class DelugeClient {
235235
seal.reject(ClientError.torrentCouldNotBeParsed)
236236
}
237237

238-
case .failure(let error): seal.reject(ClientError.unexpectedError(error.localizedDescription))
238+
case .failure(let error): seal.reject(error)
239239
}
240240
}
241241
}

Deluge Remote/Sources/Models/Cells/ChevronTableViewCell.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ class ChevronCell: TableViewCellBuilder {
5353
self.cell = cell
5454
return cell
5555
}
56+
57+
func registerCell(in tableView: UITableView) {
58+
59+
}
5660
}
5761

5862
class ChevronTableViewCell: UITableViewCell {

Deluge Remote/Sources/Models/Cells/DefaultTableViewCell.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import UIKit
1010

1111
class DefaultCell: TableViewCellBuilder {
12+
1213
var label: String?
1314
var detail: String?
1415

@@ -23,6 +24,10 @@ class DefaultCell: TableViewCellBuilder {
2324
cell.detail.text = detail
2425
return cell
2526
}
27+
28+
func registerCell(in tableView: UITableView) {
29+
}
30+
2631
}
2732

2833
class DefaultTableViewCell: UITableViewCell {

Deluge Remote/Sources/Models/Cells/MenuTableViewCell.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import UIKit
1111

1212
class MenuCell: TableViewCellBuilder {
1313
var label: String
14-
var icon: UIImage
14+
var icon: UIImage?
1515

1616
var onTapped: (()->())?
1717

18-
init(label: String, icon: UIImage, onTap: (()->())? = nil) {
18+
init(label: String, icon: UIImage? = nil, onTap: (()->())? = nil) {
1919
self.label = label
2020
self.icon = icon
2121
self.onTapped = onTap
@@ -27,6 +27,10 @@ class MenuCell: TableViewCellBuilder {
2727
cell.icon.image = icon
2828
return cell
2929
}
30+
31+
func registerCell(in tableView: UITableView) {
32+
tableView.register(UINib(nibName: "MenuTableViewCell", bundle: nil), forCellReuseIdentifier: "menuCell")
33+
}
3034
}
3135

3236
class MenuTableViewCell: UITableViewCell {

0 commit comments

Comments
 (0)