diff --git a/Sankore_3.1.pro b/Sankore_3.1.pro index 1c7b4ae7..aff1440b 100644 --- a/Sankore_3.1.pro +++ b/Sankore_3.1.pro @@ -7,7 +7,7 @@ CONFIG += debug_and_release \ no_include_pwd VERSION_MAJ = 1 -VERSION_MIN = 28 +VERSION_MIN = 35 VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error VERSION_PATCH = 00 diff --git a/release.linux.sh b/release.linux.sh index 51742ee3..fffc2450 100644 --- a/release.linux.sh +++ b/release.linux.sh @@ -19,7 +19,7 @@ make clean rm -rf build/linux/release/ rm -rf install -QT_PATH="/usr/local/Trolltech/Qt-4.7.3" +QT_PATH="../Qt-sankore3.1" PLUGINS_PATH="$QT_PATH/plugins" QMAKE_PATH="$QT_PATH/bin/qmake" diff --git a/resources/i18n/sankore_es.qm b/resources/i18n/sankore_es.qm index 6bd22c41..8854c556 100644 Binary files a/resources/i18n/sankore_es.qm and b/resources/i18n/sankore_es.qm differ diff --git a/resources/i18n/sankore_es.ts b/resources/i18n/sankore_es.ts index 351c3694..238bcdfb 100644 --- a/resources/i18n/sankore_es.ts +++ b/resources/i18n/sankore_es.ts @@ -1,1578 +1,2308 @@ - + + + BlackoutWidget + Click to Return to Application - - - - background: url(:/images/bigUniboard.png); border: none; - + Clic para volver a la aplicación DownloadDialog + Downloads - + Descargas + Clean Up - + Limpiar + 0 Items - + 0 elementos DownloadItem + Form - + Forma + Filename - + Nom. archivo + Try Again - + Nuevo intento + Stop - + Detener + Open - - - - Ico - + Abrir IntranetPodcastPublishingDialog + Publish Podcast to YouTube - + Publicar podcast en YouTube + Title - + Título + Description - + Descripción + Author - + Autor MainWindow + Uniboard - + Uniboard + + Board - + Pizarra + + Web - + Web + + Documents - - - - Tutorial - + Documentos + + Stylus - + Trazos + Ctrl+T - + Ctrl+T + Backgrounds - + Fondos + Change Background - + Cambiar fondo + Undo - + Deshacer + Ctrl+Z - + Ctrl+Z + Redo - + Rehacer + Ctrl+Y - + Ctrl+Y + Previous - + Anterior + + Previous Page - + Página anterior + PgUp - + RePág + Next - + Siguiente + + Next Page - + Página siguiente + PgDown - + AvPág + Manage Documents - + Administrar documentos + Ctrl+D - + Ctrl+D + Web Browsing - + Navegador Web + Ctrl+W - - - - Line - + Ctrl+W - Small Line - + Share Item on the Web + Compartir elemento en la Web - Medium Line - + Share Capture on the Web + Compartir captura en la web - Large Line - + Define Drawing Options + Definir opciones de dibujo + Quit - + Salir + Quit Uniboard - - - - Eraser - - - - Smalle Eraser - - - - Medium Eraser - - - - Large Eraser - + Salir de Ubiboard + + + + + Color - + Color + Back - + Atrás + Left - + Izquierda + Forward - + Adelante + Right - + Derecha + Reload - - - - Reload Current Page - + Recargar + Home - - - - Load Home Page - + Inicio + Bookmarks - - - - Show Bookmarks - + Favoritos + Bookmark - - - - Add Bookmark - - - - Display Board - + Favorito + Ctrl+B - + Ctrl+B + Erase - - - - Erase Content - + Borrar + Preferences - + Preferencias - Display Preferences - + + Library + Biblioteca - Library - + + Ctrl+L + Ctrl+L - Show Library - + + Open the tutorial + Abrir el tutorial - Ctrl+L - + + Check Update + Comprobar actualizaciones - - Sankoré 3.1 - + + + Sankoré Editor + Editor Sankoré - Sankore 3.1 - + + Show Sankore Widgets Editor + Mostrar editor de Widgets Sankore + + + + Hide Sankoré + Ocultar Sankoré + + + + Hide Sankoré Application + Ocultar aplicación Sankoré - Show Desktop - + + Ctrl+H + Ctrl+H - Show Computer Desktop - + + Bigger + Aumentar - Ctrl+Shift+H - + + + Tutorial + Tutorial + + + + Sankoré 3.1 + Sankoré 3.1 - Bigger - + + Sankore 3.1 + Sankore 3.1 - Zoom In - + + Show Desktop + Mostrar Escritorio + Ctrl++ - + Ctrl++ + Smaller - - - - Zoom Out - + Reducir + Ctrl+- - + Ctrl+- + New Folder - - - - Create a New Folder - + Nueva carpeta + New Document - - - - Create a New Document - + Nuevo documento + Import - - - - Import a Document - + Importar + Export - - - - Export a Document - + Exportar + Open in Board - - - - Open Page in Board - + Abrir en pizarra + Ctrl+O - + Ctrl+O + Duplicate - - - - Duplicate Selected Content - + Duplicar + Delete - - - - Delete Selected Content - + Limpiar + Del - + Limp + Add to Working Document - + Añadir a documento trabajo + Add Selected Content to Open Document - + Añadir contenido seleccionado al documento abierto + + Add - - - - Add Content to Document - + Añadir + Rename - - - - Rename Content - + Renombrar + + Tools - - - - Display Tools - + Herram. + Multi Screen - + Multipantalla + + Wide Size (16/9) - - - - Use Document Wide Size (16/9) - + Tamaño amplio (16/9) + + Regular Size (4/3) - - - - Use Document Regular Size (4/3) - + Tamaño normal (4/3) + + Custom Size - - - - Use Custom Document Size - + Tamaño a medida + Stop Loading - - - - Stop Loading Web Page - + Detener carga + Cut - + Cortar + Copy - + Copiar + Paste - + Pegar + Sleep - - - - Put Presentation to Sleep - + Suspender + Virtual Keyboard - - - - Display Virtual Keyboard - + Teclado virtual + + Plain Light Background - + Fondo claro liso + + Light - + Claro - Grid Light Background - + + Start Screen Recording + Comenzar a grabar pantalla - Plain Dark Background - + + Configure Podcast Recording + Configurar grabación Podcast - Dark + + Flash Trap - Grid Dark Background + + Trap Flash Content - Podcast + + Web Trap - Record Presentation to Video + + Trap Web Content - Record - + + Window Capture + Captura de ventana - Start Screen Recording - + + Show on Display + Mostrar en pantalla - Erase Items - + + + Plain Dark Background + Fondo oscuro liso - Erase All Items - + + + Dark + Oscuro - Erase Annotations - + + Podcast + Podcast - Erase All Annotations - + + Record + Grabar - Clear Page - + + Erase Items + Borrar elementos - Clear All Elements - + + + Erase Annotations + Borrar anotaciones + + + + Clear Page + Limpiar página + Pen - + Lápiz + + + + + + + Eraser + Borrador + + + + Marker + Rotulador + + + + Selector + Selector + + + + Hand + Mano + + + + + Zoom In + Acercar + + + + + Zoom Out + Alejar + + + + + + + Line + Línea + + + + Small Line + Línea fina + + + + Medium Line + Línea media + + + + Large Line + Línea ancha + + + + Smalle Eraser + Borrador pequeño + + + + Medium Eraser + Borrador mediano + + + + Large Eraser + Borrador grande + + + + Reload Current Page + Recargar página actual + + + + Load Home Page + Cargar página de inicio + + + + Show Bookmarks + Mostrar marcadores + + + + Add Bookmark + Añadir marcador + + + + Display Board + Mostrar pizarra + + + + Erase Content + Borrar contenido + + + + Display Preferences + Mostrar preferencias + + + + Show Library + Mostrar biblioteca + + + + Show Computer Desktop + Mostrar escritorio del equipo + + + + Ctrl+Shift+H + Ctrl+Shift+H + + + + Create a New Folder + Crear nueva carpeta + + + + Create a New Document + Crear nuevo documento + + + + Import a Document + Importar documento + + + + Export a Document + Exportar documento + + + + Open Page in Board + Abrir página en pizarra + + + + Duplicate Selected Content + Duplicar elemento seleccionado + + + + Delete Selected Content + Borrar elemento seleccionado + + + + Add Content to Document + Añadir contenido al documento + + + + Rename Content + Renombrar contenido + + + + + Display Tools + Mostrar herramientas + + + + Use Document Wide Size (16/9) + Usar tamaño extendido (16/9) + + + + Use Document Regular Size (4/3) + Usar tamaño regular (4/3) + + + + Use Custom Document Size + Usar tamaño personalizado + + + + Stop Loading Web Page + Parar carga de la página + + + + Put Presentation to Sleep + Suspender presentación + + + + Display Virtual Keyboard + Mostrar teclado virtual + + + + + Grid Light Background + Rejilla de fondo claro + + + + + Grid Dark Background + Rejilla de fondo oscura + + + + Record Presentation to Video + Grabar presentación en vídeo + + + + Erase All Items + Borrar todos los elementos + + Erase All Annotations + Borrar todas las anotaciones + + + + Clear All Elements + Limpiar todos los elementos + + + Annotate Document - + Anotar documento + Ctrl+I - + Ctrl+I + Erase Annotation - + Borrar anotación + Ctrl+E - - - - Marker - + Ctrl+E + Highlight - + Subrayar + Ctrl+M - - - - Selector - + Ctrl+M + Select And Modify Objects - + Seleccionar y modificar objetos + Ctrl+F - - - - Hand - + Ctrl+F + Scroll Page - + Avanzar página + Laser Pointer - + Puntero laser + Virtual Laser Pointer - + Puntero laser virtual + Ctrl+G - + Ctrl+G + Draw Lines - + Dibujar líneas + Ctrl+J - + Ctrl+J + Text - + Texto + Write Text - + Escribir texto + Ctrl+K - + Ctrl+K + Capture - - - - Capture Part of the Screen - + Captura + + Add To Current Page - + Añadir a página actual + Add Item To Current Page - + Añadir elemento a la página actual + Add To New Page - + Añadir a nueva pág. + Add Item To New Page - + Añadir elemento a una página nueva + Add To Library - + Añadir a biblioteca + Add Item To Library - + Añadir elemento a la biblioteca + Pages - + Página + + Create a New Page - + Crear página nueva + New Page - + Nueva página + Duplicate Page - + Duplicar página + Duplicate the Current Page - + Duplicar página actual + Import Page - + Importar página + Import an External Page - + Importar página externa + Pause - + Pausa + Pause Podcast Recording - + Pausar grabación Podcast + Podcast Config - - - - Configure Podcast Recording - + Config podcast - Flash Trap - - - - Trap Flash Content - - - - Web Trap - - - - Trap Web Content - + + + Capture Part of the Screen + Capturar parte de la pantalla + Custom Capture - - - - Window Capture - + Captura personalizada + Capture a Window - + Capturar una ventana + Embed Web Content - + Contenido Web empotrado + Capture Embeddable Web Content - - - - Show on Display - + Capturar contenido Web empotrado + Show Main Screen on Display Screen - + Mostrar pantalla principal en la pantalla + Erase all Annotations - + Borrar todas las anotaciones + eduMedia - + eduMedia + Import eduMedia simulation - - - - Open the tutorial - - - - Check Update - - - - Sankoré Editor - - - - Show Sankore Widgets Editor - - - - Hide Sankoré - - - - Hide Sankoré Application - - - - Ctrl+H - + Importar simulación eduMedia PasswordDialog + Authentication Required - + Autenticación necesaria + Username: - + Nom. usuario: + Password: - - - - DUMMY ICON - - - - INTRO TEXT DUMMY - + Contraseña: ProxyDialog + Proxy Authentication - + Autenticación del proxy + Connect to Proxy - + Conectar al proxy + Username: - + Nom. usuario: + Password: - + Contraseña: + Save username and password for future use - - - - ICON - + Guardar usuario y contraseña para usos futuros QObject - Trash - Pictures category element - + /Home + Category list label on nagigation tool bar + Lista de etiquetas de categoría en la barra de herramientas + /Home Category list label on navigation tool bar - + Lista de etiquetas de categoría en la barra de navegación + + + + Trash + Pictures category element + Papelera + + + + QuaZipFile + + ZIP/UNZIP API error %1 + Error ZIP/UNZIP API %1 UBAbstractPublisher + + Contacting %1 + Contactando %1 + + + Found %1 + Encontrado %1 + + + Cannot Authenticate with %1 + No se pudo autenticar con %1 + UBAbstractWidget + Cannot load content - + Impos. cargar contenido + Loading ... - + Cargando... + + + + UBAcceptLicenseClass + + Uniboard License + Licencia Uniboard + + + Accept + Aceptar + + + Reject + Rechazar UBApplication + Quit + Salir + + + Page Size - + Tamaño de página + Podcast - + Podcast UBApplicationController + Web - + Web + New update available, would you go to the web page ? - + Nueva actualización disponible, ¿quieres ir a la página web? + + + + Update available + Actualización disponible + No update available - + No hay actualizaciones - Update available - + Your version is up-to-date. + Su versión está actualizada. + + + Failed to get information on software updates. + No se pudo obtener info de actualizaciones de SW. UBBoardController + Downloading content from %1 - + Descargando contenido de %1 + Downloading content %1 failed - + Descarga de contenido %1 fallida + Download finished - + Descarga completa + Flash is not supported on Uniboard Linux + Flash no está soportado en Linux Uniboard + + + Unknown tool type %1 - + Herramienta descon. %1 + Unknown content type %1 - + Contenido desconocido %1 + + + Attach Video File + Adjuntar vídeo + + + The selected video is quite big (%1 MB), would you rather attach it to the document, or keep only a link to it? + El vídeo seleccionado es demasiado grande (%1 MB), ¿desea adjuntarlo al documento o prefiere añadir solo un enlace? + + + Attach + Adjuntar + Link + Enlazar + + + Add Item - + Añadir elem. + All Supported (%1) - + Todos los compat. (%1) UBBoardPaletteManager + Remove this + Eliminar esto + + + Added 1 Image to Library + Añadida 1 imagen a biblioteca + + + Error Adding Image to Library - + Error al añadir imag. a biblioteca + + + Error Publishing Image to the Web + Error publicando imagen en la Web UBCachePropertiesWidget + Cache Properties - + Propiedades de cache + Color: - + Color: + Shape: + Size: - + Tamaño + Close - + Cerrar + + + + UBCapturePublisher + + Preparing capture for upload... + Preparando la captura para la subida... + + + Publication canceled ... + Publicación cancelada + + + Capture Published to the Web. + Captura publicada en la Web + + + Error Publishing Capture to the Web: %1 + Error publicando captura en la Web: %1 + + + + UBCapturePublishingDialog + + Publish + Publicar UBDesktopPalette + Show Uniboard - + Mostrar Uniboard + Capture Part of the Screen - + Capturar parte de la pantalla + Capture the Screen - + Capturar la pantalla + Show the stylus palette - + Mostrar la paleta de estilos + Show Board on Secondary Screen - + Mostrar la pizarra en la pantalla secundaria + Show Desktop on Secondary Screen - + Mostrar escritorio en pantalla secundaria UBDocumentController + + New Folder - + Nueva carpeta + Page %1 - + Página %1 + Add Folder of Images - + Añadir carpeta imágenes + Add Images - + Añadir imágenes + Add Pages from File - + Añadir págs. desde arch. + Duplicating Document %1 - + Duplicando documento %1 + Document %1 copied + Documento %1 copiado + + + + The document '%1' has been generated with a newer version of Sankore (%2). By opening it, you may lose some information. Do you want to proceed? + Remove Page - + Eliminar página + + + + Are you sure you want to remove %n page(s) from the selected document '%1'? + + ¿Seguro que desea eliminar %n pág(s). del documento seleccionado '%1'? + + + Remove Document - + Eliminar documento + Are you sure you want to remove the document '%1'? - + ¿Seguro que desea eliminar el documento '%1'? + Empty Trash - + Vaciar papelera + Are you sure you want to empty trash? - + ¿Seguro que desea vaciar la papelera? + Emptying trash - + Vaciando papelera + Emptied trash - + Papelera vaciada + Remove Folder - + Eliminar carpeta + Are you sure you want to remove the folder '%1' and all its content? - + ¿Seguro que desea eliminar la carpeta '%1' y todo su contenido? + No document selected! - + Ningún doc. seleccionado + + Open Supported File - + Abrir archivo compatible + + Importing file %1... - + Importando archivo %1... + + Failed to import file ... - + Fallo al importar archivo... + Import all Images from Folder - + Importar todas imágenes de carpeta + Folder does not contain any image files! - + La carpeta no contiene archivos de imagen + Delete - + Limpiar + Empty - + Vaciar + Trash - + Papelera + Open Document - + Abrir documento + The document '%1' has been generated with a newer version of Uniboard (%2). By opening it, you may lose some information. Do you want to proceed? + El documento '%1' se ha generado con una versión nueva de Uniboard (%2). Al abrirlo, puede perder información. ¿Desea continuar? + + + Add all Images to Document - + Añadir todas las imág. al doc. + All Images (%1) - + Todas las imág. (%1) + Selection does not contain any image files! - - - - The document '%1' has been generated with a newer version of Sankore (%2). By opening it, you may lose some information. Do you want to proceed? - + La selección no contiene archivos de imagen. UBDocumentManager + images - + imágenes + videos - + vídeos + objects - + objetos + widgets - + widgets + All supported files (*.%1) - + Todos archivos compat. (*.%1) + File %1 saved - + Arch. %1 guardado + Importing page %1 of %2 - + Importando página %1 de %2 + Erronous image data, skipping file %1 - + Datos de imag. erróneos, saltando arch. %1 UBDocumentNavigator + Page %0 - + Página %0 UBDocumentPublisher - Export failed. - + Preparing document for upload... + Preparando documento para subida... - Export canceled ... - + + + Export failed. + La exportación falló. - Converting page %1/%2 ... - + Export failed ... + La exportación falló ... + Credentials has to not been filled out yet. + Uploading Sankore File on Web. - + Subiendo archivo Sankore a la web. + + + + Export canceled ... + Exportación cancelada + + + + Converting page %1/%2 ... + Convirtiendo página %1/%2 + Document uploaded correctly on the web. - + Documento subido correctamente a la web. + Failed to upload document on the web. - + Fallo al subir documento a la web. + + + Upload to Uniboard Web in progress %1 % + Subiendo a la Web Uniboard en progreso %1 % + + + Sending document ... + Enviando documento ... + + + The document has been sent to %1 + El documento se ha enviado a %1 + + + Error while publishing document to %1 + Error cuando se publicaba el documento en %1 + + + Error while publishing document to %1 : (%2) + Error cuando se publicaba el documento en %1: (%2) + + + + UBDocumentPublishingDialog + + Publish + Publicar UBDocumentTreeWidget + %1 (copy) - + %1 (copia) + Copying page %1/%2 - + Copiando página %1/%2 + + + + %1 pages copied + + %1 páginas copiadas + + UBExportDocument + Page - + Página + Export as UBZ File - + Exportar como arch. UBZ + Exporting document... - + Exportando documento... + Export successful. - + Exportación correcta. + Exporting %1 %2 of %3 - + Exportando %1 %2 de %3 + Export to Sankore Format - + Exportar a formato Sankore + + + Export to Uniboard Format + Exportar a formato Uniboard UBExportFullPDF + Made with free version of Uniboard + Realizado con versión gratuita Uniboard + + + Export as PDF File - + Exportar como arch. PDF + Exporting document... - + Exportando documento... + Export successful. - + Exportación correcta. + Export to PDF - + Exportar a PDF UBExportPDF + Export as PDF File - + Exportar como arch. PDF + Exporting document... - + Exportando documento... + Export successful. - + Exportación correcta. + Exporting page %1 of %2 - + Exportando página %1 de %2 + + + Made with free version of Uniboard + Realizado con versión gratuita Uniboard + Export to PDF - + Exportar a PDF UBExportWeb + Page - + Página + Export as Web data - + Exportar como datos Web + Exporting document... - + Exportando documento... + Export successful. - + Exportación correcta. + Export failed. - + La exportación falló. + Export to Web Browser - + Exportar a navegador Web UBGraphicsItemDelegate + Locked - + Bloqueado + Visible on Extended Screen - + Visible en pantalla ampliada + Go to Content Source - + Ir a las fuentes del contenido UBGraphicsTextItem + <Type Text Here> - + <Type Text Here> UBGraphicsTextItemDelegate + Text Color - + Color de texto UBGraphicsWidgetItemDelegate + Frozen - + Congelado + Transform as Tool - + Tranformar a herramienta UBImportCFF + Common File Format ( + + Importing file %1... - + Importando archivo %1... + + Import of file %1 failed. - + La importación del archivo %1 falló. + + Import successful. - + Importación correcta. + + Import failed. - + La importación falló. UBImportDocument - Importing file %1... - + Uniboard (*.ubz) + Uniboard (*.ubz) - Import successful. - + + Sankore 3.1 (*.ubz) + Sankore 3.1 (*.ubz) - Sankore 3.1 (*.ubz) - + + + Importing file %1... + Importando archivo %1... + Import of file %1 failed. - + La importación del archivo %1 falló. + + + + + Import successful. + Importación correcta. UBImportImage + Image Format ( - + Formato de imagen ( + Image import failed. - + Error al importar imagen. + Image import successful. - + Imag. importada correctamente UBImportPDF + Portable Document Format (*.pdf) - + Portable Document Format (*.pdf) + PDF import failed. - + Error al importar PDF. + Importing page %1 of %2 - + Importando página %1 de %2 + PDF import successful. - + PDF importado correctamente + + + + UBImportVirtualPrinter + + Importing Uniboard printer file ... + Importando arch. impresora Uniboard... + + + Error while importing Uniboard printer file. + Error al importar archivo de impresora Uniboard. UBIntranetPodcastPublisher + Error while publishing video to intranet (%1) - + Error publicando vídeo a la red interna (%1) + Publishing to Intranet in progress %1 % + Publicando a la red interna en progreso %1 % + + + + UBIntranetPodcastPublishingDialog + + + Publish + Publicar + + + + UBLibActionBar + + + Add to favorites + Añadir a favoritos + + + + Share + Compartir + + + + Search + Buscar + + + + Delete + Borrar + + + + Back to folder + Carpeta atrás + + + + Remove from favorites + Quitar de favoritos + + + + Create new folder + Crear nueva carpeta + + + + UBLibItemProperties + + + Back + Atrás + + + + Add to page + Añadir a página + + + + Set as background + Poner como fondo + + + + Add to library + Añadir a la biblioteca + + + + Object informations + Información del objeto + + + + UBLibraryController + + Backgrounds + Fondos + + + + ImportedImage - - - UBIntranetPodcastPublishingDialog - Publish - + + Added 1 Image to Library + Añadida 1 imagen a biblioteca + + + + Audios + Audio category element + Sonidos + + + + Movies + Movies category element + Vídeos + + + + Pictures + Pictures category element + Fotos + + + + Shapes + Shapes category element + Formas + + + + Applications + Applications category element + Aplicaciones + + + + Favorite + Favorite category element + Favoritos + + + + Interactivities + Interactives category element + Interactivos + + + + Animations + Animations category element + Animaciones + + + Interactives + Interactives category element + Interactivos + + + + Creating image thumbnail for %1. + Creando vista previa para %1. + + + User Pictures + User Pictures directory + Carpeta de imágenes de usuario + + + Sankoré 3.1 Pictures + Sankoré 3.1 Pictures directory + Imágenes Sankoré 3.1 + + + Sankoré Interactive + Sankore interactivo + + + User Interactive + Usuario interactivo + + + Favorite Interactive + Favoritos interactivo + + + + Adding to page failed for item %1. + Error al añadir el elemento %1 a la página. + + + New Folder + Nueva carpeta + + + Add Item to Library + Añadir elem. a biblioteca + + + All Supported (%1) + Todos los compat. (%1) - - - UBLibActionBar - Add to favorites - + Copying page %1 of file %2 to library %3 + Copiando pág. %1 de arch. %2 a biblioteca %3 - Share - + Page + Página - Search - + Copying file %1 to library %2 (%3/%4) + Copiando arch. %1 a biblioteca %2 (%3/%4) - Delete - + Finished copying %1 files ... + Finalizada copia de %1 archivos... - Back to folder - + Creating thumbnail %1 (%2/%3) + Creando miniatura %1 (%2/%3) - Remove from favorites - + Remove Folder + Eliminar carpeta - Create new folder - + Are you sure you want to remove the folder %1 from the library? + ¿Seguro que desea eliminar la carpeta %1 de la biblioteca? - - - UBLibItemProperties - Back - + Remove Item + Eliminar elem. - Add to page - + Are you sure you want to remove the item from the library? + ¿Seguro que desea eliminar el elemento de la biblioteca? - Set as background - + Sankore 3.1 + Sankore 3.1 - Add to library - + Uniboard + Uniboard - Object informations - + My Images + Mis imágenes - - - UBLibraryController - Added 1 Image to Library - + My Applications + Mis aplicaciones - Audios - Audio category element - + My Movies + Mis vídeos - Movies - Movies category element - + Add Images to Current Page + Añadir imágenes a página actual - Pictures - Pictures category element - + All Images (%1) + Todas imágenes (%1) - Shapes - Shapes category element - + Add Applications to Current Page + Añadir aplicaciones a página actual - Applications - Applications category element - + All Applications (%1) + Todas aplicaciones (%1) - Favorite - Favorite category element - + Add Movies to Current Page + Añadir vídeos a pág. actual - Creating image thumbnail for %1. - + All Files (*.*) + Todos archivos (*.*) - Adding to page failed for item %1. - + Online + Online + + + UBLibraryTreeWidget - Interactivities - Interactives category element - + Downloading content from %1 + Descargando contenido de %1 - ImportedImage - + Downloading content %1 failed + Descarga de contenido %1 fallida - Animations - Animations category element - + Download finished + Descarga completa UBMainWindow + Yes - + + No - + No UBNetworkAccessManager + <qt>Enter username and password for "%1" at %2</qt> - + <qt>Introducir nom. de usuario y contraseña para "%1" en %2</qt> + Failed to log to Proxy - + Fallo al registrar el Proxy + SSL Errors: %1 @@ -1580,295 +2310,555 @@ %2 Do you want to ignore these errors for this host? - + Errores SSL: + +%1 + +%2 + +¿Desea ignorar estos errores para este host? UBNewFolderDlg + Add new folder - + Añadir nueva carpeta + New Folder name: - + Nombre de la nueva carpeta: + Add - + Añadir + Cancel - + Cancelar UBPersistenceManager + (copy) - + (copia) + Document Repository Loss - + Pérdida repositorio de docs. + Sankore 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. + + Uniboard 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. + Uniboard ha perdido acceso al repositorio de documentos '%1'. La aplicación debe cerrarse para evitar daños en los datos. Es posible que se pierdan los últimos cambios. + UBPodcastController - Failed to start encoder ... + Uniboard Cast + Convers. Uniboard + + + + Sankore Cast + + Failed to start encoder ... + Fallo al iniciar codificador... + + + No Podcast encoder available ... - + Ningún codif. podcast disponible... + Part %1 - + Parte %1 + on your desktop ... - + en el escritorio ... + in folder %1 - + en la carpeta %1 + Podcast created %1 - + Podcast creado %1 + Podcast recording error (%1) - + Error al grabar podcast (%1) + + + Made with free version of Uniboard + Realizado con versión gratuita Uniboard + Default Audio Input - + Entrada audio preconfig + No Audio Recording - + Ninguna grabación audio + Small - + Pequeña + Medium - + Mediana + Full - + Llena + Publish to Intranet - + Publicar en la red interna + Publish to Youtube - + Publicar en Youtube + + + + UBPowerPointApplication + + Converting PowerPoint file ... + Conversión archivo PowerPoint... - Sankore Cast - + PowerPoint import successful. + PPT importado correctamente. + + + PowerPoint import failed. + Error al importar PPT. + + + Uniboard printer is not installed. Import will be done in jpg format. + Impresora Uniboard no instalada. Importación en formato jpg. UBPreferencesController + License valid until %1 + Licencia válida hasta %1 + + + version: - + versión: + Marker is pressure sensitive - + Rotulador sensible a la presión + + + %1, for personal use only + %1, solo para uso personal UBProxyLoginDlg + Proxy Login - + Autenticación del proxy + Username: - + Usuario: + Password: - + Contraseña: UBPublicationDlg + Publish document on the web - + Publicar documento en la web + Title: - + Título + Description: - + Descripción: + Publish - + Publicar UBSettings + Untitled Documents - + Documentos sin título + Trash - + Papelera + + Images - + Imágenes + My Movies + Mis vídeos + + + + UBSoftwareUpdateController + + Downloading software update (%1%) + Descargando actualización de SW (%1%) + + + Downloading software update failed + Error al descargar la actualización SW + + + Download finished + Descarga completa + + + Software Update + Actualización de SW + + + Are you sure you want to install this new version of Uniboard now? +This session will close as soon as installation begins. + ¿Seguro que desea instalar la nueva versión de Uniboard ahora? +Se cerrará esta sesión cuando comience la instalación. + + + + UBSoftwareUpdateDialog + + Download... + Descarga... + + + Show this Message Again + Volver a mostrar el mensaje + + + Software Update + Actualización de SW + + + Your version: %1 + Su versión: %1 + + + New version: %1 + Nueva versión: %1 + + + + UBTeacherBarWidget + + + Title + Título + + + + Phasis + + + + + Duration + Duración + + + + Equipment + + + + + Activity + Actividad + + + + I discover + Yo descubro + + + + I experiment + Yo experimento + + + + I train myself + + + + + I play + Yo juego + + + + I memorize + + + + + Short + Corto + + + + Middle + Medio + + + + Long + Largo + + + + Alone + + + + + By Group + + + + + All together + + UBTeacherStudentAction + + + Action %0 + Acción %0 + + + + Teacher + Profesor + + + + Student + Alumno + + UBThumbnailAdaptor + Generating preview thumbnails ... - + Generando vista previa miniaturas... + %1 thumbnails generated ... - + %1 miniaturas generadas... UBToolsManager - Mask - + + Compass + Compás + Ruler - - - - Compass - + Regla + Protractor - + Transportador + Triangle - + Triángulo + Magnifier + Cache - + Cache + + + + Mask + Máscara UBTrapFlashController + Whole page - + Página entera + Web - + Web UBUpdateDlg + Document updater - + Actualizador del documento + files require an update. - + archivos necesitan actualizarse. + Backup path: - + Ruta a la copia de seguridad: + Browse - + Navegar + Update - + Actualizar + Select a backup folder + Seleccione un directorio de copia de seguridad + + + + Please wait the import process will start soon... + Files update successful! Please reboot the application to access the updated documents. + An error occured during the update. The files have not been affected. + Files update results - Updating file - - - - Please wait the import process will start soon... - + + Updating file + Actualizando archivo UBW3CWidget + Web - + Web UBWebPluginWidget + Loading... - + Cargando... UBWebPublisher + Publish Document on Uniboard Web + Publicar documento en la Web Uniboard + + + Publish Document on Sankore Web - + Publicar documento en la web de Sankore UBWidgetUniboardAPI + %0 called (method=%1, status=%2) @@ -1876,318 +2866,391 @@ Please reboot the application to access the updated documents. UBYouTubePublisher + YouTube authentication failed. - + Falló la autenticación en YouTube. + Error while uploading video to YouTube (%1) - + Error al cargar vídeo en YouTube (%1) + Upload to YouTube in progress %1 % - + Carga en YouTube en curso %1 % UBYouTubePublishingDialog + Upload - + Subir + Autos & Vehicles - + Coches y vehículos + Music - + Música + Pets & Animals - + Animales + Sports - + Deportes + Travel & Events - + Viajes y actividades + Gaming - + Juegos + Comedy - + Comedia + People & Blogs - + Gente y blogs + News & Politics - + Noticias y política + Entertainment - + Entretenimiento + Education - + Educación + Howto & Style - + Cómos y estilo + Nonprofits & Activism - + Activismo + Science & Technology - + Ciencia y tecnología UBZoomPalette + %1 x - + %1 x WBClearButton + Clear - + Limpiar WBDownloadItem + Save File - + Guardar arch. + Download canceled: %1 - + Descarga cancelada: %1 + Error opening saved file: %1 - + Error abriendo archivo guardado: %1 + Error saving: %1 - + Error al guardar: %1 + Network Error: %1 - + Error de red: %1 + seconds - + segundos + minutes - + minutos + - %4 %5 remaining - + quedan - %4 %5 + %1 of %2 (%3/sec) %4 - + %1 de %2 (%3/s) %4 + ? unknown file size - + ? + %1 of %2 - Stopped - + %1 de %2 - Detenido + bytes - + bytes + KB - + KB + MB - + MB WBDownloadManager + 1 Download - + 1 descarga + %1 Downloads always >= 2 - + %1 descargas WBHistoryModel + Title - + Título + Address - + Dirección WBHistoryTreeModel + Earlier Today - + Hoy + %1 items - + %1 elementos WBSearchLineEdit + Search - + Buscar WBTabBar + New &Tab - + Nueva &pestaña + Clone Tab - + Dupli. pestaña + &Close Tab - + &Cerrar pestaña + Close &Other Tabs - + Cerrar &otras pestañas + Reload Tab - + Recarg. pestaña + Reload All Tabs - + Recarg. todas pest. WBTabWidget + Recently Closed Tabs - + Pest. cerradas recientem. + + (Untitled) - + (sin título) WBToolbarSearch + Search - + Buscar + No Recent Searches - + Ninguna búsqu. reciente + Recent Searches - + Búsquedas recientes + Clear Recent Searches - + Limpiar búsqu. recientes WBWebPage - Download + Download PDF Document: would you prefer to download the PDF file or add it to the current Uniboard document? + Descargar documento PDF: ¿prefiere descargar el archivo PDF o añadirlo al documento Uniboard actual? + + + + Download PDF Document: would you prefer to download the PDF file or add it to the current Sankore document? + + Download + Descargar + + + Add to Current Document - + Añadir al documento actual + PDF - + PDF + Error loading page: %1 - - - - Download PDF Document: would you prefer to download the PDF file or add it to the current Sankore document? - + Error al cargar página: %1 WBWebView + Open in New Tab - + Abrir en nueva pestaña YouTubePublishingDialog + Publish Podcast to YouTube - + Publicar Podcast en YouTube + Title - + Título + Description - + Descripción + Keywords - + Claves + Uniboard - + Uniboard + Category - + Categoría + YouTube Username - + Usuario de YouTube + YouTube Password - + Contraseña de YouTube + <!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; } @@ -2199,234 +3262,315 @@ p, li { white-space: pre-wrap; } brushProperties - On Light Background - + + Opacity + Opacidad - On Dark Background - + + On Light Background + Con fondo claro - Opacity - + + On Dark Background + Con fondo oscuro + Line Width - + Ancho de línea + Medium - + Mediana + Strong - + Fuerte + Fine - + Fina + Pen is Pressure Sensitive - + El lápiz es sensible a la presión capturePublishingDialog + Dialog - + Diálogo + Title - + Título + E-mail - + Correo electrónico + Author - + Autor + Description - + Descripción documentPublishingDialog + Dialog - + Diálogo + Title - + Título + E-mail - + Correo electrónico + Author - + Autor + Description - + Descripción + Attach Downloadable PDF Version - + Adjuntar versión PDF descargable + Attach Downloadable Uniboard File (UBZ) - + Adjuntar archivo Uniboard descargable (UBZ) + Warning: This documents contains video, which will not be displayed properly on the Web - + Advertencia: Este documento contiene vídeo, que no se podrá ver bien en la Web documents + Uniboard Documents - - - - 1 - + Documentos Uniboard - preferencesDialog + library - Preferences - + Images + Imágenes - - version : … - + + New Folder + Nueva carpeta - Default Settings - + Sankore Library + Biblioteca Sankore - Close - + Iteractive Models + Modelos interactivos - Display - + Import to Library + Importar a biblioteca - Internet - + Shapes + Formas - Show Page with External Browser - + Movies + Vídeos - Home Page: - + Applications + Aplicaciones - Proxy User/Pass: - + Sounds + Sonidos - Virtual Keyboard - + Delete + Limpiar - Keyboard button size: - + Set as Background + Fijar como fondo - Toolbar - + Remove Background + Eliminar fondo + + + Add File to Page + Añadir archivo a pág. + + + Add to Page + Añadir a página + + + Add to Editor + Añadir al editor + + + + preferencesDialog + + + Preferences + Preferencias + + + + Default Settings + Preconfiguración + + Close + Cerrar + + + + Display + Pantalla + + + Indicators + Indicadores + + + + Show Page with External Browser + Mostrar página con navegador externo + + + Positioned at the Top (recommended for tablets) - + Posicionado arriba (recomendado para tablets) + Positioned at the Bottom (recommended for white boards) - + Posicionado abajo (recomendado para pizarras digitales) + Display Text Under Button - + Mostrar texto debajo del botón - Mirroring - + + Internet + Internet - Show main display immediately on secondary screen or projector - + + Home Page: + Pág. principal: - Stylus Palette - + + Proxy User/Pass: + Proxy Usuario/Contraseña: - Horizontal - + + Toolbar + Barra de herramientas - Vertical - + + Mirroring + Reflejo - Pen - + + Show main display immediately on secondary screen or projector + Mostrar pantalla principal de inmediato en pantalla secundaria o proyector - Marker - + + Virtual Keyboard + Teclado virtual - About - + Minimize keyboard when not active + Minimizar teclado cuando no esté activo - Software Update - + + Keyboard button size: + Tamaño de botones de teclado: - Check software update at launch - + + Stylus Palette + Estilo de la paleta - Licences - + + Horizontal + Horizontal - OpenSSl - + + Vertical + Vertical - zlib - + + Pen + Lápiz - xpdf - + + Marker + Rotulador - Quazip - + + Licences + Licencias - - Sankoré 3.1 - + + + OpenSSl + OpenSSl + <!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; } @@ -2436,6 +3580,12 @@ p, li { white-space: pre-wrap; } + + zlib + zlib + + + <!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; } @@ -2444,6 +3594,12 @@ p, li { white-space: pre-wrap; } + + xpdf + xpdf + + + <!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; } @@ -2452,6 +3608,12 @@ p, li { white-space: pre-wrap; } + + Quazip + Quazip + + + <!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; } @@ -2459,7 +3621,13 @@ p, li { white-space: pre-wrap; } <p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:9pt;">GNU Library or Lesser General Public License (LGPL), zlib/libpng License</span></p></body></html> + + + Sankoré 3.1 + Sankoré 3.1 + + <!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; } @@ -2637,7 +3805,13 @@ p, li { white-space: pre-wrap; } <p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:9pt;">Library.</span></p></body></html> - + + + About + Acerca de + + + <!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; } @@ -2650,7 +3824,8 @@ p, li { white-space: pre-wrap; } <p align="justify" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:9pt; color:#35382a;">You should have received a copy of the GNU General Public License along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></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; } @@ -2660,39 +3835,70 @@ p, li { white-space: pre-wrap; } + Network - + Red + Community - + Comunidad + User/Pass: - + Usuario/Contraseña: + + + Licence + Licencia + + + + Software Update + Actualización de la aplicación + + + + Check software update at launch + Comprobar actualización de la aplicación al inicio + + + Check for Software Updates Now + Buscar actualizaciones de SW ahora + + + + version : … + versión: … trapFlashDialog + Trap flash - + Trap flash + Select a flash to trap - + Selec. flash para capturar + about:blank - + about:blank + Application name - + Nombre de aplicación + Create Application - + Crear aplicación diff --git a/resources/images/libpalette/WebSearchCategory.svg b/resources/images/libpalette/WebSearchCategory.svg new file mode 100644 index 00000000..95b5e24e --- /dev/null +++ b/resources/images/libpalette/WebSearchCategory.svg @@ -0,0 +1,240 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/library/sankoreInteractivities/ord-phrases.wgt/template/scripts/template2.js b/resources/library/sankoreInteractivities/ord-phrases.wgt/template/scripts/template2.js index 2ad61229..7e6e14a9 100644 --- a/resources/library/sankoreInteractivities/ord-phrases.wgt/template/scripts/template2.js +++ b/resources/library/sankoreInteractivities/ord-phrases.wgt/template/scripts/template2.js @@ -5,12 +5,12 @@ function startEditing() { - modeEdit(); + modeEdit(); } function stopEditing() { - modeView(); + modeView(); } function initialize() @@ -20,7 +20,7 @@ function initialize() function checkResponse() { - checkWord(); + checkWord(); } /* / END sankore api @@ -28,7 +28,16 @@ function checkResponse() -var sentence = "this is\nan example\nsentence"; +var sentence = ""; +var curSentence = ""; + +if(window.sankore){ + sentence = (sankore.preference("rightOrdPhrases", ""))?sankore.preference("rightOrdPhrases", ""):"this is\nan example\nsentence"; + curSentence = (sankore.preference("currentOrdPhrases", ""))?sankore.preference("currentOrdPhrases", ""):""; +} else { + sentence = "this is\nan example\nsentence"; +} + var doCheck = true; // array of dom elements @@ -47,10 +56,10 @@ var widget_padding = 100; function str_replace( w, b, s ){ - while( s.indexOf( w ) != -1 ){ - s = s.replace( w, b ); - } - return s; + while( s.indexOf( w ) != -1 ){ + s = s.replace( w, b ); + } + return s; } /* @@ -61,16 +70,16 @@ shuffles an array */ function shuffle( arr ) { - var pos, tmp; + var pos, tmp; - for( var i = 0; i < arr.length; i++ ) - { - pos = Math.round( Math.random() * ( arr.length - 1 ) ); - tmp = arr[pos]; - arr[pos] = arr[i]; - arr[i] = tmp; - } - return arr; + for( var i = 0; i < arr.length; i++ ) + { + pos = Math.round( Math.random() * ( arr.length - 1 ) ); + tmp = arr[pos]; + arr[pos] = arr[i]; + arr[i] = tmp; + } + return arr; } /* @@ -81,34 +90,34 @@ returns array of dom elements */ function createElements( sentence ) { - var el; - var elements = []; - var phrases = sentence.split( "\n" ); + var el; + var elements = []; + var phrases = sentence.split( "\n" ); - for( i in phrases ) - { - el = document.createElement( "div" ); - $( el ).addClass( "phrase" ).text( phrases[i] ); - elements.push( el ); - } - return elements; + for( i in phrases ) + { + el = document.createElement( "div" ); + $( el ).addClass( "phrase" ).text( phrases[i] ); + elements.push( el ); + } + return elements; } function checkSentence() { - if( !doCheck ) - return; + if( !doCheck ) + return; - var ph = []; - $( "#mp_word .phrase" ).each( function() - { - ph.push( $( this ).text() ); - }); + var ph = []; + $( "#mp_word .phrase" ).each( function() + { + ph.push( $( this ).text() ); + }); - if( ph.join( "\n" ) == str_replace( "\r", "", sentence ) ){ - $( "#mp_word .phrase" ).addClass( "right" ); - } + if( ph.join( "\n" ) == str_replace( "\r", "", sentence ) ){ + $( "#mp_word .phrase" ).addClass( "right" ); + } } /* @@ -119,49 +128,56 @@ turns the widget into the view mode */ function modeView() { - if( editMode ){ - sentence = str_replace( "\r", "", $( "#mp_word textarea" ).attr( "value" ) ); - var p = sentence.split( "\n" ); - var p2 = []; - var t; - for( var i in p ) - { - t = jQuery.trim( p[i] ); - if( t ) p2.push( t ); - } - sentence = p2.join( "\n" ); - } + if( editMode ){ + sentence = str_replace( "\r", "", $( "#mp_word textarea" ).attr( "value" ) ); + var p = sentence.split( "\n" ); + var p2 = []; + var t; + for( var i in p ) + { + t = jQuery.trim( p[i] ); + if( t ) p2.push( t ); + } + sentence = p2.join( "\n" ); + } - // if no sankore api, insert edit button - if( !isSankore ){ - $( "#mp_setup" ).empty().append( '' ); - $( "#mp_setup input:button" ).click( function(){ - modeEdit(); - }); - } + // if no sankore api, insert edit button + if( !isSankore ){ + $( "#mp_setup" ).empty().append( '' ); + $( "#mp_setup input:button" ).click( function(){ + modeEdit(); + }); + } - // clean the previous word - $( "#mp_word" ).empty(); + // clean the previous word + $( "#mp_word" ).empty(); - // create new set of elements - var phrases = shuffle( createElements( sentence ) ); - for( i in phrases ){ - $("#mp_word").append( phrases[i] ); - } + var phrases; + // create new set of elements + if(window.sankore && curSentence && !editMode) + phrases = createElements( curSentence ); + else + phrases = shuffle( createElements( sentence ) ); + + for( i in phrases ){ + $("#mp_word").append( phrases[i] ); + } - // in sankore api there would be a function to check - // the answer, so no update parameter would be needed - $( "#mp_word" ).sortable(); - if( !isSankore ){ - $( "#mp_word" ).sortable( { update: checkSentence } ); - } else - $( "#mp_word" ).sortable(); - - // adjustHeight - var aHeight = $( phrases[0] ).outerHeight( true ); + // in sankore api there would be a function to check + // the answer, so no update parameter would be needed + $( "#mp_word" ).sortable(); + if( !isSankore ){ + $( "#mp_word" ).sortable( { + update: checkSentence + } ); + } else + $( "#mp_word" ).sortable(); + + // adjustHeight + var aHeight = $( phrases[0] ).outerHeight( true ); - // apply new width - adjust( aHeight * phrases.length ); + // apply new width + adjust( aHeight * phrases.length ); } @@ -172,11 +188,13 @@ adjust width or height */ function adjust( height ) { - $( "#mp_word" ).animate( {height: height } ); - // if viewed as a widget, resize the window - if( !isBrowser ){ - window.resizeTo( widget.width, height + widget_padding ); - } + $( "#mp_word" ).animate( { + height: height + } ); + // if viewed as a widget, resize the window + if( !isBrowser ){ + window.resizeTo( widget.width, height + widget_padding ); + } } /* @@ -186,26 +204,39 @@ modeEdit */ function modeEdit() { - editMode = true; - // if no sankore api, insert ok button - if( !isSankore ) - { - $( "#mp_setup" ).empty().append( '' ); - $( "#mp_setup input:button" ).click( function(){ - modeView(); - }); - } - $( "#mp_word").css( "margin-left", 0 ).empty() - .append(''); - adjust( $( "#mp_word textarea" ).outerHeight() ); + editMode = true; + // if no sankore api, insert ok button + if( !isSankore ) + { + $( "#mp_setup" ).empty().append( '' ); + $( "#mp_setup input:button" ).click( function(){ + modeView(); + }); + } + $( "#mp_word").css( "margin-left", 0 ).empty() + .append(''); + adjust( $( "#mp_word textarea" ).outerHeight() ); } +$(window).mouseout(function(){ + if(window.sankore){ + var ph = []; + $( "#mp_word .phrase" ).each( function() + { + ph.push( $( this ).text() ); + }); + + sankore.setPreference("currentOrdPhrases", ph.join( "\n" )); + sankore.setPreference("rightOrdPhrases", sentence); + + } +}); $(document).ready(function() { - $("#ub-widget").append( '\ + $("#ub-widget").append( '\
\
\ '); - modeView(); + modeView(); }); \ No newline at end of file diff --git a/resources/library/sankoreInteractivities/ord-words.wgt/template/scripts/template2.js b/resources/library/sankoreInteractivities/ord-words.wgt/template/scripts/template2.js index 3ae3790e..bb06994c 100644 --- a/resources/library/sankoreInteractivities/ord-words.wgt/template/scripts/template2.js +++ b/resources/library/sankoreInteractivities/ord-words.wgt/template/scripts/template2.js @@ -5,12 +5,12 @@ function startEditing() { - modeEdit(); + modeEdit(); } function stopEditing() { - modeView(); + modeView(); } function initialize() @@ -20,7 +20,7 @@ function initialize() function checkResponse() { - checkWord(); + checkWord(); } /* / END sankore api @@ -28,7 +28,16 @@ function checkResponse() -var word = "a*long*,*long*time*ago*..."; +var word = ""; +var curWord = ""; + +if(window.sankore){ + word = (sankore.preference("rightOrdWords", ""))?sankore.preference("rightOrdWords", ""):"a*long*,*long*time*ago*..."; + curWord = (sankore.preference("currentOrdWords", ""))?sankore.preference("currentOrdWords", ""):""; +} else { + word = "a*long*,*long*time*ago*..."; +} + var img = "template/images/horse.png"; var doCheckWord = true; @@ -55,31 +64,31 @@ returns array of dom elements */ function createWordLetters( word ) { - var ch, el; - var letters = []; + var ch, el; + var letters = []; - if( word.indexOf( '*' ) != -1 ) - { - var tmp = word.split( '*' ); - for( i in tmp ) - { - ch = tmp[i]; - el = document.createElement( "div" ); - $(el).addClass( "letter" ).text( ch ); - letters.push( el ); - } - } - else - { - for( var i = 0; i < word.length; i++ ) - { - ch = word.charAt( i ); - el = document.createElement( "div" ); - $(el).addClass( "letter" ).text( ch ); - letters.push( el ); - } - } - return letters; + if( word.indexOf( '*' ) != -1 ) + { + var tmp = word.split( '*' ); + for( i in tmp ) + { + ch = tmp[i]; + el = document.createElement( "div" ); + $(el).addClass( "letter" ).text( ch ); + letters.push( el ); + } + } + else + { + for( var i = 0; i < word.length; i++ ) + { + ch = word.charAt( i ); + el = document.createElement( "div" ); + $(el).addClass( "letter" ).text( ch ); + letters.push( el ); + } + } + return letters; } @@ -92,22 +101,22 @@ if they are in the right order */ function checkWord() { - if( !doCheckWord ) - return; + if( !doCheckWord ) + return; - var str = ""; - $( "#mp_word .letter" ).each( function(){ - str += $(this).text(); - }); - var w = word; - while( w.indexOf( '*' ) != -1 ) - { - w = w.replace( '*', '' ); - } - if( str == w ){ - $( "#mp_word .letter" ).addClass( "right" ); - //message( "Right!" ); - } + var str = ""; + $( "#mp_word .letter" ).each( function(){ + str += $(this).text(); + }); + var w = word; + while( w.indexOf( '*' ) != -1 ) + { + w = w.replace( '*', '' ); + } + if( str == w ){ + $( "#mp_word .letter" ).addClass( "right" ); + //message( "Right!" ); + } } /* @@ -118,16 +127,16 @@ shuffles an array */ function shuffle( arr ) { - var pos, tmp; + var pos, tmp; - for( var i = 0; i < arr.length; i++ ) - { - pos = Math.round( Math.random() * ( arr.length - 1 ) ); - tmp = arr[pos]; - arr[pos] = arr[i]; - arr[i] = tmp; - } - return arr; + for( var i = 0; i < arr.length; i++ ) + { + pos = Math.round( Math.random() * ( arr.length - 1 ) ); + tmp = arr[pos]; + arr[pos] = arr[i]; + arr[i] = tmp; + } + return arr; } @@ -140,56 +149,63 @@ turns the widget into the view mode */ function modeView() { - if( editMode ){ - word = $( "#mp_word input:text" ).attr( "value" ); - } + if( editMode ){ + word = $( "#mp_word input:text" ).attr( "value" ); + } - // if no sankore api, insert edit button - if( !isSankore ){ - $( "#mp_setup" ).empty().append( '' ); - $( "#mp_setup input:button" ).click( function(){ - modeEdit(); - }); - } + // if no sankore api, insert edit button + if( !isSankore ){ + $( "#mp_setup" ).empty().append( '' ); + $( "#mp_setup input:button" ).click( function(){ + modeEdit(); + }); + } - // clean the previous word - $( "#mp_word" ).empty(); + // clean the previous word + $( "#mp_word" ).empty(); - // create new set of letters - var letters = shuffle( createWordLetters( word ) ); - for( i in letters ){ - $("#mp_word").append( letters[i] ); - } + // create new set of letters + var letters; + if(window.sankore && curWord && !editMode) + letters = createWordLetters( curWord ); + else + letters = shuffle( createWordLetters( word ) ); + + for( i in letters ){ + $("#mp_word").append( letters[i] ); + } - // in sankore api there would be a function to check - // the answer, so no update parameter would be needed - if( !isSankore ){ - $( "#mp_word" ).sortable( { update: checkWord } ); - } else $( "#mp_word" ).sortable(); - - // adjustWidth - var totalLettersWidth = 0; - for( i in letters ){ - var currentWidth = $( letters[i] ).outerWidth( true ); - totalLettersWidth += currentWidth; - } - totalLettersWidth += 1; - - var width = Math.max( - totalLettersWidth, - min_view_width - ); + // in sankore api there would be a function to check + // the answer, so no update parameter would be needed + if( !isSankore ){ + $( "#mp_word" ).sortable( { + update: checkWord + } ); + } else $( "#mp_word" ).sortable(); + + // adjustWidth + var totalLettersWidth = 0; + for( i in letters ){ + var currentWidth = $( letters[i] ).outerWidth( true ); + totalLettersWidth += currentWidth; + } + totalLettersWidth += 1; + + var width = Math.max( + totalLettersWidth, + min_view_width + ); - // shift the words to the right to center them - if( width > totalLettersWidth ){ - $( "#mp_word" ).css( "margin-left", Math.round( (width - totalLettersWidth)/2 ) ); - } - else{ - $( "#mp_word" ).css( "margin-left", 0 ); - } + // shift the words to the right to center them + if( width > totalLettersWidth ){ + $( "#mp_word" ).css( "margin-left", Math.round( (width - totalLettersWidth)/2 ) ); + } + else{ + $( "#mp_word" ).css( "margin-left", 0 ); + } - // apply new width - adjustWidth( width ); + // apply new width + adjustWidth( width ); } @@ -200,11 +216,13 @@ adjustWidth */ function adjustWidth( width ) { - $( "#ub-widget" ).animate( {width: width } ); - // if viewed as a widget, resize the window - if( !isBrowser ){ - window.resizeTo( width + widget_padding, widget.height ); - } + $( "#ub-widget" ).animate( { + width: width + } ); + // if viewed as a widget, resize the window + if( !isBrowser ){ + window.resizeTo( width + widget_padding, widget.height ); + } } /* @@ -214,25 +232,36 @@ modeEdit */ function modeEdit() { - editMode = true; - // if no sankore api, insert ok button - if( !isSankore ) - { - $( "#mp_setup" ).empty().append( '' ); - $( "#mp_setup input:button" ).click( function(){ - modeView(); - }); - } - $( "#mp_word").css( "margin-left", 0 ).empty().append(''); - adjustWidth( input_width ); + editMode = true; + // if no sankore api, insert ok button + if( !isSankore ) + { + $( "#mp_setup" ).empty().append( '' ); + $( "#mp_setup input:button" ).click( function(){ + modeView(); + }); + } + $( "#mp_word").css( "margin-left", 0 ).empty().append(''); + adjustWidth( input_width ); } +$(window).mouseout(function(){ + if(window.sankore){ + var str = ""; + $( "#mp_word .letter" ).each( function(){ + str += $(this).text(); + }); + + sankore.setPreference("currentOrdWords", str); + sankore.setPreference("rightOrdWords", word); + } +}); $(document).ready(function() { - $("#ub-widget").append( '\ + $("#ub-widget").append( '\
\
\ '); - modeView(); + modeView(); }); \ No newline at end of file diff --git a/resources/library/sankoreInteractivities/spl-phrase.wgt/scripts/app.js b/resources/library/sankoreInteractivities/spl-phrase.wgt/scripts/app.js index 871d5816..0bf5cbba 100644 --- a/resources/library/sankoreInteractivities/spl-phrase.wgt/scripts/app.js +++ b/resources/library/sankoreInteractivities/spl-phrase.wgt/scripts/app.js @@ -3,162 +3,178 @@ function createElements( phrase ) { - var s = ''; - for( var i = 0; i < phrase.length; i++ ) - { - ch = phrase.charAt( i ); - if( ch == " " ){ - ch = " "; - } + var s = ''; + for( var i = 0; i < phrase.length; i++ ) + { + ch = phrase.charAt( i ); + if( ch == " " ){ + ch = " "; + } - s += '
' + ch + '
' + - '
 
'; - } - return s; + s += '
' + ch + '
' + + '
 
'; + } + return s; } $(document).ready(function() { - var w = new wcontainer( "#ub-widget" ); + var w = new wcontainer( "#ub-widget" ); + var sentence = ""; + + if(window.sankore) + sentence = (sankore.preference("ordSplPhrases", ""))?sankore.preference("ordSplPhrases", ""):"this is a bunch of words which should be split apart"; + else + sentence = "this is a bunch of words which should be split apart"; + - w.maxWidth = 600; + w.maxWidth = 600; - w.setEditContent( '
' ); - w.setViewContent( '
.
' ); - w.setData( "dashWidth", w.elements.container.find( ".dash" ).outerWidth() ); - w.setViewContent( '
M
' ); - w.setData( "lineHeight", w.elements.container.find( ".dash" ).outerHeight() ); - w.setViewContent( "" ); + w.setEditContent( '
' ); + w.setViewContent( '
.
' ); + w.setData( "dashWidth", w.elements.container.find( ".dash" ).outerWidth() ); + w.setViewContent( '
M
' ); + w.setData( "lineHeight", w.elements.container.find( ".dash" ).outerHeight() ); + w.setViewContent( "" ); - // onViewMode - w.onViewMode = function() - { - // clean up the text - var phrase = w.elements.container.find( "textarea" ).val() - .replace( /\r/g, '' ).replace( /\n/g, ' ' ).replace( / /g, ' ' ).trim(); + // onViewMode + w.onViewMode = function() + { + // clean up the text + var phrase = w.elements.container.find( "textarea" ).val() + .replace( /\r/g, '' ).replace( /\n/g, ' ' ).replace( / /g, ' ' ).trim(); - // store the text - w.setData( "phrase", phrase ); + // store the text + w.setData( "phrase", phrase ); - // remove all dots (they are to be set during the exercise) - phrase = phrase.replace( / /g, '' ); + // remove all dots (they are to be set during the exercise) + phrase = phrase.replace( / /g, '' ); - // create the html - w.setViewContent( createElements( phrase ) ); + // create the html + w.setViewContent( createElements( phrase ) ); - // the behaviour - w.elements.containerView.find( ".letter" ) - .mouseover( function() - { - var el = $( this ).next(); + // the behaviour + w.elements.containerView.find( ".letter" ) + .mouseover( function() + { + var el = $( this ).next(); - // determine new hover class - var is_fixed = ( el.get( 0 ).className.indexOf( "fixed" ) != -1 ); - var hover_class = is_fixed? - "dash_hover_fixed" : "dash_hover"; + // determine new hover class + var is_fixed = ( el.get( 0 ).className.indexOf( "fixed" ) != -1 ); + var hover_class = is_fixed? + "dash_hover_fixed" : "dash_hover"; - // assign new hover class - el.addClass( hover_class ) - .data( "hc", hover_class ); - }) - .mouseout( function() - { - var el = $( this ).next(); - // remove current hover class - var hc = el.data( "hc" ); - el.removeClass( hc ); - }) - .click( function() - { - var el = $( this ).next(); + // assign new hover class + el.addClass( hover_class ) + .data( "hc", hover_class ); + }) + .mouseout( function() + { + var el = $( this ).next(); + // remove current hover class + var hc = el.data( "hc" ); + el.removeClass( hc ); + }) + .click( function() + { + var el = $( this ).next(); - // remove current hover class - $( this ).trigger( "mouseout" ); + // remove current hover class + $( this ).trigger( "mouseout" ); - // toggle fixed class - el.toggleClass( "fixed" ); + // toggle fixed class + el.toggleClass( "fixed" ); - // determine new hover class - // assign new hover class - $( this ).trigger( "mouseover" ); + // determine new hover class + // assign new hover class + $( this ).trigger( "mouseover" ); - w.checkAnswer(); - w.adjustSize(); - }); + w.checkAnswer(); + w.adjustSize(); + }); - w.checkAnswer(); - }; + w.checkAnswer(); + }; - // viewSize - w.viewSize = function() - { - var w = 0; - var h = 0; + // viewSize + w.viewSize = function() + { + var w = 0; + var h = 0; - var dh = winstance.getData( "lineHeight" ); - var dw = winstance.getData( "dashWidth" ); + var dh = winstance.getData( "lineHeight" ); + var dw = winstance.getData( "dashWidth" ); - winstance.elements.containerView.find( "div:visible" ).each( function() - { - w += $( this ).outerWidth(); - h = Math.max( h, $( this ).outerHeight( true ) ); - }); + winstance.elements.containerView.find( "div:visible" ).each( function() + { + w += $( this ).outerWidth(); + h = Math.max( h, $( this ).outerHeight( true ) ); + }); - var square = w*h; - h = Math.max( h, $( winstance.elements.containerView ).height() ); + var square = w*h; + h = Math.max( h, $( winstance.elements.containerView ).height() ); - if( winstance.maxWidth ) - { - w = Math.min( w, winstance.maxWidth ); - h = parseInt( square / w ); - } + if( winstance.maxWidth ) + { + w = Math.min( w, winstance.maxWidth ); + h = parseInt( square / w ); + } - return { w: w, h: h+dh }; - }; + return { + w: w, + h: h+dh + }; + }; - // editSize - w.editSize = function() - { - return { - w: winstance.elements.containerEdit.find( "textarea" ).parent().outerWidth( true ), - h: winstance.elements.containerEdit.find( "textarea" ).parent().outerHeight( true ), - }; - }; + // editSize + w.editSize = function() + { + return { + w: winstance.elements.containerEdit.find( "textarea" ).parent().outerWidth( true ), + h: winstance.elements.containerEdit.find( "textarea" ).parent().outerHeight( true ), + }; + }; - w.checkAnswer = function() - { - var phrase = ""; - var ch = ""; - this.elements.containerView.find( "div:visible" ).each( function() - { - if( this.className.indexOf( "fixed" ) != -1 ){ - phrase += ' '; - } - else if( this.className.indexOf( "dash" ) != -1 ){ - return; - } - else{ - ch = $( this ).html(); - phrase += ch; - } - }); + w.checkAnswer = function() + { + var phrase = ""; + var ch = ""; + this.elements.containerView.find( "div:visible" ).each( function() + { + if( this.className.indexOf( "fixed" ) != -1 ){ + phrase += ' '; + } + else if( this.className.indexOf( "dash" ) != -1 ){ + return; + } + else{ + ch = $( this ).html(); + phrase += ch; + } + }); - if( phrase == this.getData( "phrase" ) ){ - this.elements.containerView.addClass( "answerRight" ); - } - else{ - this.elements.containerView.removeClass( "answerRight" ); - } - }; + if( phrase == this.getData( "phrase" ) ){ + this.elements.containerView.addClass( "answerRight" ); + } + else{ + this.elements.containerView.removeClass( "answerRight" ); + } + }; - window.w = w; - window.winstance = w; + window.w = w; + window.winstance = w; - w.modeView(); + w.modeView(); + + $(window).mouseout(function(){ + if(window.sankore){ + sankore.setPreference("ordSplPhrases", w.getData("phrase")); + } + }); }); \ No newline at end of file diff --git a/resources/library/sankoreInteractivities/spl-text.wgt/scripts/app2.js b/resources/library/sankoreInteractivities/spl-text.wgt/scripts/app2.js index d1a40ae6..d357e7bc 100644 --- a/resources/library/sankoreInteractivities/spl-text.wgt/scripts/app2.js +++ b/resources/library/sankoreInteractivities/spl-text.wgt/scripts/app2.js @@ -3,168 +3,182 @@ function createElements( text ) { - var s = ''; + var s = ''; - var words = text.split( " " ); + var words = text.split( " " ); - for( var i = 0; i < words.length; i++ ) - { - if( i ){ - s += '
 
'; - } - s += '
' + words[i] + '
' + - '
.
'; - } + for( var i = 0; i < words.length; i++ ) + { + if( i ){ + s += '
 
'; + } + s += '
' + words[i] + '
' + + '
.
'; + } - return s; + return s; } $(document).ready(function() { - var w = new wcontainer( "#ub-widget" ); + var w = new wcontainer( "#ub-widget" ); + + var sentences = ""; + + if(window.sankore) + sentences = (sankore.preference("ordSplText", ""))?sankore.preference("ordSplText", ""):"hello, this is the first sentence. hi, this is the second sentence. hello again, this is the third sentence. good morning, this is the fifth sentence. hi, sorry, i\'m late, i\'m the fourth sentence."; + else + sentences = "hello, this is the first sentence. hi, this is the second sentence. hello again, this is the third sentence. good morning, this is the fifth sentence. hi, sorry, i\'m late, i\'m the fourth sentence."; + + w.maxWidth = 600; - w.maxWidth = 600; + w.setEditContent( '
' ); + w.setViewContent( '
.
' ); + w.setData( "dashWidth", w.elements.container.find( ".dash" ).outerWidth() ); + w.setViewContent( '
M
' ); + w.setData( "lineHeight", w.elements.container.find( ".dash" ).outerHeight() ); + w.setViewContent( "" ); - w.setEditContent( '
' ); - w.setViewContent( '
.
' ); - w.setData( "dashWidth", w.elements.container.find( ".dash" ).outerWidth() ); - w.setViewContent( '
M
' ); - w.setData( "lineHeight", w.elements.container.find( ".dash" ).outerHeight() ); - w.setViewContent( "" ); - - // onViewMode - w.onViewMode = function() - { - // clean up the text - var text = w.elements.container.find( "textarea" ).val() - .replace( /\r/g, '' ).replace( /\n/g, ' ' ).replace( / /g, ' ' ); + // onViewMode + w.onViewMode = function() + { + // clean up the text + var text = w.elements.container.find( "textarea" ).val() + .replace( /\r/g, '' ).replace( /\n/g, ' ' ).replace( / /g, ' ' ); - // store the text - w.setData( "text", text ); + // store the text + w.setData( "text", text ); - // remove all dots (they are to be set during the exercise) - text = text.replace( /\. /g, ' ' ).trim( ["."] ); + // remove all dots (they are to be set during the exercise) + text = text.replace( /\. /g, ' ' ).trim( ["."] ); - // create the html - w.setViewContent( createElements( text ) ); + // create the html + w.setViewContent( createElements( text ) ); - // the behaviour - w.elements.containerView.find( ".letter" ) - .mouseover( function() - { - var el = $( this ).next(); + // the behaviour + w.elements.containerView.find( ".letter" ) + .mouseover( function() + { + var el = $( this ).next(); - // determine new hover class - var is_fixed = ( el.get( 0 ).className.indexOf( "fixed" ) != -1 ); - var hover_class = is_fixed? - "dash_hover_fixed" : "dash_hover"; + // determine new hover class + var is_fixed = ( el.get( 0 ).className.indexOf( "fixed" ) != -1 ); + var hover_class = is_fixed? + "dash_hover_fixed" : "dash_hover"; - // assign new hover class - el.addClass( hover_class ) - .data( "hc", hover_class ); - }) - .mouseout( function() - { - var el = $( this ).next(); - // remove current hover class - var hc = el.data( "hc" ); - el.removeClass( hc ); - }) - .click( function() - { - var el = $( this ).next(); + // assign new hover class + el.addClass( hover_class ) + .data( "hc", hover_class ); + }) + .mouseout( function() + { + var el = $( this ).next(); + // remove current hover class + var hc = el.data( "hc" ); + el.removeClass( hc ); + }) + .click( function() + { + var el = $( this ).next(); - // remove current hover class - $( this ).trigger( "mouseout" ); + // remove current hover class + $( this ).trigger( "mouseout" ); - // toggle fixed class - el.toggleClass( "fixed" ); + // toggle fixed class + el.toggleClass( "fixed" ); - // determine new hover class - // assign new hover class - $( this ).trigger( "mouseover" ); + // determine new hover class + // assign new hover class + $( this ).trigger( "mouseover" ); - w.checkAnswer(); - w.adjustSize(); - }); + w.checkAnswer(); + w.adjustSize(); + }); - w.checkAnswer(); - }; + w.checkAnswer(); + }; - // viewSize - w.viewSize = function() - { - var w = 0; - var h = 0; + // viewSize + w.viewSize = function() + { + var w = 0; + var h = 0; - var dh = winstance.getData( "lineHeight" ); - var dw = winstance.getData( "dashWidth" ); + var dh = winstance.getData( "lineHeight" ); + var dw = winstance.getData( "dashWidth" ); - winstance.elements.containerView.find( "div:visible" ).each( function() - { - w += $( this ).outerWidth(); - h = Math.max( h, $( this ).outerHeight( true ) ); - }); + winstance.elements.containerView.find( "div:visible" ).each( function() + { + w += $( this ).outerWidth(); + h = Math.max( h, $( this ).outerHeight( true ) ); + }); - var square = w*h; - h = Math.max( h, $( winstance.elements.containerView ).height() ); + var square = w*h; + h = Math.max( h, $( winstance.elements.containerView ).height() ); - if( winstance.maxWidth ) - { - w = Math.min( w, winstance.maxWidth ); - h = parseInt( square / w ); - } + if( winstance.maxWidth ) + { + w = Math.min( w, winstance.maxWidth ); + h = parseInt( square / w ); + } - return { w: w, h: h+dh }; - }; + return { + w: w, + h: h+dh + }; + }; - // editSize - w.editSize = function() - { - return { - w: winstance.elements.containerEdit.find( "textarea" ).parent().outerWidth( true ), - h: winstance.elements.containerEdit.find( "textarea" ).parent().outerHeight( true ), - }; - }; + // editSize + w.editSize = function() + { + return { + w: winstance.elements.containerEdit.find( "textarea" ).parent().outerWidth( true ), + h: winstance.elements.containerEdit.find( "textarea" ).parent().outerHeight( true ), + }; + }; - w.checkAnswer = function() - { - var text = ""; - var ch = ""; - this.elements.containerView.find( "div:visible" ).each( function() - { - if( this.className.indexOf( "fixed" ) != -1 ){ - text += '.'; - } - else if( this.className.indexOf( "dash" ) != -1 ){ - return; - } - else{ - ch = $( this ).html(); - if( ch == " " ){ - ch = " "; - } - text += ch; - } - }); - - console.log( text ); + w.checkAnswer = function() + { + var text = ""; + var ch = ""; + this.elements.containerView.find( "div:visible" ).each( function() + { + if( this.className.indexOf( "fixed" ) != -1 ){ + text += '.'; + } + else if( this.className.indexOf( "dash" ) != -1 ){ + return; + } + else{ + ch = $( this ).html(); + if( ch == " " ){ + ch = " "; + } + text += ch; + } + }); - if( text == this.getData( "text" ) ){ - this.elements.containerView.addClass( "answerRight" ); - } - else{ - this.elements.containerView.removeClass( "answerRight" ); - } - }; + if( text == this.getData( "text" ) ){ + this.elements.containerView.addClass( "answerRight" ); + } + else{ + this.elements.containerView.removeClass( "answerRight" ); + } + }; - window.w = w; - window.winstance = w; + window.w = w; + window.winstance = w; - w.modeView(); + w.modeView(); + + $(window).mouseout(function(){ + if(window.sankore){ + sankore.setPreference("ordSplText", w.getData( "text" )); + } + }); }); \ No newline at end of file diff --git a/resources/library/sankoreInteractivities/spl-word.wgt/scripts/spl-word.js b/resources/library/sankoreInteractivities/spl-word.wgt/scripts/spl-word.js index b62ea90c..b4f49cd8 100644 --- a/resources/library/sankoreInteractivities/spl-word.wgt/scripts/spl-word.js +++ b/resources/library/sankoreInteractivities/spl-word.wgt/scripts/spl-word.js @@ -1,99 +1,113 @@ function createWord( word ) { - var s = ''; - for( var i = 0; i < word.length; i++ ) - { - ch = word.charAt( i ); - s += - '' + - '' + ch + '' + - (( i < word.length - 1 ) ? - '' : '' ) + - ''; - } - return s; + var s = ''; + for( var i = 0; i < word.length; i++ ) + { + ch = word.charAt( i ); + s += + '' + + '' + ch + '' + + (( i < word.length - 1 ) ? + '' : '' ) + + ''; + } + return s; } $(document).ready(function() { - var w = new wcontainer( "#ub-widget" ); + var w = new wcontainer( "#ub-widget" ); + var words = ""; + + if(window.sankore) + words = (sankore.preference("ordSplWords", ""))?sankore.preference("ordSplWords", ""):"so*phis*ti*ca*ted"; + else + words = "so*phis*ti*ca*ted"; + w.setEditContent( '
' ); + w.setViewContent( '' ); + w.setData( "dashWidth", w.elements.container.find( "span.dash" ).outerWidth() ); + w.setViewContent( "" ); - w.setEditContent( '
' ); - w.setViewContent( '' ); - w.setData( "dashWidth", w.elements.container.find( "span.dash" ).outerWidth() ); - w.setViewContent( "" ); - - // onViewMode - w.onViewMode = function() - { - var word = w.elements.container.find( "input" ).val().trim( ['*'] ); + // onViewMode + w.onViewMode = function() + { + var word = w.elements.container.find( "input" ).val().trim( ['*'] ); - w.setData( "word", word ); - word = word.replace( /\*/g, '' ); - w.setViewContent( createWord( word ) ); - w.elements.container.find( "span.upper" ).click( function(){ - $( this ).find( "span.dash" ).toggleClass( "fixed" ); - w.adjustSize(); - w.checkAnswer(); - }); - w.checkAnswer(); - }; + w.setData( "word", word ); + word = word.replace( /\*/g, '' ); + w.setViewContent( createWord( word ) ); + w.elements.container.find( "span.upper" ).click( function(){ + $( this ).find( "span.dash" ).toggleClass( "fixed" ); + w.adjustSize(); + w.checkAnswer(); + }); + w.checkAnswer(); + }; - // viewSize - w.viewSize = function() - { - var w = 0; - var h = 0; + // viewSize + w.viewSize = function() + { + var w = 0; + var h = 0; - winstance.elements.containerView.find( "span.upper span:visible" ).each( function() - { - w += $( this ).outerWidth(); - h = Math.max( h, $( this ).outerHeight() ); - }); - var dw = winstance.getData( "dashWidth" ); + winstance.elements.containerView.find( "span.upper span:visible" ).each( function() + { + w += $( this ).outerWidth(); + h = Math.max( h, $( this ).outerHeight() ); + }); + var dw = winstance.getData( "dashWidth" ); - return { w: w+dw, h: h }; - }; + return { + w: w+dw, + h: h + }; + }; - // editSize - w.editSize = function() - { - return { - w: winstance.elements.containerEdit.find( "input" ).outerWidth( true ), - h: winstance.elements.containerEdit.find( "input" ).outerHeight( true ), - }; - }; + // editSize + w.editSize = function() + { + return { + w: winstance.elements.containerEdit.find( "input" ).outerWidth( true ), + h: winstance.elements.containerEdit.find( "input" ).outerHeight( true ), + }; + }; - w.checkAnswer = function() - { - var word = ""; - this.elements.container.find( "span.upper span:visible" ).each( function() - { - if( this.className.indexOf( "fixed" ) != -1 ){ - word += '*'; - } - else if( this.className.indexOf( "dash" ) != -1 ){ - return; - } - else{ - word += $( this ).text(); - } - }); + w.checkAnswer = function() + { + var word = ""; + this.elements.container.find( "span.upper span:visible" ).each( function() + { + if( this.className.indexOf( "fixed" ) != -1 ){ + word += '*'; + } + else if( this.className.indexOf( "dash" ) != -1 ){ + return; + } + else{ + word += $( this ).text(); + } + }); - if( word == this.getData( "word" ) ){ - this.elements.container.addClass( "answerRight" ); - } - else{ - this.elements.container.removeClass( "answerRight" ); - } - }; + if( word == this.getData( "word" ) ){ + this.elements.container.addClass( "answerRight" ); + } + else{ + this.elements.container.removeClass( "answerRight" ); + } + }; - window.w = w; - window.winstance = w; + window.w = w; + window.winstance = w; - w.modeView(); + w.modeView(); + + $(window).mouseout(function(){ + if(window.sankore){ + sankore.setPreference("ordSplWords", w.getData("word")); + } + }); }); \ No newline at end of file diff --git a/resources/sankore.qrc b/resources/sankore.qrc index 4c7162ef..02e3c32e 100644 --- a/resources/sankore.qrc +++ b/resources/sankore.qrc @@ -319,7 +319,6 @@ images/pages_open.png images/cache_close.png images/cache_open.png - style.qss images/cache_circle.png images/cache_square.png images/down_arrow.png @@ -333,6 +332,8 @@ images/teacher_close.png images/teacher_open.png images/teacher_close_disabled.png + style.qss images/teacher_open_disabled.png + images/libpalette/WebSearchCategory.svg diff --git a/resources/style.qss b/resources/style.qss index 1c0ab3a3..8288ce28 100644 --- a/resources/style.qss +++ b/resources/style.qss @@ -1,13 +1,25 @@ QWidget#DockPaletteWidgetBox, QWidget#documentNavigator, -QWidget#UBLibraryWidget, QWidget#UBLibPathViewer, -QWidget#UBTeacherStudentAction +QWidget#UBTeacherStudentAction, +QWidget#UBLibNavigatorWidget, +QWidget#UBLibItemProperties { background: #EEEEEE; border-radius: 10px; border: 2px solid #999999; -/* padding-bottom: -2px; */ +} + +QWidget#UBLibWebView +{ + background: #EEEEEE; + border-radius : 10px; + border: 2px solid #999999; +} + +QWebView#SearchEngineView +{ + background:#EEEEEE; } QColorDialog @@ -121,8 +133,6 @@ QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical background:transparent; } - - QScrollBar::horizontal { background:transparent; @@ -166,7 +176,6 @@ QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal background:transparent; } - QSlider::handle::horizontal { background-color:#EEEEEE; diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index e0152975..2756f99a 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -106,6 +106,11 @@ UBBoardPaletteManager::~UBBoardPaletteManager() delete mpLibWidget; mpLibWidget = NULL; } + if(NULL != mpTeacherBarWidget) + { + delete mpTeacherBarWidget; + mpTeacherBarWidget = NULL; + } if(NULL != mpCachePropWidget) { delete mpCachePropWidget; @@ -163,20 +168,20 @@ void UBBoardPaletteManager::setupDockPaletteWidgets() mpPageNavigWidget = new UBPageNavigationWidget(); mpPageNavigWidget->registerMode(eUBDockPaletteWidget_BOARD); -// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpPageNavigWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); - +// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpPageNavigWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); + mpLibWidget = new UBLibWidget(); mpLibWidget ->registerMode(eUBDockPaletteWidget_BOARD); mpLibWidget ->registerMode(eUBDockPaletteWidget_DESKTOP); -// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpLibWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); +// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpLibWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); mpCachePropWidget = new UBCachePropertiesWidget(); mpCachePropWidget->registerMode(eUBDockPaletteWidget_BOARD); -// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpCachePropWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); +// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpCachePropWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); mpTeacherBarWidget = new UBTeacherBarWidget(); mpTeacherBarWidget->registerMode(eUBDockPaletteWidget_BOARD); -// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpTeacherBarWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); +// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpTeacherBarWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); //------------------------------------------------// // Add the dock palettes @@ -220,15 +225,38 @@ void UBBoardPaletteManager::setupDockPaletteWidgets() void UBBoardPaletteManager::slot_changeMainMode(UBApplicationController::MainMode mainMode) { +// Board = 0, Internet, Document, Tutorial, ParaschoolEditor, WebDocument + switch( mainMode ) { - case UBApplicationController::Board: - // call changeMode only when switch NOT from desktop mode - if(!UBApplication::applicationController->isShowingDesktop()) - changeMode(eUBDockPaletteWidget_BOARD); + case UBApplicationController::Board: + { + // call changeMode only when switch NOT from desktop mode + if(!UBApplication::applicationController->isShowingDesktop()) + changeMode(eUBDockPaletteWidget_BOARD); + } + break; + + case UBApplicationController::Tutorial: + { + if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) + mKeyboardPalette->hide(); + } + break; + + case UBApplicationController::Internet: + changeMode(eUBDockPaletteWidget_WEB); + break; + + case UBApplicationController::Document: + changeMode(eUBDockPaletteWidget_DOCUMENT); break; default: + { + if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) + mKeyboardPalette->hide(); + } break; } } @@ -236,8 +264,8 @@ void UBBoardPaletteManager::slot_changeMainMode(UBApplicationController::MainMod void UBBoardPaletteManager::slot_changeDesktopMode(bool isDesktop) { UBApplicationController::MainMode currMode = UBApplication::applicationController->displayMode(); - if(!isDesktop) - { + if(!isDesktop) + { switch( currMode ) { case UBApplicationController::Board: @@ -246,34 +274,34 @@ void UBBoardPaletteManager::slot_changeDesktopMode(bool isDesktop) default: break; - } - } + } + } else - changeMode(eUBDockPaletteWidget_DESKTOP); + changeMode(eUBDockPaletteWidget_DESKTOP); } void UBBoardPaletteManager::setupPalettes() { - setupDockPaletteWidgets(); - - - // Add the other palettes - mStylusPalette = new UBStylusPalette(mContainer, UBSettings::settings()->appToolBarOrientationVertical->get().toBool() ? Qt::Vertical : Qt::Horizontal); - connect(mStylusPalette, SIGNAL(stylusToolDoubleClicked(int)), UBApplication::boardController, SLOT(stylusToolDoubleClicked(int))); - mStylusPalette->show(); // always show stylus palette at startup - if (UBPlatformUtils::hasVirtualKeyboard()) { - mKeyboardPalette = UBKeyboardPalette::create(0); + mKeyboardPalette = new UBKeyboardPalette(0); #ifndef Q_WS_WIN connect(mKeyboardPalette, SIGNAL(closed()), mKeyboardPalette, SLOT(onDeactivated())); #endif #ifndef Q_WS_MAC - mKeyboardPalette->setParent(mContainer); + // mKeyboardPalette->setParent(mContainer); #endif } + setupDockPaletteWidgets(); + + + // Add the other palettes + mStylusPalette = new UBStylusPalette(mContainer, UBSettings::settings()->appToolBarOrientationVertical->get().toBool() ? Qt::Vertical : Qt::Horizontal); + connect(mStylusPalette, SIGNAL(stylusToolDoubleClicked(int)), UBApplication::boardController, SLOT(stylusToolDoubleClicked(int))); + mStylusPalette->show(); // always show stylus palette at startup + mZoomPalette = new UBZoomPalette(mContainer); QList backgroundsActions; @@ -483,7 +511,7 @@ void UBBoardPaletteManager::connectPalettes() } - +bool isFirstResized = true; void UBBoardPaletteManager::containerResized() { int innerMargin = UBSettings::boardMargin; @@ -493,25 +521,39 @@ void UBBoardPaletteManager::containerResized() int userTop = innerMargin; int userHeight = mContainer->height() - (2 * innerMargin); - mStylusPalette->move(userLeft, userTop); - mStylusPalette->adjustSizeAndPosition(); - mStylusPalette->initPosition(); + if(mStylusPalette) + { + mStylusPalette->move(userLeft, userTop); + mStylusPalette->adjustSizeAndPosition(); + mStylusPalette->initPosition(); + } + + if(mZoomPalette) + { + mZoomPalette->move(userLeft + userWidth - mZoomPalette->width() + , userTop + userHeight /*- mPageNumberPalette->height()*/ - innerMargin - mZoomPalette->height()); + mZoomPalette->adjustSizeAndPosition(); + } - mZoomPalette->move(userLeft + userWidth - mZoomPalette->width() - , userTop + userHeight /*- mPageNumberPalette->height()*/ - innerMargin - mZoomPalette->height()); - mZoomPalette->adjustSizeAndPosition(); + if (isFirstResized && mKeyboardPalette && mKeyboardPalette->parent() == UBApplication::boardController->controlContainer()) + { + isFirstResized = false; + mKeyboardPalette->move(userLeft + (userWidth - mKeyboardPalette->width())/2, + userTop + (userHeight - mKeyboardPalette->height())/2); + mKeyboardPalette->adjustSizeAndPosition(); + } - if (mKeyboardPalette) + if(mLeftPalette) { - mKeyboardPalette->move(userLeft + (userWidth - mKeyboardPalette->width())/2, - userTop + userHeight - mKeyboardPalette->height()); - mKeyboardPalette->adjustSizeAndPosition(); + mLeftPalette->resize(mLeftPalette->width()-1, mContainer->height()); + mLeftPalette->resize(mLeftPalette->width(), mContainer->height()); } - mLeftPalette->resize(mLeftPalette->width()-1, mContainer->height()); - mRightPalette->resize(mRightPalette->width()-1, mContainer->height()); - mLeftPalette->resize(mLeftPalette->width(), mContainer->height()); - mRightPalette->resize(mRightPalette->width(), mContainer->height()); + if(mRightPalette) + { + mRightPalette->resize(mRightPalette->width()-1, mContainer->height()); + mRightPalette->resize(mRightPalette->width(), mContainer->height()); + } } @@ -683,6 +725,18 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is { mLeftPalette->setParent(UBApplication::boardController->controlContainer()); mRightPalette->setParent(UBApplication::boardController->controlContainer()); + if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) + { + + if(mKeyboardPalette->m_isVisible) + { + mKeyboardPalette->hide(); + mKeyboardPalette->setParent(UBApplication::boardController->controlContainer()); + mKeyboardPalette->show(); + } + else + mKeyboardPalette->setParent(UBApplication::boardController->controlContainer()); + } mLeftPalette->setVisible(true); mRightPalette->setVisible(true); @@ -696,6 +750,18 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is { mLeftPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); mRightPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); + if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) + { + + if(mKeyboardPalette->m_isVisible) + { + mKeyboardPalette->hide(); + mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); + mKeyboardPalette->show(); + } + else + mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); + } mLeftPalette->setVisible(false); mRightPalette->setVisible(true); @@ -705,12 +771,46 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is } break; + case eUBDockPaletteWidget_WEB: + { + if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) + { + WBBrowserWindow* brWnd = UBApplication::webController->GetCurrentWebBrowser(); + + if(mKeyboardPalette->m_isVisible) + { + mKeyboardPalette->hide(); + mKeyboardPalette->setParent(brWnd); + mKeyboardPalette->show(); + } + else + mKeyboardPalette->setParent(brWnd); + } + + } + break; + default: { mLeftPalette->setVisible(false); mRightPalette->setVisible(false); mLeftPalette->setParent(0); mRightPalette->setParent(0); + if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) + { + + if(mKeyboardPalette->m_isVisible) + { + mKeyboardPalette->hide(); + mKeyboardPalette->setParent(0); + mKeyboardPalette->show(); + } + else + mKeyboardPalette->setParent(0); + +// mKeyboardPalette->update(); + + } } break; } @@ -899,4 +999,4 @@ void UBBoardPaletteManager::refreshPalettes() { mRightPalette->update(); mLeftPalette->update(); -} \ No newline at end of file +} diff --git a/src/board/UBBoardPaletteManager.h b/src/board/UBBoardPaletteManager.h index 5b3ee587..a151bab0 100644 --- a/src/board/UBBoardPaletteManager.h +++ b/src/board/UBBoardPaletteManager.h @@ -26,7 +26,6 @@ #include "gui/UBLibWidget.h" #include "gui/UBCachePropertiesWidget.h" #include "gui/UBTeacherBarWidget.h" - #include "core/UBApplicationController.h" diff --git a/src/board/UBLibraryController.cpp b/src/board/UBLibraryController.cpp index 1a4a42a1..d2d66716 100644 --- a/src/board/UBLibraryController.cpp +++ b/src/board/UBLibraryController.cpp @@ -222,7 +222,6 @@ QList UBLibraryController::rootCategoriesList() element->setMoveable(false); categories << element; - element = new UBLibElement(eUBLibElementType_Folder, mInteractiveUserDirectoryPath, tr("Applications", "Applications category element")); element->setThumbnail(QImage(":images/libpalette/ApplicationsCategory.svg")); element->setMoveable(false); @@ -239,11 +238,20 @@ QList UBLibraryController::rootCategoriesList() element->setMoveable(false); categories << element; +// Note : FEATURE IN DEVELOPMENT, DO NOT ERASE (or you will get problems) !!!! +// mSearchCategoryPath = QUrl::fromLocalFile(UBSettings::settings()->uniboardSearchDirectory()); +// element = new UBLibElement(eUBLibElementType_Folder, mSearchCategoryPath, tr("Web Search", "Web search category element")); +// element->setThumbnail(QImage(":images/libpalette/WebSearchCategory.svg")); +// element->setMoveable(false); +// categories << element; + element = new UBLibElement(eUBLibElementType_Folder, mAnimationUserDirectoryPath, tr("Animations", "Animations category element")); element->setThumbnail(QImage(":images/libpalette/FlashCategory.svg")); element->setMoveable(false); categories << element; + + categories << UBLibElement::trashElement(); return categories; @@ -759,6 +767,31 @@ void UBChainedLibElement::setNextElement(UBChainedLibElement *nextElem) mpNextElem = nextElem; } +UBChainedLibElement* UBChainedLibElement::lastElement() +{ + UBChainedLibElement* pElem = NULL; + + if(NULL != mpNextElem) + { + UBChainedLibElement* pLast = mpNextElem->lastElement(); + if(NULL != pLast) + { + pElem = pLast; + } + else + { + pElem = mpNextElem; + } + } + + return pElem; +} + +QUrl UBChainedLibElement::lastItemPath() +{ + return lastElement()->element()->path(); +} + UBLibElement* UBLibElement::trashElement() { UBLibElement *trashElement; diff --git a/src/board/UBLibraryController.h b/src/board/UBLibraryController.h index 009114ef..9903260d 100644 --- a/src/board/UBLibraryController.h +++ b/src/board/UBLibraryController.h @@ -82,8 +82,10 @@ public: ~UBChainedLibElement(); UBChainedLibElement* nextElement(){return mpNextElem;} + UBChainedLibElement* lastElement(); void setNextElement(UBChainedLibElement* nextElem); UBLibElement* element(){return mpElem;} + QUrl lastItemPath(); private: UBLibElement* mpElem; @@ -160,6 +162,7 @@ class UBLibraryController : public QObject QUrl mInteractiveUserDirectoryPath; QUrl mInteractiveCategoryPath; QUrl mAnimationUserDirectoryPath; + QUrl mSearchCategoryPath; QStringList addItemsToCurrentLibrary(const QDir& pSelectedFolder, const QStringList& pExtensions); diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index b3560186..efece366 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -368,6 +368,8 @@ void UBApplicationController::showInternet() if (UBSettings::settings()->webUseExternalBrowser->get().toBool()) { showDesktop(true); + UBApplication::webController->show(UBWebController::WebBrowser); + // really no have emit mainModeChanged here ? potential problem with virtual keyboard ? } else { @@ -382,10 +384,11 @@ void UBApplicationController::showInternet() mMainWindow->show(); mUninoteController->hideWindow(); + + UBApplication::webController->show(UBWebController::WebBrowser); + emit mainModeChanged(Internet); } - - UBApplication::webController->show(UBWebController::WebBrowser); } @@ -563,9 +566,7 @@ void UBApplicationController::downloadJsonFinished(QString currentJson) } else { if (isNoUpdateDisplayed) { - QMessageBox msgBox; - msgBox.setText (tr ("No update available")); - msgBox.exec(); + mMainWindow->information(tr("Update"), tr("No update available")); } } } diff --git a/src/core/UBPersistenceManager.cpp b/src/core/UBPersistenceManager.cpp index 5e3449f5..8c2f3f95 100644 --- a/src/core/UBPersistenceManager.cpp +++ b/src/core/UBPersistenceManager.cpp @@ -14,6 +14,7 @@ */ #include "UBPersistenceManager.h" +#include "gui/UBMainWindow.h" #include @@ -1005,11 +1006,7 @@ void UBPersistenceManager::checkIfDocumentRepositoryExists() QString humanPath = QDir::cleanPath(mDocumentRepositoryPath); humanPath = QDir::toNativeSeparators(humanPath); - QMessageBox::question( - QApplication::activeWindow(), - tr("Document Repository Loss"), - tr("Sankore 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.").arg(humanPath), - QMessageBox::Yes); + UBApplication::mainWindow->warning(tr("Document Repository Loss"),tr("Sankore 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.").arg(humanPath)); UBApplication::quit(); } diff --git a/src/core/UBPersistenceManager.h b/src/core/UBPersistenceManager.h index 3c224f04..98a296f6 100644 --- a/src/core/UBPersistenceManager.h +++ b/src/core/UBPersistenceManager.h @@ -74,8 +74,8 @@ class UBPersistenceManager : public QObject virtual void persistDocumentScene(UBDocumentProxy* pDocumentProxy, UBGraphicsScene* pScene, const int pSceneIndex); - virtual void persistTeacherBar(UBDocumentProxy* pDocumentProxy, int page, sTeacherBarInfos infos); + sTeacherBarInfos getTeacherBarInfos(UBDocumentProxy* pDocumentProxy, int page); virtual UBGraphicsScene* createDocumentSceneAt(UBDocumentProxy* pDocumentProxy, int index); diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index 68fa5c88..54631f21 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -1020,6 +1020,15 @@ QString UBSettings::uniboardGipLibraryDirectory() return dirPath; } +QString UBSettings::uniboardSearchDirectory() +{ + QString dirPath = UBPlatformUtils::applicationResourcesDirectory() + "/library/search"; + if (!QDir(dirPath).exists()) + QDir().mkpath(dirPath); + + return dirPath; +} + QString UBSettings::uniboardImageLibraryDirectory() { QString defaultRelativePath = QString("./library/image"); diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h index 8c1d2d60..f1e1a938 100644 --- a/src/core/UBSettings.h +++ b/src/core/UBSettings.h @@ -112,6 +112,7 @@ class UBSettings : public QObject QString uniboardImageLibraryDirectory(); QString uniboardUserImageDirectory(); QString defaultUserImagesDirectory(); + QString uniboardSearchDirectory(); QString uniboardUserVideoDirectory(); QString uniboardDefaultUserImageLibraryDirectory(); diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index a4b9c92d..9bf8a694 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -52,7 +52,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) , mTransparentDrawingView(0) , mTransparentDrawingScene(0) , mDesktopPalette(NULL) - , mKeyboardPalette(0) +// , mKeyboardPalette(0) , mDesktopPenPalette(NULL) , mDesktopMarkerPalette(NULL) , mDesktopEraserPalette(NULL) @@ -64,7 +64,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) , mPendingMarkerButtonPressed(false) , mPendingEraserButtonPressed(false) , mbArrowClicked(false) - , mBoardStylusTool(UBStylusTool::Pen) + , mBoardStylusTool(UBStylusTool::Selector /*UBStylusTool::Pen*/) , mDesktopStylusTool(UBStylusTool::Selector) { @@ -101,10 +101,15 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) connect(mTransparentDrawingView, SIGNAL(hidden()), mKeyboardPalette, SLOT(hide())); connect(mTransparentDrawingView, SIGNAL(shown()), this, SLOT(showKeyboard())); #else - mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView); - mKeyboardPalette->setParent(mTransparentDrawingView); +// mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView); +// mKeyboardPalette->setParent(mTransparentDrawingView); #endif - connect(mKeyboardPalette, SIGNAL(keyboardActivated(bool)), mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool))); + connect( UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(keyboardActivated(bool)), + mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool))); + +// connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), +// mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool))); + #ifdef Q_WS_X11 connect(mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask())); connect(mDesktopPalette,SIGNAL(refreshMask()), this, SLOT(refreshMask())); @@ -117,7 +122,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture())); connect(mDesktopPalette, SIGNAL(maximized()), this, SLOT(onDesktopPaletteMaximized())); connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(onDesktopPaletteMinimize())); - connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool))); +// connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool))); connect(mTransparentDrawingView, SIGNAL(resized(QResizeEvent*)), this, SLOT(onTransparentWidgetResized())); @@ -164,31 +169,32 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) onDesktopPaletteMaximized(); } -void UBDesktopAnnotationController::showKeyboard(bool show) -{ - #ifdef Q_WS_X11 - if (!mTransparentDrawingView->isVisible()) - return; - #endif - - if(mKeyboardPalette) - { - if(show) - UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); - mKeyboardPalette->setVisible(show); - - #ifdef Q_WS_X11 - updateMask(true); - #endif - - } - -} -void UBDesktopAnnotationController::showKeyboard() -{ - if (UBApplication::mainWindow->actionVirtualKeyboard->isChecked()) - mKeyboardPalette->show(); -} +// void UBDesktopAnnotationController::showKeyboard(bool show) +// { +// #ifdef Q_WS_X11 +// if (!mTransparentDrawingView->isVisible()) +// return; +// #endif +// +// if(mKeyboardPalette) +// { +// if(show) +// UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); +// mKeyboardPalette->setVisible(show); +// +// #ifdef Q_WS_X11 +// updateMask(true); +// #endif +// +// } +// +// } + +// void UBDesktopAnnotationController::showKeyboard() +// { +// if (UBApplication::mainWindow->actionVirtualKeyboard->isChecked()) +// mKeyboardPalette->show(); +// } UBDesktopAnnotationController::~UBDesktopAnnotationController() { @@ -366,12 +372,12 @@ void UBDesktopAnnotationController::close() void UBDesktopAnnotationController::stylusToolChanged(int tool) { - UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool; - if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text) - { - if(mKeyboardPalette->m_isVisible) - UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger); - } +// UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool; +// if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text) +// { +// if(mKeyboardPalette->m_isVisible) +// UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger); +// } updateBackground(); } @@ -910,15 +916,15 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent) { p.drawRect(mDesktopPalette->geometry().x(), mDesktopPalette->geometry().y(), mDesktopPalette->width(), mDesktopPalette->height()); } - if(mKeyboardPalette->isVisible()) + if(UBApplication::boardController->paletteManager()->mKeyboardPalette->isVisible()) { - p.drawRect(mKeyboardPalette->geometry().x(), mKeyboardPalette->geometry().y(), mKeyboardPalette->width(), mKeyboardPalette->height()); + p.drawRect(UBApplication::boardController->paletteManager()->mKeyboardPalette->geometry().x(), UBApplication::boardController->paletteManager()->mKeyboardPalette->geometry().y(), + UBApplication::boardController->paletteManager()->mKeyboardPalette->width(), UBApplication::boardController->paletteManager()->mKeyboardPalette->height()); } // UBApplication::boardController->paletteManager()->mDesktopRightPalette if(UBApplication::boardController->paletteManager()->rightPalette()->isVisible()) { - qDebug() << ">>>>>> Drawing the mask for the right palette"; p.drawRect(UBApplication::boardController->paletteManager()->rightPalette()->geometry().x(), UBApplication::boardController->paletteManager()->rightPalette()->geometry().y(), UBApplication::boardController->paletteManager()->rightPalette()->width(), @@ -979,4 +985,4 @@ void UBDesktopAnnotationController::refreshMask() { updateMask(true); } -} +} \ No newline at end of file diff --git a/src/desktop/UBDesktopAnnotationController.h b/src/desktop/UBDesktopAnnotationController.h index b3a9e37f..924156b0 100644 --- a/src/desktop/UBDesktopAnnotationController.h +++ b/src/desktop/UBDesktopAnnotationController.h @@ -29,7 +29,7 @@ class UBDesktopPenPalette; class UBDesktopMarkerPalette; class UBDesktopEraserPalette; class UBActionPalette; -class UBKeyboardPalette; +//class UBKeyboardPalette; class UBMainWindow; #define PROPERTY_PALETTE_TIMER 1000 @@ -72,8 +72,8 @@ class UBDesktopAnnotationController : public QObject void stylusToolChanged(int tool); void updateBackground(); - void showKeyboard(bool show); - void showKeyboard(); //X11 virtual keyboard working only needed +// void showKeyboard(bool show); +// void showKeyboard(); //X11 virtual keyboard working only needed signals: /** @@ -118,7 +118,7 @@ class UBDesktopAnnotationController : public QObject void updateMask(bool bTransparent); UBDesktopPalette *mDesktopPalette; - UBKeyboardPalette *mKeyboardPalette; + //UBKeyboardPalette *mKeyboardPalette; UBDesktopPenPalette* mDesktopPenPalette; UBDesktopMarkerPalette* mDesktopMarkerPalette; UBDesktopEraserPalette* mDesktopEraserPalette; diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index b2cd201b..dd014988 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -38,7 +38,7 @@ #include "board/UBBoardPaletteManager.h" #include "board/UBDrawingController.h" -#include "gui/UBKeyboardPalette.h" +//#include "gui/UBKeyboardPalette.h" #include "gui/UBThumbnailView.h" #include "gui/UBDocumentTreeWidget.h" @@ -70,7 +70,7 @@ UBDocumentController::UBDocumentController(UBMainWindow* mainWindow) , mToolsPalette(0) , mToolsPalettePositionned(false) , mTrashTi(0) - , mKeyboardPalette(0) +// , mKeyboardPalette(0) { setupViews(); setupToolbar(); @@ -444,12 +444,12 @@ void UBDocumentController::setupViews() mMessageWindow = new UBMessageWindow(mDocumentUI->thumbnailWidget); mMessageWindow->hide(); - if (UBPlatformUtils::hasVirtualKeyboard()) - { - mKeyboardPalette = UBKeyboardPalette::create(0); - mKeyboardPalette->setParent(controlView()); - connect(mMainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool))); - } +// if (UBPlatformUtils::hasVirtualKeyboard()) +// { +// mKeyboardPalette = UBKeyboardPalette::create(0); +// mKeyboardPalette->setParent(controlView()); +// connect(mMainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool))); +// } } } @@ -467,6 +467,7 @@ void UBDocumentController::setupToolbar() connect(mMainWindow->actionDocumentTools, SIGNAL(triggered()), this, SLOT(toggleDocumentToolsPalette())); } +/* void UBDocumentController::showKeyboard(bool show) { if(mKeyboardPalette) @@ -477,6 +478,7 @@ void UBDocumentController::showKeyboard(bool show) } } +*/ void UBDocumentController::setupPalettes() { diff --git a/src/document/UBDocumentController.h b/src/document/UBDocumentController.h index 4e9b3d31..4baf8b36 100644 --- a/src/document/UBDocumentController.h +++ b/src/document/UBDocumentController.h @@ -34,7 +34,7 @@ class UBDocumentGroupTreeItem; class UBDocumentProxyTreeItem; class UBMainWindow; class UBDocumentToolsPalette; -class UBKeyboardPalette; +//class UBKeyboardPalette; class UBDocumentController : public QObject { @@ -76,7 +76,7 @@ class UBDocumentController : public QObject void paste(); void focusChanged(QWidget *old, QWidget *current); - void showKeyboard(bool show); +// void showKeyboard(bool show); protected: virtual void setupViews(); @@ -112,7 +112,7 @@ class UBDocumentController : public QObject UBDocumentGroupTreeItem* mTrashTi; UBDocumentProxy* mCurrentDocument; - UBKeyboardPalette *mKeyboardPalette; +// UBKeyboardPalette *mKeyboardPalette; private slots: diff --git a/src/domain/UBGraphicsItemDelegate.cpp b/src/domain/UBGraphicsItemDelegate.cpp index 00f1f200..ea5d792c 100644 --- a/src/domain/UBGraphicsItemDelegate.cpp +++ b/src/domain/UBGraphicsItemDelegate.cpp @@ -193,6 +193,7 @@ bool UBGraphicsItemDelegate::mouseMoveEvent(QGraphicsSceneMouseEvent *event) bool UBGraphicsItemDelegate::weelEvent(QGraphicsSceneWheelEvent *event) { + Q_UNUSED(event); if( mDelegated->isSelected() ) { // event->accept(); diff --git a/src/frameworks/UBFileSystemUtils.cpp b/src/frameworks/UBFileSystemUtils.cpp index cd789784..1c315dfe 100644 --- a/src/frameworks/UBFileSystemUtils.cpp +++ b/src/frameworks/UBFileSystemUtils.cpp @@ -334,7 +334,7 @@ QString UBFileSystemUtils::mimeTypeFromFileName(const QString& fileName) { QString ext = extension(fileName); - if (ext == "xls" || ext == "xlsx") return "application/msexcel"; + if (ext == "xls" || ext == "xlsx") return "application/msexcel"; if (ext == "ppt" || ext == "pptx") return "application/mspowerpoint"; if (ext == "ief") return "image/ief"; if (ext == "m3u") return "audio/x-mpegurl"; @@ -396,6 +396,7 @@ QString UBFileSystemUtils::mimeTypeFromFileName(const QString& fileName) if (ext == "m4v") return "video/x-m4v"; // W3C widget if (ext == "wgt") return "application/widget"; + if (ext == "wgs") return "application/search"; // Apple widget if (ext == "wdgt") return "application/vnd.apple-widget"; //mime type invented by us :-( if (ext == "swf") return "application/x-shockwave-flash"; diff --git a/src/gui/UBCachePropertiesWidget.cpp b/src/gui/UBCachePropertiesWidget.cpp index 0d415674..7deb5232 100644 --- a/src/gui/UBCachePropertiesWidget.cpp +++ b/src/gui/UBCachePropertiesWidget.cpp @@ -92,7 +92,7 @@ UBCachePropertiesWidget::UBCachePropertiesWidget(QWidget *parent, const char *na mpSizeLabel = new QLabel(tr("Size:"), mpProperties); mpSizeSlider = new QSlider(Qt::Horizontal, mpProperties); mpSizeSlider->setMinimumHeight(20); - mpSizeSlider->setMinimum(0); + mpSizeSlider->setMinimum(50); mpSizeSlider->setMaximum(MAX_SHAPE_WIDTH); mpSizeLayout->addWidget(mpSizeLabel, 0); mpSizeLayout->addWidget(mpSizeSlider, 1); @@ -205,16 +205,21 @@ UBCachePropertiesWidget::~UBCachePropertiesWidget() void UBCachePropertiesWidget::onCloseClicked() { - // Remove the current cache from the list - mCaches.remove(mCaches.indexOf(mpCurrentCache)); + if(!mCaches.empty()) + { + // Remove the current cache from the list + mCaches.remove(mCaches.indexOf(mpCurrentCache)); - // Remove the cache from the board - UBApplication::boardController->activeScene()->removeItem(mpCurrentCache); - mpCurrentCache = NULL; + // Remove the cache from the board + UBApplication::boardController->activeScene()->removeItem(mpCurrentCache); + mpCurrentCache = NULL; - if(mCaches.empty()) - { - emit cacheListEmpty(); + if(mCaches.empty()) + { + emit cacheListEmpty(); + } + + emit hideTab(name()); } } @@ -321,8 +326,8 @@ void UBCachePropertiesWidget::updateCurrentCache() // If we fall here, that means: // 1 - that this page has no cache - // 2 - we do not on Board page - // 3 - we in board mode, but show desktop (as really - desktop mode) + // 2 - we are not in Board mode + // 3 - we are in Board mode, but show desktop (as really - Desktop mode) emit hideTab(name()); mpCurrentCache = NULL; setDisabled(true); @@ -340,4 +345,4 @@ void UBCachePropertiesWidget::onCacheEnabled() { emit showTab(name()); } - \ No newline at end of file + diff --git a/src/gui/UBDocumentNavigator.cpp b/src/gui/UBDocumentNavigator.cpp index 74bd3611..371cdbd5 100644 --- a/src/gui/UBDocumentNavigator.cpp +++ b/src/gui/UBDocumentNavigator.cpp @@ -141,7 +141,10 @@ void UBDocumentNavigator::updateSpecificThumbnail(int iPage) { // Save the current state of the scene pScene->setModified(true); - UBSvgSubsetAdaptor::persistScene(mCrntDoc,pScene, iPage); + if(UBApplication::boardController) + { + UBApplication::boardController->persistCurrentScene(); + } UBThumbnailAdaptor::persistScene(mCrntDoc->persistencePath(), pScene, iPage); diff --git a/src/gui/UBKeyboardPalette.cpp b/src/gui/UBKeyboardPalette.cpp index cf4f3b85..9c76cc9b 100644 --- a/src/gui/UBKeyboardPalette.cpp +++ b/src/gui/UBKeyboardPalette.cpp @@ -27,6 +27,9 @@ UBKeyboardPalette::UBKeyboardPalette(QWidget *parent) : UBActionPalette(Qt::TopRightCorner, parent) { + + // setWindowFlags(/*Qt::CustomizeWindowHint|*/Qt::WindowStaysOnTopHint|Qt::FramelessWindowHint); + setCustomCloseProcessing(true); setCustomPosition(true); setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); @@ -56,57 +59,25 @@ UBKeyboardPalette::UBKeyboardPalette(QWidget *parent) setContentsMargins( 22, 22, 22, 22 ); - connect(this, SIGNAL(keyboardActivated(bool)), this, SLOT(onActivated(bool))); + init(); } -QList UBKeyboardPalette::instances; -UBKeyboardPalette* UBKeyboardPalette::create(QWidget *parent) +//QList UBKeyboardPalette::instances; +void UBKeyboardPalette::init() { - //------------------------------// - - if (!UBPlatformUtils::hasVirtualKeyboard()) - return NULL; - - //------------------------------// - - UBKeyboardPalette* firstKeyboard = NULL; - // if we already have keyboards inside, get it position and show/hide status, for new keyboard - if(instances.size() > 0) - firstKeyboard = instances.at(0); - - //------------------------------// + m_isVisible = false; + setVisible(false); - UBKeyboardPalette* instance = new UBKeyboardPalette(parent); - instance->setKeyButtonSize(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize->get().toString()); + setKeyButtonSize(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize->get().toString()); - instance->m_isVisible = firstKeyboard ? firstKeyboard->m_isVisible : false; - instance->setVisible(instance->m_isVisible); - - if( firstKeyboard ) - instance->move(firstKeyboard->m_pos); - - connect(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize, SIGNAL(changed(QVariant)), instance, SLOT(keyboardPaletteButtonSizeChanged(QVariant))); - connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), instance, SLOT(showKeyboard(bool))); -// connect(instance, SIGNAL(moved(const QPoint&)), instance, SLOT(syncPosition(const QPoint&))); - connect(instance, SIGNAL(closed()), instance, SLOT(hideKeyboard())); - - //------------------------------// - - instances.append(instance); - foreach(UBKeyboardPalette* inst, instances) - { - connect(inst, SIGNAL(moved(const QPoint&)), instance, SLOT(syncPosition(const QPoint&))); - connect(instance, SIGNAL(moved(const QPoint&)), inst, SLOT(syncPosition(const QPoint&))); - - connect(inst, SIGNAL(localeChanged(int)), instance, SLOT(syncLocale(int))); - connect(instance, SIGNAL(localeChanged(int)), inst, SLOT(syncLocale(int))); - -// connect(instance, SIGNAL(closed()), inst, ) - } + connect(this, SIGNAL(keyboardActivated(bool)), this, SLOT(onActivated(bool))); + connect(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize, SIGNAL(changed(QVariant)), this, SLOT(keyboardPaletteButtonSizeChanged(QVariant))); + connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool))); + connect(this, SIGNAL(closed()), this, SLOT(hideKeyboard())); //------------------------------// - return instance; + UBPlatformUtils::setWindowNonActivableFlag(this, true); } void UBKeyboardPalette::showKeyboard(bool show) diff --git a/src/gui/UBKeyboardPalette.h b/src/gui/UBKeyboardPalette.h index 68a0a7e9..c7077fe2 100644 --- a/src/gui/UBKeyboardPalette.h +++ b/src/gui/UBKeyboardPalette.h @@ -67,6 +67,7 @@ friend class UBCapsLockButton; friend class UBLocaleButton; public: + UBKeyboardPalette(QWidget *parent); ~UBKeyboardPalette(); BTNImages *currBtnImages; @@ -77,8 +78,6 @@ public: QString getKeyButtonSize() const {QString res; res.sprintf("%dx%d", btnWidth, btnHeight); return res;} void setKeyButtonSize(const QString& strSize); - static UBKeyboardPalette* create(QWidget *parent); - static QList instances; bool m_isVisible; QPoint m_pos; @@ -119,10 +118,10 @@ protected: void setLocale(int nLocale); const QString* getLocaleName(); - -private: - UBKeyboardPalette(QWidget *parent); + void init(); + +private: QRect originalRect; diff --git a/src/gui/UBLibItemProperties.cpp b/src/gui/UBLibItemProperties.cpp index 1b47fbef..a8cb3cb0 100644 --- a/src/gui/UBLibItemProperties.cpp +++ b/src/gui/UBLibItemProperties.cpp @@ -38,38 +38,16 @@ UBLibItemProperties::UBLibItemProperties(QWidget *parent, const char *name):QWid , mpThumbnail(NULL) , mpOrigPixmap(NULL) , mpElement(NULL) - , mpNavigBar(NULL) - , mpNavigLayout(NULL) - , mpNavigBack(NULL) - , mpNavigBackAction(NULL) { setObjectName(name); + setAttribute(Qt::WA_StyledBackground, true); + setStyleSheet(UBApplication::globalStyleSheet()); + // Create the GUI mpLayout = new QVBoxLayout(this); setLayout(mpLayout); - mpNavigBar = new QWidget(this); - mpNavigLayout = new QHBoxLayout(mpNavigBar); - mpNavigBar->setLayout(mpNavigLayout); - mpNavigBar->setStyleSheet(QString("background-color : white; border-radius : 10px;")); - mpNavigBar->setMaximumHeight(42); - mpNavigBackAction = new QAction(QIcon(":/images/libpalette/back.png"), tr("Back"), mpNavigBar); - mpNavigBack = new QToolButton(mpNavigBar); - mpNavigBar->addAction(mpNavigBackAction); - mpNavigBack->setDefaultAction(mpNavigBackAction); - mpNavigBack->setIconSize(QSize(32,32)); - mpNavigBack->setToolButtonStyle(Qt::ToolButtonIconOnly); - mpNavigBack->setStyleSheet(QString("QToolButton {color: white; font-weight: bold; font-family: Arial; background-color: transparent; border: none}")); - mpNavigBack->setFocusPolicy(Qt::NoFocus); - - mpNavigLayout->addWidget(mpNavigBack, 0); - connect(mpNavigBackAction, SIGNAL(triggered()), this, SLOT(onBack())); - - mpNavigLayout->addStretch(1); - - mpLayout->addWidget(mpNavigBar); - maxThumbHeight = height() / 4; mpThumbnail = new QLabel(); @@ -77,7 +55,8 @@ UBLibItemProperties::UBLibItemProperties(QWidget *parent, const char *name):QWid icon.scaledToWidth(THUMBNAIL_WIDTH); mpThumbnail->setPixmap(icon); - mpThumbnail->setStyleSheet(QString("background-color : white; padding : 10 px; border-radius : 10px;")); + mpThumbnail->setObjectName("DockPaletteWidgetBox"); + mpThumbnail->setStyleSheet("background:white;"); mpThumbnail->setAlignment(Qt::AlignHCenter); mpLayout->addWidget(mpThumbnail, 0); @@ -104,7 +83,8 @@ UBLibItemProperties::UBLibItemProperties(QWidget *parent, const char *name):QWid mpObjInfos = new QTextEdit(this); mpObjInfos->setReadOnly(true); - mpObjInfos->setStyleSheet(QString("background-color: white; border-radius : 10px;")); + mpObjInfos->setObjectName("DockPaletteWidgetBox"); + mpObjInfos->setStyleSheet("background:white;"); mpLayout->addWidget(mpObjInfos, 1); connect(mpAddPageButton, SIGNAL(clicked()), this, SLOT(onAddToPage())); @@ -118,26 +98,6 @@ UBLibItemProperties::UBLibItemProperties(QWidget *parent, const char *name):QWid */ UBLibItemProperties::~UBLibItemProperties() { - if(NULL != mpNavigBackAction) - { - delete mpNavigBackAction; - mpNavigBackAction = NULL; - } - if(NULL != mpNavigBack) - { - delete mpNavigBack; - mpNavigBack = NULL; - } - if(NULL != mpNavigLayout) - { - delete mpNavigLayout; - mpNavigLayout = NULL; - } - if(NULL != mpNavigBar) - { - delete mpNavigLayout; - mpNavigLayout = NULL; - } if(NULL != mpOrigPixmap) { delete mpOrigPixmap; @@ -148,11 +108,6 @@ UBLibItemProperties::~UBLibItemProperties() delete mpLayout; mpLayout = NULL; } - //if(NULL != mpButtonLayout) - //{ - // delete mpButtonLayout; - // mpButtonLayout = NULL; - //} if(NULL != mpSetAsBackgroundButton) { delete mpSetAsBackgroundButton; @@ -211,10 +166,6 @@ void UBLibItemProperties::adaptSize() mpThumbnail->setPixmap(mpOrigPixmap->scaledToWidth(THUMBNAIL_WIDTH)); } } - if(NULL != mpNavigBar) - { - mpNavigBar->resize(width(), mpNavigBar->height()); - } } /** diff --git a/src/gui/UBLibItemProperties.h b/src/gui/UBLibItemProperties.h index 1490002b..3ec7976b 100644 --- a/src/gui/UBLibItemProperties.h +++ b/src/gui/UBLibItemProperties.h @@ -73,12 +73,6 @@ private: QPixmap* mpOrigPixmap; int maxThumbHeight; UBLibElement* mpElement; - - // Navigation bar - QWidget* mpNavigBar; - QHBoxLayout* mpNavigLayout; - QToolButton* mpNavigBack; - QAction* mpNavigBackAction; }; diff --git a/src/gui/UBLibNavigatorWidget.cpp b/src/gui/UBLibNavigatorWidget.cpp index ef4109ef..f65c97f8 100644 --- a/src/gui/UBLibNavigatorWidget.cpp +++ b/src/gui/UBLibNavigatorWidget.cpp @@ -15,6 +15,7 @@ #include "UBLibNavigatorWidget.h" #include "UBLibWidget.h" +#include "core/UBApplication.h" #include "core/memcheck.h" static int lowBoundForSlider = 40; @@ -29,22 +30,20 @@ static int tickIntervalForSlider = 10; UBLibNavigatorWidget::UBLibNavigatorWidget(QWidget *parent, const char *name):QWidget(parent) , mLayout(NULL) , mLibWidget(NULL) - , mPathViewer(NULL) , mSlider(NULL) , mSliderWidthSetting(NULL) { setObjectName(name); + + setAttribute(Qt::WA_StyledBackground, true); + setStyleSheet(UBApplication::globalStyleSheet()); + setAcceptDrops(true); UBLibWidget* libWidget = dynamic_cast(parentWidget()); - mLayout = new QVBoxLayout(this); setLayout(mLayout); - mPathViewer = new UBLibPathViewer(this); - mPathViewer->setMaximumHeight(62); - mLayout->addWidget(mPathViewer, 0); - mLibWidget = new UBLibraryWidget(this); mLayout->addWidget(mLibWidget, 1); @@ -56,27 +55,25 @@ UBLibNavigatorWidget::UBLibNavigatorWidget(QWidget *parent, const char *name):QW mSlider->setValue(defaultWidth); mSlider->setTickInterval(tickIntervalForSlider); mLayout->addWidget(mSlider, 0); - mLibWidget->updateThumbnailsSize(defaultWidth); connect(mLibWidget, SIGNAL(navigBarUpdate(UBLibElement*)), this, SLOT(onNavigbarUpate(UBLibElement*))); - connect(mLibWidget, SIGNAL(propertiesRequested(UBLibElement*)), this, SLOT(onPropertiesRequested(UBLibElement*))); - connect(mPathViewer, SIGNAL(mouseClick(UBChainedLibElement*)), this, SLOT(onPathItemClicked(UBChainedLibElement*))); - connect(mSlider,SIGNAL(valueChanged(int)),this,SLOT(updateThumbnailsSize(int))); - connect(mPathViewer, SIGNAL(elementsDropped(QList,UBLibElement*)), mLibWidget, SLOT(onElementsDropped(QList,UBLibElement*))); + connect(this, SIGNAL(updateNavigBar(UBChainedLibElement*)), libWidget, SLOT(onUpdateNavigBar(UBChainedLibElement*))); + mLibWidget->updateThumbnailsSize(defaultWidth); + connect(mLibWidget, SIGNAL(propertiesRequested(UBLibElement*)), this, SLOT(onPropertiesRequested(UBLibElement*))); + connect(mLibWidget, SIGNAL(displaySearchEngine(UBLibElement*)), this, SLOT(onDisplaySearchEngine(UBLibElement*))); + connect(mSlider,SIGNAL(valueChanged(int)),this,SLOT(updateThumbnailsSize(int))); + connect(libWidget->pathViewer(), SIGNAL(mouseClick(UBChainedLibElement*)), this, SLOT(onPathItemClicked(UBChainedLibElement*))); + connect(libWidget->pathViewer(), SIGNAL(elementsDropped(QList,UBLibElement*)), mLibWidget, SLOT(onElementsDropped(QList,UBLibElement*))); connect(mLibWidget, SIGNAL(navigBarUpdate(UBLibElement*)), libWidget->actionBar(), SLOT(onNavigbarUpdate(UBLibElement*))); connect(mLibWidget, SIGNAL(itemsSelected(QList, bool)), libWidget->actionBar(), SLOT(onSelectionChanged(QList, bool))); connect(libWidget->actionBar(), SIGNAL(deleteDone()), mLibWidget, SLOT(onRefreshCurrentFolder())); connect(mLibWidget, SIGNAL(favoritesEntered(bool)), libWidget->actionBar(), SLOT(onFavoritesEntered(bool))); connect(libWidget->actionBar(), SIGNAL(searchElement(QString)), mLibWidget, SLOT(onSearchElement(QString))); connect(libWidget->actionBar(), SIGNAL(newFolderToCreate()), mLibWidget, SLOT(onNewFolderToCreate())); - - - /*** to update the search bar **/ connect(mLibWidget, SIGNAL(itemClicked()),libWidget->actionBar(), SLOT(onItemChanged())); - connect(mPathViewer, SIGNAL(mouseClick(UBChainedLibElement*)),libWidget->actionBar(), SLOT(onItemChanged())); - + connect(libWidget->pathViewer(), SIGNAL(mouseClick(UBChainedLibElement*)),libWidget->actionBar(), SLOT(onItemChanged())); mLibWidget->init(); } @@ -85,10 +82,10 @@ UBLibNavigatorWidget::UBLibNavigatorWidget(QWidget *parent, const char *name):QW */ UBLibNavigatorWidget::~UBLibNavigatorWidget() { - if(NULL != mPathViewer) + if(NULL != mLibWidget) { - delete mPathViewer; - mPathViewer = NULL; + delete mLibWidget; + mLibWidget = NULL; } if(NULL != mSlider) { @@ -100,6 +97,11 @@ UBLibNavigatorWidget::~UBLibNavigatorWidget() delete mSliderWidthSetting; mSliderWidthSetting = NULL; } + if(NULL != mLayout) + { + delete mLayout; + mLayout = NULL; + } } void UBLibNavigatorWidget::dropMe(const QMimeData *_data) @@ -114,14 +116,8 @@ void UBLibNavigatorWidget::dropMe(const QMimeData *_data) */ void UBLibNavigatorWidget::onNavigbarUpate(UBLibElement *pElem) { - if(NULL != pElem) - { - // Refresh the path navigator - mPathViewer->displayPath(mLibWidget->chainedElements); - - // Show the path navigator - mPathViewer->show(); - } + Q_UNUSED(pElem); + emit updateNavigBar(mLibWidget->chainedElements); } /** @@ -157,13 +153,22 @@ void UBLibNavigatorWidget::removeNextChainedElements(UBChainedLibElement *fromEl /** * \brief Handles the properties requested event - * @param elem as tje related element + * @param elem as the related element */ void UBLibNavigatorWidget::onPropertiesRequested(UBLibElement *elem) { emit propertiesRequested(elem); } +/** + * \brief Handles the display search engine requested event + * @param elem as the related element + */ +void UBLibNavigatorWidget::onDisplaySearchEngine(UBLibElement *elem) +{ + emit displaySearchEngine(elem); +} + /** * \brief Update the thumbnails size * @param newSize as the given thumbnails size diff --git a/src/gui/UBLibNavigatorWidget.h b/src/gui/UBLibNavigatorWidget.h index a8750b38..6fc52ee7 100644 --- a/src/gui/UBLibNavigatorWidget.h +++ b/src/gui/UBLibNavigatorWidget.h @@ -21,7 +21,6 @@ #include #include "UBLibraryWidget.h" -#include "UBLibPathViewer.h" #include "core/UBSetting.h" class UBLibNavigatorWidget : public QWidget @@ -32,24 +31,25 @@ public: ~UBLibNavigatorWidget(); void dropMe(const QMimeData* _data); - UBLibraryWidget* libraryWidget(){return mLibWidget;}; + UBLibraryWidget* libraryWidget(){return mLibWidget;} signals: void propertiesRequested(UBLibElement* elem); + void displaySearchEngine(UBLibElement* elem); + void updateNavigBar(UBChainedLibElement* elem); private slots: void onNavigbarUpate(UBLibElement* pElem); void onPathItemClicked(UBChainedLibElement *elem); void onPropertiesRequested(UBLibElement* elem); void updateThumbnailsSize(int newSize); + void onDisplaySearchEngine(UBLibElement* elem); private: void removeNextChainedElements(UBChainedLibElement* fromElem); - QVBoxLayout* mLayout; UBLibraryWidget* mLibWidget; - UBLibPathViewer* mPathViewer; QSlider* mSlider; UBSetting* mSliderWidthSetting; }; diff --git a/src/gui/UBLibPathViewer.cpp b/src/gui/UBLibPathViewer.cpp index 39af07e7..79a532b2 100644 --- a/src/gui/UBLibPathViewer.cpp +++ b/src/gui/UBLibPathViewer.cpp @@ -29,15 +29,21 @@ */ UBLibPathViewer::UBLibPathViewer(QWidget *parent, const char *name):QGraphicsView(parent) , mpElems(NULL) + , mpElemsBackup(NULL) , mpScene(NULL) , mpLayout(NULL) , mpContainer(NULL) + , mpBackElem(NULL) { setObjectName(name); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); setAcceptDrops(true); + mpBackElem = new UBLibElement(); + mpBackElem->setThumbnail(QPixmap(":images/libpalette/back.png").toImage()); + mpBackElem->setDeletable(false); + mpScene = new UBPathScene(this); setScene(mpScene); @@ -57,21 +63,31 @@ UBLibPathViewer::UBLibPathViewer(QWidget *parent, const char *name):QGraphicsVie */ UBLibPathViewer::~UBLibPathViewer() { -// if(NULL != mpLayout) -// { -// delete mpLayout; -// mpLayout = NULL; -// } if(NULL != mpContainer) { delete mpContainer; mpContainer = NULL; } + if(NULL != mpBackElem) + { + delete mpBackElem; + mpBackElem = NULL; + } if(NULL != mpElems) { delete mpElems; mpElems = NULL; } + if(NULL != mpElemsBackup) + { + delete mpElemsBackup; + mpElemsBackup = NULL; + } + if(NULL != mpLayout) + { + delete mpLayout; + mpLayout = NULL; + } if(NULL != mpScene) { delete mpScene; @@ -255,6 +271,24 @@ void UBLibPathViewer::onElementsDropped(QList elements, UBLibElement *t emit elementsDropped(elements, target); } +void UBLibPathViewer::showBack() +{ + // Backup the current path so we can go back by clicking on the back button + mpElemsBackup = mpElems; + + // Set the correct path to the backElem + UBChainedLibElement* pLastElem = mpElemsBackup->lastElement(); + + if(NULL != pLastElem) + { + mpBackElem->setPath(pLastElem->element()->path()); + mpBackElem->setType(eUBLibElementType_Folder); + mpBackElem->setName(pLastElem->element()->name()); + } + + // Display the 'back' element + displayPath(new UBChainedLibElement(mpBackElem)); +} UBFolderPath::UBFolderPath():QGraphicsProxyWidget() { @@ -422,7 +456,6 @@ void UBPathScene::dragMoveEvent(QGraphicsSceneDragDropEvent *event) void UBPathScene::dropEvent(QGraphicsSceneDragDropEvent *event) { const QMimeData* pMimeData = event->mimeData(); - qDebug() << " Drop source : " << event->source()->metaObject()->className(); if(0 == QString::compare(event->source()->metaObject()->className(), "UBLibraryWidget")) { diff --git a/src/gui/UBLibPathViewer.h b/src/gui/UBLibPathViewer.h index 7e44810f..ab7083d5 100644 --- a/src/gui/UBLibPathViewer.h +++ b/src/gui/UBLibPathViewer.h @@ -79,6 +79,10 @@ public: void displayPath(UBChainedLibElement* elementsChain); int widgetAt(QPointF p); void updateScrolls(); + +public slots: + void showBack(); + signals: void mouseClick(UBChainedLibElement* elem); void elementsDropped(QList elements, UBLibElement* target); @@ -99,6 +103,8 @@ private: /** The chained path elements */ UBChainedLibElement* mpElems; + /** The backup chained path elements */ + UBChainedLibElement* mpElemsBackup; /** The scene */ UBPathScene* mpScene; //QGraphicsScene* mpScene; @@ -110,6 +116,8 @@ private: QVector mVItems; /** The total width of the element in the scene */ int mSceneWidth; + /** The back element */ + UBLibElement* mpBackElem; }; diff --git a/src/gui/UBLibWebView.cpp b/src/gui/UBLibWebView.cpp new file mode 100644 index 00000000..d939654d --- /dev/null +++ b/src/gui/UBLibWebView.cpp @@ -0,0 +1,86 @@ +#include + +#include "core/UBApplication.h" + +#include "UBLibWebView.h" + +UBLibWebView::UBLibWebView(QWidget* parent, const char* name):QWidget(parent) + , mpView(NULL) + , mpWebSettings(NULL) + , mpLayout(NULL) +{ + setObjectName(name); + + setAttribute(Qt::WA_StyledBackground, true); + setStyleSheet(UBApplication::globalStyleSheet()); + + mpLayout = new QVBoxLayout(); + setLayout(mpLayout); + + mpView = new QWebView(this); + mpView->setObjectName("SearchEngineView"); + //mpView->setStyleSheet(QString("background-color:white;")); + + mpWebSettings = QWebSettings::globalSettings(); + mpWebSettings->setAttribute(QWebSettings::JavaEnabled, true); + mpWebSettings->setAttribute(QWebSettings::PluginsEnabled, true); + mpWebSettings->setAttribute(QWebSettings::JavaEnabled, true); + mpWebSettings->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, true); + mpWebSettings->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true); + mpWebSettings->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true); + mpWebSettings->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true); + mpWebSettings->setAttribute(QWebSettings::DnsPrefetchEnabled, true); + + mpLayout->addWidget(mpView); +} + +UBLibWebView::~UBLibWebView() +{ + if(NULL != mpView) + { + delete mpView; + mpView = NULL; + } + if(NULL != mpLayout) + { + delete mpLayout; + mpLayout = NULL; + } +} + +void UBLibWebView::setElement(UBLibElement *elem) +{ + if(NULL != elem) + { + QString qsWidgetName; + QString path = elem->path().toLocalFile(); + + QString qsConfigPath = QString("%0/config.xml").arg(path); + + if(QFile::exists(qsConfigPath)) + { + QFile f(qsConfigPath); + if(f.open(QIODevice::ReadOnly)) + { + QDomDocument domDoc; + domDoc.setContent(QString(f.readAll())); + QDomElement root = domDoc.documentElement(); + + QDomNode node = root.firstChild(); + while(!node.isNull()) + { + if(node.toElement().tagName() == "content") + { + QDomAttr srcAttr = node.toElement().attributeNode("src"); + qsWidgetName = srcAttr.value(); + break; + } + node = node.nextSibling(); + } + f.close(); + } + } + + mpView->load(QUrl::fromLocalFile(QString("%0/%1").arg(path).arg(qsWidgetName))); + } +} diff --git a/src/gui/UBLibWebView.h b/src/gui/UBLibWebView.h new file mode 100644 index 00000000..b661125f --- /dev/null +++ b/src/gui/UBLibWebView.h @@ -0,0 +1,27 @@ +#ifndef UBLIBWEBVIEW_H +#define UBLIBWEBVIEW_H + +#include +#include +#include +#include + +#include "board/UBLibraryController.h" + +class UBLibWebView : public QWidget +{ + Q_OBJECT + +public: + UBLibWebView(QWidget* parent = 0, const char* name = "UBLibWebView"); + ~UBLibWebView(); + + void setElement(UBLibElement* elem); + +private: + QWebView* mpView; + QWebSettings* mpWebSettings; + QVBoxLayout* mpLayout; +}; + +#endif // UBLIBWEBVIEW_H diff --git a/src/gui/UBLibWidget.cpp b/src/gui/UBLibWidget.cpp index 51ffdc16..aa2d996a 100644 --- a/src/gui/UBLibWidget.cpp +++ b/src/gui/UBLibWidget.cpp @@ -29,6 +29,8 @@ UBLibWidget::UBLibWidget(QWidget *parent, const char *name):UBDockPaletteWidget( , mNavigator(NULL) , mProperties(NULL) , mActionBar(NULL) + , mpWebView(NULL) + , mpPathViewer(NULL) { setObjectName(name); mName = "LibWidget"; @@ -43,23 +45,37 @@ UBLibWidget::UBLibWidget(QWidget *parent, const char *name):UBDockPaletteWidget( mLayout = new QVBoxLayout(this); setLayout(mLayout); + // ------------- // Build the GUI + // ------------- + // The 'global' widgets mStackedWidget = new QStackedWidget(this); mActionBar = new UBLibActionBar(this); + mpPathViewer = new UBLibPathViewer(this); + mpPathViewer->setMaximumHeight(62); + + // The internal widgets mNavigator = new UBLibNavigatorWidget(this); mProperties = new UBLibItemProperties(this); + mpWebView = new UBLibWebView(this); + mLayout->addWidget(mpPathViewer, 0); mLayout->addWidget(mStackedWidget, 1); mLayout->addWidget(mActionBar, 0); mStackedWidget->addWidget(mNavigator); mStackedWidget->addWidget(mProperties); + mStackedWidget->addWidget(mpWebView); mStackedWidget->setCurrentIndex(ID_NAVIGATOR); miCrntStackWidget = ID_NAVIGATOR; + connect(mNavigator, SIGNAL(updateNavigBar(UBChainedLibElement*)), this, SLOT(onUpdateNavigBar(UBChainedLibElement*))); connect(mNavigator, SIGNAL(propertiesRequested(UBLibElement*)), this, SLOT(showProperties(UBLibElement*))); + connect(mNavigator, SIGNAL(displaySearchEngine(UBLibElement*)), this, SLOT(showSearchEngine(UBLibElement*))); connect(mProperties, SIGNAL(showFolderContent()), this, SLOT(showFolder())); + connect(this, SIGNAL(showLibElemProperties()), mpPathViewer, SLOT(showBack())); + connect(this, SIGNAL(showLibSearchEngine()), mpPathViewer, SLOT(showBack())); } /** @@ -67,16 +83,41 @@ UBLibWidget::UBLibWidget(QWidget *parent, const char *name):UBDockPaletteWidget( */ UBLibWidget::~UBLibWidget() { + if(NULL != mpPathViewer) + { + delete mpPathViewer; + mpPathViewer = NULL; + } + if(NULL != mNavigator) + { + delete mNavigator; + mNavigator = NULL; + } + if(NULL != mpWebView) + { + delete mpWebView; + mpWebView = NULL; + } if(NULL != mProperties) { delete mProperties; mProperties = NULL; } + if(NULL != mStackedWidget) + { + delete mStackedWidget; + mStackedWidget = NULL; + } if(NULL != mActionBar) { delete mActionBar; mActionBar = NULL; } + if(NULL != mLayout) + { + delete mLayout; + mLayout = NULL; + } } /** @@ -133,14 +174,26 @@ void UBLibWidget::showProperties(UBLibElement *elem) { if(NULL != elem) { + emit showLibElemProperties(); mActionBar->setButtons(eButtonSet_Properties); - // Show the properties of this object mProperties->showElement(elem); mStackedWidget->setCurrentIndex(ID_PROPERTIES); miCrntStackWidget = ID_PROPERTIES; } } +void UBLibWidget::showSearchEngine(UBLibElement *elem) +{ + if(NULL != elem) + { + emit showLibSearchEngine(); + mActionBar->hide(); + mpWebView->setElement(elem); + mStackedWidget->setCurrentIndex(ID_WEBVIEW); + miCrntStackWidget = ID_WEBVIEW; + } +} + void UBLibWidget::showFolder() { mActionBar->setButtons(mActionBar->previousButtonSet()); @@ -157,3 +210,14 @@ int UBLibWidget::border() { return 15; } + +void UBLibWidget::onUpdateNavigBar(UBChainedLibElement *elem) +{ + mpPathViewer->displayPath(elem); + mpPathViewer->show(); + + if(ID_NAVIGATOR != miCrntStackWidget) + { + showFolder(); + } +} diff --git a/src/gui/UBLibWidget.h b/src/gui/UBLibWidget.h index 644bd93f..e20088c1 100644 --- a/src/gui/UBLibWidget.h +++ b/src/gui/UBLibWidget.h @@ -30,9 +30,12 @@ #include "UBLibNavigatorWidget.h" #include "UBLibItemProperties.h" #include "UBLibActionBar.h" +#include "UBLibWebView.h" +#include "UBLibPathViewer.h" #define ID_NAVIGATOR 0 #define ID_PROPERTIES 1 +#define ID_WEBVIEW 2 class UBLibWidget : public UBDockPaletteWidget { @@ -42,10 +45,13 @@ public: ~UBLibWidget(); UBLibActionBar* actionBar(){return mActionBar;} - UBLibNavigatorWidget* libNavigator() {return mNavigator;}; + UBLibNavigatorWidget* libNavigator() {return mNavigator;} + UBLibPathViewer* pathViewer() {return mpPathViewer;} signals: void resized(); + void showLibElemProperties(); + void showLibSearchEngine(); protected: void dragEnterEvent(QDragEnterEvent* pEvent); @@ -55,7 +61,9 @@ protected: private slots: void showProperties(UBLibElement* elem); + void showSearchEngine(UBLibElement* elem); void showFolder(); + void onUpdateNavigBar(UBChainedLibElement* elem); private: void processMimeData(const QMimeData* pData); @@ -74,6 +82,10 @@ private: UBLibActionBar* mActionBar; /** The current stack widget index*/ int miCrntStackWidget; + /** The webview used to display the search engines */ + UBLibWebView* mpWebView; + /** The path navigation widget */ + UBLibPathViewer* mpPathViewer; }; #endif // UBLIBWIDGET_H diff --git a/src/gui/UBLibraryWidget.cpp b/src/gui/UBLibraryWidget.cpp index f0f34905..ab066eb9 100644 --- a/src/gui/UBLibraryWidget.cpp +++ b/src/gui/UBLibraryWidget.cpp @@ -25,15 +25,18 @@ #include "core/memcheck.h" +#include "frameworks/UBFileSystemUtils.h" + /** * \brief Constructor * @param parent as the parent widget * @param name as the widget object name */ UBLibraryWidget::UBLibraryWidget(QWidget *parent, const char *name):UBThumbnailWidget(parent) - , chainedElements(NULL) - , mpCrntDir(NULL) - , mpCrntElem(NULL) + , chainedElements(NULL) + , mpCrntDir(NULL) + , mpCrntElem(NULL) + , mLibraryController(NULL) { setObjectName(name); setSpacing(5); @@ -45,7 +48,8 @@ UBLibraryWidget::UBLibraryWidget(QWidget *parent, const char *name):UBThumbnailW */ UBLibraryWidget::~UBLibraryWidget() { - if(mLibraryController){ + if(NULL != mLibraryController) + { delete mLibraryController; mLibraryController = NULL; } @@ -148,7 +152,8 @@ void UBLibraryWidget::onItemClicked(QGraphicsItem *item, int index) { delete mpCrntElem; mpCrntElem = new UBLibElement(pElem); - if(eUBLibElementType_Folder == pElem->type() || eUBLibElementType_VirtualFolder == pElem->type()) { + if(eUBLibElementType_Folder == pElem->type() || eUBLibElementType_VirtualFolder == pElem->type()) + { // Add the clicked element to the end of the elements list // (at this level, the user can only go down in the path) UBChainedLibElement* pNextElem = new UBChainedLibElement(pElem); @@ -162,8 +167,15 @@ void UBLibraryWidget::onItemClicked(QGraphicsItem *item, int index) } else { - // Display the properties view - emit propertiesRequested(pElem); + if ("application/search" == UBFileSystemUtils::mimeTypeFromFileName(pElem->path().toLocalFile())) + { + emit displaySearchEngine(pElem); + } + else + { + // Display the properties view + emit propertiesRequested(pElem); + } } } emit itemClicked(); diff --git a/src/gui/UBLibraryWidget.h b/src/gui/UBLibraryWidget.h index 5aed86b7..d0420c76 100644 --- a/src/gui/UBLibraryWidget.h +++ b/src/gui/UBLibraryWidget.h @@ -47,7 +47,7 @@ public: void updateThumbnailsSize(int newSize); void init(); - UBLibraryController* libraryController() {return mLibraryController;}; + UBLibraryController* libraryController() {return mLibraryController;} public slots: void onRefreshCurrentFolder(); @@ -59,6 +59,7 @@ signals: void navigBarUpdate(UBLibElement* pElem); void itemsSelected(QList elemList, bool inTrash); void propertiesRequested(UBLibElement* pElem); + void displaySearchEngine(UBLibElement* pElem); void favoritesEntered(bool bFav); void itemClicked(); diff --git a/src/gui/UBMainWindow.cpp b/src/gui/UBMainWindow.cpp index 11d8b41c..1bc2cab5 100644 --- a/src/gui/UBMainWindow.cpp +++ b/src/gui/UBMainWindow.cpp @@ -16,7 +16,6 @@ #include #include "UBMainWindow.h" - #include "core/UBApplication.h" #include "core/UBApplicationController.h" #include "board/UBBoardController.h" @@ -160,3 +159,26 @@ bool UBMainWindow::yesNoQuestion(QString windowTitle, QString text) return messageBox.clickedButton() == yesButton; } + +void UBMainWindow::oneButtonMessageBox(QString windowTitle, QString text, QMessageBox::Icon type) +{ + QMessageBox messageBox; + messageBox.setParent(this); + messageBox.setWindowFlags(Qt::Dialog); + messageBox.setWindowTitle(windowTitle); + messageBox.setText(text); + messageBox.addButton(tr("Ok"),QMessageBox::YesRole); + messageBox.setIcon(type); + messageBox.exec(); +} + +void UBMainWindow::warning(QString windowTitle, QString text) +{ + oneButtonMessageBox(windowTitle,text, QMessageBox::Warning); +} + +void UBMainWindow::information(QString windowTitle, QString text) +{ + oneButtonMessageBox(windowTitle, text, QMessageBox::Information); +} + diff --git a/src/gui/UBMainWindow.h b/src/gui/UBMainWindow.h index 2bd6fc25..4150bbec 100644 --- a/src/gui/UBMainWindow.h +++ b/src/gui/UBMainWindow.h @@ -20,6 +20,7 @@ #include #include #include +#include class QStackedLayout; @@ -41,7 +42,10 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow void addDocumentsWidget(QWidget *pWidget); void switchToDocumentsWidget(); + bool yesNoQuestion(QString windowTitle, QString text); + void warning(QString windowTitle, QString text); + void information(QString windowTitle, QString text); signals: void closeEvent_Signal( QCloseEvent *event ); @@ -50,6 +54,7 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow void onExportDone(); protected: + void oneButtonMessageBox(QString windowTitle, QString text, QMessageBox::Icon type); virtual void keyPressEvent(QKeyEvent *event); virtual void closeEvent (QCloseEvent *event); diff --git a/src/gui/UBUpdateDlg.cpp b/src/gui/UBUpdateDlg.cpp index 2c2ba56b..c0651258 100644 --- a/src/gui/UBUpdateDlg.cpp +++ b/src/gui/UBUpdateDlg.cpp @@ -12,28 +12,29 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include #include #include "UBUpdateDlg.h" +#include "core/UBApplication.h" +#include "UBMainWindow.h" #include "core/memcheck.h" UBUpdateDlg::UBUpdateDlg(QWidget *parent, int nbFiles, const QString& bkpPath) - : QDialog(parent) - , mMainLayout(NULL) - , mNbFilesLabel(NULL) - , mBkpLabel(NULL) - , mBkpPath(NULL) - , mBrowseBttn(NULL) - , mpDlgBttn(NULL) - , mLayout(NULL) - , mHLayout(NULL) - , mStackedWidget(NULL) - , mDialogWidget(NULL) - , mProgressWidget(NULL) - , mProgressLayout(NULL) - , mProgressLabel(NULL) + : QDialog(parent) + , mMainLayout(NULL) + , mNbFilesLabel(NULL) + , mBkpLabel(NULL) + , mBkpPath(NULL) + , mBrowseBttn(NULL) + , mpDlgBttn(NULL) + , mLayout(NULL) + , mHLayout(NULL) + , mStackedWidget(NULL) + , mDialogWidget(NULL) + , mProgressWidget(NULL) + , mProgressLayout(NULL) + , mProgressLabel(NULL) { mDialogWidget = new QWidget(this); @@ -178,18 +179,16 @@ void UBUpdateDlg::onUpdate() void UBUpdateDlg::onFilesUpdated(bool bResult) { - this->hide(); + this->hide(); QString qsMsg; - if (bResult) - { + if (bResult) { qsMsg = tr("Files update successful!\nPlease reboot the application to access the updated documents."); } - else - { + else { qsMsg = tr("An error occured during the update. The files have not been affected."); } - QMessageBox::information(this, tr("Files update results"), qsMsg, QMessageBox::Ok); + UBApplication::mainWindow->information(tr("Files update results"), qsMsg); } QString UBUpdateDlg::backupPath() diff --git a/src/gui/gui.pri b/src/gui/gui.pri index d7ad9d1e..d5f9eb62 100644 --- a/src/gui/gui.pri +++ b/src/gui/gui.pri @@ -43,7 +43,8 @@ HEADERS += src/gui/UBThumbnailView.h \ src/gui/UBLibWidget.h \ src/gui/UBMagnifer.h \ src/gui/UBCachePropertiesWidget.h \ - src/gui/UBTeacherBarWidget.h + src/gui/UBTeacherBarWidget.h \ + src/gui/UBLibWebView.h SOURCES += src/gui/UBThumbnailView.cpp \ src/gui/UBFloatingPalette.cpp \ @@ -89,7 +90,8 @@ SOURCES += src/gui/UBThumbnailView.cpp \ src/gui/UBLibWidget.cpp \ src/gui/UBMagnifer.cpp \ src/gui/UBCachePropertiesWidget.cpp \ - src/gui/UBTeacherBarWidget.cpp + src/gui/UBTeacherBarWidget.cpp \ + src/gui/UBLibWebView.cpp win32 { diff --git a/src/network/UBNetworkAccessManager.cpp b/src/network/UBNetworkAccessManager.cpp index 6529c388..c2b7aa10 100644 --- a/src/network/UBNetworkAccessManager.cpp +++ b/src/network/UBNetworkAccessManager.cpp @@ -160,14 +160,18 @@ void UBNetworkAccessManager::sslErrors(QNetworkReply *reply, const QListurl().toString()).arg(errors), - QMessageBox::Yes | QMessageBox::No, - QMessageBox::No); - - if (ret == QMessageBox::Yes) - { + QMessageBox messageBox; + messageBox.setParent(mainWindow); + messageBox.setWindowFlags(Qt::Dialog); + messageBox.setWindowTitle(QCoreApplication::applicationName()); + messageBox.setText(tr("SSL Errors:\n\n%1\n\n%2\n\n" + "Do you want to ignore these errors for this host?").arg(reply->url().toString()).arg(errors)); + QPushButton* yesButton = messageBox.addButton(tr("Yes"),QMessageBox::YesRole); + messageBox.addButton(tr("No"),QMessageBox::NoRole); + messageBox.setIcon(QMessageBox::Question); + messageBox.exec(); + + if(messageBox.clickedButton() == yesButton) { reply->ignoreSslErrors(); sslTrustedHostList.append(replyHost); } diff --git a/src/tools/UBGraphicsCache.cpp b/src/tools/UBGraphicsCache.cpp index af82f45d..62e1f0cc 100644 --- a/src/tools/UBGraphicsCache.cpp +++ b/src/tools/UBGraphicsCache.cpp @@ -105,7 +105,7 @@ void UBGraphicsCache::paint(QPainter *painter, const QStyleOptionGraphicsItem *o } else if(eMaskShap_Rectangle == mMaskShape) { - path.addRect(mShapePos.x() - mShapeWidth / 2, mShapePos.y() - mShapeWidth / 2, mShapeWidth, mShapeWidth); + path.addRect(mShapePos.x() - mShapeWidth, mShapePos.y() - mShapeWidth, 2*mShapeWidth, 2*mShapeWidth); } path.setFillRule(Qt::OddEvenFill); } diff --git a/src/web/UBWebController.cpp b/src/web/UBWebController.cpp index 6ae2361b..463354ef 100644 --- a/src/web/UBWebController.cpp +++ b/src/web/UBWebController.cpp @@ -32,7 +32,7 @@ #include "gui/UBScreenMirror.h" #include "gui/UBMainWindow.h" #include "gui/UBWebToolsPalette.h" -#include "gui/UBKeyboardPalette.h" +//#include "gui/UBKeyboardPalette.h" #include "core/UBSettings.h" #include "core/UBSetting.h" @@ -55,7 +55,7 @@ UBWebController::UBWebController(UBMainWindow* mainWindow) , mBrowserWidget(0) , mTrapFlashController(0) , mToolsCurrentPalette(0) - , mKeyboardCurrentPalette(0) +// , mKeyboardCurrentPalette(0) , mToolsPalettePositionned(false) , mDownloadViewIsVisible(false) @@ -113,7 +113,7 @@ void UBWebController::webBrowserInstance() { mCurrentWebBrowser = &mWebBrowserList[WebBrowser]; mToolsCurrentPalette = &mToolsPaletteList[WebBrowser]; - mKeyboardCurrentPalette = &mKeyboardPaletteList[WebBrowser]; +// mKeyboardCurrentPalette = &mKeyboardPaletteList[WebBrowser]; mToolsPalettePositionned = mToolsPalettePositionnedList[WebBrowser]; if (!(*mCurrentWebBrowser)) { @@ -191,7 +191,7 @@ void UBWebController::tutorialWebInstance() { mCurrentWebBrowser = &mWebBrowserList[Tutorial]; mToolsCurrentPalette = &mToolsPaletteList[Tutorial]; - mKeyboardCurrentPalette = &mKeyboardPaletteList[Tutorial]; +// mKeyboardCurrentPalette = &mKeyboardPaletteList[Tutorial]; mToolsPalettePositionned = &mToolsPalettePositionnedList[Tutorial]; if (!(*mCurrentWebBrowser)) { @@ -249,7 +249,7 @@ void UBWebController::paraschoolWebInstance() else { mCurrentWebBrowser = &mWebBrowserList[Paraschool]; mToolsCurrentPalette = &mToolsPaletteList[Paraschool]; - mKeyboardCurrentPalette = &mKeyboardPaletteList[Paraschool]; +// mKeyboardCurrentPalette = &mKeyboardPaletteList[Paraschool]; mToolsPalettePositionned = &mToolsPalettePositionnedList[Paraschool]; if (!(*mCurrentWebBrowser)){ (*mCurrentWebBrowser) = new WBBrowserWindow(mMainWindow->centralWidget(), mMainWindow, true); @@ -391,7 +391,7 @@ void UBWebController::setupPalettes() { (*mToolsCurrentPalette) = new UBWebToolsPalette((*mCurrentWebBrowser),false); - (*mKeyboardCurrentPalette) = UBKeyboardPalette::create(*mCurrentWebBrowser); +// (*mKeyboardCurrentPalette) = UBKeyboardPalette::create(*mCurrentWebBrowser); #ifndef Q_WS_WIN if (*mKeyboardCurrentPalette) connect(*mKeyboardCurrentPalette, SIGNAL(closed()), *mKeyboardCurrentPalette, SLOT(onDeactivated())); @@ -411,7 +411,7 @@ void UBWebController::setupPalettes() (*mToolsCurrentPalette)->hide(); (*mToolsCurrentPalette)->adjustSizeAndPosition(); - (*mKeyboardCurrentPalette)->adjustSizeAndPosition(); +// (*mKeyboardCurrentPalette)->adjustSizeAndPosition(); if (controlView()){ int left = controlView()->width() - 20 - (*mToolsCurrentPalette)->width(); @@ -435,15 +435,14 @@ void UBWebController::toggleWebTrap(bool checked) } } -void UBWebController::showKeyboard(bool checked) -{ - if (mKeyboardCurrentPalette - && (*mKeyboardCurrentPalette)) - { - (*mKeyboardCurrentPalette)->setVisible(checked); - } -} - +// void UBWebController::showKeyboard(bool checked) +// { +// if (mKeyboardCurrentPalette +// && (*mKeyboardCurrentPalette)) +// { +// (*mKeyboardCurrentPalette)->setVisible(checked); +// } +// } void UBWebController::toggleWebToolsPalette(bool checked) { diff --git a/src/web/UBWebController.h b/src/web/UBWebController.h index 1cb38c4c..29640cbe 100644 --- a/src/web/UBWebController.h +++ b/src/web/UBWebController.h @@ -28,7 +28,7 @@ class UBMainWindow; class UBWebToolsPalette; class WBWebView; class UBServerXMLHttpRequest; -class UBKeyboardPalette; +//class UBKeyboardPalette; class UBWebController : public QObject @@ -58,6 +58,12 @@ class UBWebController : public QObject void show(WebInstance type = UBWebController::WebBrowser); + WBBrowserWindow* GetCurrentWebBrowser() + { + if( mCurrentWebBrowser != NULL ) return *mCurrentWebBrowser; + else return NULL; + }; + protected: void setupPalettes(); @@ -101,8 +107,8 @@ class UBWebController : public QObject UBTrapFlashController* mTrapFlashController; UBWebToolsPalette** mToolsCurrentPalette; UBWebToolsPalette* mToolsPaletteList[TotalNumberOfWebInstances]; - UBKeyboardPalette** mKeyboardCurrentPalette; - UBKeyboardPalette* mKeyboardPaletteList[TotalNumberOfWebInstances]; +// UBKeyboardPalette** mKeyboardCurrentPalette; +// UBKeyboardPalette* mKeyboardPaletteList[TotalNumberOfWebInstances]; bool mToolsPalettePositionned; bool mToolsPalettePositionnedList[TotalNumberOfWebInstances]; @@ -124,7 +130,7 @@ class UBWebController : public QObject void toggleWebTrap(bool checked); - void showKeyboard(bool checked); +// void showKeyboard(bool checked); signals: /** diff --git a/src/web/browser/WBWebView.cpp b/src/web/browser/WBWebView.cpp index 23fb6cb5..eb0be66f 100644 --- a/src/web/browser/WBWebView.cpp +++ b/src/web/browser/WBWebView.cpp @@ -168,8 +168,7 @@ void WBWebPage::handleUnsupportedContent(QNetworkReply *reply) messageBox.setText(tr("Download PDF Document: would you prefer to download the PDF file or add it to the current Sankore document?")); messageBox.addButton(tr("Download"), QMessageBox::AcceptRole); - QAbstractButton *addButton = - messageBox.addButton(tr("Add to Current Document"), QMessageBox::AcceptRole); + QAbstractButton *addButton = messageBox.addButton(tr("Add to Current Document"), QMessageBox::AcceptRole); messageBox.exec(); if (messageBox.clickedButton() == addButton)