Browse Source

Modifications for the lite version of Transdroid (now called Transdrone :).

pull/82/head
Eric Kok 11 years ago
parent
commit
f8f0fa42b6
  1. 4
      core/AndroidManifest.xml
  2. 1
      core/res/layout/fragment_torrents.xml
  3. 4
      core/res/values/changelog.xml
  4. 11
      core/res/values/strings.xml
  5. 3
      core/res/xml/pref_system.xml
  6. 9
      core/src/org/transdroid/core/app/settings/SystemSettings.java
  7. 1
      core/src/org/transdroid/core/gui/TorrentsFragment.java
  8. 13
      core/src/org/transdroid/core/gui/settings/SystemSettingsActivity.java
  9. 2
      core/src/org/transdroid/core/service/BootReceiver.java
  10. 6
      full/AndroidManifest.xml
  11. 12
      lite/AndroidManifest.xml
  12. 2
      lite/res/values/strings.xml

4
core/AndroidManifest.xml

@ -17,8 +17,8 @@
--> -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.transdroid.core" package="org.transdroid.core"
android:versionCode="6" android:versionCode="7"
android:versionName="2.0" > android:versionName="2.0.1" >
<uses-sdk <uses-sdk
android:minSdkVersion="7" android:minSdkVersion="7"

1
core/res/layout/fragment_torrents.xml

@ -74,7 +74,6 @@
android:gravity="center" android:gravity="center"
android:maxWidth="400dip" android:maxWidth="400dip"
android:padding="@dimen/margin_default" android:padding="@dimen/margin_default"
android:text="@string/navigation_nosettings"
android:textIsSelectable="false" android:textIsSelectable="false"
android:visibility="gone" /> android:visibility="gone" />

4
core/res/values/changelog.xml

@ -17,6 +17,10 @@
--> -->
<resources> <resources>
<string name="system_changelog"> <string name="system_changelog">
Transdroid 2.0.1\n
- First Google Play release of the lite version as Transdrone\n
- First release as auto-update (now checked only once a day)\n
\n
Transdroid 2.0.0\n Transdroid 2.0.0\n
- Scrollable home screen widget (Android 3+)\n - Scrollable home screen widget (Android 3+)\n
- Allow changing of storage location (Deluge and Transmission)\n - Allow changing of storage location (Deluge and Transmission)\n

11
core/res/values/strings.xml

@ -59,7 +59,7 @@
<string name="action_removesettings">Remove settings</string> <string name="action_removesettings">Remove settings</string>
<string name="action_visitwebsite">Visit transdroid.org</string> <string name="action_visitwebsite">Visit transdroid.org</string>
<string name="navigation_nosettings">Transdroid allows you to monitor and manage the torrent client you run at home or on your seedbox. Setting things up can be a bit tricky, but we offer step-by-step guides and promise it\'ll be worth it!</string> <string name="navigation_nosettings">%1$s allows you to monitor and manage the torrent client you run at home or on your seedbox. Setting things up can be a bit tricky, but we offer step-by-step guides and promise it\'ll be worth it!</string>
<string name="navigation_emptytorrents">Connected, but no torrent are active within the current filter</string> <string name="navigation_emptytorrents">Connected, but no torrent are active within the current filter</string>
<string name="navigation_emptydetails">Select a torrent to view its details</string> <string name="navigation_emptydetails">Select a torrent to view its details</string>
<string name="navigation_servers">SERVERS</string> <string name="navigation_servers">SERVERS</string>
@ -270,17 +270,17 @@
<string name="pref_usedarktheme">Use dark UI theme</string> <string name="pref_usedarktheme">Use dark UI theme</string>
<string name="pref_usedarktheme_info">Requires a restart to take effect</string> <string name="pref_usedarktheme_info">Requires a restart to take effect</string>
<string name="pref_import">Import settings</string> <string name="pref_import">Import settings</string>
<string name="pref_import_dialog">Transdroid will try to import server, web search, RSS and system settings from: %1$s</string> <string name="pref_import_dialog">%1$s will try to import server, web search, RSS and system settings from: %2$s</string>
<string name="pref_import_success">Settings successfully imported</string> <string name="pref_import_success">Settings successfully imported</string>
<string name="pref_export">Export settings</string> <string name="pref_export">Export settings</string>
<string name="pref_export_dialog">Transdroid will export server (including passwords), web search, RSS and system settings to the following plain text JSON file: %1$s</string> <string name="pref_export_dialog">%1$s will export server (including passwords), web search, RSS and system settings to the following plain text JSON file: %2$s</string>
<string name="pref_export_success">Settings successfully exported</string> <string name="pref_export_success">Settings successfully exported</string>
<string name="pref_sendlog">Send error log</string> <string name="pref_sendlog">Send error log</string>
<string name="pref_sendlog_info">Get support or report a bug</string> <string name="pref_sendlog_info">Get support or report a bug</string>
<string name="pref_installhelp">View install guides</string> <string name="pref_installhelp">View install guides</string>
<string name="pref_installhelp_info">Available at transdroid.org/download</string> <string name="pref_installhelp_info">Available at transdroid.org/download</string>
<string name="pref_changelog">Recent changes</string> <string name="pref_changelog">Recent changes</string>
<string name="pref_about">About Transdroid</string> <string name="pref_about">About %1$s</string>
<string-array name="pref_daemon_types" translatable="false"> <string-array name="pref_daemon_types" translatable="false">
<item>BitComet</item> <item>BitComet</item>
<item>Bitflu 1.2+</item> <item>Bitflu 1.2+</item>
@ -359,7 +359,7 @@
<string name="error_no_link">The RSS feed item does not provide a link to browse to</string> <string name="error_no_link">The RSS feed item does not provide a link to browse to</string>
<string name="error_norssfeed">URL is not a (valid) RSS feed</string> <string name="error_norssfeed">URL is not a (valid) RSS feed</string>
<string name="error_media_not_available">SD card not available to read/write</string> <string name="error_media_not_available">SD card not available to read/write</string>
<string name="error_no_valid_settings_file">File does not seem to contain Transdroid settings</string> <string name="error_no_valid_settings_file">File does not seem to contain %1$s settings</string>
<string name="error_file_not_found">The settings file could not be found</string> <string name="error_file_not_found">The settings file could not be found</string>
<string name="error_cant_write_settings_file">Can\'t write to the settings file</string> <string name="error_cant_write_settings_file">Can\'t write to the settings file</string>
<string name="error_notanumber">Please enter a positive number</string> <string name="error_notanumber">Please enter a positive number</string>
@ -371,7 +371,6 @@
<string name="update_search_newversion">New Transdroid search module available</string> <string name="update_search_newversion">New Transdroid search module available</string>
<string name="update_updateto">You can now update to %1$s</string> <string name="update_updateto">You can now update to %1$s</string>
<string name="system_name" translatable="false">Transdroid</string>
<string name="system_developer" translatable="false">\u00A9 Eric Kok, 2312 development</string> <string name="system_developer" translatable="false">\u00A9 Eric Kok, 2312 development</string>
<string name="system_license" translatable="false">Published under GNU General Public License v3</string> <string name="system_license" translatable="false">Published under GNU General Public License v3</string>
<string name="system_librarieslabel">Some code/libraries are used in the project:</string> <string name="system_librarieslabel">Some code/libraries are used in the project:</string>

3
core/res/xml/pref_system.xml

@ -52,7 +52,6 @@
android:title="@string/pref_changelog" /> android:title="@string/pref_changelog" />
<Preference <Preference
android:key="system_about" android:key="system_about" />
android:title="@string/pref_about" />
</PreferenceScreen> </PreferenceScreen>

9
core/src/org/transdroid/core/app/settings/SystemSettings.java

@ -67,4 +67,13 @@ public class SystemSettings {
prefs.edit().putLong("system_lastappupdatecheck", lastChecked == null ? -1L : lastChecked.getTime()).commit(); prefs.edit().putLong("system_lastappupdatecheck", lastChecked == null ? -1L : lastChecked.getTime()).commit();
} }
/**
* Whether the custom app update checker should be used to check for new app and search module versions.
* @return True if it should be checked against transdroid.org if there are app updates (as opposed to using the
* Play Store for updates), false otherwise
*/
public static boolean enableUpdateChecker(Context context) {
return !context.getPackageName().equals("org.transdroid.lite");
}
} }

1
core/src/org/transdroid/core/gui/TorrentsFragment.java

@ -114,6 +114,7 @@ public class TorrentsFragment extends SherlockFragment implements OnLabelPickedL
torrentsList.setFastScrollEnabled(true); torrentsList.setFastScrollEnabled(true);
if (torrents != null) if (torrents != null)
updateTorrents(torrents, currentLabels); updateTorrents(torrents, currentLabels);
nosettingsText.setText(getString(R.string.navigation_nosettings, getString(R.string.app_name)));
} }

13
core/src/org/transdroid/core/gui/settings/SystemSettingsActivity.java

