Hello community, here is the log from the commit of package parley for openSUSE:Factory checked in at 2016-07-24 19:49:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/parley (Old) and /work/SRC/openSUSE:Factory/.parley.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "parley" Changes: -------- --- /work/SRC/openSUSE:Factory/parley/parley.changes 2016-06-25 02:03:45.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.parley.new/parley.changes 2016-07-24 19:49:37.000000000 +0200 @@ -1,0 +2,8 @@ +Fri Jul 8 09:22:40 UTC 2016 - [email protected] + +- Update to KDE Applications 16.04.3 + * KDE Applications 16.04.3 + * https://www.kde.org/announcements/announce-applications-16.04.3.php + + +------------------------------------------------------------------- Old: ---- parley-16.04.2.tar.xz New: ---- parley-16.04.3.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ parley.spec ++++++ --- /var/tmp/diff_new_pack.08a0LF/_old 2016-07-24 19:49:38.000000000 +0200 +++ /var/tmp/diff_new_pack.08a0LF/_new 2016-07-24 19:49:38.000000000 +0200 @@ -17,7 +17,7 @@ Name: parley -Version: 16.04.2 +Version: 16.04.3 Release: 0 Summary: Vocabulary Trainer License: GPL-2.0+ ++++++ parley-16.04.2.tar.xz -> parley-16.04.3.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.2/docs/parley/index.docbook new/parley-16.04.3/docs/parley/index.docbook --- old/parley-16.04.2/docs/parley/index.docbook 2016-04-12 16:06:27.000000000 +0200 +++ new/parley-16.04.3/docs/parley/index.docbook 2016-06-18 18:29:44.000000000 +0200 @@ -1027,7 +1027,7 @@ </mediaobject> </screenshot> </para> -<para> +<!--para> The needed images can be obtained from Google search using &parley; inbuilt scripts. </para> <para> @@ -1059,7 +1059,7 @@ <para> Due to the current script limitations the image files cannot be saved in the paths with Unicode symbols in the names of folders and files. </para> -</warning> +</warning--> </sect1> <sect1 id="adding-sound"><title>Adding Sound</title> <para>First show the sound tool by selecting <guilabel>View</guilabel> in the menubar and then clicking on <guilabel>Sound</guilabel>. This will show up the sound section on the right hand side of the &parley; screen. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.2/plugins/CMakeLists.txt new/parley-16.04.3/plugins/CMakeLists.txt --- old/parley-16.04.2/plugins/CMakeLists.txt 2016-04-12 16:06:27.000000000 +0200 +++ new/parley-16.04.3/plugins/CMakeLists.txt 2016-06-18 18:29:44.000000000 +0200 @@ -3,7 +3,6 @@ google_dictionary.desktop leo-dict.desktop example.desktop - google_images.desktop DESTINATION ${KDE_INSTALL_DATADIR}/parley/plugins) #script files @@ -11,12 +10,6 @@ google_dictionary.py leo-dict.py example.py - google_images.py - DESTINATION ${KDE_INSTALL_DATADIR}/parley/plugins) - -#ui files -install(FILES - google_images.ui DESTINATION ${KDE_INSTALL_DATADIR}/parley/plugins) add_subdirectory( wiktionary ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.2/plugins/google_images.desktop new/parley-16.04.3/plugins/google_images.desktop --- old/parley-16.04.2/plugins/google_images.desktop 2016-04-12 16:06:27.000000000 +0200 +++ new/parley-16.04.3/plugins/google_images.desktop 1970-01-01 01:00:00.000000000 +0100 @@ -1,94 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Icon=mypluginicon -Type=Service -ServiceTypes=KPluginInfo - -Name=Google Images (online image fetching) -Name[bg]=Изображения в Google (изтегляне на изображения от мрежата) -Name[bs]=Google slike (on-line uzimanje slike) -Name[ca]=Imatges de Google (recull imatges en línia) -Name[ca@valencia]=Imatges de Google (recull imatges en línia) -Name[cs]=Obrázky Google (získávání obrázků z internetu) -Name[da]=Google Images (hent billeder online) -Name[de]=Google-Bilder (Online Herunterladen von Bildern) -Name[el]=Εικόνες Google (διαδικτυακή ανάκτηση εικόνων) -Name[en_GB]=Google Images (online image fetching) -Name[es]=Imágenes de Google (obtención de imágenes de la red) -Name[et]=Google'i pildid (piltide tõmbamine veebist) -Name[eu]=Google-ren irudiak (lineako irudiak eskuratzea) -Name[fi]=Google-kuvahaku (kuvien noutaminen verkosta) -Name[fr]=Images Google (téléchargement d'images en ligne) -Name[ga]=Íomhánna Google (cuardach íomhá ar líne) -Name[gl]=Imaxes de Google (obtén imaxes da rede) -Name[gu]=ગુગલ ઇમેજીસ (ઓનલાઇન ચિત્ર મેળવવાનું) -Name[hu]=Google Images (internetes képletöltéssel) -Name[is]=Google myndir (sækir myndir á netið) -Name[it]=Google Immagini (recupero di immagini da Internet) -Name[ja]=Google イメージ (オンライン画像検索) -Name[kk]=Google кескіндері (онлайн кескіндерді қарастыру) -Name[km]=រូបភាពហ្គូហ្គល (ការទៅយករូបភាពលើបណ្ដាញ) -Name[ko]=구글 그림 (온라인으로 그림 가져오기) -Name[lt]=Paveikslai iš Google (paveikslų atsiuntimas iš tinklo) -Name[lv]=Google attēli (tiešsaistes attēlu ielāde) -Name[nb]=Google-bilder (henter bilder fra nettverket) -Name[nds]=Google-Biller (Internetbiller halen) -Name[nl]=Google Images (ophalen van afbeeldingen) -Name[nn]=Google-bilete (henting av bilete frå nettet) -Name[pa]=ਗੂਗਲ ਚਿੱਤਰ (ਆਨਲਾਈਨ ਚਿੱਤਰ ਲਵੋ) -Name[pl]=Google Images (pobieranie obrazów) -Name[pt]=Google Images (pesquisa de imagens 'online') -Name[pt_BR]=Google Images (obtenção de imagens online) -Name[ru]=Google Картинки (загрузка картинок из Интернета) -Name[sk]=Obrázky Google (online sťahovanie obrázkov) -Name[sl]=Google Slike (pridobivanje slik s spleta) -Name[sv]=Googles bilder (direkt bildhämtning) -Name[tr]=Google Resimler (çevrimiçi resim getirme) -Name[uk]=Зображення Google (інтерактивне отримання зображень) -Name[x-test]=xxGoogle Images (online image fetching)xx -Name[zh_CN]=Google 图像(在线获取图像) -Name[zh_TW]=Google 影像(線上影像拮取) -Comment=This script automatically fetches images from images.google.com for the selected word. The search language depends on the selected word. Downloaded images are stored in a <em>document file name</em>_files folder next to the document file. Requires PyQt4. -Comment[bs]=Ova skripta automatski preuzima slike iz images.google.com za izabranu riječ. Jezik pretrage zavisi od izabrane riječi. Preuzete slike se čuvaju u <em> dokumentovo ime datoteke </em> _files direktoriju pored datoteke dokumenta. Zahtijeva PyQt4. -Comment[ca]=Aquest script recull automàticament imatges des d'«images.google.com» per al mot seleccionat. L'idioma de cerca depèn del mot seleccionat. Les imatges descarregades es desen a la carpeta <em>nom del fitxer del document</em>_files prop del fitxer del document. Requereix PyQt4. -Comment[ca@valencia]=Este script recull automàticament imatges des d'«images.google.com» per al mot seleccionat. L'idioma de cerca depèn del mot seleccionat. Les imatges descarregades es guarden a la carpeta <em>nom del fitxer del document</em>_files prop del fitxer del document. Requereix PyQt4. -Comment[cs]=Tento skript získává obrázky související s vybraným slovem automaticky z adresy images.google.com. Jazyk hledání závisí na vybraném slově. Stažené obrázky jsou uloženy ve složce se soubory <em>název souboru dokumentu</em>_ vedle souboru s dokumentem. Vyžaduje PyQt4. -Comment[da]=Dette script henter automatisk billeder fra images.google.com for det markerede ord. Søgesproget afhænger af det valgte ord. Downloadede billeder gemmes i mappen <em>document file name</em>_files ved siden af dokumentfilen. Kræver PyQt4. -Comment[de]=Das Skript lädt automatisch Bilder von images.google.de für das ausgewählte Wort. Die Suchsprache hängt von dem ausgewählten Wort ab. Die heruntergeladenen Bilder werden in <em>document file name</em>_Dateien-Ordner neben der Dokumentendatei gespeichert. Benötigt PyQt4. -Comment[el]=Το σενάριο αυτό ανακτά αυτόματα εικόνες από το images.google.com για την επιλεγμένη λέξη. Η γλώσσα αναζήτησης εξαρτάται από την επιλεγμένη λέξη. Οι ληφθείσες εικόνες αποθηκεύονται σε έναν <em>όνομα αρχείου εγγράφου</em>_files φάκελο δίπλα στο αρχείο του εγγράφου. Απαιτείται το PyQt4. -Comment[en_GB]=This script automatically fetches images from images.google.com for the selected word. The search language depends on the selected word. Downloaded images are stored in a <em>document file name</em>_files folder next to the document file. Requires PyQt4. -Comment[es]=Este guion obtiene las imágenes automáticamente de images.google.com para la palabra seleccionada. El idioma de búsqueda depende de la palabra seleccionada. Las imágenes descargadas se guardan en una carpeta <em>nombre de archivo del documento</em>_archivos junto al archivo del documento. Necesita PyQt4. -Comment[et]=See skript tõmbab automaatselt aadressilt images.google.com valitud sõnaga seotud pildid. Otsingukeel sõltub valitud sõnast. Allalaaditud pildid salvestatakse koos dokumendifailiga kataloogi <em>dokumendifaili nimi</em>_files. Vajalik on PyQt4. -Comment[fi]=Noutaa valittuun sanaan liittyviä kuvia automaattisesti osoitteesta images.google.com. Hakukieli riippuu valitusta sanasta. Ladatut kuvat tallennetaan sanastotiedoston viereen <em>tiedostonimi</em>_files-kansioon. Vaatii PyQt4:n. -Comment[fr]=Ce script télécharge automatiquement des images à partir de « images.google.com » pour le mot sélectionné. La langue de recherche dépend du mot sélectionné. Les images téléchargées sont enregistrées dans un dossier « <<document file name>>_files », situé au même endroit que le fichier du document. Ce script nécessite « PyQt4 ». -Comment[gl]=Este script obtén automaticamente imaxes desde images.google.com relacionadas coa palabra escollida. A lingua de busca depende da palabra escollida. As imaxes obtidas gárdanse nun cartafol <em>nome do ficheiro do documentos</em>_files xunto ao ficheiro do documento. Require o PyQt4. -Comment[hu]=Ez a szkript képeket tölt le automatikusan a kijelölt szóhoz az images.google.com weboldalról. A keresési nyelv az adott szótól függ. A letöltött képek a <em>dokumentum fájlnév</em>_files nevű mappába kerülnek a dokumentumfájl mellé. PyQt4 szükséges a használathoz. -Comment[it]=Questo script recupera automaticamente immagini da images.google.com per la parola selezionata. La lingua di ricerca dipende dalla parola selezionata. Le immagini scaricare sono memorizzare in una cartella <em>nome file del documento</em>_files, nella stessa cartella del documento. Richiede PyQt4. -Comment[kk]=Бұл скрипт таңдалған сөзге автоматты түрде images.google.com көмегімен кескіндерді қарастырады. Іздеу тілі таңдалған сөзге байланысты. Жүктеп алынған кескіндер құжат файлы кейінгі <em>document file name</em>_files қапшығына cақталады. PyQt4 дегенді қажет етеді. -Comment[ko]=이 스크립트는 선택한 단어와 연관된 그림을 images.google.com에서 받아옵니다. 검색 언어는 선택한 단어에 따라 정해집니다. 다운로드한 그림은 문서 파일이 저장된 폴더의 <em>문서 파일 이름</em>_files 폴더에 저장됩니다. PyQt4가 필요합니다. -Comment[lt]=Šis scenarijus iš images.google.com automatiškai atsiunčia su pažymėtu žodžiu susijusius paveikslus. Kalba, pagal kuria ieškoma, priklauso nuo pažymėtojo žodžio. Atsiųstieji paveikslai talpinami aplanke „<em>dokumento failo pavadinimas</em>_failai“, šalia dokumento failo. Privalomas PyQt4. -Comment[nb]=Dette skriptet henter automatisk bilder fra images.google.com for det valgte ordet. Søkespråket avhenger av det valgte ordet. De nedlastede bildene lagres i en mappe <em>document file name</em>_files nær dokumentfila. Krever PyQt4. -Comment[nds]=Dit Skript haalt automaatsch vun "images.google.com" Biller för dat utsöchte Woort. De Söökspraak hangt vun dat markeerte Woort af. Daallaadt Biller warrt binnen en Orner <em>Dokment-Dateinaam</em>_files neegst de Dokmentdatei sekert. Bruukt PyQt4. -Comment[nl]=Dit script haalt automatisch afbeeldingen op van images.google.com, die bij het geselecteerde woord horen. De zoektaal hangt af van het geselecteerde woord. De opgehaalde afbeeldingen worden opgeslagen in een map <em>bestandsnaam document</em>_files, samen met het documentbestand. PyQt4 is vereist. -Comment[pl]=Ten skrypt samoczynnie pobiera odpowiadające wybranym słowom obrazy z images.google.com. Język wyszukiwania zależy od słowa. Pobrane obrazy są przechowywane w katalogu <em>nazwa pliku dokumentu</em>_files obok pliku dokumentu. Potrzebne jest PyQT4. -Comment[pt]=Este programa obtém automaticamente imagens do images.google.com para a palavra seleccionada. A língua da pesquisa depende da palavra seleccionada. As imagens transferidas são guardadas numa pasta <em>nome do ficheiro do documento</em>_files, ao lado do ficheiro do documento. Necessita do PyQt4. -Comment[pt_BR]=Este script obtém imagens automaticamente do images.google.com para a palavra selecionada. O idioma de pesquisa depende da palavra selecionada. As imagens baixadas são guardadas em uma pasta <em>nome do arquivo de documento</em>_files. Requer o PyQt4. -Comment[ru]=Этот сценарий автоматически получает картинки с images.google.com для выбранных слов. Язык поиска зависит от выбранных слов. Загруженные картинки сохраняются в папке <<document file name>>. Требуется PyQt4. -Comment[sk]=Tento skript automaticky stiahne obrázky z images.google.com pre vybrané slovo. Jazyk hľadania závisí od vybraného slova. Stiahnuté obrázky sa uložia v priečinku súborov <em>názov súboru dokumentu</em> vedľa súborov dokumentov. Vyžaduje PyQT4. -Comment[sl]=Ta skript s spletišča images.google.com samodejno pridobi slike za izbrano besedo. Iskalni jezik je odvisen od izbrane besede. Prejete slike so shranjene v mapo <em>ime datoteke dokumenta</em>_files poleg datoteke dokumenta. Potrebuje PyQt4. -Comment[sv]=Skriptet hämtar automatiskt bilder från images.google.com för det valda ordet. Sökspråk beror på det valda ordet. Nerladdade bilder lagras i katalogen <em>dokumentfilnamn</em>_files intill dokumentfilen. Kräver PyQt4. -Comment[tr]=Bu betik, seçili kelime için images.google.com daki resimleri otomatik olarak getirir. Arama dili, seçili kelimeye göre değişir. İndirilen resimler dosyanın bulunduğu dizinde <em>dosyaadı</em>_files dizinine konur. PyQt4 gerektirir. -Comment[uk]=Цей скрипт автоматично отримує зображення з images.google.com за вибраним словом. Мова пошуку залежить від вибраного слова. Отримані зображення зберігаються у теці <em>назва файла документа</em>_files поряд з файлом документа. Потрібен PyQt4. -Comment[x-test]=xxThis script automatically fetches images from images.google.com for the selected word. The search language depends on the selected word. Downloaded images are stored in a <em>document file name</em>_files folder next to the document file. Requires PyQt4.xx -Comment[zh_CN]=本脚本可自动为所选单词从 images.google.com 获取图像。搜索语言取决于所选的单词。下载的图像保存在文档文件所处的 <em>document file name</em>文件夹。需要 PyQt4。 -Comment[zh_TW]=此文稿會自動為選取的字從 images.google.com 抓取影像。搜尋語言與選取的單字有關。下載的影像會放在 "<em>文件檔名</em>_files" 的資料夾中。此文稿需要使用 PyQt4。 -Script=google_images.py - -X-KDE-PluginInfo-Author=Avgoustinos Kadis [email protected] -X-KDE-PluginInfo-Name=google_images -X-KDE-PluginInfo-Version=1.1 -X-KDE-PluginInfo-Website=http://edu.kde.org/parley -X-KDE-PluginInfo-Category=Images -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-EnabledByDefault=true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.2/plugins/google_images.py new/parley-16.04.3/plugins/google_images.py --- old/parley-16.04.2/plugins/google_images.py 2016-04-12 16:06:27.000000000 +0200 +++ new/parley-16.04.3/plugins/google_images.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,257 +0,0 @@ -#!/usr/bin/env kf5kross -# -*- coding: utf-8 -*- -import Parley -import socket -from PyQt4 import QtGui -from PyQt4 import QtCore -from PyQt4 import uic -# for localization (i18n) -import Kross -from PyKDE4.kdeui import KIcon -from PyKDE4.kdeui import KDialog -from PyKDE4.kdeui import KMessageBox - -from os import path -from os import mkdir -import urllib2 -import urllib -import simplejson - -T = Kross.module("kdetranslation") - -# TODO -# + Fetch more images (get the next results page) -# + Resize images before saving (to take less space) -# + comment out the code! -# + improve getIdentifier function (maybe by adding a new C++ function) -# + add "Alert" message box when no translation was selected - - -#GUI -uiFile = "google_images.ui" - -#dialog class (loads google_images.ui) -class ImageDialog(KDialog): - def __init__(self, translations): - KDialog.__init__(self) - - self.w = None - #look for the uiFile in plugin dirs and get the first occurrence of it - for plugindir in Parley.pluginDirs(): - if path.exists(plugindir+uiFile): - (ImageWidget, widget) = uic.loadUiType(plugindir+uiFile) - self.w = ImageWidget() - self.w.setupUi(self.mainWidget()) - break - - if self.w is None: - KMessageBox.error(None, T.i18n("Error: ui file not found.\nCheck your installation."), T.i18n("Fetch Image")) - return - - self.translation = translations[0] - - #member variables - self.word = self.translation.text - self.locale = locale(getIdentifier(self.translation)) - - self.w.nextButton.setIcon(KIcon("go-next")) - self.w.previousButton.setIcon(KIcon("go-previous")) - self.w.searchButton.setIcon(KIcon("edit-find")) - - # Connect signals - self.connect(self.w.nextButton, QtCore.SIGNAL("clicked()"),self.nextImage) - self.connect(self.w.previousButton, QtCore.SIGNAL("clicked()"),self.previousImage) - self.connect(self.w.searchButton, QtCore.SIGNAL("clicked()"),self.searchBtnClicked) - self.connect(self.w.freeImageCheckBox, QtCore.SIGNAL("clicked()"),self.searchBtnClicked) - self.connect(self, QtCore.SIGNAL("okClicked()"),self.okBtnClicked) - self.connect(self, QtCore.SIGNAL("cancelClicked()"),self.cancelBtnClicked) - - #set search text - self.w.searchEdit.setText(self.word) - - #display image - self.searchBtnClicked() - - - def showImage(self,url): - #pixmap = self.getPixmap("http://www.tuning-blog.net/wp-content/uploads/2007/05/audittclubsportquattro1.jpg") - pixmap = self.getPixmap(url) - if pixmap: - p = pixmap.scaledToWidth(self.width()-10) - if p.height() > self.height()-100: - p = p.scaledToHeight(self.height()-100) - self.w.imageLabel.setPixmap(p) - return True - else: - return False - - - #Returns a QPixmap from the given http url or None if url is invalid - def getPixmap(self,url): - pixmap = QtGui.QPixmap() - try: - img = urllib2.urlopen(url) - imgdata = img.read() - pixmap.loadFromData(imgdata); - return pixmap - except: - print "Image not found" - return None - - - def nextImage(self): - self.img_index += 1 - if self.img_index < len(self.images): - print self.images[self.img_index] - if not self.showImage(self.images[self.img_index]): - self.nextImage() - - def previousImage(self): - self.img_index -= 1 - if self.img_index >= 0: - print self.images[self.img_index] - if not self.showImage(self.images[self.img_index]): - self.previousImage() - - def searchBtnClicked(self): - data = self.fetchData() - self.images = getImageUrls(data) - #display the first image (a small hack) - self.img_index = -1 - self.nextImage() - - def okBtnClicked(self): - filesdir = getFilesDir() - if not path.exists(filesdir): - mkdir(filesdir) - url = self.images[self.img_index] - [u,img_name] = url.rsplit("/",1) - [name,ext] = img_name.rsplit(".",1) - - #get a unique file name - if path.exists(filesdir+"/"+name+"."+ext): - c = 1 - while path.exists(filesdir+"/"+name+"-"+str(c)+"."+ext): - c += 1 - fn = filesdir+"/"+name+"-"+str(c)+"."+ext - else: - fn = filesdir+"/"+name+"."+ext - - print fn - - self.w.imageLabel.pixmap().save(fn) - self.translation.imageUrl = fn - self.close() - - def cancelBtnClicked(self): - self.close() - - - # fetches the json document for the given word and language pair - def fetchData(self): - timeout = 10.0 - socket.setdefaulttimeout(timeout) - - url = "https://ajax.googleapis.com/ajax/services/search/images" - user_agent = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008072820 Firefox/3.0.1' - #params = [("gbv","2"),("hl",lang),("safe","active"),("q",word),("sa","2"),("btnG","Bilder-Suche")] - params = {"v":"1.0", "start":"0", "q":self.w.searchEdit.text(), "hl":self.locale, "safe":"active"} - if self.w.freeImageCheckBox.isChecked(): - params["as_rights"]="(cc_publicdomain|cc_attribute|cc_sharealike|cc_noncommercial|cc_nonderived)" - - headrs = { 'User-Agent' : user_agent } - request_url = url + "?" + urllib.urlencode(params) - - - req = urllib2.Request(url = request_url, headers=headrs) - - try: - response = urllib2.urlopen(req) - #print response.read() - return response - except: - #in case of error not to return incompleted results - print "error on fetching online data" - return "" - - -#FUNCTIONS - - -#parses the response (json) and returns all the links to images -def getImageUrls(response): - print "Parsing data" - search_res = simplejson.load(response) - # print data - print(search_res) - results = [] - for result in search_res['responseData']['results']: - href = result['originalContextUrl'] - title = result['title'] - if not result['url']: - continue - results.append(result['url']) - return results - - -#downloads image from the url given and returns the data (array of chars) -def downloadImage(url): - img = urllib2.urlopen(url) - imgdata = img.read() - return imgdata - -#get the identifier of the given translation (see Scripting::Translation) -def getIdentifier(trans): - sel_entries = Parley.selectedEntries() - for entry in sel_entries: - #print "entry",entry - for i in entry.translationIndices(): - #print "index",i - if entry.translation(i).text == trans.text: - return Parley.doc.identifier(i).locale - -#corrects the difference between the locale names of Parley and the google dictionary -def locale(lang): - if lang == "en_US": - return "en" - if lang == "zh_TW": - return "zh-TW" - if lang == "zh_HK": - return "zh-HK" - if lang == "zh_CN": - return "zh-CN" - - return lang - -#Get the string that describes the _files directory next to the Parley document -def getFilesDir(): - filepath = Parley.doc.url - #print path.dirname(filepath) - p,f = path.split(filepath) - [name,ext] = f.rsplit(".",1) - #print f.rsplit(".",1) - filesdir = p+"/"+name+"_files" - return filesdir - - -#ACTION FUNCTION - -#method called by clicking "Fetch image" in the Scripts menu -def fetchImage(): - print "fetching image" - translations = Parley.selectedTranslations() - if len(translations) > 0: - m = ImageDialog(translations) - m.exec_() - - else: - KMessageBox.error(None, T.i18n("No Selection:\nSelect a word to fetch an image for it"), T.i18n("Fetch Image")) - - -#SCRIPT MENU - -#create a new action for the Scripts menu (action1) -action1 = Parley.newAction("example_action1", T.i18n("Fetch Image")) -action1.statusTip = T.i18n("Fetches an image for the selected translation") -Parley.connect(action1,"triggered()",fetchImage) - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/parley-16.04.2/plugins/google_images.ui new/parley-16.04.3/plugins/google_images.ui --- old/parley-16.04.2/plugins/google_images.ui 2016-04-12 16:06:27.000000000 +0200 +++ new/parley-16.04.3/plugins/google_images.ui 1970-01-01 01:00:00.000000000 +0100 @@ -1,141 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>Form</class> - <widget class="QWidget" name="Form"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>391</width> - <height>256</height> - </rect> - </property> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> - <widget class="QLabel" name="imageLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>0</height> - </size> - </property> - <property name="styleSheet"> - <string notr="true">background-color: rgb(255, 255, 255);</string> - </property> - <property name="text"> - <string/> - </property> - </widget> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QLabel" name="label"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Give a keyword to search for an image related to it:</string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLineEdit" name="searchEdit"/> - </item> - <item> - <widget class="QPushButton" name="searchButton"> - <property name="text"> - <string>Search</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - <item> - <widget class="QCheckBox" name="freeImageCheckBox"> - <property name="text"> - <string>Free images only (creative commons, gpl, ...)</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="previousButton"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Previous</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="nextButton"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Next</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui>
