diff options
37 files changed, 274 insertions, 1424 deletions
diff --git a/MobileCydia.app/English.lproj/Localizable.strings b/MobileCydia.app/English.lproj/Localizable.strings index 3f4b44f..4d1250e 100644 --- a/MobileCydia.app/English.lproj/Localizable.strings +++ b/MobileCydia.app/English.lproj/Localizable.strings @@ -116,7 +116,7 @@ "NOT_RATED" = "Not Rated"; "NOTE" = "Note"; "NOT_REPOSITORY" = "Did not Find Repository"; -"NOT_REPOSITORY_EX" = "The indicated repository could not be found. This could be because you are trying to add a legacy Installer repository (these are not supported). Also, this interface is only capable of working with exact repository URLs. If you host a repository and are having issues please contact the author of Cydia with any questions you have."; +"NOT_REPOSITORY_EX" = "The indicated repository could not be found. This could be because you are trying to add a legacy Installer repository (these are not supported). Also, this interface is only capable of working with exact repository URLs."; "OK" = "OK"; "OKAY" = "Okay"; "PACKAGE_CANNOT_BE_FOUND" = "The package %@ cannot be found in your current sources. I might recommend installing more sources."; @@ -191,7 +191,7 @@ "THANK_YOU" = "Thank You"; "QUEUE" = "Queue"; "UNABLE_TO_COMPLY" = "Unable to Comply"; -"UNABLE_TO_COMPLY_EX" = "This operation requires the removal of one or more packages that are required for the continued operation of either Cydia or iOS. In order to continue and force this operation you will need to be activate the Advanced mode under to continue and force this operation you will need to be activate the Advanced mode under Settings."; +"UNABLE_TO_COMPLY_EX" = "This operation requires the removal of one or more packages that are required for the continued operation of either Cydia or iOS. In order to continue and force this operation you will need to be activate the Advanced under Settings."; "UNABLE_TO_LOAD" = "Unable to Load"; "UNKNOWN" = "Unknown"; "UNSAFE" = "Unsafe"; diff --git a/MobileCydia.app/Modes/DOWNGRADE.png b/MobileCydia.app/Modes/DOWNGRADE.png Binary files differdeleted file mode 100644 index 41c0d70..0000000 --- a/MobileCydia.app/Modes/DOWNGRADE.png +++ /dev/null diff --git a/MobileCydia.app/Modes/INSTALL.png b/MobileCydia.app/Modes/INSTALL.png Binary files differdeleted file mode 100644 index a83f354..0000000 --- a/MobileCydia.app/Modes/INSTALL.png +++ /dev/null diff --git a/MobileCydia.app/Modes/NEW_INSTALL.png b/MobileCydia.app/Modes/NEW_INSTALL.png deleted file mode 120000 index 475bda6..0000000 --- a/MobileCydia.app/Modes/NEW_INSTALL.png +++ /dev/null @@ -1 +0,0 @@ -INSTALL.png
\ No newline at end of file diff --git a/MobileCydia.app/Modes/PURGE.png b/MobileCydia.app/Modes/PURGE.png Binary files differdeleted file mode 100644 index 795fa19..0000000 --- a/MobileCydia.app/Modes/PURGE.png +++ /dev/null diff --git a/MobileCydia.app/Modes/REINSTALL.png b/MobileCydia.app/Modes/REINSTALL.png Binary files differdeleted file mode 100644 index 0b7754c..0000000 --- a/MobileCydia.app/Modes/REINSTALL.png +++ /dev/null diff --git a/MobileCydia.app/Modes/REMOVE.png b/MobileCydia.app/Modes/REMOVE.png Binary files differdeleted file mode 100644 index 1b2e691..0000000 --- a/MobileCydia.app/Modes/REMOVE.png +++ /dev/null diff --git a/MobileCydia.app/Modes/UPGRADE.png b/MobileCydia.app/Modes/UPGRADE.png Binary files differdeleted file mode 100644 index 631b7ef..0000000 --- a/MobileCydia.app/Modes/UPGRADE.png +++ /dev/null diff --git a/MobileCydia.app/Sections.plist b/MobileCydia.app/Sections.plist index b160632..4a2e9b5 100644 --- a/MobileCydia.app/Sections.plist +++ b/MobileCydia.app/Sections.plist @@ -105,6 +105,9 @@ <key>Dictionaries (Hunspell)</key> <string>Dictionaries</string> + <key>Addons (Bootlogo)</key> + <string>Addons (BootLogo)</string> + <key>eBooks</key> <string>Books</string> @@ -146,6 +149,9 @@ <key>Cydgets (Lock)</key> <string>Addons (Cydget)</string> + + <key>Themes (App Addons)</key> + <string>Themes (Addons)</string> </dict> </plist> diff --git a/MobileCydia.app/Test b/MobileCydia.app/Test deleted file mode 100755 index 123c7eb..0000000 --- a/MobileCydia.app/Test +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -killall Cydia_ -set -e -rsync -SPaz --copy-links saurik@carrier.saurik.com:menes/cydia/cydia_iphoneos-arm.deb . -dpkg -i cydia_iphoneos-arm.deb -touch /tmp/cydia.log -chown mobile.mobile /tmp/cydia.log -uiopen "${1-cydia://}" -exec tail /var/log/syslog /tmp/cydia.log -fn0 diff --git a/MobileCydia.app/commercial.png b/MobileCydia.app/commercial.png Binary files differdeleted file mode 100644 index 8599f48..0000000 --- a/MobileCydia.app/commercial.png +++ /dev/null diff --git a/MobileCydia.app/console.png b/MobileCydia.app/console.png Binary files differdeleted file mode 100644 index dba3788..0000000 --- a/MobileCydia.app/console.png +++ /dev/null diff --git a/MobileCydia.app/email.png b/MobileCydia.app/email.png Binary files differdeleted file mode 100644 index 1aa20b3..0000000 --- a/MobileCydia.app/email.png +++ /dev/null diff --git a/MobileCydia.app/expanded.png b/MobileCydia.app/expanded.png Binary files differdeleted file mode 100644 index 9efce56..0000000 --- a/MobileCydia.app/expanded.png +++ /dev/null diff --git a/MobileCydia.app/filesystem.png b/MobileCydia.app/filesystem.png Binary files differdeleted file mode 100644 index 1bb23fe..0000000 --- a/MobileCydia.app/filesystem.png +++ /dev/null diff --git a/MobileCydia.app/id.png b/MobileCydia.app/id.png Binary files differdeleted file mode 100644 index f168812..0000000 --- a/MobileCydia.app/id.png +++ /dev/null diff --git a/MobileCydia.app/loading.html b/MobileCydia.app/loading.html deleted file mode 100644 index 33b2637..0000000 --- a/MobileCydia.app/loading.html +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-16"?> -<html><head> - <title>Loading</title> - <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"/> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> - <link rel="stylesheet" type="text/css" href="menes/style.css"/> - <base target="_blank"/> -</head><body> - <div style="padding: 5px 7px"> - <span style="color: #4d4d70; font-weight: normal; font-size: 16px"> - <div style="display: inline-block; background-image: url(menes/indicator-c7ced5-4d4d70.gif); width: 16px; height: 16px; margin: 2px 0 -2px 0"></div> - <span style="margin: 0 4px">Loading...</span> - </span> - </div> -</body></html> diff --git a/MobileCydia.app/manage.html b/MobileCydia.app/manage.html deleted file mode 100644 index 55e7462..0000000 --- a/MobileCydia.app/manage.html +++ /dev/null @@ -1,100 +0,0 @@ -<?xml version="1.0" encoding="UTF-16"?> -<html><head> - <title localize="MANAGE"></title> - <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"/> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> - <script type="text/javascript" src="menes/menes.js"></script> - <script type="text/javascript" src="localize.js"></script> - <base target="_blank"/> - - <style> - body { - background: #c7ced5 url(cydia://uikit-image/UIPinstripe.png); - background-size: 7px 1px; - display: table; - font-family: Helvetica; - height: 337px; - margin: 0; - padding: 0; - -webkit-text-size-adjust: none; - -webkit-user-select: none; - } - - div.page { - display: table-cell; - text-align: center; - margin: 0 auto; - vertical-align: middle; - width: 320px; - } - - a.giant-button { - background-color: rgba(0, 0, 0, .15); - -webkit-border-radius: 10px; - color: #193250; - display: block; - margin: 10px; - text-decoration: none; - } - - a.giant-button > img { - display: inline-block; - float: left; - height: 80px; - margin: 10px -10px 0 10px; - width: 80px; - vertical-align: middle; - } - - a.giant-button > div.contents { - display: inline-block; - width: 190px; - margin: 5px 10px 17px 10px; - } - - a.giant-button > div.contents > label { - display: block; - font-size: 28px; - margin: 8px 0 8px 0; - text-align: center; - text-shadow: rgba(200, 200, 200, 0.75) 1px 1px 0; - } - - a.giant-button > div.contents > div { - display: block; - font-size: 14px; - margin-left: 4px; - text-align: center; - } - </style> -</head><body><div class="page"> -<div class="dialog"> - <div class="panel"> - -<a href="cydia://installed" class="giant-button"> - <img src="packages.png"/> - <div class="contents"> - <label localize="PACKAGES"></label> - <div localize="PACKAGES_EX"></div> - </div> -</a> - -<a href="cydia://sources" class="giant-button"> - <img src="sources.png"/> - <div class="contents"> - <label localize="SOURCES"></label> - <div localize="SOURCES_EX"></div> - </div> -</a> - -<a href="cydia://storage" class="giant-button"> - <img src="storage.png"/> - <div class="contents"> - <label localize="STORAGE"></label> - <div localize="STORAGE_EX"></div> - </div> -</a> - - </div> -</div> -</div></body></html> diff --git a/MobileCydia.app/menes/indicator-c7ced5-4d4d70.gif b/MobileCydia.app/menes/indicator-c7ced5-4d4d70.gif Binary files differdeleted file mode 100644 index e41bb96..0000000 --- a/MobileCydia.app/menes/indicator-c7ced5-4d4d70.gif +++ /dev/null diff --git a/MobileCydia.app/package.html b/MobileCydia.app/package.html deleted file mode 100644 index 985b207..0000000 --- a/MobileCydia.app/package.html +++ /dev/null @@ -1,388 +0,0 @@ -<?xml version="1.0" encoding="UTF-16"?> -<html><head> - <title localize="DETAILS"></title> - <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"/> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> - <link rel="stylesheet" type="text/css" href="menes/style.css"/> - <script type="text/javascript" src="menes/menes.js"></script> - <script type="text/javascript" src="package.js"></script> - <script type="text/javascript" src="localize.js"></script> - <base target="_blank"/> - - <!--script type="text/javascript"> - var count = -1; - var loaded = function() { - if (count++ != 0) - return; - $("#depiction-load").remove(); - $("#depiction-src").css("display", "block"); - } - - var remove = function() { - $(".description").css("display", "block"); - $(".depiction").remove(); - } - </script--> - - <style> - .flip-180 { - -webkit-backface-visibility: hidden; - -webkit-transform: rotateY(180deg); - } - - #icon.flip-180 { - -webkit-transition-duration: 2s; - -webkit-transition-property: transform; - } - - .flip-360 { - -webkit-backface-visibility: hidden; - -webkit-transform: rotateY(360deg); - -webkit-transition-duration: 2s; - -webkit-transition-property: transform; - } - - .fade-out { - opacity: 0; - -webkit-transition-property: opacity; - -webkit-transition-duration: 2s; - } - - .fade-in { - opacity: 1; - -webkit-transition-property: opacity; - -webkit-transition-duration: 2s; - } - - #remove { - margin-top: 7px; - text-align: center; - } - - #indicator { - left: 20px; - position: relative; - top: -5px; - } - - #remove > a { - color: #335588; - text-decoration: none; - } - - #upper-bar { - margin-bottom: 0; - margin-top: 10px; - } - - #lower-bar { - margin-bottom: 10px; - margin-top: 0; - } - - #warnings { - background-color: #ffdddd; - } - - #warnings > div > label { - color: red; - } - - #boundary { - float: left; - height: 64; - width: 64px; - } - - #thumb, - #icon { - background-position: center center; - background-repeat: no-repeat; - height: 64px; - position: absolute; - width: 64px; - } - - #thumb { - -webkit-border-radius: 9px; - } - - /* XXX: this style is out of date */ - #reflection { - height: 59px; - max-width: 60px; - opacity: 0.4; - position: absolute; - -webkit-transform: matrix(1, 0, 0, -1, 0, 0); - width: auto; - } - - #id, #author, #maintainer, #sponsor { - white-space: nowrap; - } - - #header { - background: transparent; - border: none; - position: relative; - } - - #header > div { - padding: 0; - } - - #content { - padding: 5px; - position: absolute; - left: 77px; - width: 232px; - } - - #lower { - margin: 0px 5px; - } - - #name { - margin-bottom: 13px; - font-weight: bold; - font-size: 17px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - - #latest { - color: #335588; - float: left; - } - - a[href].rating { - background: 107px 7px no-repeat url(menes/chevron.png); - } - - .rating { - /*border: 1px solid #999999;*/ - -webkit-border-radius: 6px; - padding: 7px 7px; - margin: -7px 0px; - float: right; - width: 126px; - } - - .rating .back, - .rating .fore, - .rating .star { - background: url(star.png); - } - - .rating .text { - display: inline-block; - color: #4d4d70; - margin: 0 6px; - vertical-align: top; - } - - #rating-done { - padding-left: 12px; - } - - #rating-none, - #rating-done { - display: none; - } - - #depiction-src, - #notice-src { - height: 1px; - width: 320px; - } - - .invisible * { - visibility: hidden; - } - </style> -</head><body class="pinstripe invisible"> -<panel> - -<fieldset id="header"> - <div> - <div id="boundary"> - <div class="flip-0" id="icon"></div> - <div class="flip-180" id="thumb"></div> - <!--img id="reflection"/--> - </div> - - <div id="content"> - <div id="name"></div> - <div id="latest"></div> - - <a class="rating" id="rating-href"> - <div id="rating-none"> - <div class="star"></div><div class="text" localize="NOT_RATED"></div> - </div><div id="rating-done"> - <div class="fore" id="rating-value"></div> - <div class="back"></div> - </div> - </a> - </div> - </div> -</fieldset> - -<fieldset class="mode"> - <a> - <img class="icon" id="mode-src"/><div> - <label localize="PACKAGE_QUEUE"></label> - <label id="mode"></label> - </div></a> -</fieldset> - -<fieldset id="actions"> - <a id="settings"> - <img class="icon" src="settings.png"/><div> - <label localize="CHANGE_PACKAGE_SETTINGS"></label> - </div></a> - - <a id="author-href" class="author" target="_popup"> - <img id="author-icon" class="icon" src="email.png"/><div> - <label localize="AUTHOR"></label> - <label id="author"></label> - </div></a> - - <!--div class="commercial"> - <img class="icon" src="commercial.png"/><div> - <label>This is a commercial package!</label> - </div></div--> - - <a class="console" href="http://cydia.saurik.com/purpose/console/"> - <img class="icon" src="console.png"/><div> - <label localize="CONSOLE_PACKAGE"></label> - </div></a> - - <a id="application"> - <img class="icon"/><div> - <label class="application"></label> - </div></a> -</fieldset> - -<fieldset class="warnings" id="warnings"> - <div id="warning"> - <img class="icon" src="warning.png"/><div> - <label class="warning"></label> - </div></div> -</fieldset> - -<iframe - class="notice" - id="notice-src" - frameborder="0" - width="320" - height="0" - target="_top" -></iframe> - -<!--iframe - class="activation" - id="activation-src" - frameborder="0" - width="320" - height="0" - target="_top" -></iframe--> - -<!--div id="remove" class="depiction"> - <a href="javascript:remove()">Remove Custom Depiction</a> -</div> - -<hr id="upper-bar" class="depiction"/--> - -<iframe - class="depiction" - id="depiction-src" - frameborder="0" - width="320" - height="0" - target="_top" - onload_="loaded()" -></iframe> - -<!--hr id="lower-bar" class="depiction"/--> - -<block class="description"><p id="description"></p></block> - -<fieldset class="description homepage"> - <a class="homepage" id="homepage-href"> - <img class="icon" src="web.png"/><div> - <label localize="MORE_INFORMATION"></label> - </div></a> -</fieldset> - -<label class="installed" localize="INSTALLED_DETAILS"></label> -<fieldset class="installed"> - <div> - <img class="icon" src="version.png"/><div> - <label localize="VERSION"></label> - <label id="installed"></label> - </div></div> - - <a id="files-href"> - <img class="icon" src="filesystem.png"/><div> - <label localize="FILESYSTEM_CONTENT"></label> - </div></a> -</fieldset> - -<label localize="PACKAGE_DETAILS"></label> -<fieldset> - <div> - <img class="icon" src="id.png"/><div> - <label localize="ID"></label> - <label id="id"></label> - </div></div> - - <div class="section"> - <img id="section-src" class="icon"/><div> - <label localize="SECTION"></label> - <label id="section"></label> - </div></div> - - <div class="size"> - <img class="icon" src="expanded.png"/><div> - <label localize="EXPANDED_SIZE"></label> - <label id="size"></label> - </div></div> - - <a id="maintainer-href" class="maintainer" target="_popup"> - <img id="maintainer-icon" class="icon" src="email.png"/><div> - <label localize="MAINTAINER"></label> - <label id="maintainer"></label> - </div></a> - - <a id="sponsor-href" class="sponsor"> - <img class="icon" src="web.png"/><div> - <label localize="SPONSOR"></label> - <label id="sponsor"></label> - </div></a> - - <!--a class="trusted" id="trusted"> - <img class="icon" src="trusted.png"><div> - <label localize="REPOSITORY_SIGNATURE"></label> - </div></a--> - - <div class="trusted"> - <img class="icon" src="trusted.png"><div> - <label> </label> - <label localize="SIGNED_PACKAGE"></label> - </div></div> -</fieldset> - -<label class="source" localize="SOURCE_DETAILS"></label> -<fieldset class="source"> - <div> - <img class="icon" id="source-src"/><div> - <label id="source-name"></label> - </div></div> - - <div class="source-description" id="source-description"></div> -</fieldset> - -</panel> -</body></html> diff --git a/MobileCydia.app/package.js b/MobileCydia.app/package.js deleted file mode 100644 index 7dee044..0000000 --- a/MobileCydia.app/package.js +++ /dev/null @@ -1,290 +0,0 @@ -/*var package = { - "name": "MobileTerminal", - "latest": "286u-5", - "author": { - "name": "Allen Porter", - "address": "allen.porter@gmail.com" - }, - //"depiction": "http://planet-iphones.com/repository/info/chromium1.3.php", - "depiction": "http://cydia.saurik.com/terminal.html", - "longDescription": "this is a sample description", - "homepage": "http://cydia.saurik.com/terminal.html", - "installed": "286u-4", - "id": "mobileterminal", - "section": "Terminal Support", - "size": 552*1024, - "maintainer": { - "name": "Jay Freeman", - "address": "saurik@saurik.com" - }, - "source": { - "name": "Telesphoreo Tangelo", - "description": "Distribution of Unix Software for the iPhone" - } -};*/ - -function space(selector, html, max) { - var node = $(selector); - node.html(html); - var width = node.width(); - if (width > max) { - var spacing = (max - node.width()) / (html.length - 1) + "px"; - node.css("letter-spacing", spacing); - } -} - -var swap_, swap = function (on, off, time) { - setTimeout(swap_(on, off, time), time); -}; - -swap_ = function (on, off, time) { - return function () { - on.className = 'fade-out'; - off.className = 'fade-in'; - swap(off, on, time); - }; -}; - -$(function () { - if (package == null) - return; - - var id = package.id; - var idc = encodeURIComponent(id); - var name = package.name; - var icon = 'cydia://package-icon/' + idc; - - var api = 'http://cydia.saurik.com/api/'; - var capi = 'http://cache.cydia.saurik.com/api/'; - - var support = package.support; - - var regarding = function (type) { - return encodeURIComponent("Cydia/APT(" + type + "): " + name); - }; - - $("#icon").css("background-image", 'url("' + icon + '")'); - //$("#reflection").src("cydia://package-icon/" + idc); - - $("#name").html($.xml(name)); - space("#latest", $.xml(package.latest), 96); - - $.xhr(capi + 'package/' + idc, 'GET', {}, null, { - success: function (value) { - value = eval(value); - - if (typeof value.notice == "undefined") - $(".notice").addClass("deleted"); - else - $("#notice-src").src(value.notice); - - if (typeof value.rating == "undefined") - $(".rating").addClass("deleted"); - else { - $("#rating-load").addClass("deleted"); - $("#rating-href").href(value.reviews); - - var none = $("#rating-none"); - var done = $("#rating-done"); - - if (value.rating == null) { - none.css("display", "block"); - } else { - done.css("display", "block"); - - $("#rating-value").css('width', 16 * value.rating); - } - } - - if (typeof value.icon != "undefined" && value.icon != null) { - var icon = $("#icon"); - var thumb = $("#thumb"); - - icon[0].className = 'flip-180'; - thumb[0].className = 'flip-360'; - - thumb.css("background-image", 'url("' + value.icon + '")'); - - setTimeout(function () { - icon.addClass("deleted"); - thumb[0].className = 'flip-0'; - }, 2000); - } - }, - - failure: function (status) { - $(".rating").addClass("deleted"); - } - }); - - $("#settings").href("cydia://package/" + idc + "/settings"); - - var mode = package.mode; - if (mode == null) - $(".mode").addClass("deleted"); - else { - $("#mode").html(cydia.localize(mode)); - $("#mode-src").src("Modes/" + mode + ".png"); - } - - var warnings = package.warnings; - var length = warnings == null ? 0 : warnings.length; - if (length == 0) - $(".warnings").addClass("deleted"); - else { - var parent = $("#warnings"); - var child = $("#warning"); - - for (var i = 0; i != length; ++i) { - var clone = child.clone(true); - clone.addClass("inserted"); - parent.append(clone); - clone.xpath("./div/label").html($.xml(warnings[i])); - } - - child.addClass("deleted"); - } - - var applications = package.applications; - var length = applications == null ? 0 : applications.length; - - var child = $("#application"); - - /*if (length != 0) { - var parent = $("#actions"); - - for (var i = 0; i != length; ++i) { - var application = applications[i]; - var clone = child.clone(true); - parent.append(clone); - clone.href("cydia://launch/" + application[0]); - clone.xpath("label").html("Run " + $.xml(application[1])); - clone.xpath("img").src(application[2]); - } - }*/ - - child.addClass("deleted"); - - var commercial = package.hasTag('cydia::commercial'); - if (!commercial) - $(".commercial").addClass("deleted"); - - var _console = package.hasTag('purpose::console'); - if (!_console) - $(".console").addClass("deleted"); - - var author = package.author; - if (author == null) - $(".author").addClass("deleted"); - else { - space("#author", $.xml(author.name), 160); - if (author.address == null) - $("#author-icon").addClass("deleted"); - else if (support == null) - $("#author-href").href("mailto:" + author.address + "?subject=" + regarding("A")); - else - $("#author-href").href(support); - } - - /*var store = commercial; - if (!store) - $(".activation").addClass("deleted"); - else { - var activation = api + 'activation/' + idc; - $("#activation-src").src(activation); - }*/ - - var depiction = package.depiction; - if (depiction != null) { - $(".description").addClass("deleted"); - $("#depiction-src").src(depiction); - } else { - $(".depiction").addClass("deleted"); - - var description = package.longDescription; - if (description == null) - description = package.shortDescription; - - if (description == null) - $(".description").addClass("deleted"); - else { - description = $.xml(description).replace(/\n/g, "<br/>"); - $("#description").html(description); - } - } - - var homepage = package.homepage; - if (homepage == null) - $(".homepage").addClass("deleted"); - else - $("#homepage-href").href(homepage); - - var installed = package.installed; - if (installed == null) - $(".installed").addClass("deleted"); - else { - $("#installed").html($.xml(installed)); - $("#files-href").href("cydia://package/" + idc + "/files"); - } - - space("#id", $.xml(id), 220); - - var section = package.longSection; - if (section == null) - $(".section").addClass("deleted"); - else { - $("#section-src").src("cydia://section-icon/" + encodeURIComponent(section)); - $("#section").html($.xml(section)); - } - - var size = package.size; - if (size == 0) - $(".size").addClass("deleted"); - else - $("#size").html(size / 1024 + " kB"); - - var maintainer = package.maintainer; - if (maintainer == null) - $(".maintainer").addClass("deleted"); - else { - space("#maintainer", $.xml(maintainer.name), 153); - if (maintainer.address == null) - $("#maintainer-icon").addClass("deleted"); - else if (support == null) - $("#maintainer-href").href("mailto:" + maintainer.address + "?subject=" + regarding("M")); - else - $("#maintainer-href").href(support); - } - - var sponsor = package.sponsor; - if (sponsor == null) - $(".sponsor").addClass("deleted"); - else { - space("#sponsor", $.xml(sponsor.name), 152); - $("#sponsor-href").href(sponsor.address); - } - - var source = package.source; - if (source == null) { - $(".source").addClass("deleted"); - $(".trusted").addClass("deleted"); - } else { - var host = source.host; - - $("#source-src").src("cydia://source-icon/" + encodeURIComponent(host)); - $("#source-name").html($.xml(source.name)); - - if (source.trusted) - $("#trusted").href("cydia://package/" + idc + "/signature"); - else - $(".trusted").addClass("deleted"); - - var description = source.description; - if (description == null) - $(".source-description").addClass("deleted"); - else - $("#source-description").html($.xml(description)); - } - - $("body").removeClass("invisible"); -}); diff --git a/MobileCydia.app/packages.png b/MobileCydia.app/packages.png Binary files differdeleted file mode 100644 index 404fe0c..0000000 --- a/MobileCydia.app/packages.png +++ /dev/null diff --git a/MobileCydia.app/settings.png b/MobileCydia.app/settings.png Binary files differdeleted file mode 100644 index 86f4e78..0000000 --- a/MobileCydia.app/settings.png +++ /dev/null diff --git a/MobileCydia.app/signature.html b/MobileCydia.app/signature.html deleted file mode 100644 index aa113b8..0000000 --- a/MobileCydia.app/signature.html +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-16"?> -<html><head> - <title>Signature</title> - <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"/> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> - <link rel="stylesheet" type="text/css" href="menes/style.css"/> - <script type="text/javascript" src="menes/menes.js"></script> - <script type="text/javascript" src="signature.js"></script> - <base target="_blank"/> -</head><body><div class="page"> -<div class="dialog"> - <div class="panel"> - - </div> -</div> -</div></body></html> diff --git a/MobileCydia.app/sources.png b/MobileCydia.app/sources.png Binary files differdeleted file mode 100644 index e8422e4..0000000 --- a/MobileCydia.app/sources.png +++ /dev/null diff --git a/MobileCydia.app/star.png b/MobileCydia.app/star.png Binary files differdeleted file mode 100644 index f762a24..0000000 --- a/MobileCydia.app/star.png +++ /dev/null diff --git a/MobileCydia.app/storage.html b/MobileCydia.app/storage.html deleted file mode 100644 index 55ac5ab..0000000 --- a/MobileCydia.app/storage.html +++ /dev/null @@ -1,237 +0,0 @@ -<?xml version="1.0" encoding="UTF-16"?> -<html><head> - <title localize="STORAGE"></title> - <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"/> - <link rel="stylesheet" type="text/css" href="menes/style.css"/> - <script type="text/javascript" src="menes/menes.js"></script> - <script type="text/javascript" src="storage.js"></script> - <script type="text/javascript" src="localize.js"></script> - <base target="_blank"/> - - <style> - body { - display: table; - font-family: Helvetica; - height: 337px; - margin: 0; - padding: 0; - -webkit-text-size-adjust: none; - -webkit-user-select: none; - } - - div.page { - display: table-cell; - text-align: center; - margin: 0 auto; - vertical-align: middle; - width: 320px; - } - - a.giant-button { - background-color: rgba(0, 0, 0, 0.15); - -webkit-border-radius: 10px; - color: #193250; - display: block; - margin: 8px 10px; - position: relative; - text-decoration: none; - width: 300px; - } - - a.giant-button > piechart { - float: left; - margin: 10px; - vertical-align: middle; - } - - a.giant-button > label { - display: block; - float: left; - font-size: 25px; - margin: 10px 0 4px 4px; - text-align: center; - text-shadow: rgba(200, 200, 200, 0.75) 1px 1px 0; - width: 155px; - } - - a.giant-button > div.text { - display: block; - float: left; - font-size: 14px; - margin-left: 4px; - text-align: center; - width: 155px; - } - - div.key { - display: inline-block; - width: 50%; - } - - a.giant-button > div.legend { - float: left; - font-size: 14px; - left: 15px; - position: absolute; - top: 120px; - width: 290px; - } - - div.key { - margin-bottom: 4px; - } - - piechart { - /*-webkit-transform: rotate(-5deg);*/ - /*-webkit-transform: rotateY(15deg) rotateX(-45deg);*/ - } - - piechart > div { - -webkit-border-radius: 50px; - height: 100px; - overflow: hidden; - position: relative; - width: 100px; - } - - piechart > div > div:first-child { - height: 100px; - overflow: hidden; - position: absolute; - z-index: 102; - width: 51px; - } - - piechart > div > div:last-child { - height: 100px; - overflow: hidden; - position: absolute; - width: 100px; - z-index: 0; - } - - piechart > div div.lslice, - piechart > div div.rslice, - piechart > div div.tslice, - piechart > div div.bslice { - background-color: #4d4d70; - } - - piechart > div div.lslice, - piechart > div div.rslice, - piechart > div div.tslice, - piechart > div div.bslice, - piechart > div div.xslice { - /* XXX: technically, these aren't needed */ - -webkit-border-bottom-left-radius: 50px; - -webkit-border-top-left-radius: 50px; - height: 100px; - position: absolute; - -webkit-transform-origin: 100% 50%; - width: 50px; - } - - piechart > div div.lslice { - z-index: 100; - } - - piechart > div div.rslice, - piechart > div div.tslice, - piechart > div div.bslice { - z-index: 0; - } - - piechart > div div.rslice { - -webkit-transform: rotate(180deg); - } - - piechart > div div.tslice { - -webkit-transform: rotate(90deg); - } - - piechart > div div.bslice { - -webkit-transform: rotate(270deg); - } - - piechart > div > div.nslice { - position: absolute; - text-align: center; - top: 42px; - width: 100px; - z-index: 103; - } - - piechart > div > div.nslice > div { - background-color: rgba(255, 255, 255, 0.7); - -webkit-border-radius: 7px; - display: inline; - color: black; - font-size: 15px; - font-weight: bold; - margin: 0 auto; - padding: 2px 4px; - text-align: center; - } - - div.color { - background-color: black; - border: 1px solid #4d4d70; - display: inline-block; - vertical-align: middle; - } - - div.color > div { - border: 1px solid white; - display: inline-block; - height: 12px; - width: 12px; - } - - div.name { - display: inline-block; - font-size: 14px; - margin-left: 5px; - vertical-align: middle; - } - </style> -</head><body class="pinstripe"> -<panel> - -<a class="giant-button" style="height: 149px"> - <piechart><div> - <div id="system-left"></div> - <div id="system-right"> - <div class="lslice"></div> - <div class="rslice"></div> - <div class="tslice"></div> - <div class="bslice"></div> - </div> - <div class="nslice"><div id="system-size"></div></div> - </div></piechart> - - <label>System</label> - <div class="text">A small partition used to store iPhone OS. Cydia adds a few important programs and libraries.</div> - - <div class="legend" id="system-legend"></div> -</a> - -<a class="giant-button" style="height: 189px"> - <piechart><div> - <div id="private-left"></div> - <div id="private-right"> - <div class="lslice"></div> - <div class="rslice"></div> - <div class="tslice"></div> - <div class="bslice"></div> - </div> - <div class="nslice"><div id="private-size"></div></div> - </div></piechart> - - <label>Private</label> - <div class="text">Most content is stored on this partition: from applications (Cydia and Apple) to multimedia.</div> - - <div class="legend" id="private-legend"></div> -</a> - -</panel> -</body></html> diff --git a/MobileCydia.app/storage.js b/MobileCydia.app/storage.js deleted file mode 100644 index ae8cb85..0000000 --- a/MobileCydia.app/storage.js +++ /dev/null @@ -1,88 +0,0 @@ -var colors = ["#9090e0", "#4d4d70", "#7d7da0", "#7da0e0", "#d0d0f0", "#7070e0"]; - -var list = function (legend, color, name, value) { - legend.append('<div class="key">' + - '<div class="color" style="background-color: ' + color + '"><div></div></div>' + - '<div class="name">' + name + ' (' + Math.round(value * 1000) / 10 + '%)</div>' + - '</div>'); -}; - -console.log(cydia.statfs("/")); - -var cut = function (parent, color, fraction, z) { - var deg = Math.round(360 * fraction); - if (deg < 2) - deg = 2; - parent.append('<div class="xslice" style="' + - 'background-color: ' + color + ';' + - '-webkit-transform: rotate(' + deg + 'deg);' + - 'z-index: ' + z + ';' + - '"></div>'); -}; - -var chart = function (right, left, slices) { - var total = 0; - for (var i = 0; i != slices.length; ++i) { - var slice = slices[i]; - var z = slices.length - i; - if (slice[1] > 0.5) - cut(right, slice[0], total + 0.5, z); - total += slice[1]; - cut(total > 0.5 ? left : right, slice[0], total, z); - } -}; - -var setup = function (name, root, folders) { - var size = $("#" + name + "-size"); - var statfs = cydia.statfs(root); - var kb = statfs[0] * statfs[1] / 1024; - var total = kb / 1024; - - var unit; - if (total < 1000) - unit = 'M'; - else { - total = total / 1024; - unit = 'G' - } - - size.html(Math.round(total * 10) / 10 + " " + unit); - - var legend = $("#" + name + "-legend"); - var used = 0; - - var slices = []; - - if (folders != null) - for (var i = 0; i != folders.length; ++i) { - var folder = folders[i]; - var usage = cydia.du(folder[1]); - if (usage == null) - usage = 0; - var color = colors[i + 2]; - var percent = usage / kb; - list(legend, color, folder[0], percent); - slices.push([color, percent]); - used += usage; - } - - var free = statfs[0] * statfs[2] / 1024; - var other = (kb - free - used) / kb; - - slices.push([colors[0], other]); - chart($("#" + name + "-right"), $("#" + name + "-left"), slices); - - list(legend, colors[0], folders == null ? "Used" : "Other", other); - list(legend, colors[1], "Free", statfs[2] / statfs[1]); -}; - -$(function () { - setup("system", "/", null); - - setup("private", "/private/var", [ - ["Themes", "/Library/Themes/"], - ["iTunes", "/var/mobile/Media/iTunes_Control/"], - ["App Store", "/var/mobile/Applications/"], - ["Camera", "/var/mobile/Media/DCIM/"] - ]); -}); diff --git a/MobileCydia.app/storage.png b/MobileCydia.app/storage.png Binary files differdeleted file mode 100644 index 3cefef0..0000000 --- a/MobileCydia.app/storage.png +++ /dev/null diff --git a/MobileCydia.app/trusted.png b/MobileCydia.app/trusted.png Binary files differdeleted file mode 100644 index de249eb..0000000 --- a/MobileCydia.app/trusted.png +++ /dev/null diff --git a/MobileCydia.app/version.png b/MobileCydia.app/version.png Binary files differdeleted file mode 100644 index fd1eec1..0000000 --- a/MobileCydia.app/version.png +++ /dev/null diff --git a/MobileCydia.app/warning.png b/MobileCydia.app/warning.png Binary files differdeleted file mode 100644 index 8d3e5df..0000000 --- a/MobileCydia.app/warning.png +++ /dev/null diff --git a/MobileCydia.app/web.png b/MobileCydia.app/web.png Binary files differdeleted file mode 100644 index a4f04e3..0000000 --- a/MobileCydia.app/web.png +++ /dev/null diff --git a/MobileCydia.mm b/MobileCydia.mm index ccec42b..bb01abd 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -1,5 +1,5 @@ /* Cydia - iPhone UIKit Front-End for Debian APT - * Copyright (C) 2008-2010 Jay Freeman (saurik) + * Copyright (C) 2008-2011 Jay Freeman (saurik) */ /* Modified BSD License {{{ */ @@ -402,6 +402,7 @@ static const CFStringCompareFlags LaxCompareFlags_ = kCFCompareCaseInsensitive | #define ShowInternals (0 && !ForRelease) #define IgnoreInstall (0 && !ForRelease) #define AlwaysReload (0 && !ForRelease) +#define TryIndexedCollation (0 && !ForRelease) #if !TraceLogging #undef _trace @@ -1071,7 +1072,7 @@ static _transient NSMutableDictionary *Sources_; static bool Changed_; static time_t now_; -static bool IsWildcat_; +bool IsWildcat_; /* }}} */ /* Display Helpers {{{ */ @@ -1184,7 +1185,6 @@ bool isSectionVisible(NSString *section) { @protocol CydiaDelegate - (void) retainNetworkActivityIndicator; - (void) releaseNetworkActivityIndicator; -- (void) setPackageController:(CYPackageController *)view; - (void) clearPackage:(Package *)package; - (void) installPackage:(Package *)package; - (void) installPackages:(NSArray *)packages; @@ -2735,6 +2735,8 @@ struct PackageNameOrdering : if (range.location != NSNotFound) return YES; + [self parse]; + range = [[self shortDescription] rangeOfString:text options:MatchCompareOptions_]; if (range.location != NSNotFound) return YES; @@ -4104,18 +4106,16 @@ static NSString *Warning_; WebDataSource *source([frame dataSource]); NSURLResponse *response([source response]); + NSURL *url([response URL]); NSString *scheme([url scheme]); - - NSHTTPURLResponse *http; - if (scheme != nil && ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"])) - http = (NSHTTPURLResponse *) response; - else - http = nil; - - NSDictionary *headers([http allHeaderFields]); NSString *host([url host]); - [self setHeaders:headers forHost:host]; + + if ([response isKindOfClass:[NSHTTPURLResponse class]]) { + NSHTTPURLResponse *http((NSHTTPURLResponse *) response); + NSDictionary *headers([http allHeaderFields]); + [self setHeaders:headers forHost:host]; + } if ( [host isEqualToString:@"cydia.saurik.com"] || @@ -4498,7 +4498,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { //[status_ setFont:font]; output_ = [[UITextView alloc] init]; - [output_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth]; //[output_ setTextFont:@"Courier New"]; [output_ setFont:[[output_ font] fontWithSize:12]]; @@ -4544,7 +4543,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { 10, 20, bounds.size.width - 20, - bounds.size.height - 62 + bounds.size.height - 96 )]; [close_ setFrame:CGRectMake( (bounds.size.width - closewidth) / 2, @@ -5442,8 +5441,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) release { - if ([self retainCount] == 1) - [delegate_ setPackageController:self]; [super release]; } @@ -5544,11 +5541,16 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } #endif +- (void) viewWillAppear:(BOOL)animated { + if (![self hasLoaded]) + [self loadURL:[NSURL URLWithString:CydiaURL(@"ui/package/")]]; + [super viewWillAppear:animated]; +} + - (id) initWithDatabase:(Database *)database { if ((self = [super init]) != nil) { database_ = database; buttons_ = [[NSMutableArray alloc] initWithCapacity:4]; - [self loadURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"package" ofType:@"html"]]]; } return self; } @@ -5610,14 +5612,16 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) reloadData { + [super reloadData]; + [self setPackage:[database_ packageWithName:name_]]; } @end /* }}} */ -/* Package Table {{{ */ -@interface PackageTable : UIView < +/* Package List Controller {{{ */ +@interface PackageListController : CYViewController < UITableViewDataSource, UITableViewDelegate > { @@ -5628,29 +5632,16 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { UITableView *list_; NSMutableArray *index_; NSMutableDictionary *indices_; - // XXX: this target_ seems to be delegate_. :( - _transient id target_; - SEL action_; - // XXX: why do we even have this delegate_? - _transient id delegate_; + NSString *title_; } -- (id) initWithFrame:(CGRect)frame database:(Database *)database target:(id)target action:(SEL)action; - +- (id) initWithDatabase:(Database *)database title:(NSString *)title; - (void) setDelegate:(id)delegate; - -- (void) reloadData; - (void) resetCursor; -- (UITableView *) list; - -- (void) setShouldHideHeaderInShortLists:(BOOL)hide; - -- (void) deselectWithAnimation:(BOOL)animated; - @end -@implementation PackageTable +@implementation PackageListController - (void) dealloc { [packages_ release]; @@ -5658,13 +5649,98 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [list_ release]; [index_ release]; [indices_ release]; + [title_ release]; [super dealloc]; } +- (void) deselectWithAnimation:(BOOL)animated { + [list_ deselectRowAtIndexPath:[list_ indexPathForSelectedRow] animated:animated]; +} + +- (void) resizeForKeyboardBounds:(CGRect)bounds duration:(NSTimeInterval)duration curve:(UIViewAnimationCurve)curve { + CGRect base = [[self view] bounds]; + base.size.height -= bounds.size.height; + base.origin = [list_ frame].origin; + + [UIView beginAnimations:nil context:NULL]; + [UIView setAnimationBeginsFromCurrentState:YES]; + [UIView setAnimationCurve:curve]; + [UIView setAnimationDuration:duration]; + [list_ setFrame:base]; + [UIView commitAnimations]; +} + +- (void) resizeForKeyboardBounds:(CGRect)bounds duration:(NSTimeInterval)duration { + [self resizeForKeyboardBounds:bounds duration:duration curve:UIViewAnimationCurveLinear]; +} + +- (void) resizeForKeyboardBounds:(CGRect)bounds { + [self resizeForKeyboardBounds:bounds duration:0]; +} + +- (void) keyboardWillShow:(NSNotification *)notification { + CGRect bounds; + CGPoint center; + NSTimeInterval duration; + UIViewAnimationCurve curve; + [[[notification userInfo] objectForKey:UIKeyboardBoundsUserInfoKey] getValue:&bounds]; + [[[notification userInfo] objectForKey:UIKeyboardCenterEndUserInfoKey] getValue:¢er]; + [[[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] getValue:&curve]; + [[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&duration]; + + CGRect kbframe = CGRectMake(round(center.x - bounds.size.width / 2.0), round(center.y - bounds.size.height / 2.0), bounds.size.width, bounds.size.height); + UIViewController *base = self; + while ([base parentViewController] != nil) + base = [base parentViewController]; + CGRect viewframe = [[base view] convertRect:[list_ frame] fromView:[list_ superview]]; + CGRect intersection = CGRectIntersection(viewframe, kbframe); + + [self resizeForKeyboardBounds:intersection duration:duration curve:curve]; +} + +- (void) keyboardWillHide:(NSNotification *)notification { + NSTimeInterval duration; + UIViewAnimationCurve curve; + [[[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] getValue:&curve]; + [[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&duration]; + + [self resizeForKeyboardBounds:CGRectZero duration:duration curve:curve]; +} + +- (void) viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + + [self resizeForKeyboardBounds:CGRectZero]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; +} + +- (void) viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; + + [self resizeForKeyboardBounds:CGRectZero]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil]; +} + +- (void) viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + [self deselectWithAnimation:animated]; +} + +- (void) didSelectPackage:(Package *)package { + CYPackageController *view([[[CYPackageController alloc] initWithDatabase:database_] autorelease]); + [view setPackage:package]; + [view setDelegate:delegate_]; + [[self navigationController] pushViewController:view animated:YES]; +} + +#if TryIndexedCollation + (BOOL) hasIndexedCollation { return NO; // XXX: objc_getClass("UILocalizedIndexedCollation") != nil; } +#endif - (NSInteger) numberOfSectionsInTableView:(UITableView *)list { NSInteger count([sections_ count]); @@ -5702,15 +5778,10 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { return cell; } -- (void) deselectWithAnimation:(BOOL)animated { - [list_ deselectRowAtIndexPath:[list_ indexPathForSelectedRow] animated:animated]; -} - -- (NSIndexPath *) tableView:(UITableView *)table willSelectRowAtIndexPath:(NSIndexPath *)path { +- (void) tableView:(UITableView *)table didSelectRowAtIndexPath:(NSIndexPath *)path { Package *package([self packageAtIndexPath:path]); package = [database_ packageWithName:[package id]]; - [target_ performSelector:action_ withObject:package]; - return path; + [self didSelectPackage:package]; } - (NSArray *) sectionIndexTitlesForTableView:(UITableView *)tableView { @@ -5719,32 +5790,37 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (NSInteger) tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index { +#if TryIndexedCollation if ([[self class] hasIndexedCollation]) { return [[objc_getClass("UILocalizedIndexedCollation") currentCollation] sectionForSectionIndexTitleAtIndex:index]; } +#endif return index; } -- (id) initWithFrame:(CGRect)frame database:(Database *)database target:(id)target action:(SEL)action { - if ((self = [super initWithFrame:frame]) != nil) { +- (id) initWithDatabase:(Database *)database title:(NSString *)title { + if ((self = [super init]) != nil) { database_ = database; + title_ = [title copy]; + [[self navigationItem] setTitle:title_]; - target_ = target; - action_ = action; +#if TryIndexedCollation + if ([[self class] hasIndexedCollation]) + index_ = [[[objc_getClass("UILocalizedIndexedCollation") currentCollation] sectionIndexTitles] retain] + else +#endif + index_ = [[NSMutableArray alloc] initWithCapacity:32]; - index_ = [[self class] hasIndexedCollation] - ? [[[objc_getClass("UILocalizedIndexedCollation") currentCollation] sectionIndexTitles] retain] - : [[NSMutableArray alloc] initWithCapacity:32]; indices_ = [[NSMutableDictionary alloc] initWithCapacity:32]; packages_ = [[NSMutableArray arrayWithCapacity:16] retain]; sections_ = [[NSMutableArray arrayWithCapacity:16] retain]; - list_ = [[UITableView alloc] initWithFrame:[self bounds] style:UITableViewStylePlain]; + list_ = [[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStylePlain]; [list_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth]; [list_ setRowHeight:73]; - [self addSubview:list_]; + [[self view] addSubview:list_]; [list_ setDataSource:self]; [list_ setDelegate:self]; @@ -5760,6 +5836,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) reloadData { + [super reloadData]; + era_ = [database_ era]; NSArray *packages = [database_ packages]; @@ -5776,6 +5854,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { Section *section = nil; +#if TryIndexedCollation if ([[self class] hasIndexedCollation]) { id collation = [objc_getClass("UILocalizedIndexedCollation") currentCollation]; NSArray *titles = [collation sectionIndexTitles]; @@ -5806,7 +5885,9 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [section addToCount]; } _end - } else { + } else +#endif + { [index_ removeAllObjects]; _profile(PackageTable$reloadData$Section) @@ -5846,18 +5927,10 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [list_ scrollRectToVisible:CGRectMake(0, 0, 0, 0) animated:NO]; } -- (UITableView *) list { - return list_; -} - -- (void) setShouldHideHeaderInShortLists:(BOOL)hide { - //XXX:[list_ setShouldHideHeaderInShortLists:hide]; -} - @end /* }}} */ -/* Filtered Package Table {{{ */ -@interface FilteredPackageTable : PackageTable { +/* Filtered Package List Controller {{{ */ +@interface FilteredPackageListController : PackageListController { SEL filter_; IMP imp_; id object_; @@ -5866,11 +5939,11 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { - (void) setObject:(id)object; - (void) setObject:(id)object forFilter:(SEL)filter; -- (id) initWithFrame:(CGRect)frame database:(Database *)database target:(id)target action:(SEL)action filter:(SEL)filter with:(id)object; +- (id) initWithDatabase:(Database *)database title:(NSString *)title filter:(SEL)filter with:(id)object; @end -@implementation FilteredPackageTable +@implementation FilteredPackageListController - (void) dealloc { if (object_ != nil) @@ -5908,95 +5981,16 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { _end } -- (id) initWithFrame:(CGRect)frame database:(Database *)database target:(id)target action:(SEL)action filter:(SEL)filter with:(id)object { - if ((self = [super initWithFrame:frame database:database target:target action:action]) != nil) { +- (id) initWithDatabase:(Database *)database title:(NSString *)title filter:(SEL)filter with:(id)object { + if ((self = [super initWithDatabase:database title:title]) != nil) { [self setFilter:filter]; - object_ = [object retain]; + [self setObject:object]; [self reloadData]; } return self; } @end /* }}} */ -/* Filtered Package Controller {{{ */ -@interface FilteredPackageController : CYViewController { - _transient Database *database_; - FilteredPackageTable *packages_; - NSString *title_; - SEL filter_; - id object_; -} - -- (id) initWithDatabase:(Database *)database title:(NSString *)title filter:(SEL)filter with:(id)object; - -@end - -@implementation FilteredPackageController - -- (void) dealloc { - [self releaseSubviews]; - [title_ release]; - - [super dealloc]; -} - -- (void) viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; - [packages_ deselectWithAnimation:animated]; -} - -- (void) didSelectPackage:(Package *)package { - CYPackageController *view([[[CYPackageController alloc] initWithDatabase:database_] autorelease]); - [view setPackage:package]; - [view setDelegate:delegate_]; - [[self navigationController] pushViewController:view animated:YES]; -} - -- (void) loadView { - [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]]; - - packages_ = [[FilteredPackageTable alloc] - initWithFrame:[[self view] bounds] - database:database_ - target:self - action:@selector(didSelectPackage:) - filter:filter_ - with:object_ - ]; - [packages_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth]; - [[self view] addSubview:packages_]; -} - -- (void) viewDidLoad { - [[self navigationItem] setTitle:title_]; -} - -- (void) releaseSubviews { - [packages_ release]; -} - -- (id) initWithDatabase:(Database *)database title:(NSString *)title filter:(SEL)filter with:(id)object { - if ((self = [super init]) != nil) { - database_ = database; - title_ = [title copy]; - filter_ = filter; - object_ = object; - } return self; -} - -- (void) reloadData { - [super reloadData]; - [packages_ reloadData]; -} - -- (void) setDelegate:(id)delegate { - [super setDelegate:delegate]; - [packages_ setDelegate:delegate]; -} - -@end - -/* }}} */ /* Home Controller {{{ */ @interface HomeController : CYBrowserController { @@ -6005,7 +5999,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { @implementation HomeController -+ (BOOL)shouldHideNavigationBar { ++ (BOOL) shouldHideNavigationBar { return NO; } @@ -6032,7 +6026,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [alert setCancelButtonIndex:0]; [alert setMessage: - @"Copyright (C) 2008-2010\n" + @"Copyright (C) 2008-2011\n" "Jay Freeman (saurik)\n" "saurik@saurik.com\n" "http://www.saurik.com/" @@ -6041,13 +6035,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [alert show]; } -- (void) viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - - if ([[self class] shouldHideNavigationBar]) - [[self navigationController] setNavigationBarHidden:YES animated:animated]; -} - - (void) viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; @@ -6055,17 +6042,23 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [[self navigationController] setNavigationBarHidden:NO animated:animated]; } -- (id) init { - if ((self = [super init]) != nil) { - [self loadURL:[NSURL URLWithString:CydiaURL(@"")]]; +- (void) viewWillAppear:(BOOL)animated { + if (![self hasLoaded]) + [self loadURL:[NSURL URLWithString:CydiaURL(@"ui/home/")]]; - [[self navigationItem] setLeftBarButtonItem:[[[UIBarButtonItem alloc] - initWithTitle:UCLocalize("ABOUT") - style:UIBarButtonItemStylePlain - target:self - action:@selector(aboutButtonClicked) - ] autorelease]]; - } return self; + [super viewWillAppear:animated]; + + if ([[self class] shouldHideNavigationBar]) + [[self navigationController] setNavigationBarHidden:YES animated:animated]; +} + +- (void) viewDidLoad { + [[self navigationItem] setLeftBarButtonItem:[[[UIBarButtonItem alloc] + initWithTitle:UCLocalize("ABOUT") + style:UIBarButtonItemStylePlain + target:self + action:@selector(aboutButtonClicked) + ] autorelease]]; } @end @@ -6083,21 +6076,24 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { return [NSURL URLWithString:@"cydia://manage"]; } -- (id) init { - if ((self = [super init]) != nil) { - [[self navigationItem] setTitle:UCLocalize("MANAGE")]; +- (void) viewWillAppear:(BOOL)animated { + if (![self hasLoaded]) + [self loadURL:[NSURL URLWithString:CydiaURL(@"ui/manage/")]]; - [self loadURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"manage" ofType:@"html"]]]; + [super viewWillAppear:animated]; +} - [[self navigationItem] setLeftBarButtonItem:[[[UIBarButtonItem alloc] - initWithTitle:UCLocalize("SETTINGS") - style:UIBarButtonItemStylePlain - target:self - action:@selector(settingsButtonClicked) - ] autorelease]]; +- (void) viewDidLoad { + [[self navigationItem] setTitle:UCLocalize("MANAGE")]; - [self queueStatusDidChange]; - } return self; + [[self navigationItem] setLeftBarButtonItem:[[[UIBarButtonItem alloc] + initWithTitle:UCLocalize("SETTINGS") + style:UIBarButtonItemStylePlain + target:self + action:@selector(settingsButtonClicked) + ] autorelease]]; + + [self queueStatusDidChange]; } - (void) settingsButtonClicked { @@ -6110,11 +6106,11 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) applyLoadingTitle { - // No "Loading" title. + // Disable "Loading" title. } - (void) applyRightButton { - // No right button. + // Disable right button. } #endif @@ -6134,6 +6130,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (bool) isLoading { + // Never show as loading. return false; } @@ -6273,7 +6270,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { id root_; } -- (NSArray *) navigationURLItems; +- (NSArray *) navigationURLCollection; - (void) dropBar:(BOOL)animated; - (void) beginUpdate; - (void) raiseBar:(BOOL)animated; @@ -6283,12 +6280,12 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { @implementation CYTabBarController -- (NSArray *) navigationURLItems { +- (NSArray *) navigationURLCollection { NSMutableArray *items([NSMutableArray array]); - // XXX:Deal with transient view controllers. + // XXX: Should this deal with transient view controllers? for (id navigation in [self viewControllers]) { - NSArray *stack = [navigation performSelector:@selector(navigationURLStack)]; + NSArray *stack = [navigation performSelector:@selector(navigationURLCollection)]; if (stack != nil) [items addObject:stack]; } @@ -6297,15 +6294,19 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) reloadData { - size_t count([[self viewControllers] count]); - for (size_t i(0); i != count; ++i) { - CYNavigationController *page([[self viewControllers] objectAtIndex:(count - i - 1)]); - [page reloadData]; - } + for (CYViewController *controller in [self viewControllers]) + [controller reloadData]; [(CYNavigationController *)[self transientViewController] reloadData]; } +- (void) dealloc { + [refreshbar_ release]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + [super dealloc]; +} + - (id) initWithDatabase:(Database *)database { if ((self = [super init]) != nil) { database_ = database; @@ -6530,12 +6531,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } } -- (void) dealloc { - [refreshbar_ release]; - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [super dealloc]; -} - @end /* }}} */ /* Cydia Navigation Controller {{{ */ @@ -6544,7 +6539,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { _transient id<UINavigationControllerDelegate> delegate_; } -- (NSArray *) navigationURLStack; +- (NSArray *) navigationURLCollection; - (id) initWithDatabase:(Database *)database; - (void) reloadData; @@ -6557,7 +6552,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [super dealloc]; } -- (NSArray *) navigationURLStack { +- (NSArray *) navigationURLCollection { NSMutableArray *stack([NSMutableArray array]); for (CYViewController *controller in [self viewControllers]) { @@ -6570,10 +6565,9 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) reloadData { - size_t count([[self viewControllers] count]); - for (size_t i(0); i != count; ++i) { - CYViewController *page([[self viewControllers] objectAtIndex:(count - i - 1)]); - [page reloadData]; + for (CYViewController *page in [self viewControllers]) { + if ([page hasLoaded]) + [page reloadData]; } } @@ -6692,7 +6686,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { /* }}} */ /* Section Controller {{{ */ -@interface SectionController : FilteredPackageController { +@interface SectionController : FilteredPackageListController { NSString *section_; } @@ -6773,6 +6767,10 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } } +- (BOOL) isEditing { + return editing_; +} + - (void) setEditing:(BOOL)editing { if ((editing_ = editing)) [list_ reloadData]; @@ -6808,7 +6806,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { - (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *reuseIdentifier = @"SectionCell"; - SectionCell *cell = (SectionCell *) [tableView dequeueReusableCellWithIdentifier:reuseIdentifier]; + SectionCell *cell = (SectionCell *)[tableView dequeueReusableCellWithIdentifier:reuseIdentifier]; if (cell == nil) cell = [[[SectionCell alloc] initWithFrame:CGRectZero reuseIdentifier:reuseIdentifier] autorelease]; @@ -6957,6 +6955,12 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { return [NSURL URLWithString:@"cydia://changes"]; } +- (void) viewWillAppear:(BOOL)animated { + // Loads after it appears, so don't load beforehand. + loaded_ = YES; + [super viewWillAppear:animated]; +} + - (void) viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; @@ -7052,9 +7056,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { if ((self = [super init]) != nil) { database_ = database; - // We load after the view is visible, so don't "magically" load beforehand. - loaded_ = YES; - packages_ = CFArrayCreateMutable(kCFAllocatorDefault, 0, NULL); sections_ = [[NSMutableArray arrayWithCapacity:16] retain]; } return self; @@ -7178,7 +7179,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { @end /* }}} */ /* Search Controller {{{ */ -@interface SearchController : FilteredPackageController < +@interface SearchController : FilteredPackageListController < UISearchBarDelegate > { UISearchBar *search_; @@ -7199,7 +7200,10 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (NSURL *) navigationURL { - return [NSURL URLWithString:[NSString stringWithFormat:@"cydia://search/%@", [search_ text]]]; + if ([search_ text] == nil || [[search_ text] isEqualToString:@""]) + return [NSURL URLWithString:@"cydia://search"]; + else + return [NSURL URLWithString:[NSString stringWithFormat:@"cydia://search/%@", [search_ text]]]; } - (void) setSearchTerm:(NSString *)searchTerm { @@ -7208,13 +7212,13 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) searchBarSearchButtonClicked:(UISearchBar *)searchBar { - [packages_ setObject:[search_ text] forFilter:@selector(isUnfilteredAndSearchedForBy:)]; + [self setObject:[search_ text] forFilter:@selector(isUnfilteredAndSearchedForBy:)]; [search_ resignFirstResponder]; [self reloadData]; } - (void) searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)text { - [packages_ setObject:[search_ text] forFilter:@selector(isUnfilteredAndSelectedForBy:)]; + [self setObject:text forFilter:@selector(isUnfilteredAndSelectedForBy:)]; [self reloadData]; } @@ -7247,9 +7251,9 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) reloadData { - [packages_ setObject:[search_ text]]; + [self setObject:[search_ text]]; [super reloadData]; - [packages_ resetCursor]; + [self resetCursor]; } - (void) didSelectPackage:(Package *)package { @@ -7417,49 +7421,9 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { @end /* }}} */ -/* Signature Controller {{{ */ -@interface SignatureController : CYBrowserController { - _transient Database *database_; - NSString *package_; -} - -- (id) initWithDatabase:(Database *)database package:(NSString *)package; - -@end - -@implementation SignatureController - -- (void) dealloc { - [package_ release]; - [super dealloc]; -} - -- (NSURL *) navigationURL { - return [NSURL URLWithString:[NSString stringWithFormat:@"cydia://package/%@/signature", package_]]; -} - -- (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame { - // XXX: dude! - [super webView:view didClearWindowObject:window forFrame:frame]; -} - -- (id) initWithDatabase:(Database *)database package:(NSString *)package { - if ((self = [super init]) != nil) { - database_ = database; - package_ = [package retain]; - [self reloadData]; - } return self; -} - -- (void) reloadData { - [self loadURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"signature" ofType:@"html"]]]; -} - -@end -/* }}} */ /* Installed Controller {{{ */ -@interface InstalledController : FilteredPackageController { +@interface InstalledController : FilteredPackageListController { BOOL expert_; } @@ -7510,10 +7474,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { #endif } -- (void) reloadData { - [packages_ reloadData]; -} - - (void) updateRoleButton { if (Role_ != nil && ![Role_ isEqualToString:@"Developer"]) [[self navigationItem] setRightBarButtonItem:[[[UIBarButtonItem alloc] @@ -7525,18 +7485,13 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) roleButtonClicked { - [packages_ setObject:[NSNumber numberWithBool:expert_]]; - [packages_ reloadData]; + [self setObject:[NSNumber numberWithBool:expert_]]; + [self reloadData]; expert_ = !expert_; [self updateRoleButton]; } -- (void) setDelegate:(id)delegate { - [super setDelegate:delegate]; - [packages_ setDelegate:delegate]; -} - @end /* }}} */ @@ -7626,7 +7581,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { @end /* }}} */ /* Source Controller {{{ */ -@interface SourceController : FilteredPackageController { +@interface SourceController : FilteredPackageListController { Source *source_; } @@ -8509,8 +8464,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { if (recently || loaded_ || ManualRefresh) { [self performSelectorOnMainThread:@selector(_loaded) withObject:nil waitUntilDone:NO]; - // If we are cancelling due to ManualRefresh or a recent refresh - // we need to make sure it knows it's already loaded. + // If we are cancelling, we need to make sure it knows it's already loaded. loaded_ = true; return; } else { @@ -8763,12 +8717,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [self setNetworkActivityIndicatorVisible:NO]; } -- (void) setPackageController:(CYPackageController *)view { - WebThreadLock(); - [view setPackage:nil]; - WebThreadUnlock(); -} - - (void) cancelAndClear:(bool)clear { @synchronized (self) { if (clear) { @@ -9001,8 +8949,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { if ([base isEqualToString:@"package"]) { if ([arg2 isEqualToString:@"settings"]) { controller = [[[PackageSettingsController alloc] initWithDatabase:database_ package:arg1] autorelease]; - } else if ([arg2 isEqualToString:@"signature"]) { - controller = [[[SignatureController alloc] initWithDatabase:database_ package:arg1] autorelease]; } else if ([arg2 isEqualToString:@"files"]) { if (Package *package = [database_ packageWithName:arg1]) { controller = [[[FileTable alloc] initWithDatabase:database_] autorelease]; @@ -9045,7 +8991,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { } - (void) applicationWillTerminate:(UIApplication *)application { - [Metadata_ setObject:[tabbar_ navigationURLItems] forKey:@"InterfaceState"]; + Changed_ = true; + [Metadata_ setObject:[tabbar_ navigationURLCollection] forKey:@"InterfaceState"]; [Metadata_ setObject:[NSDate date] forKey:@"LastClosed"]; [Metadata_ setObject:[NSNumber numberWithInt:[tabbar_ selectedIndex]] forKey:@"InterfaceIndex"]; diff --git a/UICaboodle/RVPage.h b/UICaboodle/RVPage.h index 68ffb39..5d1346e 100644 --- a/UICaboodle/RVPage.h +++ b/UICaboodle/RVPage.h @@ -2,13 +2,31 @@ #import <UIKit/UIKit.h> +@interface UIViewController (Cydia) +- (BOOL) hasLoaded; +@end + @interface CYViewController : UIViewController { id delegate_; BOOL loaded_; } + +// The default implementation of this method is essentially a no-op, +// but calling the superclass implementation is *required*. +- (void) reloadData; +// This URL is used to save the state of the view controller. Return +// nil if you cannot or should not save the URL for this page. - (NSURL *)navigationURL; +// By default, this delegate is unused. However, it's provided here in case +// you need some kind of delegate in a subclass. - (void) setDelegate:(id)delegate; -- (void) reloadData; +- (id)delegate; +// Override this in subclasses if you manage the "has seen first load" state yourself. +- (BOOL) hasLoaded; +// This is called when the view managed by the view controller is released. +// That is not always when the controller itself is released: it also can +// happen when more memory is needed by the system or whenever the controller +// just happens not to be visible. - (void) releaseSubviews; @end diff --git a/UICaboodle/RVPage.mm b/UICaboodle/RVPage.mm index d3de6d3..05a1e25 100644 --- a/UICaboodle/RVPage.mm +++ b/UICaboodle/RVPage.mm @@ -5,19 +5,37 @@ #import "RVBook.h" +extern bool IsWildcat_; + +@implementation UIViewController (Cydia) + +- (BOOL) hasLoaded { + return YES; +} + +@end + @implementation CYViewController - (void) setDelegate:(id)delegate { delegate_ = delegate; } +- (id) delegate { + return delegate_; +} + - (void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - if (!loaded_) + if (![self hasLoaded]) [self reloadData]; } +- (BOOL) hasLoaded { + return loaded_; +} + - (void) releaseSubviews { // Do nothing. } @@ -38,7 +56,7 @@ } - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation { - return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad || orientation == UIInterfaceOrientationPortrait); + return IsWildcat_ || orientation == UIInterfaceOrientationPortrait; } @end diff --git a/iPhonePrivate.h b/iPhonePrivate.h index 818dae3..96679a5 100644 --- a/iPhonePrivate.h +++ b/iPhonePrivate.h @@ -334,6 +334,10 @@ typedef enum { - (void) setModalPresentationStyle:(UIModalPresentationStyle)style; @end +@interface UIApplication (iOS_3_0) +@property(nonatomic) BOOL applicationSupportsShakeToEdit; +@end + @interface UIScrollView (iOS_3_0) @property(assign, nonatomic) float decelerationRate; @end @@ -350,6 +354,7 @@ extern float const UIScrollViewDecelerationRateNormal; #if __IPHONE_OS_VERSION_MIN_REQUIRED < 30000 #define kSCNetworkReachabilityFlagsConnectionOnDemand (1 << 5) +#define kCFCoreFoundationVersionNumber_iPhoneOS_3_0 478.47 #endif // }}} |