@ -26,6 +26,7 @@ import org.json.JSONException;
import org.transdroid.core.R; import org.transdroid.core.R;
import org.transdroid.core.app.settings.ApplicationSettings; import org.transdroid.core.app.settings.ApplicationSettings;
import org.transdroid.core.app.settings.SettingsPersistence; import org.transdroid.core.app.settings.SettingsPersistence;
import org.transdroid.core.app.settings.SystemSettings;
import org.transdroid.core.gui.log.ErrorLogSender; import org.transdroid.core.gui.log.ErrorLogSender;
import org.transdroid.core.gui.navigation.DialogHelper; import org.transdroid.core.gui.navigation.DialogHelper;
import org.transdroid.core.gui.navigation.NavigationHelper; import org.transdroid.core.gui.navigation.NavigationHelper;
@ -77,12 +78,17 @@ public class SystemSettingsActivity extends SherlockPreferenceActivity {
addPreferencesFromResource(R.xml.pref_system); addPreferencesFromResource(R.xml.pref_system);
// Handle outgoing links and preference changes // Handle outgoing links and preference changes
if (SystemSettings.enableUpdateChecker(this)) {
findPreference("system_checkupdates").setOnPreferenceClickListener(onCheckUpdatesClick); findPreference("system_checkupdates").setOnPreferenceClickListener(onCheckUpdatesClick);
} else {
getPreferenceScreen().removePreference(findPreference("system_checkupdates"));
}
findPreference("system_sendlog").setOnPreferenceClickListener(onSendLogClick); findPreference("system_sendlog").setOnPreferenceClickListener(onSendLogClick);
findPreference("system_installhelp").setOnPreferenceClickListener(onInstallHelpClick); findPreference("system_installhelp").setOnPreferenceClickListener(onInstallHelpClick);
findPreference("system_changelog").setOnPreferenceClickListener(onChangeLogClick); findPreference("system_changelog").setOnPreferenceClickListener(onChangeLogClick);
findPreference("system_importsettings").setOnPreferenceClickListener(onImportSettingsClick); findPreference("system_importsettings").setOnPreferenceClickListener(onImportSettingsClick);
findPreference("system_exportsettings").setOnPreferenceClickListener(onExportSettingsClick); findPreference("system_exportsettings").setOnPreferenceClickListener(onExportSettingsClick);
findPreference("system_about").setTitle(getString(R.string.pref_about, getString(R.string.app_name)));
findPreference("system_about").setOnPreferenceClickListener(onAboutClick); findPreference("system_about").setOnPreferenceClickListener(onAboutClick);
} }
@ -165,7 +171,7 @@ public class SystemSettingsActivity extends SherlockPreferenceActivity {
// @formatter:off // @formatter:off
return new AlertDialog.Builder(this) return new AlertDialog.Builder(this)
.setMessage( .setMessage(
getString(R.string.pref_import_dialog, SettingsPersistence.DEFAULT_SETTINGS_FILE.toString())) getString(R.string.pref_import_dialog, getString(R.string.app_name), SettingsPersistence.DEFAULT_SETTINGS_FILE.toString()))
.setPositiveButton(android.R.string.ok, importSettings) .setPositiveButton(android.R.string.ok, importSettings)
.setNegativeButton(android.R.string.cancel, null).create(); .setNegativeButton(android.R.string.cancel, null).create();
// @formatter:on // @formatter:on
@ -173,7 +179,7 @@ public class SystemSettingsActivity extends SherlockPreferenceActivity {
// @formatter:off // @formatter:off
return new AlertDialog.Builder(this) return new AlertDialog.Builder(this)
.setMessage( .setMessage(
getString(R.string.pref_export_dialog, SettingsPersistence.DEFAULT_SETTINGS_FILE.toString())) getString(R.string.pref_export_dialog, getString(R.string.app_name), SettingsPersistence.DEFAULT_SETTINGS_FILE.toString()))
.setPositiveButton(android.R.string.ok, exportSettings) .setPositiveButton(android.R.string.ok, exportSettings)
.setNegativeButton(android.R.string.cancel, null).create(); .setNegativeButton(android.R.string.cancel, null).create();
// @formatter:on // @formatter:on
@ -193,7 +199,8 @@ public class SystemSettingsActivity extends SherlockPreferenceActivity {
Crouton.showText(SystemSettingsActivity.this, R.string.error_file_not_found, Crouton.showText(SystemSettingsActivity.this, R.string.error_file_not_found,
NavigationHelper.CROUTON_ERROR_STYLE); NavigationHelper.CROUTON_ERROR_STYLE);
} catch (JSONException e) { } catch (JSONException e) {
Crouton.showText(SystemSettingsActivity.this, R.string.error_no_valid_settings_file, Crouton.showText(SystemSettingsActivity.this,
getString(R.string.error_no_valid_settings_file, getString(R.string.app_name)),
NavigationHelper.CROUTON_ERROR_STYLE); NavigationHelper.CROUTON_ERROR_STYLE);
} }
} }

