From 42827b2a465831d188106a25d74d888130504609 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 5 Nov 2016 18:59:44 -0400 Subject: [PATCH 01/33] =?UTF-8?q?Added=20Basque=20translation=20(credit:?= =?UTF-8?q?=20I=C3=B1igo=20Gebara)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/i18n/OpenBoard_eu.ts | 3187 ++++++++++++++++++++++++++++++++ 1 file changed, 3187 insertions(+) create mode 100644 resources/i18n/OpenBoard_eu.ts diff --git a/resources/i18n/OpenBoard_eu.ts b/resources/i18n/OpenBoard_eu.ts new file mode 100644 index 00000000..2d3247cb --- /dev/null +++ b/resources/i18n/OpenBoard_eu.ts @@ -0,0 +1,3187 @@ + + + + + BlackoutWidget + + + Click to Return to Application + Egin klik aplikaziora bueltatzeko + + + + DownloadDialog + + + Downloads + Deskargak + + + + Clean Up + Garbitu + + + + 0 Items + 0 item + + + + DownloadItem + + + Form + Formularioa + + + + Filename + Fitxategi izena + + + + Try Again + Saiatu berriro + + + + Stop + Gelditu + + + + Open + Ireki + + + + IntranetPodcastPublishingDialog + + + Publish Podcast to YouTube + Publikatu podcasta YouTuben + + + + Title + Izenburua + + + + Description + Deskribapena + + + + Author + Egilea + + + + MainWindow + + + + + OpenBoard + OpenBoard + + + + + Board + Arbela + + + + + Web + Web + + + + + Documents + Dokumentuak + + + + + Stylus + Arkatza + + + + Ctrl+T + Ktrl+T + + + + Backgrounds + Atzeko planoak + + + + Change Background + Aldatu atzeko planoa + + + + Undo + Desegin + + + + Ctrl+Z + Ktrl+Z + + + + Redo + Berregin + + + + Ctrl+Y + Ktrl+Y + + + + Previous + Aurrekoa + + + + + Previous Page + Aurreko orria + + + + PgUp + OrriaGora + + + + Next + Hurrengoa + + + + + Next Page + Hurrengo orria + + + + PgDown + OrriaBehera + + + + Manage Documents + Dokumentuak kudeatu + + + + Ctrl+D + Ktrl+D + + + + Web Browsing + Sare arakatzea + + + + Ctrl+W + Ktrl+W + + + + + + + Line + Lerroa + + + + Small Line + Lerro txikia + + + + Medium Line + Lerro ertaina + + + + Large Line + Lerro handia + + + + Quit + Itxi + + + + Quit OpenBoard + Itxi OpenBoard + + + + + + + Eraser + Borragoma + + + + Smalle Eraser + Borragoma txikia + + + + Medium Eraser + Borragoma ertaina + + + + Large Eraser + Borragoma handia + + + + + + + + + Color + Kolorea + + + + Back + Atzera + + + + Left + Ezkerrera + + + + Forward + Aurrera + + + + Right + Eskuinera + + + + Reload + Birkargatu + + + + Reload Current Page + Birkargatu uneko orria + + + + Home + Hasiera-orria + + + + Load Home Page + Kargatu hasierako orria + + + + Bookmarks + Laster-markak + + + + Show Bookmarks + Erakutsi lastermarkak + + + + Bookmark + Laster-marka + + + + Add Bookmark + Gehitu laster-marka + + + + Display Board + Erakutsi arbela + + + + Ctrl+B + Ktrl+B + + + + Erase + Ezabatu + + + + Erase Content + Ezabatu edukia + + + + Preferences + Ezarpenak + + + + Display Preferences + Erakutsi ezarpenak + + + + Library + Liburutegia + + + + Show Library + Erakutsi liburutegia + + + + Ctrl+L + Ktrl+L + + + + Show Desktop + Erakutsi mahaigaina + + + + Show Computer Desktop + Erakutsi ordenagailuaren mahaigaina + + + + Ctrl+Shift+H + Ktrl+Shift+H + + + + Bigger + Handiagoa + + + + + Zoom In + Zoom egin + + + + Ctrl++ + Ktrl++ + + + + Smaller + Txikiagoa + + + + + Zoom Out + Zooma kendu + + + + Ctrl+- + Ktrl+- + + + + New Folder + Karpeta berria + + + + Create a New Folder + Sortu karpeta berria + + + + New Document + Dokumentu berria + + + + Create a New Document + Sortu dokumentu berria + + + + Import + Inportatu + + + + Import a Document + Inportatu dokumentua + + + + Export + Esportatu + + + + Export a Document + Esportatu dokumentua + + + + Open in Board + Ireki arbelean + + + + Open Page in Board + Ireki orria arbelean + + + + Ctrl+O + Ktrl+O + + + + Duplicate + Bikoiztu + + + + Duplicate Selected Content + Bikoiztu hautatutako edukia + + + + Delete + Ezabatu + + + + Delete Selected Content + Ezabatu hautatutako edukia + + + + Del + Ezab + + + + Add to Working Document + Gehitu laneko dokumentura + + + + Add Selected Content to Open Document + Gehitu hautatuko edukia irekitako dokumentura + + + + + Add + Gehitu + + + + Add Content to Document + Gehitu edukia dokumentura + + + + Rename + Berrizendatu + + + + Rename Content + Berrizendatu edukia + + + + + Tools + Tresnak + + + + + Display Tools + Erakutsi tresnak + + + + Multi Screen + Pantaila anitzak + + + + + Wide Size (16/9) + Tamaina panoramikoa (16/9) + + + + Use Document Wide Size (16/9) + Erabili tamaina zabaleko dokumentua (16/9) + + + + + Regular Size (4/3) + Ohiko tamaina (4/3) + + + + Use Document Regular Size (4/3) + Erabili dokumentu tamaina arrunta (4/3) + + + + + Custom Size + Tamaina pertsonalizatua + + + + Use Custom Document Size + Erabili dokumentu tamaina pertsonalizatua + + + + Stop Loading + Utzi kargatzeari + + + + Stop Loading Web Page + Utzi web orria kargatzeari + + + + Cut + Moztu + + + + Copy + Kopiatu + + + + Paste + Itsatsi + + + + Sleep + Lo + + + + Put Presentation to Sleep + Eraman aurkezpena lotara + + + + Virtual Keyboard + Teklatu birtuala + + + + Display Virtual Keyboard + Erakutsi teklatu birtuala + + + + + Plain Light Background + Atzeko plano argia + + + + + + Light + Argia + + + + + Grid Light Background + Atzeko plano sareta argia + + + + + Ruled Light Background + Atzeko plano marradun argia + + + + + Plain Dark Background + Atzeko plano iluna + + + + + + Dark + Iluna + + + + + Grid Dark Background + Atzeko plano sareta iluna + + + + + Ruled Dark Background + Atzeko plano marradun iluna + + + + Podcast + Podcast-a + + + + Record Presentation to Video + Grabatu aurkezpena bideora + + + + Record + Grabatu + + + + Start Screen Recording + Hasi pantaila grabatzen + + + + Erase Items + Ezabatu itemak + + + + Erase All Items + Ezabatu item guztiak + + + + + Erase Annotations + Ezabatu oharrak + + + + Erase All Annotations + Ezabatu ohar guztiak + + + + Clear Page + Garbitu orria + + + + Clear All Elements + Garbitu elementu guztiak + + + + Pen + Bolaluma + + + + Annotate Document + Gehit oharrak dokumentuan + + + + Ctrl+I + Ktrl+I + + + + Erase Annotation + Ezabatu oharra + + + + Ctrl+E + Ktrl+E + + + + Marker + Errotulagailua + + + + Highlight + Azpimarratu + + + + Ctrl+M + Ktrl+M + + + + Selector + Aukeratzailea + + + + Select And Modify Objects + Aukeratu eta eraldatu objektuak + + + + Ctrl+F + Ktrl+F + + + + Hand + Eskua + + + + Scroll Page + Jeitsi orria + + + + Laser Pointer + Laser puntua + + + + Virtual Laser Pointer + Laser puntu birtuala + + + + Ctrl+G + Ktrl+G + + + + Draw Lines + Marraztu lerroak + + + + Ctrl+J + Ktrl+J + + + + Text + Testua + + + + Write Text + Idatzi testua + + + + Ctrl+K + Ktrl+K + + + + Capture + Kapturatu + + + + + Capture Part of the Screen + Kapturatu pantailaren zati bat + + + + + Add To Current Page + Gehitu uneko orrira + + + + Add Item To Current Page + Gehitu itema uneko orrira + + + + Add To New Page + Gehitu orri berrira + + + + Add Item To New Page + Gehitu itema orri berrira + + + + Add To Library + Gehitu liburutegira + + + + Add Item To Library + Gehitu itema liburutegira + + + + Pages + Orriak + + + + + Create a New Page + Sortu orri berria + + + + New Page + Orri berria + + + + Duplicate Page + Bikoiztu orria + + + + Duplicate the Current Page + Bikoiztu uneko orria + + + + Import Page + Inportatu orria + + + + Import an External Page + Inportatu kanpoko orria + + + + Pause + Gelditu + + + + Pause Podcast Recording + Gelditu Podcast-aren grabaketa + + + + Podcast Config + Podcast konfiguratu + + + + Configure Podcast Recording + Konfiguratu podcast-aren grabaketa + + + + Flash Trap + + + + + Trap Flash Content + + + + + Web Trap + + + + + Trap Web Content + + + + + Custom Capture + Pertsonalizatutako kaptura + + + + Window Capture + Leiho kaptura + + + + Capture a Window + Leiho bat kapturatu + + + + Embed Web Content + Kabiatutako web edukia + + + + Capture Embeddable Web Content + Kapturatu kabiatutako web edukia + + + + Show on Display + Erakutsi pantailan + + + + Show Main Screen on Display Screen + Erakutsi pantaila nagusia erakusteko pantailan + + + + Erase all Annotations + Ezabatu ohar guztiak + + + + eduMedia + eduMedia + + + + Import eduMedia simulation + Inportatu eduMedia simulazioa + + + + Check Update + Egiaztatu eguneraketa + + + + Hide OpenBoard + Ezkutatu OpenBoard + + + + Hide OpenBoard Application + Ezkutatu OpenBoard aplikazioa + + + + Ctrl+H + Ktrl+H + + + + Play + Erreproduzitu + + + + Interact with items + Itemekin elkar ekin + + + + Erase Background + Ezabatu atzeko planoa + + + + Remove the backgound + Kendu atzeko planoa + + + + Open Tutorial + Ireki tutoriala + + + + Open the tutorial web page + Ireki tutorialaren web orria + + + + PasswordDialog + + + Authentication Required + Autentikazioa beharrezkoa + + + + Username: + Erabiltzailea: + + + + Password: + Pasahitza: + + + + ProxyDialog + + + Proxy Authentication + Proxy autentikazioa + + + + Connect to Proxy + Konektatu proxyra + + + + Username: + Erabiltzailea: + + + + Password: + Pasahitza: + + + + Save username and password for future use + Gorde erabltzailea eta pasahitza etorkizuneko erabiletarako + + + + QObject + + + Remove Page + Ezabatu orrialdea + + + + Are you sure you want to remove 1 page from the selected document '%0'? + Ziur zaude orri bat ezabatu nahi duzulua '%0' dokumentutik? + + + + UBApplication + + + Page Size + Orri tamaina + + + + Podcast + Podcast-a + + + + UBApplicationController + + + Web + Web-a + + + + Update available + Eguneratzea eskuragarri + + + + New update available, would you go to the web page ? + Eguneraketa berria eskuragarri, nahi duzu web orrira joan? + + + + Update + Eguneraketa + + + + No update available + Ez dago eguneraketarik eskuragarri + + + + UBBackgroundPalette + + + Grid size + Sareta tamaina + + + + UBBoardController + + + Group + Taldekatu + + + + Ungroup + Taldekatzea kendu + + + + Saving document... + Dokumentua gordetzen... + + + + Document has just been saved... + Dokumentua oraintxe izan da gordea... + + + + Delete page %1 from document + Ezabatu %1 orria dokumentutik + + + + Page %1 deleted + %1 orria ezabatua + + + + Downloading content %1 failed + %1 edukiaren deskargak huts egin du + + + + Download finished + Deskarga amaitua + + + + + + + Add file operation failed: file copying error + Fitxategia gehitzearen prozesuak huts egin du: fitxategi kopiaren errorea + + + + Unknown tool type %1 + %1 tresna mota ezezaguna + + + + Unknown content type %1 + %1 eduki mota ezezaguna + + + + Add Item + Gehitu itema + + + + All Supported (%1) + Denak onartuak (%1) + + + + UBBoardPaletteManager + + + CapturedImage + KapturatutakoIrudia + + + + Error Adding Image to Library + Errorea Irudai liburutegira gehitzean + + + + UBCachePropertiesWidget + + + Cache Properties + Katxearen propietateak + + + + Color: + Kolorea: + + + + Shape: + Forma: + + + + Size: + Tamaina: + + + + Close + Itxi + + + + UBDesktopPalette + + + Show OpenBoard + Erakutsi OpenBoard + + + + Capture Part of the Screen + Kapturatu pantailaren zati bat + + + + Capture the Screen + Kapturatu pantaila + + + + Show the stylus palette + Erakutsi stylus paleta + + + + Show Board on Secondary Screen + Erakutsi arbela bigarren pantailan + + + + Show Desktop on Secondary Screen + Erakutsi mahaigaina bigarren pantailan + + + + UBDocumentController + + + + Trash + Zakarrontzia + + + + Untitled Documents + Izengabeko dokumentuak + + + + + New Folder + Karpeta berria + + + + Add Folder of Images + Gehitu irudien karpeta + + + + Add Images + Gehitu irudiak + + + + Add Pages from File + Gehitu orriak fitxategitik + + + + Duplicating Document %1 + Bikoiztu %1 dokumentua + + + + Document %1 copied + %1 dokumentua kopiatua + + + + Empty Trash + Hustu zakarrontzia + + + + Are you sure you want to empty trash? + Ziur zaude zakarrontzia hustu nahi duzula? + + + + Emptying trash + Zakarrontzia husten + + + + Emptied trash + Zakarrontzia hutsa + + + + Remove Document + Ezabatu dokumentua + + + + Are you sure you want to remove the document '%1'? + Ziur zaude '%1' dokumentua ezabatu nahi duzula? + + + + Remove Folder + Ezabatu karpeta + + + + Are you sure you want to remove the folder '%1' and all its content? + Ziur zaude '%1' karpeta eta bere eduki guztia borratu nahi dituzula? + + + + Remove multiple documents + Ezabatu dokumentu anitzak + + + + Are you sure you want to remove all selected documents? + Ziur zaude aukeratutako dokumentuak ezabatu nahi dituzula? + + + + No document selected! + Ez da dokumenturik aukeratu! + + + + + Open Supported File + Ireki onartutako fitxategia + + + + + Importing file %1... + %1 fitxategia inportatzen... + + + + + Failed to import file ... + Fitxategiaren inportazioak huts egin du... + + + + Import all Images from Folder + Inportatu karpetako fitxategi guztiak + + + + Folder does not contain any image files + Karpetak ez dauka irudi fitxategirik + + + + Delete + Ezabatu + + + + Empty + Hustu + + + + Open Document + Ireki dokumentua + + + + The document '%1' has been generated with a newer version of OpenBoard (%2). By opening it, you may lose some information. Do you want to proceed? + '%1' dokumentua OpenBoarden bertsio berriago batekin (%2) sortua da. Irekitzean baliteke informazioa galtzea. Jarraitu nahi duzu? + + + + Add all Images to Document + Gehitu irudi guztiak dokumentura + + + + All Images (%1) + Irudi guztiak (%1) + + + + Selection does not contain any image files! + Aukeraketak ez du inongo irudi fitxategirik! + + + + Remove Page + Ezabatu orria + + + + Are you sure you want to remove %n page(s) from the selected document '%1'? + + Ziur zaude orri %n ezabatu nahi duzula '%1' dokumentutik? + Ziur zaude %n orri ezabatu nahi dituzula '%1' dokumentutik? + + + + + Page %1 + %1 orria + + + + UBDocumentManager + + + images + irudiak + + + + videos + bideoak + + + + objects + objektuak + + + + widgets + widgetak + + + + All supported files (*.%1) + Onartutako fitxategi guztiak (*.%1) + + + + + Inserting page %1 of %2 + %1 orria txertatzen %2tik + + + + Import successful. + Inportazio arrakastatsua. + + + + Importing file %1 + %1 inportatzen + + + + Import of file %1 successful. + %1 fitxategiaren inportazio arrakastatsua. + + + + File %1 saved + %1 fitxategia gordea + + + + UBDocumentNavigator + + + Page %0 + %0 orria + + + + UBDocumentTreeWidget + + + %1 (copy) + %1 (kopia) + + + + Copying page %1/%2 + %1/%2 orria kopiatzen + + + + %1 pages copied + + orri %1 kopiatua + %1 orri kopiatua + + + + + UBDownloadWidget + + + Downloading files + Fitxategiak jeisten + + + + Cancel + Ezeztatu + + + + UBExportAdaptor + + + Exporting document... + Dokumentua esportatzen... + + + + Export failed + Esportazioak huts egin du + + + + Unable to export to the selected location. You do not have the permissions necessary to save the file. + Ezin da aukeratutako tokira esportatu. Ez daukazu nahikoa baimenik fitxategia gordetzeko. + + + + Export failed: location not writable + Esportazioak huts egin du: helburuan ezin da idatzi + + + + Export successful. + Esportazio arrakastatsua. + + + + Warnings during export was appeared + Esportazioan zehar arazoak egon dira + + + + UBExportDocument + + + Page + Orria + + + + Export as UBZ File + UBZ fitxategi moduan esportatu + + + + Exporting %1 %2 of %3 + Esportatu %1 %2 %3tik + + + + Export to OpenBoard Format + Esportatu OpenBoard formatura + + + + UBExportFullPDF + + + Export as PDF File + Esportatu PDF fitxategira + + + + Export to PDF + Esportatu PDFra + + + + UBExportPDF + + + Export as PDF File + Esportatu PDF fitxategira + + + + Exporting page %1 of %2 + %1 orria %2tik esportatzen + + + + Export to PDF + Esportatu PDFra + + + + UBExportWeb + + + Page + Orria + + + + Export as Web data + Esportatu Web datu mduan + + + + Exporting document... + Dokumentua esportatzen... + + + + Export successful. + Esportazio arraskatatsua. + + + + Export failed. + Esportazioak huts egin du. + + + + Export to Web Browser + Esportatu web arakatzailera + + + + UBFeatureProperties + + + Add to page + Gehitu orrira + + + + Set as background + Ezarri atzeko plano moduan + + + + Add to library + Gehitu liburutegira + + + + Object informations + Objektuaren informazioa + + + + UBFeaturesActionBar + + + Add to favorites + Gehitu gogokoenetara + + + + Share + Elkarbanatu + + + + Search + Bilatu + + + + Rescan file system + Berreskaneatu fitxategi sistema + + + + Delete + Ezabatu + + + + Back to folder + Atzera karpetara + + + + Remove from favorites + Ezabatu gogokoenetatik + + + + Create new folder + Sortu karpeta berria + + + + UBFeaturesController + + + Audios + Audioak + + + + Movies + Filmak + + + + Pictures + Irudiak + + + + Animations + Animazioak + + + + Interactivities + Interjarduerak + + + + Applications + Aplikazioak + + + + Shapes + Formak + + + + Favorites + Gogokoenak + + + + Web search + Web bilaketak + + + + Trash + Zakarrontzia + + + + + ImportedImage + InportatutakoIrudia + + + + UBFeaturesNewFolderDialog + + + Accept + Onartu + + + + Cancel + Ezeztatu + + + + Enter a new folder name + Sartu karpeta izen berria + + + + UBFeaturesProgressInfo + + + Loading + Kargatzen + + + + UBGraphicsGroupContainerItemDelegate + + + Locked + Blokeatua + + + + Visible on Extended Screen + Hedatutako pantailan ikusgarri + + + + UBGraphicsItemDelegate + + + Locked + Blokeatua + + + + Visible on Extended Screen + Hedatutako pantailan ikusgarri + + + + Go to Content Source + Joan edukiaren jatorrira + + + + UBGraphicsMediaItem + + + Media resource couldn't be resolved + Multimedia baliabidea ezin izan da ebatzi + + + + Unsupported media format + Multimedia formatua ez da onargarria + + + + Media playback service not found + Multimedia erreproduzitze zerbitzua ez da aurkitu + + + + Media error: + Multimedia errorea: + + + + UBGraphicsTextItem + + + <Type Text Here> + <Idatzi Testua hemen> + + + + UBGraphicsTextItemDelegate + + + Text Color + TestuKolorea + + + + Editable + Editagarria + + + + UBGraphicsW3CWidgetItem + + + Web + Weba + + + + UBGraphicsWidgetItem + + + Loading ... + Kargatzen... + + + + UBGraphicsWidgetItemDelegate + + + Frozen + Izoztua + + + + Transform as Tool + Eraldatu tresna moduan + + + + UBImportDocument + + + OpenBoard (*.ubz) + OPenBoard (*.ubz) + + + + + Importing file %1... + %1 fitxategia inportatzen... + + + + + + Import of file %1 failed. + %1 fitxategiaren inportazioak huts egin du. + + + + + Import successful. + Inportazio arrakastatsua. + + + + UBImportImage + + + Image Format ( + Irudi formatua ( + + + + UBImportPDF + + + Portable Document Format (*.pdf) + Dokumentu formatu eramangarria (*.pdf) + + + + PDF import failed. + PDF inportazioak huts egin du. + + + + Importing page %1 of %2 + %1 orria %2tik inportatzen + + + + UBIntranetPodcastPublisher + + + Error while publishing video to intranet (%1) + Errorea bideoa intranetera esportatzen zen bitartean (%1) + + + + Publishing to Intranet in progress %1 % + Intranetera publikatzea abian %1 % + + + + UBIntranetPodcastPublishingDialog + + + Publish + Publikatu + + + + UBKeyboardPalette + + + + Enter + Sartu + + + + UBMainWindow + + + Yes + Bai + + + + No + Ez + + + + Ok + Ok + + + + UBMessagesDialog + + + Close + Itxi + + + + UBNetworkAccessManager + + + <qt>Enter username and password for "%1" at %2</qt> + <qt>Sartu erabiltzailea eta pasahitza "%1" %2n</qt> + + + + Failed to log to Proxy + Proxyra sartzean errorea + + + + SSL Errors: + +%1 + +%2 + +Do you want to ignore these errors for this host? + SSL Erroreak: + +%1 + +%2 + +Ostalari onentzako errore hauek ez-ikusi nahi dituzu? + + + + Yes + Bai + + + + No + Ez + + + + UBOpenSankoreImporterWidget + + + Open-Sankore Documents Detected + Open-Sankore dokumentuak antzemanda + + + + Open-Sankoré documents are present on your computer. It is possible to import them to OpenBoard by pressing the “Proceed” button to launch the importer application. + Open-Sankoré dokumentuak daude zure ordenagailuan. OpenBoardera inportatu daitezke inportazio-aplikazioa irekitzeko "Jarraitu" botoia sakatuz. + + + + Show this panel next time + Erakutsi panel hau hurrengoan + + + + You can always access the OpenBoard Document Importer through the Preferences panel in the About tab. Warning, if you have already imported your Open-Sankore datas, you might loose your current OpenBoard documents. + Beti ere OPenBoard dokumentuak inportatzailea atzi dezakezu Ezarpenen paneleko Honi buruz fitxan. Kontuz, jada Open-Sankore datuak inportatu badituzu oraingo OpenBoard dokumentuak gal ditzakezu. + + + + Cancel + Ezeztu + + + + Proceed + Jarraitu + + + + UBPersistenceManager + + + (copy) + (kopiatu) + + + + Document Repository Loss + Dokumentuen repositorioaren galera + + + + has lost access to the document repository '%1'. Unfortunately the application must shut down to avoid data corruption. Latest changes may be lost as well. + %1 dokumentu errepositorira sarbidea galdu da. Tamalez aplikazioa itxi egingo da datuen galera sahiesteko. Azken aldaketak galdu daitezke ere. + + + + UBPlatformUtils + + + + English + Ingelesa + + + + + Russian + Errusiera + + + + + German + Alemaniera + + + + + French + Frantsesa + + + + + Swiss French + Suitzar frantsesa + + + + UBPodcastController + + + OpenBoard Cast + + + + + Failed to start encoder ... + Kodegailuaren hasierak huts egin du... + + + + No Podcast encoder available ... + Ez dago Podcast kodegailurik erabilgarri... + + + + Part %1 + %1 Zatia + + + + on your desktop ... + zure mahaigainean... + + + + in folder %1 + %1 karpetan + + + + Podcast created %1 + %1 Podcasta sortua + + + + Podcast recording error (%1) + Errorea Podcasta grabatzean (%1) + + + + Default Audio Input + Lehenetsitako audio sarrera + + + + No Audio Recording + Audio grabaziorik ez + + + + Small + Txikia + + + + Medium + Ertaina + + + + Full + Osoa + + + + Publish to Intranet + Publikatu intraneten + + + + Publish to Youtube + Publikatu Youtuben + + + + UBPreferencesController + + + version: + bertsioa: + + + + Marker is pressure sensitive + Markadorea presioarekiko sentibera da + + + + UBProxyLoginDlg + + + Proxy Login + Proxy sarrera + + + + Username: + Erabiltzailea: + + + + Password: + Pasahitza: + + + + UBPublicationDlg + + + Publish document on the web + Publikatu dokumentua webean + + + + Title: + Izenburua: + + + + Description: + Deskribapena: + + + + Publish + Publikatu + + + + UBSettings + + + My Movies + Nire filmak + + + + UBStartupHintsPalette + + + Visible next time + Ikusgarri hurrengoan + + + + UBThumbnailAdaptor + + + Generating preview thumbnails ... + Aurreikuste irudiak sortzen... + + + + %1 thumbnails generated ... + %1 aurreikuspen sortuak... + + + + UBToolsManager + + + Mask + Maskara + + + + Ruler + Erregela + + + + Compass + Konpasa + + + + Protractor + Angelu-garraiagailu + + + + Triangle + Triangelua + + + + Magnifier + Handitzailea + + + + Cache + Katxea + + + + UBTrapFlashController + + + Whole page + Orri osoa + + + + Web + Weba + + + + UBUpdateDlg + + + Document updater + Dokumentu eguneratzailea + + + + files require an update. + fitxategiek eguneraketa behar dute. + + + + Backup path: + Babeskopia helbidea: + + + + Browse + Arakatu + + + + Update + Eguneratu + + + + Remind me later + Gogoratu beranduago + + + + Select a backup folder + Aukeratu babeskopia karpeta + + + + Please wait the import process will start soon... + Mesedez itxaron, inportatze prozesua laster hasiko da... + + + + Files update successful! +Please reboot the application to access the updated documents. + Fitxategien eguneraketa ondo egin da! +Mesedez berrabiarazi aplikazioa eguneratutako dokumentuak irekitzeko. + + + + An error occured during the update. The files have not been affected. + Errorea gertatu da eguneraketan zehar. Fitxategiak ez dira kaltetuak izan. + + + + Files update results + Fitxategien eguneraketa emaitzak + + + + Updating file + FItxategia eguneratzen + + + + UBWebPluginWidget + + + Loading... + Kargatzen... + + + + UBWidgetUniboardAPI + + + %0 called (method=%1, status=%2) + %0 deitua (metodoa=%1, egoera=%2) + + + + UBYouTubePublisher + + + YouTube authentication failed. + Youtuberen autentikazioak huts egin du. + + + + Error while uploading video to YouTube (%1) + Errorea Youtubeko bideoa igotzean (%1) + + + + Upload to YouTube in progress %1 % + Youtubera igotzen % %1 + + + + UBYouTubePublishingDialog + + + Upload + Igo + + + + Autos & Vehicles + Autoak eta ibilgailuak + + + + Music + Musika + + + + Pets & Animals + Maskotak eta animaliak + + + + Sports + Kirolak + + + + Travel & Events + Bidaiak eta gertaerak + + + + Gaming + Jokoak + + + + Comedy + Komedia + + + + People & Blogs + Jendea eta Blogak + + + + News & Politics + Berriak eta Politikak + + + + Entertainment + Denbora-pasa + + + + Education + Hezkuntza + + + + Howto & Style + Estiloa + + + + Nonprofits & Activism + Aktibismoa + + + + Science & Technology + Zientzia eta teknologia + + + + UBZoomPalette + + + %1 x + %1 x + + + + WBClearButton + + + Clear + Garbitu + + + + WBDownloadItem + + + Save File + Gorde fitxategia + + + + Download canceled: %1 + Deskarga bertan behera; %1 + + + + Error opening saved file: %1 + Errorea gordetako fitxategia irekitzea: %1 + + + + Error saving: %1 + Errorea gordetzean: %1 + + + + Network Error: %1 + Sare errorea: %1 + + + + seconds + Segundo + + + + minutes + minutu + + + + - %4 %5 remaining + - %4 %5 falta dira + + + + %1 of %2 (%3/sec) %4 + %1 %2tik (%3/seg) %4 + + + + ? + unknown file size + ? + + + + %1 of %2 - Stopped + %1 %2tik - Geldituta + + + + bytes + byte + + + + KB + KB + + + + MB + MB + + + + WBDownloadManager + + + 1 Download + Deskarga bat + + + + %1 Downloads + always >= 2 + %1 Deskarga + + + + WBHistoryModel + + + Title + Izenburua + + + + Address + Helbidea + + + + WBHistoryTreeModel + + + Earlier Today + Lehenago gaur + + + + %1 items + %1 item + + + + WBSearchLineEdit + + + Search + Bilatu + + + + WBTabBar + + + New &Tab + &Fitxa berria + + + + Clone Tab + Klonatu fitxa + + + + &Close Tab + &Fitxa itxi + + + + Close &Other Tabs + Itxi &beste fitxak + + + + Reload Tab + Birkargatu fitxa + + + + Reload All Tabs + Birkargatu fitxa guztiak + + + + WBTabWidget + + + Recently Closed Tabs + DUela gutxi itxitako fitxak + + + + + (Untitled) + (Izengabea) + + + + WBToolbarSearch + + + Search + Bilatu + + + + No Recent Searches + Ez dago duela gutxiko bilaketarik + + + + Recent Searches + Duela gutxiko bilaketak + + + + Clear Recent Searches + Garbitu duela gutxiko bilaketak + + + + WBWebPage + + + Download PDF Document: would you prefer to download the PDF file or add it to the current OpenBoard document? + Jeitsi PDF dokumentua: nahiago duzu PDfdokumentua jeistea edo uneko OpenBoard dokumentuan txertatzea? + + + + Download + Jeitsi + + + + Add to Current Document + Gehitu uneko dokumentura + + + + PDF + PDF + + + + Error loading page: %1 + Errorea orria kargatzean: %1 + + + + WBWebView + + + Open in New Tab + Ireki fitxa berrian + + + + YouTubePublishingDialog + + + Publish Podcast to YouTube + Publikatu Podcasta Youtuben + + + + Title + Izenburua + + + + Description + Deskribapena + + + + Keywords + HItz klabeak + + + + OpenBoard + Open Board + + + + Category + Kategoria + + + + YouTube Username + Youtubeko erabiltzailea + + + + YouTube Password + Youtubeko pasahitza + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Grande'; font-size:10pt;">By clicking 'Upload,' you certify that you own all rights to the content or that you are authorized by the owner to make the content publicly available on YouTube, and that it otherwise complies with the YouTube Terms of Service located at </span><a href="http://www.youtube.com/t/terms"><span style=" font-family:'Lucida Grande'; font-size:10pt; text-decoration: underline; color:#0000ff;">http://www.youtube.com/t/terms</span></a></p></body></html> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Grande'; font-size:10pt;">'Igo' klikatuz zertifikatzen duzu edukiaren eskubideak dituzula edo jabearen baimena duzula modu publikoan Youtuben publikatzeko eta bestela Youtuberen erabilera terminoak puskatzen direla: </span><a href="http://www.youtube.com/t/terms"><span style=" font-family:'Lucida Grande'; font-size:10pt; text-decoration: underline; color:#0000ff;">http://www.youtube.com/t/terms</span></a></p></body></html> + + + + Restore credentials on reboot + Berrezarri kredentzialak berrabiaraztean + + + + brushProperties + + + On Light Background + Atzeko-plano argian + + + + On Dark Background + Atzeko plano ilunean + + + + Opacity + Opakotasuna + + + + Line Width + Lerroaren lodiera + + + + Medium + Ertaina + + + + Strong + Indartsua + + + + Fine + FIna + + + + Pen is Pressure Sensitive + Bolaluma presioarekiko sentibera da + + + + Smooth strokes (experimental) + Lerroak lausotu (esperimentala) + + + + Simplify strokes after drawing (experimental) + Sinplifikatu trazuak marraztu eta gero (esperimentala) + + + + capturePublishingDialog + + + Dialog + Elkarrizketa + + + + Title + Izenburua + + + + E-mail + E-posta + + + + Author + Egilea + + + + Description + Deskribapena + + + + documents + + + OpenBoard Documents + OpenBoard dokumentuak + + + + preferencesDialog + + + Preferences + Ezarpenak + + + + version : … + bertsioa: ... + + + + Display + Pantailaratu + + + + Multi display + Pantailaratze anitza + + + + Show internal web page content on secondary screen or projector + Erakutsi barruko web orriaren edukia bigarren pantailan edo proiektorean + + + + Swap control display and view display + Aldatu kontrol pantaila eta ikuste pantaila + + + + Toolbar + Tresna barra + + + + Positioned at the Top (recommended for tablets) + Goikaldean kokatu (tabletentzako gomendatua) + + + + Positioned at the Bottom (recommended for white boards) + Behekaldean kokatu (Arbel zurientzako gomendatua) + + + + Display Text Under Button + Erakutsi testua botoiaren azpian + + + + Stylus Palette + Luma paleta + + + + Horizontal + Horizontala + + + + Vertical + Bertikala + + + + Mode + Modua + + + + Mode to start in: + Hasteko modua: + + + + Board + Arbela + + + + Desktop + Mahaigaina + + + + Virtual Keyboard + Teklatu birtuala + + + + Built-in virtual keyboard button size: + Teklatu birutalaren botoi tamaina: + + + + Use system keyboard (recommended) + Erabili sistemaren teklatua (gomendatua) + + + + Pen + Bolaluma + + + + Marker + Markadorea + + + + Network + Sarea + + + + Internet + Internet + + + + Show Page with External Browser + Erakutsi orria kanpoko arakatzailearekin + + + + Home Page: + Hasiera orria: + + + + Proxy User: + Proxy erabiltzailea: + + + + Pass: + Pasahitza: + + + + Licences + Lizentziak + + + + Credits + Kredituak + + + + About + Honi buruz + + + + Software Update + SOftware eguneraketa + + + + Check software update at launch + Egiaztatu software eguneraketa hasieran + + + + Open-Sankoré Importer + Open-Sankoré inportatzailea + + + + Check if Open-Sankoré data could be imported at launch + Egiaztatu hasieran Open-Sankoré datuak inportatu daitezkeen + + + + Default Settings + Ezarpen lehenetsiak + + + + Close + Itxi + + + + trapFlashDialog + + + Trap flash + Flasha harrapatu + + + + Select a flash to trap + Aukeratu harrapatzeko Flasha + + + + about:blank + about:blank + + + + Application name + Aplikazio izena + + + + Create Application + Sortu aplikazioa + + + From 2fd0cc87b1032d27fc7111c17b396ed26654ba2e Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 13 Nov 2016 17:55:09 -0500 Subject: [PATCH 02/33] Background cross color is now a setting in the config file This allows users to change the color of the background grid e.g if they are using a projector or other low-contrast display. The settings are in the `Board` category and are named `CrossColorDarkBackground` and `CrossColorLightBackground`. They take strings representing the color in any of the following formats: - #RGB (Hexadecimal digits) - #RRGGBB - #AARRGGBB - #RRRGGGBBB - #RRRRGGGGBBBB - Any SVG color keyword name (as defined by W3C) --- src/board/UBBoardView.cpp | 4 ++-- src/core/UBSettings.cpp | 7 ++++--- src/core/UBSettings.h | 5 +++-- src/domain/UBGraphicsScene.cpp | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index 92fe17d6..ced6325e 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -1597,9 +1597,9 @@ void UBBoardView::drawBackground (QPainter *painter, const QRectF &rect) QColor bgCrossColor; if (darkBackground) - bgCrossColor = UBSettings::crossDarkBackground; + bgCrossColor = QColor(UBSettings::settings()->boardCrossColorDarkBackground->get().toString()); else - bgCrossColor = UBSettings::crossLightBackground; + bgCrossColor = QColor(UBSettings::settings()->boardCrossColorLightBackground->get().toString()); if (transform ().m11 () < 1.0) { diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index 9f2c72fb..6a479a6f 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -71,9 +71,6 @@ const char *UBSettings::sDefaultFontFamily = "Arial"; QString UBSettings::currentFileVersion = "4.8.0"; -QColor UBSettings::crossDarkBackground = QColor(44, 44, 44, 200); -QColor UBSettings::crossLightBackground = QColor(165, 225, 255); - QBrush UBSettings::eraserBrushDarkBackground = QBrush(QColor(127, 127, 127, 80)); QBrush UBSettings::eraserBrushLightBackground = QBrush(QColor(255, 255, 255, 30)); @@ -272,6 +269,10 @@ void UBSettings::init() pageSize = new UBSetting(this, "Board", "DefaultPageSize", documentSizes.value(DocumentSizeRatio::Ratio4_3)); + + boardCrossColorDarkBackground = new UBSetting(this, "Board", "CrossColorDarkBackground", "#C82C2C2C"); + boardCrossColorLightBackground = new UBSetting(this, "Board", "CrossColorLightBackground", "#A5FFFF"); + QStringList penLightBackgroundColors; penLightBackgroundColors << "#000000" << "#FF0000" <<"#004080" << "#008000" << "#FFDD00" << "#C87400" << "#800040" << "#008080" << "#5F2D0A" << "#FFFFFF"; boardPenLightBackgroundColors = new UBColorListSetting(this, "Board", "PenLightBackgroundColors", penLightBackgroundColors, 1.0); diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h index 9d04f0dc..9f024d57 100644 --- a/src/core/UBSettings.h +++ b/src/core/UBSettings.h @@ -160,8 +160,6 @@ class UBSettings : public QObject static int pointerDiameter; static int boardMargin; - static QColor crossDarkBackground; - static QColor crossLightBackground; static QColor paletteColor; static QColor opaquePaletteColor; @@ -275,6 +273,9 @@ class UBSettings : public QObject UBSetting* featureSliderPosition; + UBSetting* boardCrossColorDarkBackground; + UBSetting* boardCrossColorLightBackground; + UBColorListSetting* boardPenLightBackgroundColors; UBColorListSetting* boardPenLightBackgroundSelectedColors; diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index deb6cbd5..357fb1a8 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -2391,9 +2391,9 @@ void UBGraphicsScene::drawBackground(QPainter *painter, const QRectF &rect) QColor bgCrossColor; if (darkBackground) - bgCrossColor = UBSettings::crossDarkBackground; + bgCrossColor = QColor(UBSettings::settings()->boardCrossColorDarkBackground->get().toString()); else - bgCrossColor = UBSettings::crossLightBackground; + bgCrossColor = QColor(UBSettings::settings()->boardCrossColorLightBackground->get().toString()); if (mZoomFactor < 1.0) { int alpha = 255 * mZoomFactor / 2; From 62fabf8e31af5faff6a954be7c3605e59208aa9f Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 13 Nov 2016 18:34:24 -0500 Subject: [PATCH 03/33] Corrected typo in color --- src/core/UBSettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index 6a479a6f..cccf87b7 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -271,7 +271,7 @@ void UBSettings::init() boardCrossColorDarkBackground = new UBSetting(this, "Board", "CrossColorDarkBackground", "#C82C2C2C"); - boardCrossColorLightBackground = new UBSetting(this, "Board", "CrossColorLightBackground", "#A5FFFF"); + boardCrossColorLightBackground = new UBSetting(this, "Board", "CrossColorLightBackground", "#A5E1FF"); QStringList penLightBackgroundColors; penLightBackgroundColors << "#000000" << "#FF0000" <<"#004080" << "#008000" << "#FFDD00" << "#C87400" << "#800040" << "#008080" << "#5F2D0A" << "#FFFFFF"; From 39b8204e96767f5fc55f36afe04ce7d0b7298e24 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Mon, 14 Nov 2016 22:53:16 -0500 Subject: [PATCH 04/33] Document mode: multiple documents can now be moved together --- src/gui/UBDocumentTreeWidget.cpp | 139 ++++++++++++++++++------------- src/gui/UBDocumentTreeWidget.h | 2 + 2 files changed, 82 insertions(+), 59 deletions(-) diff --git a/src/gui/UBDocumentTreeWidget.cpp b/src/gui/UBDocumentTreeWidget.cpp index d0248d59..cd6ba2f6 100644 --- a/src/gui/UBDocumentTreeWidget.cpp +++ b/src/gui/UBDocumentTreeWidget.cpp @@ -214,79 +214,39 @@ void UBDocumentTreeWidget::focusInEvent(QFocusEvent *event) QTreeWidget::focusInEvent(event); } - void UBDocumentTreeWidget::dropEvent(QDropEvent *event) { - if (mDropTargetProxyTi) - { + if (mDropTargetProxyTi) { mDropTargetProxyTi->setBackground(0, mBackground); mDropTargetProxyTi = 0; } - QTreeWidgetItem* underlyingItem = this->itemAt(event->pos()); - - UBDocumentGroupTreeItem *groupItem = dynamic_cast(underlyingItem); - - if (groupItem && mSelectedProxyTi && mSelectedProxyTi->proxy()) - { - UBDocumentGroupTreeItem *sourceGroupItem = dynamic_cast(mSelectedProxyTi->parent()); - bool isTrashItem = sourceGroupItem && sourceGroupItem->isTrashFolder(); - if ((isTrashItem && !groupItem->isTrashFolder()) || - (!isTrashItem && mSelectedProxyTi->proxy()->groupName() != groupItem->groupName())) - { - QString groupName; - if (groupItem->isTrashFolder()) - { - QString oldGroupName = mSelectedProxyTi->proxy()->metaData(UBSettings::documentGroupName).toString(); - groupName = UBSettings::trashedDocumentGroupNamePrefix + oldGroupName; - } - else - { - if (groupItem->groupName() == UBApplication::app()->documentController->defaultDocumentGroupName()) - groupName = ""; - else - groupName = groupItem->groupName(); - } - mSelectedProxyTi->proxy()->setMetaData(UBSettings::documentGroupName, groupName); - UBPersistenceManager::persistenceManager()->persistDocumentMetadata(mSelectedProxyTi->proxy()); + QTreeWidgetItem * underlyingItem = this->itemAt(event->pos()); - mSelectedProxyTi->parent()->removeChild(mSelectedProxyTi); + // If the destination is a folder, move the selected document(s) there + UBDocumentGroupTreeItem * destinationFolder = dynamic_cast(underlyingItem); - int i = 0; - for (i = 0; i < groupItem->childCount(); i++) - { - QTreeWidgetItem *ti = groupItem->child(i); - UBDocumentProxyTreeItem* pi = dynamic_cast(ti); - if (pi) - { - if (mSelectedProxyTi->proxy()->metaData(UBSettings::documentDate).toString() >= pi->proxy()->metaData(UBSettings::documentDate).toString()) - { - break; - } - } - } - groupItem->insertChild(i, mSelectedProxyTi); - - if (isTrashItem) - mSelectedProxyTi->setFlags(mSelectedProxyTi->flags() | Qt::ItemIsEditable); - - if (groupItem->isTrashFolder()) - mSelectedProxyTi->setFlags(mSelectedProxyTi->flags() ^ Qt::ItemIsEditable); - - expandItem(groupItem); - scrollToItem(mSelectedProxyTi); + if (destinationFolder) { + UBDocumentProxyTreeItem * lastMovedDocument; + foreach(QTreeWidgetItem * item, this->selectedItems()) { + UBDocumentProxyTreeItem * document = dynamic_cast(item); + if (document && moveDocument(document, destinationFolder)) + lastMovedDocument = document; + } - // disabled, as those 2 calls are buggy on windows, the item disappears if we selected them - // - setCurrentItem(mSelectedProxyTi); - mSelectedProxyTi->setSelected(true); + if (lastMovedDocument) { + expandItem(destinationFolder); + scrollToItem(lastMovedDocument); + setCurrentItem(lastMovedDocument); + lastMovedDocument->setSelected(true); event->setDropAction(Qt::IgnoreAction); event->accept(); } } - else - { + + // If the destination is a document and the dropped item is a page, copy the page to that document + else { QTreeWidgetItem* underlyingTreeItem = this->itemAt(event->pos()); UBDocumentProxyTreeItem *targetProxyTreeItem = dynamic_cast(underlyingTreeItem); @@ -393,6 +353,67 @@ void UBDocumentTreeWidget::documentUpdated(UBDocumentProxy *pDocument) } } +/** + * @brief Move a document to the specified destination folder + * @param document Pointer to the document to move + * @param destinationFolder Pointer to the folder to move the document to + * @return true if document was moved successfully, false otherwise + */ +bool UBDocumentTreeWidget::moveDocument(UBDocumentProxyTreeItem* document, UBDocumentGroupTreeItem* destinationFolder) +{ + if (!document || !(document->proxy()) || !destinationFolder) + return false; + + UBDocumentGroupTreeItem * sourceFolder = dynamic_cast(document->parent()); + bool documentIsInTrash = (sourceFolder && sourceFolder->isTrashFolder()); + + if (documentIsInTrash && destinationFolder->isTrashFolder()) + return false; + + if (!documentIsInTrash && document->proxy()->groupName() == destinationFolder->groupName()) + return false; + + QString destinationFolderName; + + if (destinationFolder->isTrashFolder()) { + QString sourceFolderName = document->proxy()->metaData(UBSettings::documentGroupName).toString(); + destinationFolderName = UBSettings::trashedDocumentGroupNamePrefix + sourceFolderName; + } + + else { + if (destinationFolder->groupName() == UBApplication::app()->documentController->defaultDocumentGroupName()) + destinationFolderName = ""; + else + destinationFolderName = destinationFolder->groupName(); + } + + // Update the folder name in the document + document->proxy()->setMetaData(UBSettings::documentGroupName, destinationFolderName); + UBPersistenceManager::persistenceManager()->persistDocumentMetadata(document->proxy()); + + // Remove document from its old folder + document->parent()->removeChild(document); + + // Insert document at the right spot in the destination folder (ordered by document date) + int i = 0; + for (i = 0; i < destinationFolder->childCount(); i++) { + QTreeWidgetItem *ti = destinationFolder->child(i); + UBDocumentProxyTreeItem* pi = dynamic_cast(ti); + if (pi && document->proxy()->metaData(UBSettings::documentDate).toString() >= pi->proxy()->metaData(UBSettings::documentDate).toString()) + break; + } + + destinationFolder->insertChild(i, document); + + // Update editable status of the document if it was moved to or from the trash + if (documentIsInTrash) + document->setFlags(document->flags() | Qt::ItemIsEditable); + + if (destinationFolder->isTrashFolder()) + document->setFlags(document->flags() ^ Qt::ItemIsEditable); + + return true; +} UBDocumentProxyTreeItem::UBDocumentProxyTreeItem(QTreeWidgetItem * parent, UBDocumentProxy* proxy, bool isEditable) : QTreeWidgetItem() diff --git a/src/gui/UBDocumentTreeWidget.h b/src/gui/UBDocumentTreeWidget.h index 02d12ff9..420a8bf1 100644 --- a/src/gui/UBDocumentTreeWidget.h +++ b/src/gui/UBDocumentTreeWidget.h @@ -35,6 +35,7 @@ class UBDocumentProxy; class UBDocumentProxyTreeItem; +class UBDocumentGroupTreeItem; class UBDocumentTreeWidget : public QTreeWidget { @@ -60,6 +61,7 @@ class UBDocumentTreeWidget : public QTreeWidget void autoScroll(); private: + bool moveDocument(UBDocumentProxyTreeItem* document, UBDocumentGroupTreeItem* destinationFolder); UBDocumentProxyTreeItem *mSelectedProxyTi; QTreeWidgetItem *mDropTargetProxyTi; QBrush mBackground; From 5477d44e48fdfaad46461641c51c0a9ffd47a2ae Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 30 Oct 2016 18:02:33 -0400 Subject: [PATCH 05/33] Fix for video / audio items not being selectable by rubber band --- src/board/UBBoardView.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index ced6325e..901f2cb5 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -1170,7 +1170,8 @@ void UBBoardView::mouseMoveEvent (QMouseEvent *event) if (item->type() == UBGraphicsW3CWidgetItem::Type || item->type() == UBGraphicsPixmapItem::Type - || item->type() == UBGraphicsMediaItem::Type + || item->type() == UBGraphicsVideoItem::Type + || item->type() == UBGraphicsAudioItem::Type || item->type() == UBGraphicsSvgItem::Type || item->type() == UBGraphicsTextItem::Type || item->type() == UBGraphicsStrokesGroup::Type From bd3d8e951b4fe1adb70c00cf724076d77113f0b9 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 26 Nov 2016 18:13:07 -0500 Subject: [PATCH 06/33] Document screen: when trashing the current document by drag-n-drop, select a new one --- src/document/UBDocumentController.h | 3 ++- src/gui/UBDocumentTreeWidget.cpp | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/document/UBDocumentController.h b/src/document/UBDocumentController.h index f4614174..39e5f635 100644 --- a/src/document/UBDocumentController.h +++ b/src/document/UBDocumentController.h @@ -55,6 +55,8 @@ class UBDocumentController : public UBDocumentContainer { Q_OBJECT + friend class UBDocumentTreeWidget; + public: UBDocumentController(UBMainWindow* mainWindow); virtual ~UBDocumentController(); @@ -163,5 +165,4 @@ class UBDocumentController : public UBDocumentContainer }; - #endif /* UBDOCUMENTCONTROLLER_H_ */ diff --git a/src/gui/UBDocumentTreeWidget.cpp b/src/gui/UBDocumentTreeWidget.cpp index cd6ba2f6..37a93ecf 100644 --- a/src/gui/UBDocumentTreeWidget.cpp +++ b/src/gui/UBDocumentTreeWidget.cpp @@ -375,10 +375,8 @@ bool UBDocumentTreeWidget::moveDocument(UBDocumentProxyTreeItem* document, UBDoc QString destinationFolderName; - if (destinationFolder->isTrashFolder()) { - QString sourceFolderName = document->proxy()->metaData(UBSettings::documentGroupName).toString(); - destinationFolderName = UBSettings::trashedDocumentGroupNamePrefix + sourceFolderName; - } + if (destinationFolder->isTrashFolder()) + UBApplication::app()->documentController->moveDocumentToTrash(sourceFolder, document, true); else { if (destinationFolder->groupName() == UBApplication::app()->documentController->defaultDocumentGroupName()) From 5ecc66a220568bf451b0701bb2fbdc6af4045ef4 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 7 Jan 2017 16:12:29 -0500 Subject: [PATCH 07/33] Fix saving of polygonItem's parent to SVG (caused crash in some cases) --- src/adaptors/UBSvgSubsetAdaptor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 93dc16b6..722569fc 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -1562,9 +1562,9 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::polygonItemToSvgPolygon(UBGraphicsPo } mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "uuid", UBStringUtils::toCanonicalUuid(polygonItem->uuid())); - if (polygonItem->parentItem()) { - mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "parent", UBStringUtils::toCanonicalUuid(UBGraphicsItem::getOwnUuid(polygonItem->parentItem()))); - } + UBGraphicsStrokesGroup* sg = polygonItem->strokesGroup(); + if (sg) + mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "parent", UBStringUtils::toCanonicalUuid(sg->uuid())); mXmlWriter.writeEndElement(); } From 4cff84737dbcae35437375c3ce62bac1b1e7ebf8 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 7 Jan 2017 18:54:11 -0500 Subject: [PATCH 08/33] When loading a scene that is about to be deleted, don't cache the previous and next scenes. This prevents crashes that may occur when deleting multiple pages from a document. --- src/core/UBPersistenceManager.cpp | 14 ++++++++------ src/core/UBPersistenceManager.h | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/core/UBPersistenceManager.cpp b/src/core/UBPersistenceManager.cpp index bcef40aa..280acfea 100644 --- a/src/core/UBPersistenceManager.cpp +++ b/src/core/UBPersistenceManager.cpp @@ -483,7 +483,7 @@ void UBPersistenceManager::deleteDocumentScenes(UBDocumentProxy* proxy, const QL foreach(int index, compactedIndexes) { - UBGraphicsScene *scene = loadDocumentScene(proxy, index); + UBGraphicsScene *scene = loadDocumentScene(proxy, index, false); if (scene) { //scene is about to move into new document @@ -727,7 +727,7 @@ void UBPersistenceManager::moveSceneToIndex(UBDocumentProxy* proxy, int source, } -UBGraphicsScene* UBPersistenceManager::loadDocumentScene(UBDocumentProxy* proxy, int sceneIndex) +UBGraphicsScene* UBPersistenceManager::loadDocumentScene(UBDocumentProxy* proxy, int sceneIndex, bool cacheNeighboringScenes) { UBGraphicsScene* scene = NULL; @@ -740,11 +740,13 @@ UBGraphicsScene* UBPersistenceManager::loadDocumentScene(UBDocumentProxy* proxy, mSceneCache.insert(proxy, sceneIndex, scene); } - if(sceneIndex + 1 < proxy->pageCount() && !mSceneCache.contains(proxy, sceneIndex + 1)) - mWorker->readScene(proxy,sceneIndex+1); + if (cacheNeighboringScenes) { + if(sceneIndex + 1 < proxy->pageCount() && !mSceneCache.contains(proxy, sceneIndex + 1)) + mWorker->readScene(proxy,sceneIndex+1); - if(sceneIndex - 1 >= 0 && !mSceneCache.contains(proxy, sceneIndex - 1)) - mWorker->readScene(proxy,sceneIndex-1); + if(sceneIndex - 1 >= 0 && !mSceneCache.contains(proxy, sceneIndex - 1)) + mWorker->readScene(proxy,sceneIndex-1); + } return scene; } diff --git a/src/core/UBPersistenceManager.h b/src/core/UBPersistenceManager.h index bd981106..08556061 100644 --- a/src/core/UBPersistenceManager.h +++ b/src/core/UBPersistenceManager.h @@ -85,7 +85,7 @@ class UBPersistenceManager : public QObject virtual void moveSceneToIndex(UBDocumentProxy* pDocumentProxy, int source, int target); - virtual UBGraphicsScene* loadDocumentScene(UBDocumentProxy* pDocumentProxy, int sceneIndex); + virtual UBGraphicsScene* loadDocumentScene(UBDocumentProxy* pDocumentProxy, int sceneIndex, bool cacheNeighboringScenes = true); UBGraphicsScene *getDocumentScene(UBDocumentProxy* pDocumentProxy, int sceneIndex) {return mSceneCache.value(pDocumentProxy, sceneIndex);} QList > documentProxies; From ae380e4eb4bca6fcc5c1ed219db5764df2e96fde Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 26 Nov 2016 14:20:19 -0500 Subject: [PATCH 09/33] Adjust text item size upon loading to account for platform-to-platform variability The same font, in the same point size, can be displayed differently depending on platform (this is a Qt limitation). This can lead to text items being the wrong size when importing a document created on a different computer. As a workaround, when saving a text item to SVG, the size of 1pt in pixels is calculated and saved. Upon loading, this value is calculated again and, if it is different from the saved value, the text item is scaled accordingly. Thus, any document created from this version onward will have correctly-scaled text boxes. If an old document (not containing a pixel-per-point attribute for text items) is loaded, the scene is marked as modified to make sure that all text items are then saved with the pixels-per-point value (even if the document is not edited). This allows old documents to be "fixed" by simply opening them once from a new version of OpenBoard. save text item font size in pixels, and scale it on load fixed loading of text item pixel height Save and load pixels-per-point rather than text pixel height Upon loading a text item from SVG, make sure that it will be saved with a pixel-per-point value --- src/adaptors/UBSvgSubsetAdaptor.cpp | 37 ++++++++++++++++++++++++++--- src/adaptors/UBSvgSubsetAdaptor.h | 2 ++ src/domain/UBGraphicsTextItem.cpp | 33 +++++++++++++++++++++++++ src/domain/UBGraphicsTextItem.h | 2 ++ 4 files changed, 71 insertions(+), 3 deletions(-) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 722569fc..9d6203c1 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -355,6 +355,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene(UBDocumentProx mScene = 0; UBGraphicsWidgetItem *currentWidget = 0; bool pageDpiSpecified = true; + saveSceneAfterLoading = false; mFileVersion = 40100; // default to 4.1.0 @@ -371,6 +372,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene(UBDocumentProx if (!mScene) { mScene = new UBGraphicsScene(mProxy, false); + mScene->setModified(false); } // introduced in UB 4.2 @@ -914,10 +916,11 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene(UBDocumentProx mScene->addItem(iterator.value()); } - if (mScene) - mScene->setModified(false); + if (mScene) { + mScene->setModified(saveSceneAfterLoading); + mScene->enableUndoRedoStack(); + } - mScene->enableUndoRedoStack(); qDebug() << "loadScene() : created scene and read file"; qDebug() << "spent milliseconds: " << time.elapsed(); return mScene; @@ -2496,6 +2499,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::textItemToSvg(UBGraphicsTextItem* it mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "width", QString("%1").arg(item->textWidth())); mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "height", QString("%1").arg(item->textHeight())); + mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "pixels-per-point", QString("%1").arg(item->pixelsPerPoint())); QColor colorDarkBg = item->colorOnDarkBackground(); QColor colorLightBg = item->colorOnLightBackground(); @@ -2522,6 +2526,8 @@ UBGraphicsTextItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::textItemFromSvg() qreal width = mXmlReader.attributes().value("width").toString().toFloat(); qreal height = mXmlReader.attributes().value("height").toString().toFloat(); + qreal originalPixelsPerPoint = mXmlReader.attributes().value(mNamespaceUri, "pixels-per-point").toString().toDouble(); + UBGraphicsTextItem* textItem = new UBGraphicsTextItem(); graphicsItemFromSvg(textItem); @@ -2564,6 +2570,31 @@ UBGraphicsTextItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::textItemFromSvg() if (mXmlReader.name() == "itemTextContent") { text = mXmlReader.readElementText(); textItem->setHtml(text); + + // Fonts sizes are not displayed the same across platforms: e.g a text item with the same + // font size (in Pts) is displayed smaller on Linux than Windows. This messes up layouts + // when importing documents created on another computer, so if a font is being displayed + // at a different size (relative to the rest of the document) than it was when created, + // we adjust its size. + if (originalPixelsPerPoint != 0) { + qreal pixelsPerPoint = textItem->pixelsPerPoint(); + + qDebug() << "Pixels per point: original/current" << originalPixelsPerPoint + << "/" << pixelsPerPoint; + qreal ratio = originalPixelsPerPoint/pixelsPerPoint; + + if (ratio != 1) { + qDebug() << "Scaling text by " << ratio; + UBGraphicsTextItemDelegate* textDelegate = dynamic_cast(textItem->Delegate()); + if (textDelegate) + textDelegate->scaleTextSize(ratio); + } + } + else + // mark scene as modified so the text item will be saved with a pixelsPerPoint value + saveSceneAfterLoading = true; + + textItem->resize(width, height); if (textItem->toPlainText().isEmpty()) { delete textItem; diff --git a/src/adaptors/UBSvgSubsetAdaptor.h b/src/adaptors/UBSvgSubsetAdaptor.h index 48e3b1d7..5124e013 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.h +++ b/src/adaptors/UBSvgSubsetAdaptor.h @@ -168,6 +168,8 @@ class UBSvgSubsetAdaptor qreal mGroupZIndex; bool mGroupHasInfo; + bool saveSceneAfterLoading; + QString mNamespaceUri; UBGraphicsScene *mScene; diff --git a/src/domain/UBGraphicsTextItem.cpp b/src/domain/UBGraphicsTextItem.cpp index e48cbb5b..5ef3b738 100644 --- a/src/domain/UBGraphicsTextItem.cpp +++ b/src/domain/UBGraphicsTextItem.cpp @@ -328,6 +328,39 @@ qreal UBGraphicsTextItem::textHeight() const return mTextHeight; } +/** + * @brief Get the ratio between font size in pixels and points. + * @return The ratio of pixel size to point size of the first character, or 0 if the text item is empty. + * + * Qt may display fonts differently on different platforms -- on the same display, + * the same point size may be displayed at different pixel sizes. This function returns the + * ratio of pixel size to point size, based on the first character in the text item. + */ +qreal UBGraphicsTextItem::pixelsPerPoint() const +{ + QTextCursor cursor = textCursor(); + if (cursor.isNull()) + return 0; + + cursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor); + cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor); + + QFont f = cursor.charFormat().font(); + qDebug() << "ppp. Font: " << f; + QFontInfo fi(cursor.charFormat().font()); + + qreal pixelSize = fi.pixelSize(); + qreal pointSize = fi.pointSizeF(); + + //qDebug() << "Pixel size: " << pixelSize; + //qDebug() << "Point size: " << pointSize; + + if (pointSize == 0) + return 0; + + return pixelSize/pointSize; +} + void UBGraphicsTextItem::contentsChanged() { diff --git a/src/domain/UBGraphicsTextItem.h b/src/domain/UBGraphicsTextItem.h index bb001a26..bb031f71 100644 --- a/src/domain/UBGraphicsTextItem.h +++ b/src/domain/UBGraphicsTextItem.h @@ -65,6 +65,7 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes void setTextWidth(qreal width); void setTextHeight(qreal height); qreal textHeight() const; + qreal pixelsPerPoint() const; void contentsChanged(); @@ -101,6 +102,7 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes QString mTypeTextHereLabel; + signals: void textUndoCommandAdded(UBGraphicsTextItem *textItem); From 427379a2eb30408db93090b5bbd6433a73a0a487 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 8 Jan 2017 14:11:57 -0500 Subject: [PATCH 10/33] Set minimum size for protractor --- src/tools/UBGraphicsProtractor.cpp | 13 ++++++++----- src/tools/UBGraphicsProtractor.h | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/tools/UBGraphicsProtractor.cpp b/src/tools/UBGraphicsProtractor.cpp index 85ef4b93..39f28d48 100644 --- a/src/tools/UBGraphicsProtractor.cpp +++ b/src/tools/UBGraphicsProtractor.cpp @@ -41,6 +41,7 @@ const QRectF UBGraphicsProtractor::sDefaultRect = QRectF(-250, -250, 500, 500); +const qreal UBGraphicsProtractor::minRadius = 70; UBGraphicsProtractor::UBGraphicsProtractor() : QGraphicsEllipseItem(sDefaultRect) @@ -213,11 +214,13 @@ void UBGraphicsProtractor::mouseMoveEvent(QGraphicsSceneMouseEvent *event) case Resize : - prepareGeometryChange(); - setTransform(QTransform::fromTranslate(rect().center().x(), rect().center().y()), true); - setTransform(QTransform::fromScale(scaleFactor, scaleFactor), true); - setTransform(QTransform::fromTranslate(-rect().center().x(), -rect().center().y()), true); - mScaleFactor *= scaleFactor; + if (radius() * mScaleFactor * scaleFactor > minRadius) { + prepareGeometryChange(); + setTransform(QTransform::fromTranslate(rect().center().x(), rect().center().y()), true); + setTransform(QTransform::fromScale(scaleFactor, scaleFactor), true); + setTransform(QTransform::fromTranslate(-rect().center().x(), -rect().center().y()), true); + mScaleFactor *= scaleFactor; + } break; case MoveMarker : diff --git a/src/tools/UBGraphicsProtractor.h b/src/tools/UBGraphicsProtractor.h index 74f68155..42dd591f 100644 --- a/src/tools/UBGraphicsProtractor.h +++ b/src/tools/UBGraphicsProtractor.h @@ -119,6 +119,7 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse QGraphicsSvgItem* mRotateSvgItem; static const QRectF sDefaultRect; + static const qreal minRadius; virtual void rotateAroundCenter(qreal angle); virtual QPointF rotationCenter() const; From 71287f6228ea2775c421f0791b243e598147b9a5 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 14 Jan 2017 15:00:20 -0500 Subject: [PATCH 11/33] Fix for grouped items' locked state not being saved --- src/domain/UBGraphicsScene.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 357fb1a8..a5c5fec7 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -1180,12 +1180,17 @@ UBGraphicsScene* UBGraphicsScene::sceneDeepCopy() const groupCloned->resetTransform(); groupCloned->setMatrix(group->matrix()); groupCloned->setTransform(group->transform()); + bool locked = groupCloned->Delegate()->isLocked(); foreach(QGraphicsItem* eachItem ,group->childItems()){ QGraphicsItem* copiedChild = dynamic_cast(dynamic_cast(eachItem)->deepCopy()); copy->addItem(copiedChild); groupCloned->addToGroup(copiedChild); } + + if (locked) + groupCloned->setData(UBGraphicsItemData::ItemLocked, QVariant(true)); + copy->addItem(groupCloned); } From 09ab3e19d0006edf5d0ec24ece551da3904e3070 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 14 Jan 2017 15:27:55 -0500 Subject: [PATCH 12/33] Fixes for media item grouping: - Selecting multiple media items then grouping them didn't behave as it should for other items => fixed by adding type tests - A group containing several media items wasn't saved to SVG with those media items as children, due to incorrect UUID copying in the mediaItems's deepCopy() methods --- src/board/UBBoardView.cpp | 6 ++++++ src/domain/UBGraphicsGroupContainerItem.cpp | 5 ++++- src/domain/UBGraphicsMediaItem.cpp | 6 ++++++ src/domain/UBGraphicsMediaItem.h | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index 901f2cb5..48cc5932 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -555,6 +555,8 @@ Here we determines cases when items should to get mouse press event at pressing return true; case UBGraphicsMediaItem::Type: + case UBGraphicsVideoItem::Type: + case UBGraphicsAudioItem::Type: return false; case UBGraphicsTextItem::Type: @@ -626,6 +628,8 @@ bool UBBoardView::itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item) case DelegateButton::Type: case UBGraphicsMediaItem::Type: + case UBGraphicsVideoItem::Type: + case UBGraphicsAudioItem::Type: return true; } @@ -858,6 +862,8 @@ void UBBoardView::moveRubberedItems(QPointF movingVector) if (item->type() == UBGraphicsW3CWidgetItem::Type || item->type() == UBGraphicsPixmapItem::Type || item->type() == UBGraphicsMediaItem::Type + || item->type() == UBGraphicsVideoItem::Type + || item->type() == UBGraphicsAudioItem::Type || item->type() == UBGraphicsSvgItem::Type || item->type() == UBGraphicsTextItem::Type || item->type() == UBGraphicsStrokesGroup::Type diff --git a/src/domain/UBGraphicsGroupContainerItem.cpp b/src/domain/UBGraphicsGroupContainerItem.cpp index a4f45a62..646f8b6d 100644 --- a/src/domain/UBGraphicsGroupContainerItem.cpp +++ b/src/domain/UBGraphicsGroupContainerItem.cpp @@ -162,7 +162,10 @@ void UBGraphicsGroupContainerItem::removeFromGroup(QGraphicsItem *item) void UBGraphicsGroupContainerItem::deselectCurrentItem() { - if (mCurrentItem && mCurrentItem->type() == UBGraphicsMediaItem::Type){ + if (mCurrentItem && (mCurrentItem->type() == UBGraphicsMediaItem::Type + || mCurrentItem->type() == UBGraphicsVideoItem::Type + || mCurrentItem->type() == UBGraphicsAudioItem::Type)) + { dynamic_cast(mCurrentItem)->Delegate()->getToolBarItem()->hide(); mCurrentItem->setSelected(false); diff --git a/src/domain/UBGraphicsMediaItem.cpp b/src/domain/UBGraphicsMediaItem.cpp index a9ed21f3..4185fe40 100644 --- a/src/domain/UBGraphicsMediaItem.cpp +++ b/src/domain/UBGraphicsMediaItem.cpp @@ -252,6 +252,12 @@ void UBGraphicsMediaItem::setMinimumSize(const QSize& size) this->setSize(width, height); } +void UBGraphicsMediaItem::setUuid(const QUuid &pUuid) +{ + UBItem::setUuid(pUuid); + setData(UBGraphicsItemData::ItemUuid, QVariant(pUuid)); +} + void UBGraphicsMediaItem::setMediaFileUrl(QUrl url) { mMediaFileUrl = url; diff --git a/src/domain/UBGraphicsMediaItem.h b/src/domain/UBGraphicsMediaItem.h index f08a5ae5..dd5ed396 100644 --- a/src/domain/UBGraphicsMediaItem.h +++ b/src/domain/UBGraphicsMediaItem.h @@ -100,6 +100,7 @@ public: virtual void setSourceUrl(const QUrl &pSourceUrl); void setSelected(bool selected); void setMinimumSize(const QSize& size); + void setUuid(const QUuid &pUuid); virtual void copyItemParameters(UBItem *copy) const; From 67d3a34b0b131c3667ac223e5a8985131088edeb Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 15 Jan 2017 22:01:24 +0100 Subject: [PATCH 13/33] Document mode: Don't automatically select a new document when deleting one --- src/document/UBDocumentController.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index 25dd3c95..ebce0117 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -805,10 +805,12 @@ void UBDocumentController::deleteTreeItem(QTreeWidgetItem * item, bool showConfi document->parent()->removeChild(document); UBPersistenceManager::persistenceManager()->deleteDocument(document->proxy()); - if (mTrashTi->childCount()==0) - selectDocument(NULL); - else - selectDocument(((UBDocumentProxyTreeItem*)mTrashTi->child(0))->proxy()); + if (selectNewDocument) { + if (mTrashTi->childCount()==0) + selectDocument(NULL); + else + selectDocument(((UBDocumentProxyTreeItem*)mTrashTi->child(0))->proxy()); + } reloadThumbnails(); } From d7b73a169d52eee5f75dbb86d5475a7e4761bf60 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 15 Jan 2017 17:14:00 -0500 Subject: [PATCH 14/33] Save the transform matrix of group items to SVG Solves issue where items (other than strokes) that had been grouped then moved (and/or rotated) lost their new position after saving and loading the document. --- src/adaptors/UBSvgSubsetAdaptor.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 9d6203c1..df4530d6 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -938,6 +938,8 @@ UBGraphicsGroupContainerItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::readGroup() if(mStrokesList.contains(id)) shouldSkipSubElements = true; + QStringRef svgTransform = mXmlReader.attributes().value("transform"); + mXmlReader.readNext(); while (!mXmlReader.atEnd()) { @@ -981,6 +983,12 @@ UBGraphicsGroupContainerItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::readGroup() group->destroy(false); } } + + if (!svgTransform.isNull()) { + QMatrix itemMatrix = fromSvgTransform(svgTransform.toString()); + group->setMatrix(itemMatrix); + } + return group; } @@ -1346,6 +1354,10 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(UBDocumentProxy* proxy, if(curElement.hasAttribute("locked")){ mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri,"locked",curElement.attribute("locked")); } + + if (curElement.hasAttribute("transform")) + mXmlWriter.writeAttribute("transform", curElement.attribute("transform")); + QDomElement curSubElement = curElement.firstChildElement(); while (!curSubElement.isNull()) { if (curSubElement.hasAttribute(aId)) { @@ -1391,6 +1403,8 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistGroupToDom(QGraphicsItem *gro else curGroupElement.setAttribute("locked", xmlFalse); } + + curGroupElement.setAttribute("transform", toSvgTransform(groupItem->sceneMatrix())); curParent->appendChild(curGroupElement); foreach (QGraphicsItem *item, groupItem->childItems()) { QUuid tmpUuid = UBGraphicsScene::getPersonalUuid(item); From 949dbdb59ee859cbce06e139d584285dc6971c82 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 15 Jan 2017 17:28:33 -0500 Subject: [PATCH 15/33] Slimmed compass slightly --- src/tools/UBGraphicsCompass.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/tools/UBGraphicsCompass.h b/src/tools/UBGraphicsCompass.h index 485237db..7f56cb12 100644 --- a/src/tools/UBGraphicsCompass.h +++ b/src/tools/UBGraphicsCompass.h @@ -126,25 +126,25 @@ class UBGraphicsCompass: public QObject, public QGraphicsRectItem, public UBItem int mPixelsPerMillimeter; // Constants - static const int sNeedleLength = 18; + static const int sNeedleLength = 12; static const int sNeedleWidth = 3; - static const int sNeedleBaseLength = 12; - static const int sNeedleBaseWidth = 12; + static const int sNeedleBaseLength = 9; + static const int sNeedleBaseWidth = 9; - static const int sNeedleArmLeftWidth = 18; - static const int sNeedleArmRigthWidth = 24; + static const int sNeedleArmLeftWidth = 12; + static const int sNeedleArmRigthWidth = 16; static const int sPencilLength = 12; - static const int sPencilWidth = 3; + static const int sPencilWidth = 2; - static const int sPencilBaseLength = 18; - static const int sPencilBaseWidth = 12; + static const int sPencilBaseLength = 9; + static const int sPencilBaseWidth = 9; - static const int sPencilArmLeftWidth = 24; - static const int sPencilArmRightWidth = 18; + static const int sPencilArmLeftWidth = 16; + static const int sPencilArmRightWidth = 12; - static const int sCornerRadius = 3; + static const int sCornerRadius = 2; static const QRect sDefaultRect; static const int sMinRadius; From 064b5a99b77bf757382d582d3a5f6748f6740e32 Mon Sep 17 00:00:00 2001 From: EmPeWe Date: Mon, 16 Jan 2017 15:39:19 +0100 Subject: [PATCH 16/33] Updated German translation Credit: EmPeWe --- resources/i18n/OpenBoard_de.ts | 150 ++++++++++++++++----------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/resources/i18n/OpenBoard_de.ts b/resources/i18n/OpenBoard_de.ts index 6ce93662..d7ca233e 100644 --- a/resources/i18n/OpenBoard_de.ts +++ b/resources/i18n/OpenBoard_de.ts @@ -169,7 +169,7 @@ Quit - Verlassen + Beenden Eraser @@ -409,7 +409,7 @@ Multi Screen - Geteilter Bildschirm + Mehrere Bildschirme Wide Size (16/9) @@ -477,7 +477,7 @@ Light - Licht + Hell Grid Light Background @@ -561,7 +561,7 @@ Highlight - Highlight + Hervorheben Ctrl+M @@ -569,7 +569,7 @@ Selector - Selector + Auswahl Select And Modify Objects @@ -697,7 +697,7 @@ Flash Trap - Falle einblenden + Einblendung einfangen Trap Flash Content @@ -705,7 +705,7 @@ Web Trap - Webfalle + Internet einfangen Trap Web Content @@ -793,11 +793,11 @@ Open Tutorial - + Anleitung öffnen Open the tutorial web page - + Öffnen der Anleitung im Internet @@ -854,7 +854,7 @@ Are you sure you want to remove 1 page from the selected document '%0'? - Wollen Sie wirklich 1 Seite des gewählten Dokuments '%0' entfernen? + Wollen Sie wirklich die ausgewählte Seite des Dokuments '%0' entfernen? @@ -876,30 +876,30 @@ New update available, would you go to the web page ? - Neues Update verfügbar, möchten Sie auf die Webseite gehen? + Neue Aktualisierung verfügbar, möchten Sie auf die Internetseite gehen? No update available - Kein Update verfügbar + Keine Aktualisierung verfügbar Update available - Update verfügbar + Aktualisierung verfügbar Update - Update + Aktualisierung UBBoardController Downloading content %1 failed - Fehler beim Download von %1 + Fehler beim Herunterladen von %1 Download finished - Download beendet + Herunterladen beendet Unknown tool type %1 @@ -919,11 +919,11 @@ Delete page %1 from document - Seite %1 des Dokuments löschen + Seite %1 des Dokuments löschen Page %1 deleted - Seite %1 gelöscht + Seite %1 gelöscht Add file operation failed: file copying error @@ -939,11 +939,11 @@ Saving document... - + Dokument wird gespeichert... Document has just been saved... - + Dokument wurde gespeichert... @@ -1004,7 +1004,7 @@ Show OpenBoard - + Zeige OpenBoard @@ -1031,7 +1031,7 @@ Duplicating Document %1 - Dokument %1 wird kopiert + Dokument %1 wird dupliziert Document %1 copied @@ -1051,7 +1051,7 @@ Empty Trash - Leerer Papierkorb + Papierkorb leeren Are you sure you want to empty trash? @@ -1063,7 +1063,7 @@ Emptied trash - Papierkorb geleert + Papierkorb wurde geleert Remove Folder @@ -1071,7 +1071,7 @@ Are you sure you want to remove the folder '%1' and all its content? - Möchten Sie den Ordner '%1 mit dem gesamten Inhalt wirklich entfernen? + Möchten Sie den Ordner '%1 und seinen gesamten Inhalt wirklich entfernen? No document selected! @@ -1099,7 +1099,7 @@ Empty - Leer + Leeren Trash @@ -1138,15 +1138,15 @@ The document '%1' has been generated with a newer version of OpenBoard (%2). By opening it, you may lose some information. Do you want to proceed? - + Das Dokument '%1' wurde mit einer neueren Version von OpenBoard erstellt (%2). Beim Öffnen können einige Informationen verloren gehen. Möchten Sie fortfahren? Are you sure you want to remove all selected documents? - + Möchten sie wirklich alle ausgewählten Dokumente entfernen? Remove multiple documents - + Mehrere Dokumente entfernen @@ -1185,11 +1185,11 @@ Import of file %1 successful. - Import des Dokuments %1 erfolgreich. + Import der Datei %1 erfolgreich. Importing file %1 - Importieren von %1 + Datei %1 wird importiert @@ -1212,8 +1212,8 @@ %1 pages copied - %1 Seite kopiert - %1 Seiten kopiert + %1 Seite wurde kopiert + %1 Seiten wurden kopiert @@ -1282,19 +1282,19 @@ Export to OpenBoard Format - + In das OpenBoard Format exportieren Export failed: location not writable - + Export fehlgeschlagen: Zielpfad nicht beschreibbar Export failed - + Export fehlgeschlagen Unable to export to the selected location. You do not have the permissions necessary to save the file. - + Export im ausgewählten Zielpfad nicht möglich. Sie haben nicht die erforderliche Berechtigung um die Datei zu speichern. @@ -1317,15 +1317,15 @@ Export failed: location not writable - + Export fehlgeschlagen: Zielpfad nicht beschreibbar. Export failed - + Export fehlgeschlagen Unable to export to the selected location. You do not have the permissions necessary to save the file. - + Export im ausgewählten Zielpfad nicht möglich. Sie haben nicht die erforderliche Berechtigung um die Datei zu speichern. @@ -1531,19 +1531,19 @@ UBGraphicsMediaItem Media resource couldn't be resolved - + Medienquelle konnte nicht aufgelöst werden Unsupported media format - + Medienformat wird nicht unterstützt Media playback service not found - + Dienst zum Abspielen von Mediainhalten nicht gefunden Media error: - + Medienfehler: @@ -1582,11 +1582,11 @@ UBGraphicsWidgetItemDelegate Frozen - Erstarrt + Fixiert Transform as Tool - In Extra umwandeln + In Werkzeug umwandeln @@ -1601,7 +1601,7 @@ Import of file %1 failed. - Import der Datei %1 fehlgeschlagen. + Import der Datei %1 fehlgeschlagen. Import successful. @@ -1628,7 +1628,7 @@ OpenBoard (*.ubz) - + OpenBoard (*.ubz) @@ -1724,7 +1724,7 @@ Do you want to ignore these errors for this host? %2 -Möchten Sie diese Fehler auf diesem Computer ignorieren? +Möchten Sie diese Fehler für diesen Computer ignorieren? Yes @@ -1739,15 +1739,15 @@ Möchten Sie diese Fehler auf diesem Computer ignorieren? UBOpenSankoreImporterWidget Open-Sankore Documents Detected - + Geöffnete Open-Sankore Dokumente festgestellt Show this panel next time - + Diesen Dialog erneut anzeigen You can always access the OpenBoard Document Importer through the Preferences panel in the About tab. Warning, if you have already imported your Open-Sankore datas, you might loose your current OpenBoard documents. - + Sie können jederzeit im Einstellungsdialog im Menü "Über" auf den OpenBoard Document Importer zugreifen. Warnung, falls sie bereits Ihre Open-Sankore Daten importiert haben, können Sie Ihre aktuellen OpenBoard Dokumente verlieren. Cancel @@ -1755,11 +1755,11 @@ Möchten Sie diese Fehler auf diesem Computer ignorieren? Proceed - + Fortfahren Open-Sankoré documents are present on your computer. It is possible to import them to OpenBoard by pressing the “Proceed” button to launch the importer application. - + Auf Ihrem Computer befinden sich Open-Sankoré Dokumente. Um diese in OpenBoard zu importieren drücken Sie den "Fortfahren" Knopf um die Importanwendung zu starten. @@ -1774,7 +1774,7 @@ Möchten Sie diese Fehler auf diesem Computer ignorieren? has lost access to the document repository '%1'. Unfortunately the application must shut down to avoid data corruption. Latest changes may be lost as well. - + Verbindung zum Dokumentenarchiv verloren. Um fehlerhafte Daten zu vermeiden muss die Anwendung leider geschlossen werden. Letzte Änderungen können auch verloren gehen. @@ -1828,7 +1828,7 @@ Möchten Sie diese Fehler auf diesem Computer ignorieren? Podcast recording error (%1) - Podcast registriert einen Fehler (%1) + Fehler bei der Podcast Aufnahme (%1) Default Audio Input @@ -2002,7 +2002,7 @@ Möchten Sie diese Fehler auf diesem Computer ignorieren? Update - Update + Aktualisierung Select a backup folder @@ -2020,7 +2020,7 @@ Bitte starten Sie die Anwendung erneut, um auf die aktualisierten Dokumente zugr Files update results - Ergebnis des Daten-Updates + Ergebnis der Dateien-Aktualisierung Updating file @@ -2046,7 +2046,7 @@ Bitte starten Sie die Anwendung erneut, um auf die aktualisierten Dokumente zugr UBWidgetUniboardAPI %0 called (method=%1, status=%2) - %0 abgerufen (Methode=%1, Status=%2) + %0 aufgerufen (Methode=%1, Status=%2) @@ -2149,7 +2149,7 @@ Bitte starten Sie die Anwendung erneut, um auf die aktualisierten Dokumente zugr Download canceled: %1 - Download abgebrochen %1 + Herunterladen abgebrochen %1 Error opening saved file: %1 @@ -2246,19 +2246,19 @@ Bitte starten Sie die Anwendung erneut, um auf die aktualisierten Dokumente zugr WBTabBar New &Tab - Tab Neu & + &Tab Neu Clone Tab - Tab Klon + Tab duplizieren &Close Tab - Tab & Schließen + Tab &Schließen Close &Other Tabs - Tabs Schließen & Andere + &Andere Tabs schließen Reload Tab @@ -2319,7 +2319,7 @@ Bitte starten Sie die Anwendung erneut, um auf die aktualisierten Dokumente zugr Download PDF Document: would you prefer to download the PDF file or add it to the current OpenBoard document? - + PDF Dokument herunterladen: Möchten Sie die PDF-Datei herunterladen oder sie zum aktuellen OpenBoard Dokument hinzufügen? @@ -2373,7 +2373,7 @@ p, li { white-space: pre-wrap; } Restore credentials on reboot - + Zugangsdaten beim Neustarten wiederherstellen OpenBoard @@ -2392,7 +2392,7 @@ p, li { white-space: pre-wrap; } Opacity - Lichtundurchlässigkeit + Deckkraft Line Width @@ -2404,7 +2404,7 @@ p, li { white-space: pre-wrap; } Strong - Stark + Dick Fine @@ -2442,7 +2442,7 @@ p, li { white-space: pre-wrap; } documents OpenBoard Documents - + OpenBoard Dokumente @@ -2529,11 +2529,11 @@ p, li { white-space: pre-wrap; } Software Update - Software-Update + Software-Aktualisierung Check software update at launch - Software-Update beim Start prüfen + Software-Aktualisierung beim Start prüfen Licences @@ -2586,19 +2586,19 @@ p, li { white-space: pre-wrap; } Open-Sankoré Importer - + Open-Sankoré Importer Check if Open-Sankoré data could be imported at launch - + Prüfen, ob Open-Sankoré Daten beim Start importiert werden können Use system keyboard (recommended) - + Benutze System-Tastatur (empfohlen) Built-in virtual keyboard button size: - + Tastengröße der integrierten virtuellen Tastatur From b213b2d82dbb0bcb8df17b09e75ecb83d45352e1 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 21 Jan 2017 17:41:44 -0500 Subject: [PATCH 17/33] Revert "Save the transform matrix of group items to SVG" This reverts commit d7b73a169d52eee5f75dbb86d5475a7e4761bf60. --- src/adaptors/UBSvgSubsetAdaptor.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index df4530d6..9d6203c1 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -938,8 +938,6 @@ UBGraphicsGroupContainerItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::readGroup() if(mStrokesList.contains(id)) shouldSkipSubElements = true; - QStringRef svgTransform = mXmlReader.attributes().value("transform"); - mXmlReader.readNext(); while (!mXmlReader.atEnd()) { @@ -983,12 +981,6 @@ UBGraphicsGroupContainerItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::readGroup() group->destroy(false); } } - - if (!svgTransform.isNull()) { - QMatrix itemMatrix = fromSvgTransform(svgTransform.toString()); - group->setMatrix(itemMatrix); - } - return group; } @@ -1354,10 +1346,6 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(UBDocumentProxy* proxy, if(curElement.hasAttribute("locked")){ mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri,"locked",curElement.attribute("locked")); } - - if (curElement.hasAttribute("transform")) - mXmlWriter.writeAttribute("transform", curElement.attribute("transform")); - QDomElement curSubElement = curElement.firstChildElement(); while (!curSubElement.isNull()) { if (curSubElement.hasAttribute(aId)) { @@ -1403,8 +1391,6 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistGroupToDom(QGraphicsItem *gro else curGroupElement.setAttribute("locked", xmlFalse); } - - curGroupElement.setAttribute("transform", toSvgTransform(groupItem->sceneMatrix())); curParent->appendChild(curGroupElement); foreach (QGraphicsItem *item, groupItem->childItems()) { QUuid tmpUuid = UBGraphicsScene::getPersonalUuid(item); From f2786221c330c905c410f6a19600c49be99cc5eb Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 22 Jan 2017 19:12:52 -0500 Subject: [PATCH 18/33] Fixed saving/loading of grouped items' transforms (Much simpler and cleaner solution than previous commit) --- src/domain/UBGraphicsScene.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index a5c5fec7..05b5ec87 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -1178,8 +1178,6 @@ UBGraphicsScene* UBGraphicsScene::sceneDeepCopy() const UBGraphicsGroupContainerItem* groupCloned = group->deepCopyNoChildDuplication(); groupCloned->resetMatrix(); groupCloned->resetTransform(); - groupCloned->setMatrix(group->matrix()); - groupCloned->setTransform(group->transform()); bool locked = groupCloned->Delegate()->isLocked(); foreach(QGraphicsItem* eachItem ,group->childItems()){ @@ -1192,6 +1190,8 @@ UBGraphicsScene* UBGraphicsScene::sceneDeepCopy() const groupCloned->setData(UBGraphicsItemData::ItemLocked, QVariant(true)); copy->addItem(groupCloned); + groupCloned->setMatrix(group->matrix()); + groupCloned->setTransform(group->transform()); } if (ubItem && !stroke && !group && item->isVisible()) From e094da34bced0aaf118f8443763bfd43450f87ce Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 22 Jan 2017 20:58:34 -0500 Subject: [PATCH 19/33] Fix saving/loading of strokes' positions Fixed issue that appeared with previous commit, where grouped strokes' positions were sometimes saved and loaded incorrectly. Strokes and their transforms should now be saved correctly whether they are grouped or not --- src/adaptors/UBSvgSubsetAdaptor.cpp | 9 ++++----- src/domain/UBGraphicsStrokesGroup.cpp | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 9d6203c1..3f2018d6 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -1145,11 +1145,6 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(UBDocumentProxy* proxy, mXmlWriter.writeStartElement("g"); openStroke = currentStroke; - QMatrix matrix = item->sceneMatrix(); - - if (!matrix.isIdentity()) - mXmlWriter.writeAttribute("transform", toSvgTransform(matrix)); - UBGraphicsStroke* stroke = dynamic_cast(currentStroke); if (stroke) @@ -1170,6 +1165,10 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(UBDocumentProxy* proxy, mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "uuid", UBStringUtils::toCanonicalUuid(sg->uuid())); + QMatrix matrix = sg->sceneMatrix(); + if (!matrix.isIdentity()) + mXmlWriter.writeAttribute("transform", toSvgTransform(matrix)); + qDebug() << "Attributes written"; groupHoldsInfo = true; diff --git a/src/domain/UBGraphicsStrokesGroup.cpp b/src/domain/UBGraphicsStrokesGroup.cpp index a2606700..39cde9ee 100644 --- a/src/domain/UBGraphicsStrokesGroup.cpp +++ b/src/domain/UBGraphicsStrokesGroup.cpp @@ -173,7 +173,7 @@ UBItem* UBGraphicsStrokesGroup::deepCopy() const } } const_cast(this)->setTransform(groupTransform); - copy->setTransform(sceneTransform()); + copy->setTransform(groupTransform); return copy; } @@ -184,6 +184,7 @@ void UBGraphicsStrokesGroup::copyItemParameters(UBItem *copy) const if(NULL != cp) { cp->setTransform(transform()); + cp->setPos(pos()); cp->setFlag(QGraphicsItem::ItemIsMovable, true); cp->setFlag(QGraphicsItem::ItemIsSelectable, true); From c3c7a9030c8d324d2681e4fee38b09c596adb0de Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Tue, 24 Jan 2017 21:59:01 -0500 Subject: [PATCH 20/33] Fix for strokes' locked status not being saved/loaded --- src/adaptors/UBSvgSubsetAdaptor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 3f2018d6..823b6cb3 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -1165,6 +1165,10 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(UBDocumentProxy* proxy, mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "uuid", UBStringUtils::toCanonicalUuid(sg->uuid())); + QVariant locked = sg->data(UBGraphicsItemData::ItemLocked); + if (!locked.isNull() && locked.toBool()) + mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "locked", xmlTrue); + QMatrix matrix = sg->sceneMatrix(); if (!matrix.isIdentity()) mXmlWriter.writeAttribute("transform", toSvgTransform(matrix)); From 86e2bf93cf4723f73bfa6b33ac3e76519928132a Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Tue, 24 Jan 2017 22:57:47 -0500 Subject: [PATCH 21/33] When scaling text, first round the scaling factor... ... to the nearest 2 decimal places. This fixes a bug where upon loading a text item, it could be scaled by e.g 0.999999, which would eventually round down the point size by 1pt. Making the text item shrink by 1pt every time the document was opened. --- src/domain/UBGraphicsTextItemDelegate.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/domain/UBGraphicsTextItemDelegate.cpp b/src/domain/UBGraphicsTextItemDelegate.cpp index 1d9267b6..4e4a5c50 100644 --- a/src/domain/UBGraphicsTextItemDelegate.cpp +++ b/src/domain/UBGraphicsTextItemDelegate.cpp @@ -532,6 +532,9 @@ bool UBGraphicsTextItemDelegate::keyReleaseEvent(QKeyEvent *event) void UBGraphicsTextItemDelegate::ChangeTextSize(qreal factor, textChangeMode changeMode) { + // round it to the nearest hundredth + factor = floor(factor*100+0.5)/100.; + if (scaleSize == changeMode) { if (1 == factor) From 334ef904f4d51d86964e759cae27fc8b1068e7f9 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 28 Jan 2017 12:23:26 -0500 Subject: [PATCH 22/33] Don't move locked strokes --- src/domain/UBGraphicsStrokesGroup.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/domain/UBGraphicsStrokesGroup.cpp b/src/domain/UBGraphicsStrokesGroup.cpp index 39cde9ee..5d418d01 100644 --- a/src/domain/UBGraphicsStrokesGroup.cpp +++ b/src/domain/UBGraphicsStrokesGroup.cpp @@ -128,10 +128,12 @@ void UBGraphicsStrokesGroup::mousePressEvent(QGraphicsSceneMouseEvent *event) void UBGraphicsStrokesGroup::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { - QGraphicsItemGroup::mouseMoveEvent(event); + if (!isLocked(this)) { + QGraphicsItemGroup::mouseMoveEvent(event); - event->accept(); - setSelected(false); + event->accept(); + setSelected(false); + } } void UBGraphicsStrokesGroup::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) From fe6b92513f5c715a52ac92be91837bc152e86b4a Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 28 Jan 2017 17:32:35 -0500 Subject: [PATCH 23/33] Fix for text items' buttons overflowing from frame This was observed in some cases on low-resolution screens, at least on Linux and Windows. The previously hardcoded value for the width of the text items' titlebar (consisting of the buttons for formatting text) was replaced by a method calculating its width (which varies based on screen resolution). --- src/board/UBBoardView.cpp | 1 + src/domain/UBGraphicsTextItem.cpp | 8 ++++++-- src/domain/UBGraphicsTextItemDelegate.cpp | 25 +++++++++++++++++++++++ src/domain/UBGraphicsTextItemDelegate.h | 1 + 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index 48cc5932..4ca060dd 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -1335,6 +1335,7 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event) textItem->setTextInteractionFlags(Qt::TextEditorInteraction); textItem->setSelected (true); + textItem->setTextWidth(0); textItem->setFocus(); } } diff --git a/src/domain/UBGraphicsTextItem.cpp b/src/domain/UBGraphicsTextItem.cpp index 5ef3b738..f2326bb9 100644 --- a/src/domain/UBGraphicsTextItem.cpp +++ b/src/domain/UBGraphicsTextItem.cpp @@ -306,8 +306,12 @@ QPainterPath UBGraphicsTextItem::shape() const void UBGraphicsTextItem::setTextWidth(qreal width) { - qreal strictMin = 155; // the size of the font customization panel - qreal newWidth = qMax(strictMin, width); + qreal titleBarWidth = 0; + UBGraphicsTextItemDelegate * del = dynamic_cast(Delegate()); + if (del) + titleBarWidth = del->titleBarWidth(); + + qreal newWidth = qMax(titleBarWidth, width); QGraphicsTextItem::setTextWidth(newWidth); } diff --git a/src/domain/UBGraphicsTextItemDelegate.cpp b/src/domain/UBGraphicsTextItemDelegate.cpp index 4e4a5c50..34b866e6 100644 --- a/src/domain/UBGraphicsTextItemDelegate.cpp +++ b/src/domain/UBGraphicsTextItemDelegate.cpp @@ -204,6 +204,31 @@ void UBGraphicsTextItemDelegate::createControls() } +/** + * @brief Calculate the width of the toolbar containing the text item-related buttons + * @return The space between the left-most and right-most buttons in pixels + */ +qreal UBGraphicsTextItemDelegate::titleBarWidth() +{ + if (!mFontButton) + return 0; + + // refresh the frame and buttons' positions + positionHandles(); + + qreal titleBarWidth(0); + qreal frameLeftCoordinate = mFontButton->pos().x(); + qreal frameRightCoordinate = frameLeftCoordinate; + + foreach(DelegateButton* button, mButtons) { + if (button->getSection() == Qt::TitleBarArea) { + frameLeftCoordinate = qMin(button->pos().x(), frameLeftCoordinate); + frameRightCoordinate = qMax(button->pos().x() + button->boundingRect().width(), frameRightCoordinate); + } + } + + return frameRightCoordinate - frameLeftCoordinate; +} void UBGraphicsTextItemDelegate::freeButtons() { diff --git a/src/domain/UBGraphicsTextItemDelegate.h b/src/domain/UBGraphicsTextItemDelegate.h index bfd99229..bc10f367 100644 --- a/src/domain/UBGraphicsTextItemDelegate.h +++ b/src/domain/UBGraphicsTextItemDelegate.h @@ -114,6 +114,7 @@ class UBGraphicsTextItemDelegate : public UBGraphicsItemDelegate void scaleTextSize(qreal multiplyer); virtual QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value); virtual void createControls(); + qreal titleBarWidth(); public slots: void contentsChanged(); From 37790b77f96924c564a8190ffbe8df55293b04db Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Tue, 31 Jan 2017 19:16:11 -0500 Subject: [PATCH 24/33] Fix building with gcc 6 (see issue 76) --- src/frameworks/UBGeometryUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frameworks/UBGeometryUtils.cpp b/src/frameworks/UBGeometryUtils.cpp index a453e9b8..481ba1a9 100644 --- a/src/frameworks/UBGeometryUtils.cpp +++ b/src/frameworks/UBGeometryUtils.cpp @@ -188,7 +188,7 @@ QPolygonF UBGeometryUtils::arcToPolygon(const QLineF& startRadius, qreal spanAng qreal radiusLength = startRadius.length(); qreal angle = 2 * asin(width / (2 * radiusLength)) * 180 / PI; - bool overlap = abs(spanAngleInDegrees) > 360 - angle; + bool overlap = qAbs(spanAngleInDegrees) > 360 - angle; if (overlap) spanAngleInDegrees = spanAngleInDegrees < 0 ? -360 : 360; From 1fd2545692f91a369c12a3c6d5be4365f7dd90a1 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 4 Feb 2017 13:34:28 -0500 Subject: [PATCH 25/33] Fix saving of polygons' transforms --- src/adaptors/UBSvgSubsetAdaptor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 823b6cb3..66cd9978 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -1534,7 +1534,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::polygonItemToSvgPolygon(UBGraphicsPo QString points = pointsToSvgPointsAttribute(polygon); mXmlWriter.writeAttribute("points", points); - mXmlWriter.writeAttribute("transform",toSvgTransform(polygonItem->sceneMatrix())); + mXmlWriter.writeAttribute("transform",toSvgTransform(polygonItem->matrix())); mXmlWriter.writeAttribute("fill", polygonItem->brush().color().name()); qreal alpha = polygonItem->brush().color().alphaF(); From 14849cf538b88827475b2543786d84f7c558bf48 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 11 Feb 2017 16:37:43 -0500 Subject: [PATCH 26/33] Fix saving of groups' positions Previously, only transforms were saved -- not positions (which are set if a group is moved by dragging it directly; if dragged by its frame, its transform is updated instead). Issue observed was that a group that had been moved would lose its new position when the document was saved then loaded. (All other transforms were kept, however). Now, when duplicating a group before saving a document, position is included in the group's transform. --- src/domain/UBGraphicsScene.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 05b5ec87..fe0cdcc7 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -1178,6 +1178,7 @@ UBGraphicsScene* UBGraphicsScene::sceneDeepCopy() const UBGraphicsGroupContainerItem* groupCloned = group->deepCopyNoChildDuplication(); groupCloned->resetMatrix(); groupCloned->resetTransform(); + groupCloned->setPos(0, 0); bool locked = groupCloned->Delegate()->isLocked(); foreach(QGraphicsItem* eachItem ,group->childItems()){ @@ -1191,7 +1192,8 @@ UBGraphicsScene* UBGraphicsScene::sceneDeepCopy() const copy->addItem(groupCloned); groupCloned->setMatrix(group->matrix()); - groupCloned->setTransform(group->transform()); + groupCloned->setTransform(QTransform::fromTranslate(group->pos().x(), group->pos().y())); + groupCloned->setTransform(group->transform(), true); } if (ubItem && !stroke && !group && item->isVisible()) From 694123c3448c4ae90f976b781f217845d80b307c Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 11 Feb 2017 18:54:54 -0500 Subject: [PATCH 27/33] Fix for crash when exiting with an empty document This removes a few instances of deleting a scene twice, or accessing elements of a scene after they've been deleted. Previously, the application would crash upon exiting if the scene was empty but had been modified (e.g if an object was placed on the board then deleted, then the application closed) --- src/core/UBApplicationController.cpp | 1 - src/core/UBPersistenceManager.cpp | 11 +++++++---- src/core/UBPersistenceManager.h | 2 ++ src/desktop/UBDesktopAnnotationController.cpp | 5 ++++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index 04b49ed6..36ae40ca 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -658,7 +658,6 @@ void UBApplicationController::closing() if (mUninoteController) { - mUninoteController->hideWindow(); mUninoteController->close(); } diff --git a/src/core/UBPersistenceManager.cpp b/src/core/UBPersistenceManager.cpp index 280acfea..d5de377b 100644 --- a/src/core/UBPersistenceManager.cpp +++ b/src/core/UBPersistenceManager.cpp @@ -67,6 +67,7 @@ UBPersistenceManager * UBPersistenceManager::sSingleton = 0; UBPersistenceManager::UBPersistenceManager(QObject *pParent) : QObject(pParent) , mHasPurgedDocuments(false) + , mIsApplicationClosing(false) , mIsWorkerFinished(false) { @@ -131,8 +132,10 @@ void UBPersistenceManager::destroy() void UBPersistenceManager::onScenePersisted(UBGraphicsScene* scene) { - delete scene; - scene = NULL; + if (!mIsApplicationClosing) { + delete scene; + scene = NULL; + } } void UBPersistenceManager::onMetadataPersisted(UBDocumentProxy* proxy) @@ -147,6 +150,8 @@ void UBPersistenceManager::onWorkerFinished() UBPersistenceManager::~UBPersistenceManager() { + mIsApplicationClosing = true; + if(mWorker) mWorker->applicationWillClose(); @@ -943,7 +948,6 @@ bool UBPersistenceManager::isEmpty(UBDocumentProxy* pDocumentProxy) empty = theSoleScene->isEmpty(); if(empty){ mSceneCache.removeScene(pDocumentProxy,0); - delete theSoleScene; theSoleScene = NULL; } else{ @@ -960,7 +964,6 @@ bool UBPersistenceManager::isEmpty(UBDocumentProxy* pDocumentProxy) } if(!usefulItemFound){ mSceneCache.removeScene(pDocumentProxy,0); - delete theSoleScene; theSoleScene = NULL; empty = true; } diff --git a/src/core/UBPersistenceManager.h b/src/core/UBPersistenceManager.h index 08556061..19d10f66 100644 --- a/src/core/UBPersistenceManager.h +++ b/src/core/UBPersistenceManager.h @@ -157,6 +157,8 @@ class UBPersistenceManager : public QObject QThread* mThread; bool mIsWorkerFinished; + bool mIsApplicationClosing; + private slots: void documentRepositoryChanged(const QString& path); void errorString(QString error); diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 3544d464..f17911be 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -354,7 +354,10 @@ void UBDesktopAnnotationController::showWindow() void UBDesktopAnnotationController::close() { - // NOOP + if (mTransparentDrawingView) + mTransparentDrawingView->hide(); + + mDesktopPalette->hide(); } From 31f16b6abc71911ced04d38bcdf14dafb5719c93 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 11 Feb 2017 21:35:05 -0500 Subject: [PATCH 28/33] =?UTF-8?q?Fix=20launching=20of=20Open-Sankor=C3=A9?= =?UTF-8?q?=20importer=20on=20Windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also install the importer executable to OpenBoard root install folder --- release_scripts/windows/OpenBoard.iss | 2 +- src/core/UBOpenSankoreImporter.cpp | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/release_scripts/windows/OpenBoard.iss b/release_scripts/windows/OpenBoard.iss index 35003f86..51656008 100644 --- a/release_scripts/windows/OpenBoard.iss +++ b/release_scripts/windows/OpenBoard.iss @@ -119,7 +119,7 @@ Source: "{#QtDir}\plugins\mediaservice\wmfengine.dll"; DestDir: "{app}\mediaserv Source: "{#QtDir}\plugins\mediaservice\wmfengined.dll"; DestDir: "{app}\mediaservice"; Flags: ignoreversion ;OpenBoardImporter -Source: "{#ProjectRoot}\..\OpenBoard-Importer\release\OpenBoardImporter.exe"; DestDir: "{app}\Importer"; Flags: ignoreversion +Source: "{#ProjectRoot}\..\OpenBoard-Importer\release\OpenBoardImporter.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "{#QtLibs}\Qt5Core.dll"; DestDir: "{app}" Source: "{#QtLibs}\Qt5Gui.dll"; DestDir: "{app}" diff --git a/src/core/UBOpenSankoreImporter.cpp b/src/core/UBOpenSankoreImporter.cpp index 955f3f71..2d22b37a 100644 --- a/src/core/UBOpenSankoreImporter.cpp +++ b/src/core/UBOpenSankoreImporter.cpp @@ -56,11 +56,9 @@ void UBOpenSankoreImporter::onProceedClicked() newProcess.startDetached(qApp->applicationDirPath()+"/importer/OpenBoardImporter"); #elif defined Q_OS_OSX newProcess.startDetached(qApp->applicationDirPath()+"/../Resources/OpenBoardImporter.app/Contents/MacOS/OpenBoardImporter"); -#else - // Windows does not allows to run easily an exe located in a subdirectory when the main - // directory is placed into programs files. - //newProcess.startDetached(qApp->applicationDirPath()+"\\Importer\\OpenBoardImporter.exe"); - newProcess.startDetached("C:/OpenBoard/Importer/OpenBoardImporter.exe"); +#elif defined Q_OS_WIN + QString importerPath = QDir::toNativeSeparators(qApp->applicationDirPath())+"\\OpenBoardImporter.exe"; + newProcess.startDetached("explorer.exe", QStringList() << importerPath); #endif qApp->exit(0); From 8d9fc7b0711f886f4764066c982edbf8023401ee Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 18 Feb 2017 14:57:33 -0500 Subject: [PATCH 29/33] Smaller Triangle tool Added checks for the size of the interior, cut-out triangle to make sure everything is drawn correctly at small sizes; buttons are now also hidden if they overflow from the tool. --- src/tools/UBGraphicsTriangle.cpp | 161 ++++++++++++++++++++++--------- src/tools/UBGraphicsTriangle.h | 10 +- 2 files changed, 123 insertions(+), 48 deletions(-) diff --git a/src/tools/UBGraphicsTriangle.cpp b/src/tools/UBGraphicsTriangle.cpp index 5ba3ab91..0e2b2136 100644 --- a/src/tools/UBGraphicsTriangle.cpp +++ b/src/tools/UBGraphicsTriangle.cpp @@ -49,6 +49,7 @@ UBGraphicsTriangle::UBGraphicsTriangle() , mResizing1(false) , mResizing2(false) , mRotating(false) + , mShouldPaintInnerTriangle(true) { setRect(sDefaultRect, sDefaultOrientation); @@ -224,6 +225,29 @@ void UBGraphicsTriangle::calculatePoints(const QRectF& r) C2.setX(r.left() + L); C2.setY(r.bottom() - d); break; } + + bool paintInnerTriangle = true; + switch(mOrientation) + { + case BottomLeft: + if (B2.x() > C2.x() || B2.y() < A2.y()) + paintInnerTriangle = false; + break; + case TopLeft: + if (B2.x() > C2.x() || B2.y() > A2.y()) + paintInnerTriangle = false; + break; + case TopRight: + if (B2.x() < C2.x() || B2.y() > A2.y()) + paintInnerTriangle = false; + break; + case BottomRight: + if (B2.x() < C2.x() || B2.y() < A2.y()) + paintInnerTriangle = false; + break; + } + mShouldPaintInnerTriangle = paintInnerTriangle; + W1 = rect().height() * d / C; H1 = rect().width() * d / C; @@ -251,40 +275,54 @@ void UBGraphicsTriangle::paint(QPainter *painter, const QStyleOptionGraphicsItem QPolygonF polygon; - QLinearGradient gradient1(QPointF(A1.x(), 0), QPointF(A2.x(), 0)); - gradient1.setColorAt(0, edgeFillColor()); - gradient1.setColorAt(1, middleFillColor()); - painter->setBrush(gradient1); - polygon << A1 << A2 << B2 << B1; - painter->drawPolygon(polygon); - polygon.clear(); - - QLinearGradient gradient2(QPointF(0, B1.y()), QPointF(0, B2.y())); - gradient2.setColorAt(0, edgeFillColor()); - gradient2.setColorAt(1, middleFillColor()); - painter->setBrush(gradient2); - polygon << B1 << B2 << C2 << C1; - painter->drawPolygon(polygon); - polygon.clear(); - - QLinearGradient gradient3(CC, C2); - gradient3.setColorAt(0, edgeFillColor()); - gradient3.setColorAt(1, middleFillColor()); - painter->setBrush(gradient3); - polygon << C1 << C2 << A2 << A1; - painter->drawPolygon(polygon); - polygon.clear(); - - - painter->setBrush(Qt::NoBrush); - painter->setPen(drawColor()); + if (mShouldPaintInnerTriangle) { + QLinearGradient gradient1(QPointF(A1.x(), 0), QPointF(A2.x(), 0)); + gradient1.setColorAt(0, edgeFillColor()); + gradient1.setColorAt(1, middleFillColor()); + painter->setBrush(gradient1); + polygon << A1 << A2 << B2 << B1; + painter->drawPolygon(polygon); + polygon.clear(); + + QLinearGradient gradient2(QPointF(0, B1.y()), QPointF(0, B2.y())); + gradient2.setColorAt(0, edgeFillColor()); + gradient2.setColorAt(1, middleFillColor()); + painter->setBrush(gradient2); + polygon << B1 << B2 << C2 << C1; + painter->drawPolygon(polygon); + polygon.clear(); + + QLinearGradient gradient3(CC, C2); + gradient3.setColorAt(0, edgeFillColor()); + gradient3.setColorAt(1, middleFillColor()); + painter->setBrush(gradient3); + polygon << C1 << C2 << A2 << A1; + painter->drawPolygon(polygon); + polygon.clear(); + + + painter->setBrush(Qt::NoBrush); + painter->setPen(drawColor()); + + polygon << A1 << B1 << C1; + painter->drawPolygon(polygon); + polygon.clear(); + + polygon << A2 << B2 << C2; + painter->drawPolygon(polygon); + } - polygon << A1 << B1 << C1; - painter->drawPolygon(polygon); - polygon.clear(); + else { + QLinearGradient gradient(QPointF(A1.x(), 0), QPointF(C1.x(), 0)); + gradient.setColorAt(0, edgeFillColor()); + gradient.setColorAt(1, middleFillColor()); + painter->setBrush(gradient); + painter->setPen(drawColor()); + polygon << A1 << B1 << C1; + painter->drawPolygon(polygon); + polygon.clear(); + } - polygon << A2 << B2 << C2; - painter->drawPolygon(polygon); paintGraduations(painter); @@ -329,9 +367,11 @@ QPainterPath UBGraphicsTriangle::shape() const tShape.addPolygon(tPolygon); tPolygon.clear(); - tPolygon << A2 << B2 << C2; - tShape.addPolygon(tPolygon); - tPolygon.clear(); + if (mShouldPaintInnerTriangle) { + tPolygon << A2 << B2 << C2; + tShape.addPolygon(tPolygon); + tPolygon.clear(); + } //qDebug() << "UBGraphicsTriangle shape()"<<"A1 ="< Date: Tue, 21 Feb 2017 21:24:20 -0500 Subject: [PATCH 30/33] Fix for documents not being deleted when dragged to trash When drag-n-dropping a document to the trash, it would reappear in the "untitled documents" folder on the next restart. (This was introduced by bd3d8e95) --- src/gui/UBDocumentTreeWidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/UBDocumentTreeWidget.cpp b/src/gui/UBDocumentTreeWidget.cpp index 37a93ecf..b6728e4c 100644 --- a/src/gui/UBDocumentTreeWidget.cpp +++ b/src/gui/UBDocumentTreeWidget.cpp @@ -375,8 +375,10 @@ bool UBDocumentTreeWidget::moveDocument(UBDocumentProxyTreeItem* document, UBDoc QString destinationFolderName; - if (destinationFolder->isTrashFolder()) + if (destinationFolder->isTrashFolder()) { UBApplication::app()->documentController->moveDocumentToTrash(sourceFolder, document, true); + destinationFolderName = document->proxy()->metaData(UBSettings::documentGroupName).toString(); + } else { if (destinationFolder->groupName() == UBApplication::app()->documentController->defaultDocumentGroupName()) From d8b1dae9c8830ab67b5e9a53c3024ad34f198477 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 25 Feb 2017 16:38:12 -0500 Subject: [PATCH 31/33] Bumped version to 1.3.5 --- OpenBoard.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenBoard.pro b/OpenBoard.pro index 2505bb5b..64955fb9 100644 --- a/OpenBoard.pro +++ b/OpenBoard.pro @@ -10,7 +10,7 @@ CONFIG += debug_and_release \ VERSION_MAJ = 1 VERSION_MIN = 3 -VERSION_PATCH = 4 +VERSION_PATCH = 5 VERSION_TYPE = r # a = alpha, b = beta, rc = release candidate, r = release, other => error VERSION_BUILD = 0 From 6ff78892c072745a5cd2072520e92ea9e71ee6e9 Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sun, 26 Feb 2017 18:29:39 -0500 Subject: [PATCH 32/33] Don't move a selection containing locked items Fixes an issue where locked items could be moved if they were selected along with other items, and these items all moved by dragging the selection frame. This implementation prevents any movement of the selected items if at least one of them is locked. It also changes the colour of the selection frame, like a locked UBGraphicsDelegateFrame. --- src/domain/UBSelectionFrame.cpp | 17 +++++++++++++++++ src/domain/UBSelectionFrame.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/src/domain/UBSelectionFrame.cpp b/src/domain/UBSelectionFrame.cpp index ed3cbbd3..0ebc912d 100644 --- a/src/domain/UBSelectionFrame.cpp +++ b/src/domain/UBSelectionFrame.cpp @@ -111,9 +111,15 @@ void UBSelectionFrame::setEnclosedItems(const QList pGraphicsIte QRegion resultRegion; UBGraphicsFlags resultFlags; mEnclosedtems.clear(); + + // If at least one of the enclosed items is locked, the entire selection is + // considered to be locked. + mIsLocked = false; + foreach (QGraphicsItem *nextItem, pGraphicsItems) { UBGraphicsItemDelegate *nextDelegate = UBGraphicsItem::Delegate(nextItem); if (nextDelegate) { + mIsLocked = (mIsLocked || nextDelegate->isLocked()); mEnclosedtems.append(nextDelegate); resultRegion |= nextItem->boundingRegion(nextItem->sceneTransform()); resultFlags |= nextDelegate->ubflags(); @@ -129,6 +135,14 @@ void UBSelectionFrame::setEnclosedItems(const QList pGraphicsIte if (resultRect.isEmpty()) { hide(); } + + if (mIsLocked) { + QColor baseColor = UBSettings::paletteColor; + baseColor.setAlphaF(baseColor.alphaF() / 3); + setLocalBrush(QBrush(baseColor)); + } + else + setLocalBrush(QBrush(UBSettings::paletteColor)); } void UBSelectionFrame::updateRect() @@ -168,6 +182,9 @@ void UBSelectionFrame::mousePressEvent(QGraphicsSceneMouseEvent *event) void UBSelectionFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { + if (mIsLocked) + return; + QPointF dp = event->pos() - mPressedPos; QPointF rotCenter = mapToScene(rect().center()); diff --git a/src/domain/UBSelectionFrame.h b/src/domain/UBSelectionFrame.h index 47d482a6..cda1f5f0 100644 --- a/src/domain/UBSelectionFrame.h +++ b/src/domain/UBSelectionFrame.h @@ -103,6 +103,8 @@ private: QPointF mLastTranslateOffset; qreal mRotationAngle; + bool mIsLocked; + QList mButtons; DelegateButton *mDeleteButton; From 3d46bd0bc53bdf037c474075d388025aaccabe8b Mon Sep 17 00:00:00 2001 From: Craig Watson Date: Sat, 4 Mar 2017 16:55:57 -0500 Subject: [PATCH 33/33] Fix/re-enable checking for updates We can (again) check for updates and, if an update is available, send the user to the site to download them. The old format (a .json specifying a version number and download URL) was kept. The address for this file is now specified in the settings. --- src/core/UBApplicationController.cpp | 140 ++++++++++++--------------- src/core/UBApplicationController.h | 15 +-- src/core/UBSettings.cpp | 1 + src/core/UBSettings.h | 1 + src/frameworks/UBVersion.cpp | 25 +++-- 5 files changed, 86 insertions(+), 96 deletions(-) diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index 36ae40ca..5ae365a2 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -90,7 +90,6 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, , mAutomaticCheckForUpdates(false) , mCheckingForUpdates(false) , mIsShowingDesktop(false) - , mHttp(0) { mDisplayManager = new UBDisplayManager(this); @@ -121,7 +120,7 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, connect(UBApplication::webController, SIGNAL(imageCaptured(const QPixmap &, bool, const QUrl&)) , this, SLOT(addCapturedPixmap(const QPixmap &, bool, const QUrl&))); - networkAccessManager = new QNetworkAccessManager (this); + mNetworkAccessManager = new QNetworkAccessManager (this); QTimer::singleShot (1000, this, SLOT (checkAtLaunch())); } @@ -136,8 +135,6 @@ UBApplicationController::~UBApplicationController() delete mBlackScene; delete mMirror; - if (mHttp) delete mHttp; - delete(mOpenSankoreImporter); mOpenSankoreImporter = NULL; } @@ -478,85 +475,71 @@ void UBApplicationController::showDesktop(bool dontSwitchFrontProcess) } -void UBApplicationController::checkUpdate(QString urlString) +void UBApplicationController::checkUpdate(const QUrl& url) { + QUrl jsonUrl = url; + if (url.isEmpty()) + jsonUrl = UBSettings::settings()->appSoftwareUpdateURI->get().toUrl(); + qDebug() << "Checking for update at url: " << jsonUrl.toString(); - #if defined(QT_NO_DEBUG) - /* - if(mHttp) - mHttp->deleteLater(); - QUrl url(urlString); - mHttp = new QHttpPart(url.host()); - connect(mHttp, SIGNAL(requestFinished(int,bool)), this, SLOT(updateRequestFinished(int,bool))); - connect(mHttp, SIGNAL(responseHeaderReceived(QHttpResponseHeader)), this, SLOT(updateHeaderReceived(QHttpResponseHeader))); - - mHttp->get(url.path()); - - */ - -#else - if(mHttpreply) - mHttpreply->deleteLater(); - QUrl url(urlString); - mHttpreply = qnam.get(QNetworkRequest(url)); - connect(mHttpreply, SIGNAL(requestFinished(int,bool)), this, SLOT(updateRequestFinished(int,bool))); - connect(mHttpreply, SIGNAL(responseHeaderReceived(QHttpResponseHeader)), this, SLOT(updateHeaderReceived(QHttpResponseHeader))); - // mHttpreply->setUrl(url.path()); - //mHttp->get(url.path()); + connect(mNetworkAccessManager, SIGNAL(finished(QNetworkReply*)), + this, SLOT(updateRequestFinished(QNetworkReply*))); + + mNetworkAccessManager->get(QNetworkRequest(jsonUrl)); -#endif } -/* -void UBApplicationController::updateHeaderReceived(QHttpResponseHeader header) + + +void UBApplicationController::updateRequestFinished(QNetworkReply * reply) { - if(header.statusCode() == 302 && header.hasKey("Location")){ - mHttp->close(); - checkUpdate(header.value("Location")); + if (reply->error()) { + qWarning() << "Error downloading update file: " << reply->errorString(); + return; } -} -*/ -void UBApplicationController::updateHeaderReceived(QNetworkRequest header ) -{ - //if(header.attribute(QNetworkRequest::HttpStatusCodeAttribute) == 302 && header.header(QNetworkRequest::LocationHeader)){ - // mHttp->close(); - mHttpreply->close(); - //checkUpdate(header.value("Location")); - // } -} + // Check if we are being redirected. If so, call checkUpdate again -void UBApplicationController::updateRequestFinished(int id, bool error) -{ - if (error){ - qWarning() << "http command id" << id << "return an error"; - } - else{ - /* QString responseString = QString(mHttp->readAll()); - qDebug() << responseString; - if (!responseString.isEmpty() && responseString.contains("version") && responseString.contains("url")){ - mHttp->close(); - mHttp->deleteLater(); - mHttp = 0; - downloadJsonFinished(responseString); - } - */ - QString responseString = QString(mHttpreply->readAll()); - qDebug() << responseString; - if (!responseString.isEmpty() && responseString.contains("version") && responseString.contains("url")){ - mHttpreply->close(); - mHttpreply->deleteLater(); - mHttpreply = 0; - downloadJsonFinished(responseString); - } - } -} + QVariant redirect_target = reply->attribute(QNetworkRequest::RedirectionTargetAttribute); + if (!redirect_target.isNull()) { + // The returned URL might be relative. resolved() creates an absolute url from it + QUrl redirect_url(reply->url().resolved(redirect_target.toUrl())); + checkUpdate(redirect_url); + return; + } + + // No error and no redirect => we read the whole response + + QString responseString = QString(reply->readAll()); + + if (!responseString.isEmpty() && + responseString.contains("version") && + responseString.contains("url")) { + + reply->close(); + reply->deleteLater(); + + downloadJsonFinished(responseString); + } +} void UBApplicationController::downloadJsonFinished(QString currentJson) { + /* + The .json files simply specify the latest version number available, and + the URL to send the user to, so they can download it. + + They look like: + + { + "version": "1.3.5", + "url": "http://openboard.ch" + } + */ + QScriptValue scriptValue; QScriptEngine scriptEngine; scriptValue = scriptEngine.evaluate ("(" + currentJson + ")"); @@ -564,17 +547,18 @@ void UBApplicationController::downloadJsonFinished(QString currentJson) UBVersion installedVersion (qApp->applicationVersion()); UBVersion jsonVersion (scriptValue.property("version").toString()); + qDebug() << "json version: " << jsonVersion.toUInt(); + qDebug() << "installed version: " << installedVersion.toUInt(); + if (jsonVersion > installedVersion) { - if (UBApplication::mainWindow->yesNoQuestion(tr("Update available"), tr ("New update available, would you go to the web page ?"))){ - QUrl url(scriptValue.property ("url").toString()); - QDesktopServices::openUrl (url); - } - } - else { - if (isNoUpdateDisplayed) { - mMainWindow->information(tr("Update"), tr("No update available")); + if (UBApplication::mainWindow->yesNoQuestion(tr("Update available"), tr ("New update available, would you go to the web page ?"))){ + QUrl url(scriptValue.property("url").toString()); + QDesktopServices::openUrl(url); } } + else if (isNoUpdateDisplayed) { + mMainWindow->information(tr("Update"), tr("No update available")); + } } void UBApplicationController::checkAtLaunch() @@ -583,14 +567,14 @@ void UBApplicationController::checkAtLaunch() if(UBSettings::settings()->appEnableAutomaticSoftwareUpdates->get().toBool()){ isNoUpdateDisplayed = false; - //checkUpdate (); + checkUpdate(); } } void UBApplicationController::checkUpdateRequest() { isNoUpdateDisplayed = true; - //checkUpdate (); + checkUpdate(); } void UBApplicationController::hideDesktop() diff --git a/src/core/UBApplicationController.h b/src/core/UBApplicationController.h index 03ace3a9..c3cfb40d 100644 --- a/src/core/UBApplicationController.h +++ b/src/core/UBApplicationController.h @@ -53,12 +53,8 @@ class UBVersion; class UBSoftwareUpdate; class QNetworkAccessManager; class QNetworkReply; -class QHttpPart; class UBRightPalette; class UBOpenSankoreImporter; -class QScriptValue; -class QScriptEngine; -class QNetworkReply; class UBApplicationController : public QObject { @@ -158,8 +154,8 @@ class UBApplicationController : public QObject void checkAtLaunch(); private slots: - void updateRequestFinished(int id, bool error); - void updateHeaderReceived(QNetworkRequest header ); + void updateRequestFinished(QNetworkReply * reply); + protected: @@ -193,13 +189,10 @@ class UBApplicationController : public QObject bool mIsShowingDesktop; bool isNoUpdateDisplayed; - void checkUpdate (QString urlString = "http://get.openboard.org/update.json"); - QNetworkAccessManager *networkAccessManager; + void checkUpdate(const QUrl &url = QUrl()); + QNetworkAccessManager * mNetworkAccessManager; void downloadJsonFinished(QString updateString); - QHttpPart* mHttp; - QNetworkAccessManager qnam; - QNetworkReply *mHttpreply; }; #endif /* UBAPPLICATIONCONTROLLER_H_ */ diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index cccf87b7..4b657602 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -226,6 +226,7 @@ void UBSettings::init() appToolBarDisplayText = new UBSetting(this, "App", "ToolBarDisplayText", true); appEnableAutomaticSoftwareUpdates = new UBSetting(this, "App", "EnableAutomaticSoftwareUpdates", false); appEnableSoftwareUpdates = new UBSetting(this, "App", "EnableSoftwareUpdates", true); + appSoftwareUpdateURI = new UBSetting(this, "App", "SoftwareUpdateURI", "http://www.openboard.ch/update.json"); appToolBarOrientationVertical = new UBSetting(this, "App", "ToolBarOrientationVertical", false); appPreferredLanguage = new UBSetting(this,"App","PreferredLanguage", ""); diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h index 9f024d57..4e3f0ec5 100644 --- a/src/core/UBSettings.h +++ b/src/core/UBSettings.h @@ -240,6 +240,7 @@ class UBSettings : public QObject UBSetting* appToolBarDisplayText; UBSetting* appEnableAutomaticSoftwareUpdates; UBSetting* appEnableSoftwareUpdates; + UBSetting* appSoftwareUpdateURI; UBSetting* appToolBarOrientationVertical; UBSetting* appPreferredLanguage; diff --git a/src/frameworks/UBVersion.cpp b/src/frameworks/UBVersion.cpp index a08c4fc7..b8916152 100644 --- a/src/frameworks/UBVersion.cpp +++ b/src/frameworks/UBVersion.cpp @@ -42,21 +42,32 @@ UBVersion::UBVersion(const QString &string) uint UBVersion::toUInt() const { + /* Based on semantic versioning, version numbers look like: + * Major.Minor.Patch-Type.Build + * + * To compare version numbers, the string is split into each part, and they are multiplied + * to give a number where the first two digits are the Major version, the next two are the + * Minor version, and so on. + * + * i.e if Major, Minor etc. are named A, B, C, D, E, the number will look like: + * AABBCCDDEE + */ + uint result = 0; - QStringList list = mString.split("."); + QStringList list = mString.split(QRegExp("[-\\.]")); switch (list.count()) { case 2: //short version 1.0 - result = (list.at(0).toUInt() * 1000000) + (list.at(1).toUInt() * 10000) + (Release * 100); + result = (list.at(0).toUInt() * 100000000) + (list.at(1).toUInt() * 1000000) + (Release * 100); break; case 3: //release version 1.0.0 - result = (list.at(0).toUInt() * 1000000) + (list.at(1).toUInt() * 10000) + (Release * 100) + list.at(2).toUInt(); + result = (list.at(0).toUInt() * 100000000) + (list.at(1).toUInt() * 1000000) + list.at(2).toUInt()*10000 + (Release * 100); break; - case 4:{ - //standard version 1.0.a/b/r.0 - uint releaseStage = list.at(2).startsWith("a") ? Alpha :(list.at(2).startsWith("b") ? Beta : ReleaseCandidate); - result = (list.at(0).toUInt() * 1000000) + (list.at(1).toUInt() * 10000) + (releaseStage * 100) + list.at(3).toUInt(); + case 5:{ + //standard version 1.0.0.a/b/rc.0 + uint releaseStage = list.at(3).startsWith("a") ? Alpha :(list.at(3).startsWith("b") ? Beta : ReleaseCandidate); + result = (list.at(0).toUInt() * 100000000) + (list.at(1).toUInt() * 1000000) + (list.at(2).toUInt() * 10000) + (releaseStage * 100) + list.at(4).toUInt(); break; } default: