From: masensio Date: Mon, 17 Feb 2014 07:45:52 +0000 (+0100) Subject: Merge branch 'develop' into send_file_pr311_with_develop X-Git-Tag: oc-android-1.5.5~22^2~27 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/99686805e16c9891bb68c0ae4e7478913e16270e?hp=42834b213ae0ddc35b57d5aa79ffd24afde5a5da Merge branch 'develop' into send_file_pr311_with_develop --- diff --git a/owncloud-android-library b/owncloud-android-library index 985b0059..6992df89 160000 --- a/owncloud-android-library +++ b/owncloud-android-library @@ -1 +1 @@ -Subproject commit 985b005995429f52446dc5bb66abd236595e627e +Subproject commit 6992df89b04c3c35bf906c3f810fa05daad7b43f diff --git a/res/menu/file_actions_menu.xml b/res/menu/file_actions_menu.xml index 73adda71..986ce3ed 100644 --- a/res/menu/file_actions_menu.xml +++ b/res/menu/file_actions_menu.xml @@ -20,7 +20,8 @@ - + + diff --git a/res/values-ar/strings.xml b/res/values-ar/strings.xml index 499d68a1..8eaef651 100644 --- a/res/values-ar/strings.xml +++ b/res/values-ar/strings.xml @@ -8,6 +8,7 @@ إنشاء دليل تعديلات تفاصيل + شارك عام المزيد حسابات diff --git a/res/values-bg-rBG/strings.xml b/res/values-bg-rBG/strings.xml index 335b1b4c..128d81f7 100644 --- a/res/values-bg-rBG/strings.xml +++ b/res/values-bg-rBG/strings.xml @@ -5,6 +5,7 @@ Файлове Нова директория Настройки + Споделяне Общи Още Профили diff --git a/res/values-bn-rBD/strings.xml b/res/values-bn-rBD/strings.xml index 2454ad33..316d5830 100644 --- a/res/values-bn-rBD/strings.xml +++ b/res/values-bn-rBD/strings.xml @@ -4,6 +4,7 @@ ফাইল ডিরেক্টরি তৈরী কর নিয়ামকসমূহ + ভাগাভাগি কর সাধারণ বেশী একাউন্ট diff --git a/res/values-bs/strings.xml b/res/values-bs/strings.xml index c757504a..9189d414 100644 --- a/res/values-bs/strings.xml +++ b/res/values-bs/strings.xml @@ -1,2 +1,4 @@ - + + Podijeli + diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml index c29514dd..4d82b4a1 100644 --- a/res/values-ca/strings.xml +++ b/res/values-ca/strings.xml @@ -10,6 +10,7 @@ Crea una carpeta Configuració Detalls + Comparteix General Més Comptes diff --git a/res/values-cs-rCZ/strings.xml b/res/values-cs-rCZ/strings.xml index 03bc06a3..e0ae3642 100644 --- a/res/values-cs-rCZ/strings.xml +++ b/res/values-cs-rCZ/strings.xml @@ -10,6 +10,7 @@ Vytvořit adresář Nastavení Podrobnosti + Sdílet Obecné Více Účty diff --git a/res/values-cy-rGB/strings.xml b/res/values-cy-rGB/strings.xml index de4ffef9..60ccc9a0 100644 --- a/res/values-cy-rGB/strings.xml +++ b/res/values-cy-rGB/strings.xml @@ -5,6 +5,7 @@ Ffeiliau Creu cyfeiriadur Gosodiadau + Rhannu Cyffredinol Cyfrifon Rheoli Cyfrifon diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml index 71a7bff0..ead0cc8b 100644 --- a/res/values-da/strings.xml +++ b/res/values-da/strings.xml @@ -10,6 +10,7 @@ Opret mappe Indstillinger Detaljer + Del Generel Mere Konti diff --git a/res/values-de-rAT/strings.xml b/res/values-de-rAT/strings.xml index c757504a..b18a1245 100644 --- a/res/values-de-rAT/strings.xml +++ b/res/values-de-rAT/strings.xml @@ -1,2 +1,9 @@ - + + Einstellungen + Freigeben + Allgemein + Passwort + Herunterladen + Abbrechen + diff --git a/res/values-de-rCH/strings.xml b/res/values-de-rCH/strings.xml index f09e75c8..db98bf62 100644 --- a/res/values-de-rCH/strings.xml +++ b/res/values-de-rCH/strings.xml @@ -10,7 +10,7 @@ Ordner anlegen Einstellungen Details - Datei Senden + Freigeben Allgemein Mehr Konten diff --git a/res/values-de-rDE/strings.xml b/res/values-de-rDE/strings.xml index 64b43cbe..7943ca7e 100644 --- a/res/values-de-rDE/strings.xml +++ b/res/values-de-rDE/strings.xml @@ -10,7 +10,7 @@ Ordner anlegen Einstellungen Details - Datei senden + Teilen Allgemein Mehr Konten @@ -237,5 +237,6 @@ Entschuldigung, Freigaben sind auf Ihrem Server nicht aktiviert. Bitte kontaktieren Sie Ihren Administrator. Die Freigabe der Datei oder des Ordners ist nicht möglich. Bitte stellen Sie sicher, dass diese existiert. Es ist ein Fehler beim Freigeben der Datei oder des Ordners aufgetreten. + Das Entfernen der Freigabe für die Datei oder den Ordner ist nicht möglich. Diese existieren nicht. Es ist ein Fehler beim Entfernen der Freigabe für diese Datei oder den Ordner aufgetreten. diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 95d370d7..7fe82aa7 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -10,7 +10,7 @@ Ordner anlegen Einstellungen Details - Datei Senden + Teilen Allgemein Mehr Konten @@ -237,5 +237,6 @@ Entschuldigung, Freigaben sind auf Deinem Server nicht aktiviert. Bitte kontaktiere Deinen Administrator. Die Freigabe der Datei oder des Ordners ist nicht möglich. Bitte stelle sicher, dass diese existiert. Es ist ein Fehler beim Freigeben der Datei oder des Ordners aufgetreten. + Das Entfernen der Freigabe für die Datei oder den Ordner ist nicht möglich. Diese existieren nicht. Es ist ein Fehler beim Entfernen der Freigabe für diese Datei oder den Ordner aufgetreten. diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml index da7c29de..37f93ffb 100644 --- a/res/values-el/strings.xml +++ b/res/values-el/strings.xml @@ -10,6 +10,7 @@ Δημιουργία καταλόγου Ρυθμίσεις Λεπτομέρειες + Διαμοιρασμός Γενικά Περισσότερα Λογαριασμοί diff --git a/res/values-eo/strings.xml b/res/values-eo/strings.xml index cf19b74a..6276681a 100644 --- a/res/values-eo/strings.xml +++ b/res/values-eo/strings.xml @@ -6,6 +6,7 @@ Krei dosierujon Agordo Detaloj + Kunhavigi Ĝeneralo Pli Kontoj diff --git a/res/values-es-rAR/strings.xml b/res/values-es-rAR/strings.xml index 4bc8c767..0327a436 100644 --- a/res/values-es-rAR/strings.xml +++ b/res/values-es-rAR/strings.xml @@ -10,6 +10,7 @@ Crear directorio Configuración Detalles + Compartir General Más Cuentas diff --git a/res/values-es-rCL/strings.xml b/res/values-es-rCL/strings.xml index a6b3cbb3..b49126b2 100644 --- a/res/values-es-rCL/strings.xml +++ b/res/values-es-rCL/strings.xml @@ -4,6 +4,7 @@ Archivos Crear directorio Configuración + Compartir General Cuentas Usuario diff --git a/res/values-es-rMX/strings.xml b/res/values-es-rMX/strings.xml index b674ceaa..b4535bc5 100644 --- a/res/values-es-rMX/strings.xml +++ b/res/values-es-rMX/strings.xml @@ -10,6 +10,7 @@ Crear directorio Ajustes Detalles + Compartir General Más Cuentas diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index 1e19c569..3f85310a 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -10,6 +10,7 @@ Crear directorio Configuración Detalles + Compartir General Más Cuentas @@ -236,5 +237,6 @@ Compartir archivos no está activado en su servidor. Sírvase contactar a su administrador de sistema. No es posible compartir este archivo o carpeta. Asegúrese de que existe. Ocurrió un error al tratar de compartir este archivo o carpeta + No se puede dejar de compartir este archivo o carpeta. No existe. Ocurrió un error al tratar de ya no compartir este archivo o carpeta diff --git a/res/values-et-rEE/strings.xml b/res/values-et-rEE/strings.xml index eba96630..b9864283 100644 --- a/res/values-et-rEE/strings.xml +++ b/res/values-et-rEE/strings.xml @@ -10,6 +10,7 @@ Loo kaust Seaded Üksikasjad + Jaga Üldine Rohkem Kontod diff --git a/res/values-eu/strings.xml b/res/values-eu/strings.xml index 6f476d9c..7fd34e78 100644 --- a/res/values-eu/strings.xml +++ b/res/values-eu/strings.xml @@ -10,6 +10,7 @@ Sortu karpeta Ezarpenak Xehetasunak + Partekatu Orokorra Gehiago Kontuak diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml index d37ecfe4..e300c9b0 100644 --- a/res/values-fa/strings.xml +++ b/res/values-fa/strings.xml @@ -10,6 +10,7 @@ ایجاد پوشه تنظیمات جزئیات + اشتراک‌گذاری عمومی بیش‌تر حساب‌ها diff --git a/res/values-fi-rFI/strings.xml b/res/values-fi-rFI/strings.xml index e81641dd..48b3fd3a 100644 --- a/res/values-fi-rFI/strings.xml +++ b/res/values-fi-rFI/strings.xml @@ -10,6 +10,7 @@ Luo kansio Asetukset Tiedot + Jaa Yleiset Enemmän Tilit @@ -159,6 +160,7 @@ Odota hetki Odottamaton ongelma; kokeile valita tiedosto toisella sovelluksella Tiedostoa ei valittu + Lähetä linkki… Kirjaudu oAuth2:lla Yhdistetään oAuth2-palvelimeen… Sivuston identiteetin vahvistaminen ei onnistunut @@ -197,4 +199,7 @@ yritä uudelleen kaikkia valittuja Lataa lisää kuvia Virheviesti: + Valitettavasti jakamista ei ole otettu käyttöön palvelinasetuksissa. Ota yhteys ylläpitäjään. + Valitettavasti tämän tiedoston tai kansion jakaminen ei onnistu. Varmista että se on olemassa + Virhe tiedoston tai kansion jakamista yrittäessä diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index 7588229a..20a78cdc 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -3,13 +3,14 @@ %1$s Android App version %1$s Actualiser le compte - Charger + Téléverser Contenu d\'une autre application Fichiers Ouvrir avec Créer un répertoire Paramètres Détails + Partager Général Plus Comptes @@ -236,5 +237,6 @@ Désolé, la fonctionnalité de partage n’est pas activée sur ce serveur. Veuillez contacter votre administrateur. Impossible de partager ce fichier ou répertoire. Vérifiez qu’il est bien présent Une erreur est survenue lors de la tentative de partage de ce fichier ou répertoire + Impossible d’annuler le partage de ce fichier ou répertoire : il n’existe pas. Une erreur est survenue lors de la tentative d’annulation du partage de ce fichier ou répertoire diff --git a/res/values-gl/strings.xml b/res/values-gl/strings.xml index 8820c201..671d3a27 100644 --- a/res/values-gl/strings.xml +++ b/res/values-gl/strings.xml @@ -10,6 +10,7 @@ Crear un directorio Preferencias Detalles + Compartir Xeral Máis Contas @@ -236,5 +237,6 @@ O seu servidor non ten activada a opción de compartir. Póñase en contacto co administrador. Non foi posíbel compartir este ficheiro ou cartafol. Asegurese de que existe. Produciuse un erro ao tentar compartir este ficheiro ou cartafol. + Non foi posíbel compartir este ficheiro ou cartafol xa que non existe. Produciuse un erro ao tentar deixar de compartir este ficheiro ou cartafol diff --git a/res/values-he/strings.xml b/res/values-he/strings.xml index 36de5a7f..b2068c7e 100644 --- a/res/values-he/strings.xml +++ b/res/values-he/strings.xml @@ -6,6 +6,7 @@ יצירת תיקייה הגדרות פרטים + שיתוף כללי יותר חשבונות diff --git a/res/values-hi/strings.xml b/res/values-hi/strings.xml index da6fb71d..f123e9be 100644 --- a/res/values-hi/strings.xml +++ b/res/values-hi/strings.xml @@ -2,6 +2,7 @@ अपलोड सेटिंग्स + साझा करें सामान्य सहयोग प्रयोक्ता का नाम diff --git a/res/values-hr/strings.xml b/res/values-hr/strings.xml index b55e3d94..fb514b08 100644 --- a/res/values-hr/strings.xml +++ b/res/values-hr/strings.xml @@ -4,6 +4,7 @@ Datoteke Kreiraj direktorij Postavke + Podijeli Općenito više Korisnićki računi diff --git a/res/values-hu-rHU/strings.xml b/res/values-hu-rHU/strings.xml index b341bb8a..5a610c4b 100644 --- a/res/values-hu-rHU/strings.xml +++ b/res/values-hu-rHU/strings.xml @@ -10,6 +10,7 @@ Mappa létrehozása Beállítások Részletek + Megosztás Általános Több Fiókok diff --git a/res/values-ia/strings.xml b/res/values-ia/strings.xml index ecfaa300..87e49bb3 100644 --- a/res/values-ia/strings.xml +++ b/res/values-ia/strings.xml @@ -3,6 +3,7 @@ Incargar Files Configurationes + Compartir General Plus Adjuta diff --git a/res/values-id/strings.xml b/res/values-id/strings.xml index e190c5c1..8664ddb4 100644 --- a/res/values-id/strings.xml +++ b/res/values-id/strings.xml @@ -10,6 +10,7 @@ Buat folder pengaturan Rincian + Bagikan umum Lainnya Akun diff --git a/res/values-is/strings.xml b/res/values-is/strings.xml index e7d228b9..d09f87d5 100644 --- a/res/values-is/strings.xml +++ b/res/values-is/strings.xml @@ -3,6 +3,7 @@ Senda inn Skrár Stillingar + Deila Meira Hjálp Notendanafn diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index 578ea5f8..879f1818 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -10,6 +10,7 @@ Crea cartella Impostazioni Dettagli + Condividi Generale Altro Account diff --git a/res/values-ja-rJP/strings.xml b/res/values-ja-rJP/strings.xml index 2c195477..8d1ed02a 100644 --- a/res/values-ja-rJP/strings.xml +++ b/res/values-ja-rJP/strings.xml @@ -10,6 +10,7 @@ ディレクトリを作成 設定 詳細 + 共有 一般 もっと見る アカウント @@ -56,6 +57,7 @@ ファイルを同期 アップロード中にファイル名を %1$s に変更しました URLで共有 + 未共有のリンク はい いいえ OK @@ -180,6 +182,7 @@ しばらくお待ちください 予期せぬ問題;他のアプリでファイルを選択してみてください。 ファイルは選択されていません + リンクを送信… oAuth2でログイン oAuth2サーバーに接続中... サイトの識別子を確認できませんでした @@ -231,4 +234,8 @@ オンラインでなく、インスタントアップロードのために何もしません 失敗メッセージ: サーバー設定を確認してください。クォータサイズを超えている可能性があります。 + すみませんが、サーバーで共有が有効になっていません。管理者に連絡してください。 + このファイルまたはフォルダーは共有できません。存在しているか確認してください。 + このファイルまたはフォルダーを共有する際にエラーが発生しました + このファイルまたはフォルダーの共有を解除する際にエラーが発生しました diff --git a/res/values-ka-rGE/strings.xml b/res/values-ka-rGE/strings.xml index 0ff4bee3..83c0a2cf 100644 --- a/res/values-ka-rGE/strings.xml +++ b/res/values-ka-rGE/strings.xml @@ -5,6 +5,7 @@ ფაილები დირექტორიის შექმნა პარამეტრები + გაზიარება ზოგადი უფრო მეტი ანგარიში diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml index 112c57f8..23460d6d 100644 --- a/res/values-ko/strings.xml +++ b/res/values-ko/strings.xml @@ -10,6 +10,7 @@ 디렉터리 만들기 설정 세부내용 + 공유 일반 더 중요함 계정 diff --git a/res/values-ku-rIQ/strings.xml b/res/values-ku-rIQ/strings.xml index 09c1c8c5..7ce9ed71 100644 --- a/res/values-ku-rIQ/strings.xml +++ b/res/values-ku-rIQ/strings.xml @@ -4,6 +4,7 @@ په‌ڕگەکان درووستکردنى بوخچە ده‌ستكاری + هاوبەشی کردن گشتی هەژمارەکان یارمەتی diff --git a/res/values-lb/strings.xml b/res/values-lb/strings.xml index 7b6579d8..a2b54a81 100644 --- a/res/values-lb/strings.xml +++ b/res/values-lb/strings.xml @@ -7,6 +7,7 @@ Dossier erstellen Astellungen Detailer + Deelen Allgemeng Méi Accounten diff --git a/res/values-lt-rLT/strings.xml b/res/values-lt-rLT/strings.xml index 063cc849..8a4a4fbe 100644 --- a/res/values-lt-rLT/strings.xml +++ b/res/values-lt-rLT/strings.xml @@ -10,6 +10,7 @@ Kurti aplanką Nustatymai Informacija + Dalintis Bendras Daugiau Paskyros diff --git a/res/values-lv/strings.xml b/res/values-lv/strings.xml index e52b10f1..abd74853 100644 --- a/res/values-lv/strings.xml +++ b/res/values-lv/strings.xml @@ -5,6 +5,7 @@ Datnes Izveidot direktoriju Iestatījumi + Dalīties Vispārīgi Vairāk Konti diff --git a/res/values-mk/strings.xml b/res/values-mk/strings.xml index 10fa36af..210bab46 100644 --- a/res/values-mk/strings.xml +++ b/res/values-mk/strings.xml @@ -6,6 +6,7 @@ Создади папка Параметри Детали: + Сподели Општо Повеќе Сметки diff --git a/res/values-ms-rMY/strings.xml b/res/values-ms-rMY/strings.xml index 0ca0b780..d7af6e5e 100644 --- a/res/values-ms-rMY/strings.xml +++ b/res/values-ms-rMY/strings.xml @@ -4,6 +4,7 @@ Fail-fail Bina direktori Set + Kongsi Umum Lanjutan Akaun diff --git a/res/values-nb-rNO/strings.xml b/res/values-nb-rNO/strings.xml index b1d1899a..18972933 100644 --- a/res/values-nb-rNO/strings.xml +++ b/res/values-nb-rNO/strings.xml @@ -10,6 +10,7 @@ Opprett katalog Innstillinger Detaljer + Del Generelt Mer Kontoer diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index 4cfbcebb..e2a2b284 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -10,6 +10,7 @@ Creëer map Instellingen Details + Delen Algemeen Meer Accounts diff --git a/res/values-nn-rNO/strings.xml b/res/values-nn-rNO/strings.xml index 0d76c8ec..eb04441e 100644 --- a/res/values-nn-rNO/strings.xml +++ b/res/values-nn-rNO/strings.xml @@ -5,6 +5,7 @@ Filer Opprett mappe Innstillingar + Del Generelt Meir Kontoar diff --git a/res/values-oc/strings.xml b/res/values-oc/strings.xml index 9bdc9698..4381f4e5 100644 --- a/res/values-oc/strings.xml +++ b/res/values-oc/strings.xml @@ -4,6 +4,7 @@ Fichièrs Crea un repertòri Configuracion + Parteja General Mai d\'aquò Comptes diff --git a/res/values-pa/strings.xml b/res/values-pa/strings.xml index d3a28367..a5deea82 100644 --- a/res/values-pa/strings.xml +++ b/res/values-pa/strings.xml @@ -10,6 +10,7 @@ ਡਾਇਰੈਕਟਰੀ ਬਣਾਓ ਸੈਟਿੰਗ ਵੇਰਵ + ਸਾਂਝਾ ਕਰੋ ਆਮ ਅਕਾਊਂਟ ਲਾਗ ਰੱਖਣਾ ਚਾਲੂ diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml index 3d0e63d6..fb97b84f 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -10,6 +10,7 @@ Nowy katalog Ustawienia Szczegóły + Udostępnij Ogólne Więcej Konta @@ -236,5 +237,6 @@ Przepraszamy, udostępnianie jest wyłączone na twoim serwerze. Skontaktuj się z twoim administratorem. Brak możliwości udostępnienia tego pliku lub folderu. Upewnij się, że istnieje. Wystąpił błąd podczas udostępniania tego pliku lub folderu. + Nie można anulować udostępniania tego pliku lub folderu. Jeśli nie istnieje. Wystąpił błąd podczas anulowania udostępniania tego pliku lub folderu. diff --git a/res/values-pt-rBR/strings.xml b/res/values-pt-rBR/strings.xml index 93d654de..86fed2ad 100644 --- a/res/values-pt-rBR/strings.xml +++ b/res/values-pt-rBR/strings.xml @@ -10,6 +10,7 @@ Criar pasta Ajustes Detalhes + Compartilhar Geral Mais Contas diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml index 0005cb4b..cdeba14d 100644 --- a/res/values-pt-rPT/strings.xml +++ b/res/values-pt-rPT/strings.xml @@ -10,6 +10,7 @@ Criar pasta Definições Detalhes + Partilhar Geral Mais Contas diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml index 05692777..ade05f0c 100644 --- a/res/values-ro/strings.xml +++ b/res/values-ro/strings.xml @@ -5,6 +5,7 @@ Fișiere Creare director Setări + a imparti General Mai mult Conturi diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index 1964f738..8d0ea30d 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -10,6 +10,7 @@ Создать каталог Настройки Подробно + Открыть доступ Основные Больше Учётные записи diff --git a/res/values-si-rLK/strings.xml b/res/values-si-rLK/strings.xml index 7f0cf887..8c30b705 100644 --- a/res/values-si-rLK/strings.xml +++ b/res/values-si-rLK/strings.xml @@ -4,6 +4,7 @@ ගොනු ඩිරෙක්ටරිය සාදන්න සිටුවම් + බෙදා හදා ගන්න සාමාන්‍යයෙන් වැඩි ගිණුම් diff --git a/res/values-sk-rSK/strings.xml b/res/values-sk-rSK/strings.xml index 0b173702..9672d364 100644 --- a/res/values-sk-rSK/strings.xml +++ b/res/values-sk-rSK/strings.xml @@ -10,6 +10,7 @@ Vytvor priečinok Nastavenia Podrobnosti + Zdieľať Všeobecné Viac Účty diff --git a/res/values-sk/strings.xml b/res/values-sk/strings.xml index 1eb12a48..8d93cc7e 100644 --- a/res/values-sk/strings.xml +++ b/res/values-sk/strings.xml @@ -1,6 +1,7 @@ Nastavenia + Zdieľať Všeobecné Stiahnuť Zrušiť diff --git a/res/values-sl/strings.xml b/res/values-sl/strings.xml index d61395ab..98998682 100644 --- a/res/values-sl/strings.xml +++ b/res/values-sl/strings.xml @@ -10,6 +10,7 @@ Ustvari mapo Nastavitve Podrobnosti + Souporaba Splošno Več Računi @@ -233,6 +234,7 @@ ne pošlji takoj, saj je povezava v omrežje ni dejavna Sporočilo o napaki: Preverite nastavitve strežnika. Morda je presežena vrednost količinske omejitve. + Souporaba je na strežniku onemogočena. Možnost lahko spreminjajo le uporabniki s skrbniškimi dovoljenji. Ni mogoče omogočiti souporabe te datoteke ali mape. Prepričajte se, da obstaja ... Prišlo je do napake med poskusom omogočanja souporabe te datoteke ali mape Prišlo je do napake med poskusom odstranjevanja souporabe te datoteke ali mape diff --git a/res/values-sq/strings.xml b/res/values-sq/strings.xml index c460e82b..7ab53ccd 100644 --- a/res/values-sq/strings.xml +++ b/res/values-sq/strings.xml @@ -4,6 +4,7 @@ Skedarët Krijo kartelë Parametrat + Ndaj Përgjithshme Më tepër Llogarit diff --git a/res/values-sr-rSP/strings.xml b/res/values-sr-rSP/strings.xml index eefd16d8..d19ee5bb 100644 --- a/res/values-sr-rSP/strings.xml +++ b/res/values-sr-rSP/strings.xml @@ -5,6 +5,7 @@ Novi folder Podešavanja Detaljnije + Podeli Opšte Nalozi Upravljaj nalozima diff --git a/res/values-sr/strings.xml b/res/values-sr/strings.xml index 83ce42df..df41162f 100644 --- a/res/values-sr/strings.xml +++ b/res/values-sr/strings.xml @@ -5,6 +5,7 @@ Датотеке Направи фасциклу Поставке + Дели Опште Више Налози diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml index 79c98877..134ed473 100644 --- a/res/values-sv/strings.xml +++ b/res/values-sv/strings.xml @@ -10,6 +10,7 @@ Skapa mapp Inställningar Detaljer + Dela Allmänt Mer Konton diff --git a/res/values-ta-rLK/strings.xml b/res/values-ta-rLK/strings.xml index 2f1f51cc..5a7f7bdb 100644 --- a/res/values-ta-rLK/strings.xml +++ b/res/values-ta-rLK/strings.xml @@ -6,6 +6,7 @@ அடைவை உருவாக்குக அமைப்புகள் விவரங்கள் + பகிர்வு பொதுவான மேலதிக கணக்குகள் diff --git a/res/values-th-rTH/strings.xml b/res/values-th-rTH/strings.xml index 77451fac..482257f5 100644 --- a/res/values-th-rTH/strings.xml +++ b/res/values-th-rTH/strings.xml @@ -6,6 +6,7 @@ สร้างไดเร็กทอรี่ ตั้งค่า รายละเอียด + แชร์ ทั่วไป มาก บัญชี @@ -44,6 +45,7 @@ ยกเลิก บันทึก & ออก ข้อผิดพลาด + ข้อผิดพลาดที่ไม่ทราบสาเหตุ เกี่ยวกับเรา เปลี่ยนรหัสผ่าน ลบบัญชี diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml index 0e920b4f..170eddfe 100644 --- a/res/values-tr/strings.xml +++ b/res/values-tr/strings.xml @@ -10,6 +10,7 @@ Dizin oluştur Ayarlar Detaylar + Paylaş Genel Daha fazla Hesaplar diff --git a/res/values-ug/strings.xml b/res/values-ug/strings.xml index 16a441ad..48163ec9 100644 --- a/res/values-ug/strings.xml +++ b/res/values-ug/strings.xml @@ -4,6 +4,7 @@ ھۆججەتلەر مۇندەرىجە قۇر تەڭشەكلەر + ھەمبەھىر ئادەتتىكى تېخىمۇ كۆپ ھېساباتلار diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml index d0f4dfd7..2c293a7b 100644 --- a/res/values-uk/strings.xml +++ b/res/values-uk/strings.xml @@ -6,6 +6,7 @@ Створити теку Налаштування Деталі + Поділитися Основне Більше Облікові записи diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml index 0f1c0eee..70644266 100644 --- a/res/values-vi/strings.xml +++ b/res/values-vi/strings.xml @@ -10,6 +10,7 @@ Tạo thư mục Cài đặt Chi tiết + Chia sẻ Tổng hợp hơn Tài khoản @@ -56,6 +57,7 @@ Cập nhật lại tập tin Tập tin đã bị đổi tên thành %1$s trong quá trình tải lên Chia sẻ liên kết + Liên kết không chia sẻ Yes Không Chấp nhận @@ -180,6 +182,7 @@ Chờ một lúc Vấn đề bất ngờ ; hãy thử ứng dụng khác để chọn tập tin Không có tập tin nào được chọn + Gửi liên kết đến... Đăng nhập bằng oAuth2. Đang kết nối đến máy chủ oAuth2... Không thể xác minh danh tính của site @@ -231,4 +234,9 @@ không thực hiện thao tác gì nêu bạn không có kết nối mạng dành cho tải lên nhanh Thông điệp lỗi: Vui lòng kiểm tra cấu hình máy chủ của bạn, có thể hạn ngạch dữ liệu đã quá hạn. + Thật tiếc, chia sẻ đã bị vô hiệu trên server của bạn. Vui lòng liên hệ người quản trị. + Không thể chia sẻ file hoặc thư mục này. Hãy chắc chắn rằng nó tồn tại + Một lỗi đã xảy ra khi thử chia sẻ file hoặc thư mục này + Không thể gỡ chia sẻ file hoặc thư mục. Nó không tồn tại. + Một lỗi đã xảy ra khi thử gỡ chia sẻ file hoặc thư mục này diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index 3b4f8ebb..6a539018 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -10,6 +10,7 @@ 创建目录 设置 详细信息 + 共享 常规 更多 账号 diff --git a/res/values-zh-rHK/strings.xml b/res/values-zh-rHK/strings.xml index c1195647..7f79d31f 100644 --- a/res/values-zh-rHK/strings.xml +++ b/res/values-zh-rHK/strings.xml @@ -4,6 +4,7 @@ 文件 建立目錄 設定 + 分享 一般 帳號 幫助 diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml index 51fd70b1..d471b430 100644 --- a/res/values-zh-rTW/strings.xml +++ b/res/values-zh-rTW/strings.xml @@ -10,6 +10,7 @@ 建立目錄 設定 詳細資料 + 分享 一般 更多 帳號 diff --git a/res/values/strings.xml b/res/values/strings.xml index 601a703d..822cb2a8 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -250,6 +250,7 @@ Sorry, sharing is not enabled on your server. Please contact your administrator. Unable to share this file or folder. Please, make sure it exists An error occurred while trying to share this file or folder + Unable to unshare this file or folder. It does not exist. An error occurred while trying to unshare this file or folder Send diff --git a/src/com/owncloud/android/datamodel/FileDataStorageManager.java b/src/com/owncloud/android/datamodel/FileDataStorageManager.java index d1e26034..f886e16c 100644 --- a/src/com/owncloud/android/datamodel/FileDataStorageManager.java +++ b/src/com/owncloud/android/datamodel/FileDataStorageManager.java @@ -1115,8 +1115,22 @@ public class FileDataStorageManager { } } - - + + public void removeShare(OCShare share){ + Uri share_uri = ProviderTableMeta.CONTENT_URI_SHARE; + String where = ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?" + " AND " + ProviderTableMeta.FILE_PATH + "=?"; + String [] whereArgs = new String[]{mAccount.name, share.getPath()}; + if (getContentProviderClient() != null) { + try { + getContentProviderClient().delete(share_uri, where, whereArgs); + } catch (RemoteException e) { + e.printStackTrace(); + } + } else { + getContentResolver().delete(share_uri, where, whereArgs); + } + } + public void saveSharesDB(ArrayList shares) { saveShares(shares); diff --git a/src/com/owncloud/android/files/FileOperationsHelper.java b/src/com/owncloud/android/files/FileOperationsHelper.java index ab8395cd..4b37a3ba 100644 --- a/src/com/owncloud/android/files/FileOperationsHelper.java +++ b/src/com/owncloud/android/files/FileOperationsHelper.java @@ -30,8 +30,7 @@ import com.owncloud.android.R; import com.owncloud.android.datamodel.OCFile; import com.owncloud.android.lib.accounts.OwnCloudAccount; import com.owncloud.android.lib.network.webdav.WebdavUtils; -import com.owncloud.android.lib.operations.common.ShareType; -import com.owncloud.android.operations.CreateShareOperation; +import com.owncloud.android.services.OperationsService; import com.owncloud.android.ui.activity.FileActivity; import com.owncloud.android.ui.dialog.ActivityChooserDialog; import com.owncloud.android.utils.Log_OC; @@ -108,12 +107,13 @@ public class FileOperationsHelper { if (file != null) { callerActivity.showLoadingDialog(); - CreateShareOperation createShare = new CreateShareOperation(file.getRemotePath(), ShareType.PUBLIC_LINK, "", false, "", 1, sendIntent); - createShare.execute(callerActivity.getStorageManager(), - callerActivity, - callerActivity.getRemoteOperationListener(), - callerActivity.getHandler(), - callerActivity); + + Intent service = new Intent(callerActivity, OperationsService.class); + service.setAction(OperationsService.ACTION_CREATE_SHARE); + service.putExtra(OperationsService.EXTRA_ACCOUNT, callerActivity.getAccount()); + service.putExtra(OperationsService.EXTRA_REMOTE_PATH, file.getRemotePath()); + service.putExtra(OperationsService.EXTRA_SEND_INTENT, sendIntent); + callerActivity.startService(service); } else { Log_OC.wtf(TAG, "Trying to open a NULL OCFile"); @@ -140,4 +140,24 @@ public class FileOperationsHelper { return false; } + + public void unshareFileWithLink(OCFile file, FileActivity callerActivity) { + + if (isSharedSupported(callerActivity)) { + // Unshare the file + Intent service = new Intent(callerActivity, OperationsService.class); + service.setAction(OperationsService.ACTION_UNSHARE); + service.putExtra(OperationsService.EXTRA_ACCOUNT, callerActivity.getAccount()); + service.putExtra(OperationsService.EXTRA_REMOTE_PATH, file.getRemotePath()); + callerActivity.startService(service); + + callerActivity.showLoadingDialog(); + + } else { + // Show a Message + Toast t = Toast.makeText(callerActivity, callerActivity.getString(R.string.share_link_no_support_share_api), Toast.LENGTH_LONG); + t.show(); + + } + } } diff --git a/src/com/owncloud/android/files/services/FileDownloader.java b/src/com/owncloud/android/files/services/FileDownloader.java index 064b703e..67bd796e 100644 --- a/src/com/owncloud/android/files/services/FileDownloader.java +++ b/src/com/owncloud/android/files/services/FileDownloader.java @@ -382,7 +382,7 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis * Updates the OC File after a successful download. */ private void saveDownloadedFile() { - OCFile file = mCurrentDownload.getFile(); + OCFile file = mStorageManager.getFileById(mCurrentDownload.getFile().getFileId()); long syncDate = System.currentTimeMillis(); file.setLastSyncDateForProperties(syncDate); file.setLastSyncDateForData(syncDate); diff --git a/src/com/owncloud/android/files/services/FileUploader.java b/src/com/owncloud/android/files/services/FileUploader.java index 06400c06..e9a4637a 100644 --- a/src/com/owncloud/android/files/services/FileUploader.java +++ b/src/com/owncloud/android/files/services/FileUploader.java @@ -597,6 +597,9 @@ public class FileUploader extends Service implements OnDatatransferProgressListe */ private void saveUploadedFile() { OCFile file = mCurrentUpload.getFile(); + if (file.fileExists()) { + file = mStorageManager.getFileById(file.getFileId()); + } long syncDate = System.currentTimeMillis(); file.setLastSyncDateForData(syncDate); diff --git a/src/com/owncloud/android/operations/CreateShareOperation.java b/src/com/owncloud/android/operations/CreateShareOperation.java index bf462a2c..7b646533 100644 --- a/src/com/owncloud/android/operations/CreateShareOperation.java +++ b/src/com/owncloud/android/operations/CreateShareOperation.java @@ -92,12 +92,10 @@ public class CreateShareOperation extends SyncOperation { OCShare share = (OCShare) result.getData().get(0); // Update DB with the response + share.setPath(mPath); if (mPath.endsWith(FileUtils.PATH_SEPARATOR)) { - share.setPath(mPath.substring(0, mPath.length()-1)); share.setIsFolder(true); - } else { - share.setPath(mPath); share.setIsFolder(false); } share.setPermissions(mPermissions); diff --git a/src/com/owncloud/android/operations/GetSharesOperation.java b/src/com/owncloud/android/operations/GetSharesOperation.java index 8f7a2ae8..eb221598 100644 --- a/src/com/owncloud/android/operations/GetSharesOperation.java +++ b/src/com/owncloud/android/operations/GetSharesOperation.java @@ -1,5 +1,5 @@ /* ownCloud Android client application - * Copyright (C) 2012-2013 ownCloud Inc. + * Copyright (C) 2012-2014 ownCloud Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, diff --git a/src/com/owncloud/android/operations/UnshareLinkOperation.java b/src/com/owncloud/android/operations/UnshareLinkOperation.java new file mode 100644 index 00000000..d4f9c378 --- /dev/null +++ b/src/com/owncloud/android/operations/UnshareLinkOperation.java @@ -0,0 +1,93 @@ +/* ownCloud Android client application + * Copyright (C) 2014 ownCloud Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +package com.owncloud.android.operations; + +import android.content.Context; + +import com.owncloud.android.datamodel.OCFile; +import com.owncloud.android.lib.network.OwnCloudClient; +import com.owncloud.android.lib.operations.common.OCShare; +import com.owncloud.android.lib.operations.common.RemoteOperationResult; +import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode; +import com.owncloud.android.lib.operations.remote.ExistenceCheckRemoteOperation; +import com.owncloud.android.lib.operations.remote.RemoveRemoteShareOperation; +import com.owncloud.android.operations.common.SyncOperation; +import com.owncloud.android.utils.Log_OC; + +/** + * Unshare file/folder + * Save the data in Database + * + * @author masensio + */ +public class UnshareLinkOperation extends SyncOperation { + + private static final String TAG = UnshareLinkOperation.class.getSimpleName(); + + private String mRemotePath; + private Context mContext; + + + public UnshareLinkOperation(String remotePath, Context context) { + mRemotePath = remotePath; + mContext = context; + } + + @Override + protected RemoteOperationResult run(OwnCloudClient client) { + RemoteOperationResult result = null; + + // Get Share for a file + OCShare share = getStorageManager().getShareByPath(mRemotePath); + + if (share != null) { + RemoveRemoteShareOperation operation = new RemoveRemoteShareOperation((int) share.getIdRemoteShared()); + result = operation.execute(client); + + if (result.isSuccess() || result.getCode() == ResultCode.SHARE_NOT_FOUND) { + Log_OC.d(TAG, "Share id = " + share.getIdRemoteShared() + " deleted"); + + OCFile file = getStorageManager().getFileByPath(mRemotePath); + file.setShareByLink(false); + file.setPublicLink(""); + getStorageManager().saveFile(file); + getStorageManager().removeShare(share); + + if (result.getCode() == ResultCode.SHARE_NOT_FOUND) { + if (existsFile(client, file.getRemotePath())) { + result = new RemoteOperationResult(ResultCode.OK); + } else { + getStorageManager().removeFile(file, true, true); + } + } + } + + } else { + result = new RemoteOperationResult(ResultCode.SHARE_NOT_FOUND); + } + + return result; + } + + private boolean existsFile(OwnCloudClient client, String remotePath){ + ExistenceCheckRemoteOperation existsOperation = new ExistenceCheckRemoteOperation(remotePath, mContext, false); + RemoteOperationResult result = existsOperation.execute(client); + return result.isSuccess(); + } + +} diff --git a/src/com/owncloud/android/services/OperationsService.java b/src/com/owncloud/android/services/OperationsService.java index 919bedb3..200d7a3b 100644 --- a/src/com/owncloud/android/services/OperationsService.java +++ b/src/com/owncloud/android/services/OperationsService.java @@ -18,16 +18,22 @@ package com.owncloud.android.services; import java.io.IOException; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; import java.util.concurrent.ConcurrentLinkedQueue; import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.lib.network.OwnCloudClientFactory; import com.owncloud.android.lib.network.OwnCloudClient; -import com.owncloud.android.operations.GetSharesOperation; +import com.owncloud.android.operations.CreateShareOperation; +import com.owncloud.android.operations.UnshareLinkOperation; import com.owncloud.android.operations.common.SyncOperation; +import com.owncloud.android.lib.operations.common.OnRemoteOperationListener; import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.operations.common.RemoteOperationResult; +import com.owncloud.android.lib.operations.common.ShareType; import com.owncloud.android.utils.Log_OC; import android.accounts.Account; @@ -51,7 +57,12 @@ public class OperationsService extends Service { public static final String EXTRA_ACCOUNT = "ACCOUNT"; public static final String EXTRA_SERVER_URL = "SERVER_URL"; - public static final String EXTRA_RESULT = "RESULT"; + public static final String EXTRA_REMOTE_PATH = "REMOTE_PATH"; + public static final String EXTRA_SEND_INTENT = "SEND_INTENT"; + public static final String EXTRA_RESULT = "RESULT"; + + public static final String ACTION_CREATE_SHARE = "CREATE_SHARE"; + public static final String ACTION_UNSHARE = "UNSHARE"; public static final String ACTION_OPERATION_ADDED = OperationsService.class.getName() + ".OPERATION_ADDED"; public static final String ACTION_OPERATION_FINISHED = OperationsService.class.getName() + ".OPERATION_FINISHED"; @@ -69,7 +80,7 @@ public class OperationsService extends Service { private Looper mServiceLooper; private ServiceHandler mServiceHandler; - private IBinder mBinder; + private OperationsServiceBinder mBinder; private OwnCloudClient mOwnCloudClient = null; private Target mLastTarget = null; private FileDataStorageManager mStorageManager; @@ -107,10 +118,30 @@ public class OperationsService extends Service { try { Account account = intent.getParcelableExtra(EXTRA_ACCOUNT); String serverUrl = intent.getStringExtra(EXTRA_SERVER_URL); + Target target = new Target(account, (serverUrl == null) ? null : Uri.parse(serverUrl)); - GetSharesOperation operation = new GetSharesOperation(); + RemoteOperation operation = null; + + String action = intent.getAction(); + if (action.equals(ACTION_CREATE_SHARE)) { // Create Share + String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH); + Intent sendIntent = intent.getParcelableExtra(EXTRA_SEND_INTENT); + if (remotePath.length() > 0) { + operation = new CreateShareOperation(remotePath, ShareType.PUBLIC_LINK, + "", false, "", 1, sendIntent); + } + } else if (action.equals(ACTION_UNSHARE)) { // Unshare file + String remotePath = intent.getStringExtra(EXTRA_REMOTE_PATH); + if (remotePath.length() > 0) { + operation = new UnshareLinkOperation(remotePath, this.getApplicationContext()); + } + } else { + // nothing we are going to handle + return START_NOT_STICKY; + } + mPendingOperations.add(new Pair(target, operation)); - sendBroadcastNewOperation(target, operation); + //sendBroadcastNewOperation(target, operation); Message msg = mServiceHandler.obtainMessage(); msg.arg1 = startId; @@ -150,8 +181,59 @@ public class OperationsService extends Service { * * It provides by itself the available operations. */ - public class OperationsServiceBinder extends Binder { - // TODO + public class OperationsServiceBinder extends Binder /* implements OnRemoteOperationListener */ { + + /** + * Map of listeners that will be reported about the end of operations from a {@link OperationsServiceBinder} instance + */ + private Map mBoundListeners = new HashMap(); + + /** + * Cancels an operation + * + * TODO + */ + public void cancel() { + // TODO + } + + + public void clearListeners() { + + mBoundListeners.clear(); + } + + + /** + * Adds a listener interested in being reported about the end of operations. + * + * @param listener Object to notify about the end of operations. + * @param callbackHandler {@link Handler} to access the listener without breaking Android threading protection. + */ + public void addOperationListener (OnRemoteOperationListener listener, Handler callbackHandler) { + mBoundListeners.put(listener, callbackHandler); + } + + + /** + * Removes a listener from the list of objects interested in the being reported about the end of operations. + * + * @param listener Object to notify about progress of transfer. + */ + public void removeOperationListener (OnRemoteOperationListener listener) { + mBoundListeners.remove(listener); + } + + + /** + * TODO - IMPORTANT: update implementation when more operations are moved into the service + * + * @return 'True' when an operation that enforces the user to wait for completion is in process. + */ + public boolean isPerformingBlockingOperation() { + return (!mPendingOperations.isEmpty()); + } + } @@ -242,15 +324,16 @@ public class OperationsService extends Service { } } - sendBroadcastOperationFinished(mLastTarget, mCurrentOperation, result); + //sendBroadcastOperationFinished(mLastTarget, mCurrentOperation, result); + callbackOperationListeners(mLastTarget, mCurrentOperation, result); } } /** - * Sends a LOCAL broadcast when a new operation is added to the queue. + * Sends a broadcast when a new operation is added to the queue. * - * Local broadcasts are only delivered to activities in the same process. + * Local broadcasts are only delivered to activities in the same process, but can't be done sticky :\ * * @param target Account or URL pointing to an OC server. * @param operation Added operation. @@ -291,6 +374,31 @@ public class OperationsService extends Service { //lbm.sendBroadcast(intent); sendStickyBroadcast(intent); } + + /** + * Notifies the currently subscribed listeners about the end of an operation. + * + * @param target Account or URL pointing to an OC server. + * @param operation Finished operation. + * @param result Result of the operation. + */ + private void callbackOperationListeners(Target target, final RemoteOperation operation, final RemoteOperationResult result) { + Iterator listeners = mBinder.mBoundListeners.keySet().iterator(); + while (listeners.hasNext()) { + final OnRemoteOperationListener listener = listeners.next(); + final Handler handler = mBinder.mBoundListeners.get(listener); + if (handler != null) { + handler.post(new Runnable() { + @Override + public void run() { + listener.onRemoteOperationFinish(operation, result); + } + }); + } + } + + } + } diff --git a/src/com/owncloud/android/ui/activity/FileActivity.java b/src/com/owncloud/android/ui/activity/FileActivity.java index 3c8a2011..dc3ad0db 100644 --- a/src/com/owncloud/android/ui/activity/FileActivity.java +++ b/src/com/owncloud/android/ui/activity/FileActivity.java @@ -23,9 +23,13 @@ import android.accounts.AccountManager; import android.accounts.AccountManagerCallback; import android.accounts.AccountManagerFuture; import android.accounts.OperationCanceledException; +import android.content.ComponentName; +import android.content.Context; import android.content.Intent; +import android.content.ServiceConnection; import android.os.Bundle; import android.os.Handler; +import android.os.IBinder; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; @@ -43,7 +47,10 @@ import com.owncloud.android.lib.operations.common.RemoteOperation; import com.owncloud.android.lib.operations.common.RemoteOperationResult; import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode; import com.owncloud.android.operations.CreateShareOperation; +import com.owncloud.android.operations.UnshareLinkOperation; +import com.owncloud.android.services.OperationsService; +import com.owncloud.android.services.OperationsService.OperationsServiceBinder; import com.owncloud.android.ui.dialog.LoadingDialog; import com.owncloud.android.utils.Log_OC; @@ -90,6 +97,10 @@ public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp private FileDataStorageManager mStorageManager = null; private FileOperationsHelper mFileOperationsHelper; + + private ServiceConnection mOperationsServiceConnection = null; + + private OperationsServiceBinder mOperationsServiceBinder = null; /** @@ -116,7 +127,9 @@ public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp } setAccount(account, savedInstanceState != null); - + + mOperationsServiceConnection = new OperationsServiceConnection(); + bindService(new Intent(this, OperationsService.class), mOperationsServiceConnection, Context.BIND_AUTO_CREATE); } @@ -132,7 +145,6 @@ public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp if (!validAccount) { swapToDefaultAccount(); } - } @@ -142,6 +154,28 @@ public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp if (mAccountWasSet) { onAccountSet(mAccountWasRestored); } + if (mOperationsServiceBinder != null) { + mOperationsServiceBinder.addOperationListener(FileActivity.this, mHandler); + } + } + + + @Override + protected void onStop() { + super.onStop(); + if (mOperationsServiceBinder != null) { + mOperationsServiceBinder.removeOperationListener(this); + } + } + + + @Override + protected void onDestroy() { + super.onDestroy(); + if (mOperationsServiceConnection != null) { + unbindService(mOperationsServiceConnection); + mOperationsServiceBinder = null; + } } @@ -353,16 +387,22 @@ public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp Log_OC.d(TAG, "Received result of operation in FileActivity - common behaviour for all the FileActivities "); if (operation instanceof CreateShareOperation) { onCreateShareOperationFinish((CreateShareOperation) operation, result); - } + + } else if (operation instanceof UnshareLinkOperation) { + onUnshareLinkOperationFinish((UnshareLinkOperation)operation, result); + + } } private void onCreateShareOperationFinish(CreateShareOperation operation, RemoteOperationResult result) { dismissLoadingDialog(); if (result.isSuccess()) { + updateFileFromDB(); + Intent sendIntent = operation.getSendIntent(); startActivity(sendIntent); - } else if (result.getCode() == ResultCode.FILE_NOT_FOUND) { // Error --> SHARE_NOT_FOUND + } else if (result.getCode() == ResultCode.SHARE_NOT_FOUND) { // Error --> SHARE_NOT_FOUND Toast t = Toast.makeText(this, getString(R.string.share_link_file_no_exist), Toast.LENGTH_LONG); t.show(); } else { // Generic error @@ -373,6 +413,31 @@ public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp } + private void onUnshareLinkOperationFinish(UnshareLinkOperation operation, RemoteOperationResult result) { + dismissLoadingDialog(); + + if (result.isSuccess()){ + updateFileFromDB(); + + } else if (result.getCode() == ResultCode.SHARE_NOT_FOUND) { // Error --> SHARE_NOT_FOUND + Toast t = Toast.makeText(this, getString(R.string.unshare_link_file_no_exist), Toast.LENGTH_LONG); + t.show(); + } else { // Generic error + // Show a Message, operation finished without success + Toast t = Toast.makeText(this, getString(R.string.unshare_link_file_error), Toast.LENGTH_LONG); + t.show(); + } + + } + + + private void updateFileFromDB(){ + OCFile file = getStorageManager().getFileByPath(getFile().getRemotePath()); + if (file != null) { + setFile(file); + } + } + /** * Show loading dialog */ @@ -396,5 +461,37 @@ public class FileActivity extends SherlockFragmentActivity implements OnRemoteOp loading.dismiss(); } } + + + /** + * Implements callback methods for service binding. Passed as a parameter to { + */ + private class OperationsServiceConnection implements ServiceConnection { + + @Override + public void onServiceConnected(ComponentName component, IBinder service) { + if (component.equals(new ComponentName(FileActivity.this, OperationsService.class))) { + Log_OC.d(TAG, "Operations service connected"); + mOperationsServiceBinder = (OperationsServiceBinder) service; + mOperationsServiceBinder.addOperationListener(FileActivity.this, mHandler); + if (!mOperationsServiceBinder.isPerformingBlockingOperation()) { + dismissLoadingDialog(); + } + + } else { + return; + } + } + + + @Override + public void onServiceDisconnected(ComponentName component) { + if (component.equals(new ComponentName(FileActivity.this, OperationsService.class))) { + Log_OC.d(TAG, "Operations service disconnected"); + mOperationsServiceBinder = null; + // TODO whatever could be waiting for the service is unbound + } + } + }; } diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index d5c0d5a9..e6963522 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -75,6 +75,7 @@ import com.owncloud.android.operations.RemoveFileOperation; import com.owncloud.android.operations.RenameFileOperation; import com.owncloud.android.operations.SynchronizeFileOperation; import com.owncloud.android.operations.SynchronizeFolderOperation; +import com.owncloud.android.operations.UnshareLinkOperation; import com.owncloud.android.services.OperationsService; import com.owncloud.android.syncadapter.FileSyncAdapter; import com.owncloud.android.ui.dialog.EditNameDialog; @@ -85,6 +86,7 @@ import com.owncloud.android.ui.fragment.FileDetailFragment; import com.owncloud.android.ui.fragment.FileFragment; import com.owncloud.android.ui.fragment.OCFileListFragment; import com.owncloud.android.ui.preview.PreviewImageActivity; +import com.owncloud.android.ui.preview.PreviewImageFragment; import com.owncloud.android.ui.preview.PreviewMediaFragment; import com.owncloud.android.ui.preview.PreviewVideoActivity; import com.owncloud.android.utils.DisplayUtils; @@ -186,6 +188,11 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa mRightFragmentContainer = findViewById(R.id.right_fragment_container); if (savedInstanceState == null) { createMinFragments(); + } else { + Log_OC.d(TAG, "Init the secondFragment again"); + if (mDualPane) { + initFragmentsWithFile(); + } } // Action bar setup @@ -200,6 +207,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa protected void onStart() { super.onStart(); getSupportActionBar().setIcon(DisplayUtils.getSeasonalIconId()); + refeshListOfFilesFragment(); } @Override @@ -278,7 +286,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa transaction.add(R.id.left_fragment_container, listOfFiles, TAG_LIST_OF_FILES); transaction.commit(); } - + private void initFragmentsWithFile() { if (getAccount() != null && getFile() != null) { /// First fragment @@ -1327,21 +1335,53 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa } else if (operation instanceof CreateFolderOperation) { onCreateFolderOperationFinish((CreateFolderOperation)operation, result); - + } else if (operation instanceof CreateShareOperation) { onCreateShareOperationFinish((CreateShareOperation) operation, result); - } + + } else if (operation instanceof UnshareLinkOperation) { + onUnshareLinkOperationFinish((UnshareLinkOperation)operation, result); + + } } - + private void onCreateShareOperationFinish(CreateShareOperation operation, RemoteOperationResult result) { if (result.isSuccess()) { + refreshShowDetails(); refeshListOfFilesFragment(); } } + private void onUnshareLinkOperationFinish(UnshareLinkOperation operation, RemoteOperationResult result) { + if (result.isSuccess()) { + refreshShowDetails(); + refeshListOfFilesFragment(); + } else if (result.getCode() == ResultCode.SHARE_NOT_FOUND) { + cleanSecondFragment(); + refeshListOfFilesFragment(); + } + } + + private void refreshShowDetails() { + FileFragment details = getSecondFragment(); + if (details != null) { + OCFile file = details.getFile(); + if (file != null) { + file = getStorageManager().getFileByPath(file.getRemotePath()); + if (details instanceof PreviewMediaFragment) { + // Refresh OCFile of the fragment + ((PreviewMediaFragment) details).updateFile(file); + } else { + showDetails(file); + } + } + invalidateOptionsMenu(); + } + } + /** * Updates the view associated to the activity after the finish of an operation trying to remove a * file. diff --git a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java index 216cceec..fb5b6a92 100644 --- a/src/com/owncloud/android/ui/fragment/FileDetailFragment.java +++ b/src/com/owncloud/android/ui/fragment/FileDetailFragment.java @@ -186,6 +186,10 @@ public class FileDetailFragment extends FileFragment implements super.onActivityCreated(savedInstanceState); if (mAccount != null) { mStorageManager = new FileDataStorageManager(mAccount, getActivity().getApplicationContext().getContentResolver()); + OCFile file = mStorageManager.getFileByPath(getFile().getRemotePath()); + if (file != null) { + setFile(file); + } } } @@ -310,7 +314,14 @@ public class FileDetailFragment extends FileFragment implements toHide.add(R.id.action_remove_file); } - + + // Options shareLink + if (!file.isShareByLink()) { + toHide.add(R.id.action_unshare_file); + } else { + toShow.add(R.id.action_unshare_file); + } + MenuItem item = null; for (int i : toHide) { item = menu.findItem(i); @@ -340,6 +351,11 @@ public class FileDetailFragment extends FileFragment implements activity.getFileOperationsHelper().shareFileWithLink(getFile(), activity); return true; } + case R.id.action_unshare_file: { + FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity(); + activity.getFileOperationsHelper().unshareFileWithLink(getFile(), activity); + return true; + } case R.id.action_open_file_with: { FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity(); activity.getFileOperationsHelper().openFile(getFile(), activity); diff --git a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java index d0f62aed..5c6817e3 100644 --- a/src/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/src/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -259,6 +259,11 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName toHide.add(R.id.action_cancel_upload); } } + + // Options shareLink + if (!targetFile.isShareByLink()) { + toHide.add(R.id.action_unshare_file); + } for (int i : toHide) { item = menu.findItem(i); @@ -284,12 +289,17 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName public boolean onContextItemSelected (MenuItem item) { AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); mTargetFile = (OCFile) mAdapter.getItem(info.position); - switch (item.getItemId()) { + switch (item.getItemId()) { case R.id.action_share_file: { FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity(); activity.getFileOperationsHelper().shareFileWithLink(mTargetFile, activity); return true; } + case R.id.action_unshare_file: { + FileDisplayActivity activity = (FileDisplayActivity) getSherlockActivity(); + activity.getFileOperationsHelper().unshareFileWithLink(mTargetFile, activity); + return true; + } case R.id.action_rename_file: { String fileName = mTargetFile.getFileName(); int extensionStart = mTargetFile.isFolder() ? -1 : fileName.lastIndexOf("."); @@ -363,7 +373,7 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName return super.onContextItemSelected(item); } } - + /** * Use this to query the {@link OCFile} that is currently @@ -432,7 +442,7 @@ public class OCFileListFragment extends ExtendedListFragment implements EditName * @param file */ public void onBrowsedDownTo(OCFile folder); - + public void startDownloadForPreview(OCFile file); public void startMediaPreview(OCFile file, int i, boolean b); diff --git a/src/com/owncloud/android/ui/preview/PreviewImageActivity.java b/src/com/owncloud/android/ui/preview/PreviewImageActivity.java index 374a53b7..548a27b3 100644 --- a/src/com/owncloud/android/ui/preview/PreviewImageActivity.java +++ b/src/com/owncloud/android/ui/preview/PreviewImageActivity.java @@ -45,6 +45,12 @@ import com.owncloud.android.files.services.FileDownloader; import com.owncloud.android.files.services.FileUploader; import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder; import com.owncloud.android.files.services.FileUploader.FileUploaderBinder; +import com.owncloud.android.lib.operations.common.OnRemoteOperationListener; +import com.owncloud.android.lib.operations.common.RemoteOperation; +import com.owncloud.android.lib.operations.common.RemoteOperationResult; +import com.owncloud.android.lib.operations.common.RemoteOperationResult.ResultCode; +import com.owncloud.android.operations.CreateShareOperation; +import com.owncloud.android.operations.UnshareLinkOperation; import com.owncloud.android.ui.activity.FileActivity; import com.owncloud.android.ui.activity.FileDisplayActivity; import com.owncloud.android.ui.activity.PinCodeActivity; @@ -59,7 +65,7 @@ import com.owncloud.android.utils.Log_OC; * * @author David A. Velasco */ -public class PreviewImageActivity extends FileActivity implements FileFragment.ContainerActivity, ViewPager.OnPageChangeListener, OnTouchListener { +public class PreviewImageActivity extends FileActivity implements FileFragment.ContainerActivity, ViewPager.OnPageChangeListener, OnTouchListener , OnRemoteOperationListener{ public static final int DIALOG_SHORT_WAIT = 0; @@ -147,7 +153,43 @@ public class PreviewImageActivity extends FileActivity implements FileFragment.C outState.putBoolean(KEY_WAITING_FOR_BINDER, mRequestWaitingForBinder); } - + @Override + public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) { + super.onRemoteOperationFinish(operation, result); + + if (operation instanceof CreateShareOperation) { + onCreateShareOperationFinish((CreateShareOperation) operation, result); + + } else if (operation instanceof UnshareLinkOperation) { + onUnshareLinkOperationFinish((UnshareLinkOperation) operation, result); + + } + } + + + private void onUnshareLinkOperationFinish(UnshareLinkOperation operation, RemoteOperationResult result) { + if (result.isSuccess()) { + OCFile file = getStorageManager().getFileByPath(getFile().getRemotePath()); + if (file != null) { + setFile(file); + } + invalidateOptionsMenu(); + } else if (result.getCode() == ResultCode.SHARE_NOT_FOUND) { + backToDisplayActivity(); + } + + } + + private void onCreateShareOperationFinish(CreateShareOperation operation, RemoteOperationResult result) { + if (result.isSuccess()) { + OCFile file = getStorageManager().getFileByPath(getFile().getRemotePath()); + if (file != null) { + setFile(file); + } + invalidateOptionsMenu(); + } + } + /** Defines callbacks for service binding, passed to bindService() */ private class PreviewImageServiceConnection implements ServiceConnection { diff --git a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java index 84cdcc6b..80d5d1ed 100644 --- a/src/com/owncloud/android/ui/preview/PreviewImageFragment.java +++ b/src/com/owncloud/android/ui/preview/PreviewImageFragment.java @@ -176,8 +176,22 @@ public class PreviewImageFragment extends FileFragment implements OnRemoteOper mStorageManager = new FileDataStorageManager(mAccount, getActivity().getApplicationContext().getContentResolver()); if (savedInstanceState != null) { if (!mIgnoreFirstSavedState) { - setFile((OCFile)savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_FILE)); + OCFile file = (OCFile)savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_FILE); mAccount = savedInstanceState.getParcelable(PreviewImageFragment.EXTRA_ACCOUNT); + + // Update the file + if (mAccount!= null) { + mStorageManager = new FileDataStorageManager(mAccount, getActivity().getApplicationContext().getContentResolver()); + OCFile updatedFile = mStorageManager.getFileByPath(file.getRemotePath()); + if (updatedFile != null) { + setFile(updatedFile); + } else { + setFile(file); + } + } else { + setFile(file); + } + } else { mIgnoreFirstSavedState = false; } @@ -230,6 +244,11 @@ public class PreviewImageFragment extends FileFragment implements OnRemoteOper toHide.add(R.id.action_cancel_upload); toHide.add(R.id.action_download_file); toHide.add(R.id.action_rename_file); // by now + + // Options shareLink + if (!getFile().isShareByLink()) { + toHide.add(R.id.action_unshare_file); + } for (int i : toHide) { item = menu.findItem(i); @@ -241,6 +260,27 @@ public class PreviewImageFragment extends FileFragment implements OnRemoteOper } + /** + * {@inheritDoc} + */ + @Override + public void onPrepareOptionsMenu(Menu menu) { + super.onPrepareOptionsMenu(menu); + + MenuItem item = menu.findItem(R.id.action_unshare_file); + // Options shareLink + OCFile file = ((FileActivity) getSherlockActivity()).getFile(); + if (!file.isShareByLink()) { + item.setVisible(false); + item.setEnabled(false); + } else { + item.setVisible(true); + item.setEnabled(true); + } + + } + + /** * {@inheritDoc} @@ -253,6 +293,11 @@ public class PreviewImageFragment extends FileFragment implements OnRemoteOper act.getFileOperationsHelper().shareFileWithLink(getFile(), act); return true; } + case R.id.action_unshare_file: { + FileActivity act = (FileActivity)getSherlockActivity(); + act.getFileOperationsHelper().unshareFileWithLink(getFile(), act); + return true; + } case R.id.action_open_file_with: { openFile(); return true; @@ -284,6 +329,7 @@ public class PreviewImageFragment extends FileFragment implements OnRemoteOper } + private void seeDetails() { ((FileFragment.ContainerActivity)getActivity()).showDetails(getFile()); } diff --git a/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java b/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java index ee4a7b00..4c52280e 100644 --- a/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java +++ b/src/com/owncloud/android/ui/preview/PreviewMediaFragment.java @@ -289,7 +289,12 @@ public class PreviewMediaFragment extends FileFragment implements toHide.add(R.id.action_download_file); toHide.add(R.id.action_sync_file); toHide.add(R.id.action_rename_file); // by now - + + // Options shareLink + if (!getFile().isShareByLink()) { + toHide.add(R.id.action_unshare_file); + } + for (int i : toHide) { item = menu.findItem(i); if (item != null) { @@ -300,6 +305,25 @@ public class PreviewMediaFragment extends FileFragment implements } + + /** + * {@inheritDoc} + */ + @Override + public void onPrepareOptionsMenu(Menu menu) { + super.onPrepareOptionsMenu(menu); + + MenuItem item = menu.findItem(R.id.action_unshare_file); + // Options shareLink + if (!getFile().isShareByLink()) { + item.setVisible(false); + item.setEnabled(false); + } else { + item.setVisible(true); + item.setEnabled(true); + } + } + /** * {@inheritDoc} @@ -311,6 +335,10 @@ public class PreviewMediaFragment extends FileFragment implements shareFileWithLink(); return true; } + case R.id.action_unshare_file: { + unshareFileWithLink(); + return true; + } case R.id.action_open_file_with: { openFile(); return true; @@ -328,7 +356,22 @@ public class PreviewMediaFragment extends FileFragment implements return false; } } + + + /** + * Update the file of the fragment with file value + * @param file + */ + public void updateFile(OCFile file){ + setFile(file); + } + + private void unshareFileWithLink() { + stopPreview(false); + FileActivity activity = (FileActivity)((FileFragment.ContainerActivity)getActivity()); + activity.getFileOperationsHelper().unshareFileWithLink(getFile(), activity); + } private void shareFileWithLink() { stopPreview(false); @@ -545,17 +588,19 @@ public class PreviewMediaFragment extends FileFragment implements @Override public void onServiceConnected(ComponentName component, IBinder service) { - if (component.equals(new ComponentName(getActivity(), MediaService.class))) { - Log_OC.d(TAG, "Media service connected"); - mMediaServiceBinder = (MediaServiceBinder) service; - if (mMediaServiceBinder != null) { - prepareMediaController(); - playAudio(); // do not wait for the touch of nobody to play audio - - Log_OC.d(TAG, "Successfully bound to MediaService, MediaController ready"); - - } else { - Log_OC.e(TAG, "Unexpected response from MediaService while binding"); + if (getActivity() != null) { + if (component.equals(new ComponentName(getActivity(), MediaService.class))) { + Log_OC.d(TAG, "Media service connected"); + mMediaServiceBinder = (MediaServiceBinder) service; + if (mMediaServiceBinder != null) { + prepareMediaController(); + playAudio(); // do not wait for the touch of nobody to play audio + + Log_OC.d(TAG, "Successfully bound to MediaService, MediaController ready"); + + } else { + Log_OC.e(TAG, "Unexpected response from MediaService while binding"); + } } } }