2
core/src/org/transdroid/core/service/BootReceiver.java

@ -69,7 +69,7 @@ public class BootReceiver extends BroadcastReceiver {
public static void startAppUpdatesService(Context context) { public static void startAppUpdatesService(Context context) {
SystemSettings systemSettings = SystemSettings_.getInstance_(context); SystemSettings systemSettings = SystemSettings_.getInstance_(context);
AlarmManager alarms = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); AlarmManager alarms = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
if (systemSettings.checkForUpdates() && piAppUpdates == null) { if (SystemSettings.enableUpdateChecker(context) && systemSettings.checkForUpdates() && piAppUpdates == null) {
Log.d(context, "Boot signal received, starting app update checker service"); Log.d(context, "Boot signal received, starting app update checker service");
// Schedule a daily, with the first being (somewhat) in 1 second from now // Schedule a daily, with the first being (somewhat) in 1 second from now

6
full/AndroidManifest.xml

@ -17,8 +17,8 @@
--> -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.transdroid.full" package="org.transdroid.full"
android:versionCode="6" android:versionCode="7"
android:versionName="2.0" > android:versionName="2.0.1" >
<uses-sdk <uses-sdk
android:minSdkVersion="7" android:minSdkVersion="7"
@ -46,7 +46,7 @@
android:allowBackup="true" android:allowBackup="true"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"
android:label="@string/system_name" android:label="@string/app_name"
android:theme="@style/Theme.Sherlock" > android:theme="@style/Theme.Sherlock" >
<!-- Main activities --> <!-- Main activities -->

12
lite/AndroidManifest.xml

@ -17,8 +17,8 @@
--> -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.transdroid.lite" package="org.transdroid.lite"
android:versionCode="6" android:versionCode="7"
android:versionName="2.0" > android:versionName="2.0.1" >
<uses-sdk <uses-sdk
android:minSdkVersion="7" android:minSdkVersion="7"
@ -46,7 +46,7 @@
android:allowBackup="true" android:allowBackup="true"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"
android:label="@string/system_name" android:label="@string/app_name"
android:theme="@style/Theme.Sherlock" > android:theme="@style/Theme.Sherlock" >
<!-- Main activities --> <!-- Main activities -->
@ -61,9 +61,6 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<intent-filter> <intent-filter>
<action android:name="org.transdroid.ADD_MULTIPLE" /> <action android:name="org.transdroid.ADD_MULTIPLE" />
@ -180,15 +177,12 @@
<!-- Settings screens --> <!-- Settings screens -->
<activity android:name="org.transdroid.core.gui.settings.MainSettingsActivity_" /> <activity android:name="org.transdroid.core.gui.settings.MainSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.settings.ServerSettingsActivity_" /> <activity android:name="org.transdroid.core.gui.settings.ServerSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.settings.WebsearchSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.settings.RssfeedSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.settings.NotificationSettingsActivity_" /> <activity android:name="org.transdroid.core.gui.settings.NotificationSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.settings.SystemSettingsActivity_" /> <activity android:name="org.transdroid.core.gui.settings.SystemSettingsActivity_" />
<activity android:name="org.transdroid.core.gui.navigation.DialogHelper_" /> <activity android:name="org.transdroid.core.gui.navigation.DialogHelper_" />
<!-- Background service --> <!-- Background service -->
<service android:name="org.transdroid.core.service.ServerCheckerService_" /> <service android:name="org.transdroid.core.service.ServerCheckerService_" />
<service android:name="org.transdroid.core.service.RssCheckerService_" />
<service android:name="org.transdroid.core.service.AppUpdateService_" /> <service android:name="org.transdroid.core.service.AppUpdateService_" />
<receiver android:name="org.transdroid.core.service.AlarmReceiver_" /> <receiver android:name="org.transdroid.core.service.AlarmReceiver_" />

2
lite/res/values/strings.xml

@ -16,6 +16,6 @@
--> -->
<resources> <resources>
<string name="app_name" translatable="false">Transdroid Lite</string> <string name="app_name" translatable="false">Transdrone</string>
</resources> </resources>

Loading…
Cancel
Save