removed tab

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent a6c6ee3f61
commit b2628d12b8
  1. 18
      src/adaptors/UBExportFullPDF.cpp
  2. 24
      src/adaptors/UBExportPDF.cpp
  3. 12
      src/adaptors/UBImportDocument.cpp
  4. 4
      src/adaptors/UBImportPDF.cpp
  5. 4
      src/adaptors/UBImportPDF.h
  6. 8
      src/adaptors/UBSvgSubsetAdaptor.cpp
  7. 2
      src/adaptors/UBThumbnailAdaptor.h
  8. 2
      src/api/UBWidgetUniboardAPI.cpp
  9. 6
      src/board/UBBoardView.h
  10. 4
      src/board/UBDrawingController.cpp
  11. 4
      src/board/UBDrawingController.h
  12. 136
      src/board/UBFeaturesController.cpp
  13. 78
      src/board/UBFeaturesController.h
  14. 38
      src/core/UB.h
  15. 32
      src/core/UBApplication.cpp
  16. 2
      src/core/UBApplication.h
  17. 28
      src/core/UBApplicationController.cpp
  18. 4
      src/core/UBPersistenceManager.cpp
  19. 2
      src/core/UBSetting.h
  20. 30
      src/customWidgets/UBMediaWidget.cpp
  21. 12
      src/desktop/UBDesktopAnnotationController.cpp
  22. 2
      src/desktop/UBDesktopPalette.h
  23. 4
      src/document/UBDocumentContainer.cpp
  24. 60
      src/document/UBDocumentController.cpp
  25. 2
      src/domain/UBGraphicsGroupContainerItem.cpp
  26. 6
      src/domain/UBGraphicsPolygonItem.cpp
  27. 2
      src/domain/UBGraphicsScene.h
  28. 28
      src/domain/UBGraphicsStrokesGroup.cpp
  29. 22
      src/frameworks/UBPlatformUtils.cpp
  30. 58
      src/frameworks/UBPlatformUtils.h
  31. 106
      src/frameworks/UBPlatformUtils_linux.cpp
  32. 518
      src/frameworks/UBPlatformUtils_win.cpp
  33. 856
      src/gui/UBDockPalette.cpp
  34. 2
      src/gui/UBDockPalette.h
  35. 2
      src/gui/UBDockTeacherGuideWidget.cpp
  36. 42
      src/gui/UBDocumentNavigator.cpp
  37. 6
      src/gui/UBDocumentNavigator.h
  38. 104
      src/gui/UBDocumentThumbnailWidget.cpp
  39. 8
      src/gui/UBDocumentThumbnailWidget.h
  40. 48
      src/gui/UBDocumentTreeWidget.cpp
  41. 6
      src/gui/UBDocumentTreeWidget.h
  42. 50
      src/gui/UBFeaturesActionBar.cpp
  43. 38
      src/gui/UBFeaturesActionBar.h
  44. 22
      src/gui/UBFeaturesWidget.cpp
  45. 68
      src/gui/UBFeaturesWidget.h
  46. 60
      src/gui/UBFloatingPalette.cpp
  47. 10
      src/gui/UBKeyboardPalette.cpp
  48. 14
      src/gui/UBKeyboardPalette_mac.cpp
  49. 56
      src/gui/UBKeyboardPalette_win.cpp
  50. 4
      src/gui/UBLeftPalette.cpp
  51. 14
      src/gui/UBNavigatorPalette.cpp
  52. 2
      src/gui/UBResources.h
  53. 66
      src/gui/UBRightPalette.cpp
  54. 60
      src/gui/UBTeacherGuideWidget.cpp
  55. 6
      src/gui/UBTeacherGuideWidget.h
  56. 88
      src/gui/UBTeacherGuideWidgetsTools.cpp
  57. 42
      src/gui/UBThumbnailWidget.cpp
  58. 30
      src/gui/UBThumbnailWidget.h
  59. 2
      src/network/UBNetworkAccessManager.h
  60. 6
      src/pdf-merger/AbstractBoxElementHandler.h
  61. 2
      src/pdf-merger/CropBoxElementHandler.h
  62. 2
      src/pdf-merger/Document.cpp
  63. 6
      src/pdf-merger/LZWDecode.cpp
  64. 8
      src/pdf-merger/LZWDecode.h
  65. 4
      src/pdf-merger/MediaBoxElementHandler.h
  66. 22
      src/pdf-merger/Object.cpp
  67. 252
      src/pdf-merger/Object.h
  68. 10
      src/pdf-merger/OverlayDocumentParser.cpp
  69. 16
      src/pdf-merger/OverlayDocumentParser.h
  70. 2
      src/pdf-merger/Parser.cpp
  71. 4
      src/pdf-merger/Parser.h
  72. 30
      src/pdf-merger/RemoveHimSelfHandler.h
  73. 2
      src/pdf-merger/RotationHandler.h
  74. 2
      src/pdf-merger/Utils.cpp
  75. 8
      src/pdf/PDFRenderer.h
  76. 16
      src/pdf/XPDFRenderer.cpp
  77. 18
      src/podcast/UBPodcastController.cpp
  78. 12
      src/tools/UBAbstractDrawRuler.cpp
  79. 18
      src/tools/UBGraphicsProtractor.h
  80. 34
      src/tools/UBGraphicsRuler.h
  81. 2
      src/web/UBWebController.cpp
  82. 6
      src/web/UBWebController.h
  83. 2
      src/web/browser/WBBrowserWindow.cpp
  84. 4
      src/web/browser/WBBrowserWindow.h
  85. 2
      src/web/browser/WBUrlLineEdit.cpp

@ -55,9 +55,9 @@ UBExportFullPDF::UBExportFullPDF(QObject *parent)
: UBExportAdaptor(parent)
{
//need to calculate screen resolution
QDesktopWidget* desktop = UBApplication::desktop();
int dpiCommon = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
mScaleFactor = 72.0f / dpiCommon;
QDesktopWidget* desktop = UBApplication::desktop();
int dpiCommon = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
mScaleFactor = 72.0f / dpiCommon;
}
@ -95,17 +95,17 @@ void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, const QStr
scene->setRenderingQuality(UBItem::RenderingQualityHigh);
scene->setRenderingContext(UBGraphicsScene::PdfExport);
QSize pageSize = scene->nominalSize();
QSize pageSize = scene->nominalSize();
UBGraphicsPDFItem *pdfItem = qgraphicsitem_cast<UBGraphicsPDFItem*>(scene->backgroundObject());
UBGraphicsPDFItem *pdfItem = qgraphicsitem_cast<UBGraphicsPDFItem*>(scene->backgroundObject());
if (pdfItem) mHasPDFBackgrounds = true;
pdfPrinter.setPaperSize(QSizeF(pageSize.width()*mScaleFactor, pageSize.height()*mScaleFactor), QPrinter::Point);
pdfPrinter.setPaperSize(QSizeF(pageSize.width()*mScaleFactor, pageSize.height()*mScaleFactor), QPrinter::Point);
if (!pdfPainter) pdfPainter = new QPainter(&pdfPrinter);
if (pageIndex != 0) pdfPrinter.newPage();
if (pageIndex != 0) pdfPrinter.newPage();
//render to PDF
scene->setDrawingMode(true);
@ -183,9 +183,9 @@ void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QS
UBGraphicsScene* scene = UBPersistenceManager::persistenceManager()->loadDocumentScene(pDocumentProxy, pageIndex);
UBGraphicsPDFItem *pdfItem = qgraphicsitem_cast<UBGraphicsPDFItem*>(scene->backgroundObject());
QSize pageSize = scene->nominalSize();
QSize pageSize = scene->nominalSize();
if (pdfItem)
if (pdfItem)
{
QString pdfName = UBPersistenceManager::objectDirectory + "/" + pdfItem->fileUuid().toString() + ".pdf";
QString backgroundPath = pDocumentProxy->persistencePath() + "/" + pdfName;

@ -80,15 +80,15 @@ void UBExportPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QStrin
pdfPrinter.setOutputFormat(QPrinter::PdfFormat);
pdfPrinter.setResolution(UBSettings::settings()->pdfResolution->get().toInt());
pdfPrinter.setOutputFileName(filename);
pdfPrinter.setFullPage(true);
pdfPrinter.setFullPage(true);
//need to calculate screen resolution
QDesktopWidget* desktop = UBApplication::desktop();
int dpiCommon = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
float scaleFactor = 72.0f / dpiCommon;
QDesktopWidget* desktop = UBApplication::desktop();
int dpiCommon = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
float scaleFactor = 72.0f / dpiCommon;
QPainter pdfPainter;
bool painterNeedsBegin = true;
bool painterNeedsBegin = true;
int existingPageCount = pDocumentProxy->pageCount();
@ -101,17 +101,17 @@ void UBExportPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QStrin
bool isCrossed = scene->isCrossedBackground();
scene->setBackground(false, false);
QSize pageSize = scene->nominalSize();
QSize pageSize = scene->nominalSize();
// set high res rendering
scene->setRenderingQuality(UBItem::RenderingQualityHigh);
scene->setRenderingContext(UBGraphicsScene::NonScreen);
//setting page size to appropriate value
pdfPrinter.setPaperSize(QSizeF(pageSize.width()*scaleFactor, pageSize.height()*scaleFactor), QPrinter::Point);
if(painterNeedsBegin) painterNeedsBegin = !pdfPainter.begin(&pdfPrinter);
//setting page size to appropriate value
pdfPrinter.setPaperSize(QSizeF(pageSize.width()*scaleFactor, pageSize.height()*scaleFactor), QPrinter::Point);
if(painterNeedsBegin) painterNeedsBegin = !pdfPainter.begin(&pdfPrinter);
//render to PDF
scene->render(&pdfPainter, QRectF(), scene->normalizedSceneRect());
scene->render(&pdfPainter, QRectF(), scene->normalizedSceneRect());
if (pageIndex < existingPageCount - 1) pdfPrinter.newPage();
@ -122,7 +122,7 @@ void UBExportPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QStrin
//restore background state
scene->setBackground(isDark, isCrossed);
}
if(!painterNeedsBegin) pdfPainter.end();
if(!painterNeedsBegin) pdfPainter.end();
}
QString UBExportPDF::exportExtention()

@ -174,18 +174,18 @@ UBDocumentProxy* UBImportDocument::importFile(const QFile& pFile, const QString&
QString documentRootFolder;
if(!extractFileToDir(pFile, path, documentRootFolder)){
UBApplication::showMessage(tr("Import of file %1 failed.").arg(fi.baseName()));
return NULL;
}
if(!extractFileToDir(pFile, path, documentRootFolder)){
UBApplication::showMessage(tr("Import of file %1 failed.").arg(fi.baseName()));
return NULL;
}
bool addTitlePage = false;
if(UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool() && !QFile(documentRootFolder+"/page000.svg").exists())
addTitlePage=true;
UBDocumentProxy* newDocument = UBPersistenceManager::persistenceManager()->createDocumentFromDir(documentRootFolder, pGroup, "", false, addTitlePage);
UBApplication::showMessage(tr("Import successful."));
return newDocument;
UBApplication::showMessage(tr("Import successful."));
return newDocument;
}
bool UBImportDocument::addFileToDocument(UBDocumentProxy* pDocument, const QFile& pFile)

@ -38,7 +38,7 @@ UBImportPDF::UBImportPDF(QObject *parent)
: UBPageBasedImportAdaptor(parent)
{
QDesktopWidget* desktop = UBApplication::desktop();
this->dpi = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
this->dpi = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
}
@ -71,7 +71,7 @@ QList<UBGraphicsItem*> UBImportPDF::import(const QUuid& uuid, const QString& fil
UBApplication::showMessage(tr("PDF import failed."));
return result;
}
pdfRenderer->setDPI(this->dpi);
pdfRenderer->setDPI(this->dpi);
int pdfPageCount = pdfRenderer->pageCount();

@ -44,8 +44,8 @@ class UBImportPDF : public UBPageBasedImportAdaptor
virtual void placeImportedItemToScene(UBGraphicsScene* scene, UBGraphicsItem* item);
virtual const QString& folderToCopy();
private:
int dpi;
private:
int dpi;
};
#endif /* UBIMPORTPDF_H_ */

@ -1249,10 +1249,10 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex)
//disabling g section parsing as a group of elements. Use groups refs instead
// mXmlWriter.writeStartElement("g");
// mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "uuid", UBStringUtils::toCanonicalUuid(strokesGroupItem->uuid()));
// QMatrix matrix = item->sceneMatrix();
// if (!matrix.isIdentity()){
// mXmlWriter.writeAttribute("transform", toSvgTransform(matrix));
// }
// QMatrix matrix = item->sceneMatrix();
// if (!matrix.isIdentity()){
// mXmlWriter.writeAttribute("transform", toSvgTransform(matrix));
// }
// Add the polygons
foreach(QGraphicsItem* item, strokesGroupItem->childItems()){

@ -32,7 +32,7 @@ class UBGraphicsScene;
class UBThumbnailAdaptor //static class
{
Q_DECLARE_TR_FUNCTIONS(UBThumbnailAdaptor)
Q_DECLARE_TR_FUNCTIONS(UBThumbnailAdaptor)
public:
static QUrl thumbnailUrl(UBDocumentProxy* proxy, int pageIndex);

@ -241,7 +241,7 @@ void UBWidgetUniboardAPI::drawLineTo(const qreal x, const qreal y, const qreal p
if (mScene)
mScene->drawLineTo(QPointF(x, y), pWidth,
UBDrawingController::drawingController()->stylusTool() == UBStylusTool::Line);
UBDrawingController::drawingController()->stylusTool() == UBStylusTool::Line);
}

@ -143,7 +143,7 @@ class UBBoardView : public QGraphicsView
bool isAbsurdPoint(QPoint point);
bool mVirtualKeyboardActive;
bool mVirtualKeyboardActive;
bool mOkOnWidget;
bool mWidgetMoved;
@ -172,9 +172,9 @@ class UBBoardView : public QGraphicsView
void settingChanged(QVariant newValue);
public slots:
public slots:
void virtualKeyboardActivated(bool b);
void virtualKeyboardActivated(bool b);
void longPressEvent();
};

@ -55,7 +55,7 @@ UBDrawingController::UBDrawingController(QObject * parent)
, mActiveRuler(NULL)
, mStylusTool((UBStylusTool::Enum)-1)
, mLatestDrawingTool((UBStylusTool::Enum)-1)
, mIsDesktopMode(false)
, mIsDesktopMode(false)
{
connect(UBSettings::settings(), SIGNAL(colorContextChanged()), this, SIGNAL(colorPaletteChanged()));
@ -96,7 +96,7 @@ void UBDrawingController::setStylusTool(int tool)
{
if (tool != mStylusTool)
{
UBApplication::boardController->activeScene()->deselectAllItems();
UBApplication::boardController->activeScene()->deselectAllItems();
if (mStylusTool == UBStylusTool::Pen || mStylusTool == UBStylusTool::Marker
|| mStylusTool == UBStylusTool::Line)
{

@ -61,11 +61,11 @@ class UBDrawingController : public QObject
UBAbstractDrawRuler* mActiveRuler;
void setInDestopMode(bool mode){
mIsDesktopMode = mode;
mIsDesktopMode = mode;
}
bool isInDesktopMode(){
return mIsDesktopMode;
return mIsDesktopMode;
}
public slots:

@ -255,7 +255,7 @@ QString UBFeature::getVirtualDirFromVirtualPath(const QString &pVirtPath)
QString UBFeature::getUrl() const
{
if ( elementType == FEATURE_INTERNAL )
if ( elementType == FEATURE_INTERNAL )
return getFullPath().toString();
return getFullPath().toLocalFile();
@ -268,12 +268,12 @@ bool UBFeature::operator ==( const UBFeature &f )const
bool UBFeature::operator !=( const UBFeature &f )const
{
return !(*this == f);
return !(*this == f);
}
bool UBFeature::isFolder() const
{
return elementType == FEATURE_CATEGORY || elementType == FEATURE_TRASH || elementType == FEATURE_FAVORITE
return elementType == FEATURE_CATEGORY || elementType == FEATURE_TRASH || elementType == FEATURE_FAVORITE
|| elementType == FEATURE_FOLDER || elementType == FEATURE_SEARCH;
}
@ -451,11 +451,11 @@ void UBFeaturesController::fileSystemScan(const QUrl & currentPath, const QStrin
if ( favoriteSet->find( QUrl::fromLocalFile( fullFileName ) ) != favoriteSet->end() ) {
featuresList->append( UBFeature( favoritePath + "/" + fileName, icon, fileName, QUrl::fromLocalFile( fullFileName ), featureType ) );
}
}
if (featureType == FEATURE_FOLDER) {
fileSystemScan(QUrl::fromLocalFile(fullFileName), currVirtualPath + "/" + fileName);
}
}
}
}
@ -486,35 +486,35 @@ int UBFeaturesController::featuresCount(const QUrl &currPath)
void UBFeaturesController::loadFavoriteList()
{
favoriteSet = new QSet<QUrl>();
QFile file( UBSettings::userDataDirectory() + "/favorites.dat" );
if ( file.exists() )
{
file.open(QIODevice::ReadOnly);
QDataStream in(&file);
int elementsNumber;
in >> elementsNumber;
for ( int i = 0; i < elementsNumber; ++i)
{
QUrl path;
in >> path;
favoriteSet = new QSet<QUrl>();
QFile file( UBSettings::userDataDirectory() + "/favorites.dat" );
if ( file.exists() )
{
file.open(QIODevice::ReadOnly);
QDataStream in(&file);
int elementsNumber;
in >> elementsNumber;
for ( int i = 0; i < elementsNumber; ++i)
{
QUrl path;
in >> path;
favoriteSet->insert( path );
}
}
}
}
}
void UBFeaturesController::saveFavoriteList()
{
QFile file( UBSettings::userDataDirectory() + "/favorites.dat" );
file.resize(0);
file.open(QIODevice::WriteOnly);
QDataStream out(&file);
out << favoriteSet->size();
for ( QSet<QUrl>::iterator it = favoriteSet->begin(); it != favoriteSet->end(); ++it )
{
out << (*it);
}
file.close();
QFile file( UBSettings::userDataDirectory() + "/favorites.dat" );
file.resize(0);
file.open(QIODevice::WriteOnly);
QDataStream out(&file);
out << favoriteSet->size();
for ( QSet<QUrl>::iterator it = favoriteSet->begin(); it != favoriteSet->end(); ++it )
{
out << (*it);
}
file.close();
}
QString UBFeaturesController::uniqNameForFeature(const UBFeature &feature, const QString &pName, const QString &pExtention) const
@ -584,29 +584,29 @@ QString UBFeaturesController::adjustName(const QString &str)
void UBFeaturesController::addToFavorite( const QUrl &path )
{
QString filePath = fileNameFromUrl( path );
if ( favoriteSet->find( path ) == favoriteSet->end() )
{
QFileInfo fileInfo( filePath );
QString fileName = fileInfo.fileName();
QString filePath = fileNameFromUrl( path );
if ( favoriteSet->find( path ) == favoriteSet->end() )
{
QFileInfo fileInfo( filePath );
QString fileName = fileInfo.fileName();
UBFeatureElementType type = fileTypeFromUrl(filePath);
UBFeature elem(favoritePath + "/" + fileName, getIcon(filePath, type), fileName, path, fileTypeFromUrl(filePath) );
favoriteSet->insert( path );
saveFavoriteList();
favoriteSet->insert( path );
saveFavoriteList();
if ( !elem.getVirtualPath().isEmpty() && !elem.getVirtualPath().isNull())
featuresModel->addItem( elem );
}
}
}
void UBFeaturesController::removeFromFavorite( const QUrl &path, bool deleteManualy)
{
// QString filePath = fileNameFromUrl( path );
if ( favoriteSet->find( path ) != favoriteSet->end() )
{
favoriteSet->erase( favoriteSet->find( path ) );
saveFavoriteList();
}
// QString filePath = fileNameFromUrl( path );
if ( favoriteSet->find( path ) != favoriteSet->end() )
{
favoriteSet->erase( favoriteSet->find( path ) );
saveFavoriteList();
}
if (deleteManualy) {
featuresModel->deleteFavoriteItem(path.toString());
@ -615,10 +615,10 @@ void UBFeaturesController::removeFromFavorite( const QUrl &path, bool deleteManu
QString UBFeaturesController::fileNameFromUrl( const QUrl &url )
{
QString fileName = url.toString();
if ( fileName.contains( "uniboardTool://" ) )
return fileName;
return url.toLocalFile();
QString fileName = url.toString();
if ( fileName.contains( "uniboardTool://" ) )
return fileName;
return url.toLocalFile();
}
@ -657,7 +657,7 @@ UBFeatureElementType UBFeaturesController::fileTypeFromUrl(const QString &path)
fileType = FEATURE_INVALID;
}
return fileType;
return fileType;
}
QImage UBFeaturesController::getIcon(const QString &path, UBFeatureElementType pFType = FEATURE_INVALID)
@ -759,7 +759,7 @@ void UBFeaturesController::importImage( const QImage &image, const UBFeature &de
if ( !destination.getFullVirtualPath().startsWith( picturesElement.getFullVirtualPath(), Qt::CaseInsensitive ) )
{
dest = picturesElement;
dest = picturesElement;
}
filePath = dest.getFullPath().toLocalFile() + "/" + mFileName;
@ -805,7 +805,7 @@ void UBFeaturesController::addNewFolder(QString name)
if(!QFileInfo(path).exists()) {
QDir().mkpath(path);
}
}
UBFeature newFeatureFolder = UBFeature( currentElement.getFullVirtualPath() + "/" + name, QImage(":images/libpalette/folder.svg"),
name, QUrl::fromLocalFile( path ), FEATURE_FOLDER );
@ -856,7 +856,7 @@ void UBFeaturesController::addDownloadedFile(const QUrl &sourceUrl, const QByteA
QString fileName;
QString filePath;
//Audio item
if(dest == picturesElement) {
@ -897,37 +897,37 @@ void UBFeaturesController::addDownloadedFile(const QUrl &sourceUrl, const QByteA
UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeature &destination )
{
/*UBFeature newElement = copyItemToFolder( url, destination );
deleteItem( url );
return newElement;*/
/*UBFeature newElement = copyItemToFolder( url, destination );
deleteItem( url );
return newElement;*/
QString sourcePath = url.toLocalFile();
Q_ASSERT( QFileInfo( sourcePath ).exists() );
Q_ASSERT( QFileInfo( sourcePath ).exists() );
UBFeature possibleDest = getDestinationFeatureForUrl(url);
UBFeature dest = destination;
UBFeature dest = destination;
if ( destination != trashElement &&
!destination.getFullVirtualPath().startsWith( possibleDest.getFullVirtualPath(), Qt::CaseInsensitive ) )
{
dest = possibleDest;
}
if ( destination != trashElement &&
!destination.getFullVirtualPath().startsWith( possibleDest.getFullVirtualPath(), Qt::CaseInsensitive ) )
{
dest = possibleDest;
}
QString name = QFileInfo( sourcePath ).fileName();
QString name = QFileInfo( sourcePath ).fileName();
QString destPath = dest.getFullPath().toLocalFile();
QString destVirtualPath = dest.getFullVirtualPath();
QString newFullPath = destPath + "/" + name;
QString destVirtualPath = dest.getFullVirtualPath();
QString newFullPath = destPath + "/" + name;
if ( sourcePath.compare( newFullPath, Qt::CaseInsensitive ) )
{
QFile( sourcePath ).copy( newFullPath );
QFile( sourcePath ).copy( newFullPath );
deleteItem( url );
}
QImage thumb = getIcon( newFullPath );
UBFeatureElementType type = FEATURE_ITEM;
if ( UBFileSystemUtils::mimeTypeFromFileName( newFullPath ).contains("application") )
if ( UBFileSystemUtils::mimeTypeFromFileName( newFullPath ).contains("application") )
type = FEATURE_INTERACTIVE;
UBFeature newElement( destVirtualPath + "/" + name, thumb, name, QUrl::fromLocalFile( newFullPath ), type );
return newElement;
@ -1071,7 +1071,7 @@ void UBFeaturesController::deleteItem(const QUrl &url)
QString path = url.toLocalFile();
Q_ASSERT( QFileInfo( path ).exists() );
QString thumbnailPath = UBFileSystemUtils::thumbnailPath( path );
QString thumbnailPath = UBFileSystemUtils::thumbnailPath( path );
if ( thumbnailPath.length() && QFileInfo( thumbnailPath ).exists()) {
if (QFileInfo(thumbnailPath).isFile()) {
QFile::remove(thumbnailPath);

@ -120,22 +120,22 @@ public:
QString getDisplayName() const {return mDisplayName;}
QImage getThumbnail() const {return mThumbnail;}
QString getVirtualPath() const { return virtualDir; }
//QString getPath() const { return mPath; };
//QString getPath() const { return mPath; };
QUrl getFullPath() const { return mPath; }
QString getFullVirtualPath() const { return virtualDir + "/" + mName; }
QString getUrl() const;
QString getUrl() const;
void setFullPath(const QUrl &newPath) {mPath = newPath;}
void setFullVirtualPath(const QString &newVirtualPath) {virtualDir = newVirtualPath;}
UBFeatureElementType getType() const { return elementType; }
bool isFolder() const;
bool isFolder() const;
bool allowedCopy() const;
bool isDeletable() const;
bool isDeletable() const;
bool inTrash() const;
bool operator ==( const UBFeature &f )const;
bool operator !=( const UBFeature &f )const;
const QMap<QString,QString> & getMetadata() const { return metadata; }
void setMetadata( const QMap<QString,QString> &data ) { metadata = data; }
bool operator ==( const UBFeature &f )const;
bool operator !=( const UBFeature &f )const;
const QMap<QString,QString> & getMetadata() const { return metadata; }
void setMetadata( const QMap<QString,QString> &data ) { metadata = data; }
private:
@ -148,7 +148,7 @@ private:
QImage mThumbnail;
QString mName;
QString mDisplayName;
QUrl mPath;
QUrl mPath;
UBFeatureElementType elementType;
QMap<QString,QString> metadata;
};
@ -161,11 +161,11 @@ friend class UBFeaturesWidget;
Q_OBJECT
public:
UBFeaturesController(QWidget *parentWidget);
UBFeaturesController(QWidget *parentWidget);
virtual ~UBFeaturesController();
QList <UBFeature>* getFeatures() const {return featuresList;}
const QString& getRootPath()const {return rootPath;}
void scanFS();
@ -173,12 +173,12 @@ public:
void addItemAsBackground(const UBFeature &item);
const UBFeature& getCurrentElement()const {return currentElement;}
void setCurrentElement( const UBFeature &elem ) {currentElement = elem;}
const UBFeature & getTrashElement () const { return trashElement; }
const UBFeature & getTrashElement () const { return trashElement; }
void addDownloadedFile( const QUrl &sourceUrl, const QByteArray &pData, const QString pContentSource, const QString pTitle );
UBFeature moveItemToFolder( const QUrl &url, const UBFeature &destination );
UBFeature copyItemToFolder( const QUrl &url, const UBFeature &destination );
UBFeature moveItemToFolder( const QUrl &url, const UBFeature &destination );
UBFeature copyItemToFolder( const QUrl &url, const UBFeature &destination );
void moveExternalData(const QUrl &url, const UBFeature &destination);
void rescanModel();
@ -188,9 +188,9 @@ public:
void searchStarted(const QString &pattern, QListView *pOnView);
void refreshModels();
void deleteItem( const QUrl &url );
void deleteItem( const QUrl &url );
void deleteItem(const UBFeature &pFeature);
bool isTrash( const QUrl &url );
bool isTrash( const QUrl &url );
void moveToTrash(UBFeature feature, bool deleteManualy = false);
void addToFavorite( const QUrl &path );
void removeFromFavorite(const QUrl &path, bool deleteManualy = false);
@ -202,9 +202,9 @@ public:
int featuresCount(const QUrl &currPath);
static UBFeatureElementType fileTypeFromUrl( const QString &path );
static QString fileNameFromUrl( const QUrl &url );
static QString fileNameFromUrl( const QUrl &url );
static QImage getIcon( const QString &path, UBFeatureElementType pFType );
static bool isDeletable( const QUrl &url );
static bool isDeletable( const QUrl &url );
static char featureTypeSplitter() {return ':';}
static QString categoryNameForVirtualPath(const QString &str);
@ -255,49 +255,49 @@ private:
private:
static QImage createThumbnail(const QString &path);
//void addImageToCurrentPage( const QString &path );
void loadFavoriteList();
void saveFavoriteList();
//void addImageToCurrentPage( const QString &path );
void loadFavoriteList();
void saveFavoriteList();
QString uniqNameForFeature(const UBFeature &feature, const QString &pName = "Imported", const QString &pExtention = "") const;
QString adjustName(const QString &str);
QList <UBFeature> *featuresList;
QUrl mUserAudioDirectoryPath;
QUrl mUserAudioDirectoryPath;
QUrl mUserVideoDirectoryPath;
QUrl mUserPicturesDirectoryPath;
QUrl mUserInteractiveDirectoryPath;
QUrl mUserAnimationDirectoryPath;
QString libraryPath;
QString libraryPath;
QUrl mLibPicturesDirectoryPath;
QUrl mLibAudiosDirectoryPath;
QUrl mLibVideosDirectoryPath;
QUrl mLibAudiosDirectoryPath;
QUrl mLibVideosDirectoryPath;
QUrl mLibInteractiveDirectoryPath;
QUrl mLibAnimationsDirectoryPath;
QUrl mLibApplicationsDirectoryPath;
QUrl mLibShapesDirectoryPath;
QUrl mLibApplicationsDirectoryPath;
QUrl mLibShapesDirectoryPath;
QUrl trashDirectoryPath;
QUrl mLibSearchDirectoryPath;
QUrl trashDirectoryPath;
QUrl mLibSearchDirectoryPath;
int mLastItemOffsetIndex;
UBFeature currentElement;
int mLastItemOffsetIndex;
UBFeature currentElement;
UBFeature rootElement;
UBFeature favoriteElement;
UBFeature audiosElement;
UBFeature moviesElement;
UBFeature picturesElement;
UBFeature interactElement;
UBFeature audiosElement;
UBFeature moviesElement;
UBFeature picturesElement;
UBFeature interactElement;
UBFeature applicationsElement;
UBFeature flashElement;
UBFeature shapesElement;
UBFeature webSearchElement;
UBFeature flashElement;
UBFeature shapesElement;
UBFeature webSearchElement;
QSet <QUrl> *favoriteSet;
QSet <QUrl> *favoriteSet;
public:
UBFeature trashElement;

@ -51,17 +51,17 @@ struct UBStylusTool
enum Enum
{
Pen = 0,
Eraser,
Marker,
Selector,
Eraser,
Marker,
Selector,
Play,
Hand,
ZoomIn,
ZoomOut,
Pointer,
Line,
Text,
Capture
Hand,
ZoomIn,
ZoomOut,
Pointer,
Line,
Text,
Capture
};
};
@ -139,18 +139,18 @@ struct UBGraphicsItemType
enum Enum
{
PolygonItemType = QGraphicsItem::UserType + 1,
PixmapItemType,
PixmapItemType,
SvgItemType,
DelegateButtonType,
MediaItemType,
PDFItemType,
TextItemType,
CurtainItemType,
MediaItemType,
PDFItemType,
TextItemType,
CurtainItemType,
RulerItemType,
CompassItemType,
ProtractorItemType,
StrokeItemType,
TriangleItemType,
CompassItemType,
ProtractorItemType,
StrokeItemType,
TriangleItemType,
MagnifierItemType,
cacheItemType,
AristoItemType,

@ -658,17 +658,17 @@ bool UBApplication::handleOpenMessage(const QString& pMessage)
void UBApplication::cleanup()
{
if (applicationController) delete applicationController;
if (boardController) delete boardController;
if (webController) delete webController;
if (documentController) delete documentController;
if (applicationController) delete applicationController;
if (boardController) delete boardController;
if (webController) delete webController;
if (documentController) delete documentController;
if (mUniboardSankoreTransition) delete mUniboardSankoreTransition;
applicationController = NULL;
boardController = NULL;
webController = NULL;
documentController = NULL;
applicationController = NULL;
boardController = NULL;
webController = NULL;
documentController = NULL;
mUniboardSankoreTransition = NULL;
}
@ -707,19 +707,19 @@ void UBStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment,
QString UBApplication::urlFromHtml(QString html)
{
QString _html;
QRegExp comments("\\<![ \r\n\t]*(--([^\\-]|[\r\n]|-[^\\-])*--[ \r\n\t]*)\\>");
QString url;
QString _html;
QRegExp comments("\\<![ \r\n\t]*(--([^\\-]|[\r\n]|-[^\\-])*--[ \r\n\t]*)\\>");
QString url;
QDomDocument domDoc;
// We remove all the comments & CRLF of this html
_html = html.remove(comments);
domDoc.setContent(_html.remove(QRegExp("[\\0]")));
// We remove all the comments & CRLF of this html
_html = html.remove(comments);
domDoc.setContent(_html.remove(QRegExp("[\\0]")));
QDomElement rootElem = domDoc.documentElement();
// QUICKFIX: Here we have to check rootElem. Sometimes it can be a <meta> tag
// In such a case we will not be able to retrieve the src value
if(rootElem.tagName().toLower().contains("meta")){
if(rootElem.tagName().toLower().contains("meta")){
qDebug() << rootElem.firstChildElement().tagName();
// In that case we get the next element
url = rootElem.firstChildElement().attribute("src");
@ -727,7 +727,7 @@ QString UBApplication::urlFromHtml(QString html)
url = rootElem.attribute("src");
}
return url;
return url;
}
bool UBApplication::isFromWeb(QString url)

@ -58,7 +58,7 @@ class UBApplication : public QtSingleApplication
int exec(const QString& pFileToImport);
void cleanup();
void cleanup();
static QPointer<QUndoStack> undoStack;

@ -233,10 +233,10 @@ void UBApplicationController::adjustDisplayView()
QRect rect = mControlView->rect();
QPoint center(rect.x() + rect.width() / 2, rect.y() + rect.height() / 2);
QTransform recentTransform = mDisplayView->transform();
QTransform recentTransform = mDisplayView->transform();
if (recentTransform != tr)
mDisplayView->setTransform(tr);
if (recentTransform != tr)
mDisplayView->setTransform(tr);
mDisplayView->centerOn(mControlView->mapToScene(center));
}
@ -493,22 +493,22 @@ void UBApplicationController::showTutorial()
}
else{
mMainWindow->webToolBar->hide();
mMainWindow->boardToolBar->hide();
mMainWindow->documentToolBar->hide();
mMainWindow->tutorialToolBar->show();
mMainWindow->webToolBar->hide();
mMainWindow->boardToolBar->hide();
mMainWindow->documentToolBar->hide();
mMainWindow->tutorialToolBar->show();
mMainMode = Tutorial;
mMainMode = Tutorial;
adaptToolBar();
adaptToolBar();
mUninoteController->hideWindow();
mUninoteController->hideWindow();
UBApplication::webController->show(UBWebController::Tutorial);
UBApplication::webController->show(UBWebController::Tutorial);
mirroringEnabled(false);
emit mainModeChanged(mMainMode);
mirroringEnabled(false);
emit mainModeChanged(mMainMode);
}
}
@ -543,7 +543,7 @@ void UBApplicationController::showSankoreEditor()
void UBApplicationController::checkUpdate()
{
if(mHttp)
if(mHttp)
delete mHttp;
QUrl url("http://ftp.open-sankore.org/update.json");
mHttp = new QHttp(url.host());

@ -615,7 +615,7 @@ void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy,
UBBoardPaletteManager* paletteManager = UBApplication::boardController->paletteManager();
bool teacherGuideModified = false;
if(UBApplication::app()->boardController->currentPage() == pSceneIndex && paletteManager->teacherGuideDockWidget())
teacherGuideModified = paletteManager->teacherGuideDockWidget()->teacherGuideWidget()->isModified();
teacherGuideModified = paletteManager->teacherGuideDockWidget()->teacherGuideWidget()->isModified();
if (pDocumentProxy->isModified() || teacherGuideModified)
UBMetadataDcSubsetAdaptor::persist(pDocumentProxy);
@ -873,7 +873,7 @@ QString UBPersistenceManager::teacherGuideAbsoluteObjectPath(UBDocumentProxy* pD
QString UBPersistenceManager::addObjectToTeacherGuideDirectory(UBDocumentProxy* pDocumentProxy, QString pPath)
{
QString path = UBFileSystemUtils::removeLocalFilePrefix(pPath);
QFileInfo fi(path);
QFileInfo fi(path);
QString uuid = QUuid::createUuid();
if (!fi.exists() || !pDocumentProxy)

@ -61,7 +61,7 @@ class UBSetting : public QObject
public slots:
void setBool(bool pValue);
void setString(const QString& pValue);
void setString(const QString& pValue);
void setInt(int pValue);
signals:

@ -123,21 +123,21 @@ eMediaType UBMediaWidget::mediaType()
void UBMediaWidget::showEvent(QShowEvent* event)
{
if(mType == eMediaType_Audio){
return;
}else{
if(!mpVideoWidget){
mpVideoWidget = new Phonon::VideoWidget(this);
mMediaLayout->addStretch(1);
mMediaLayout->addWidget(mpVideoWidget);
mMediaLayout->addStretch(1);
Phonon::createPath(mpMediaObject, mpVideoWidget);
adaptSizeToVideo();
mpMediaObject->play();
mpMediaObject->stop();
}
QWidget::showEvent(event);
}
if(mType == eMediaType_Audio){
return;
}else{
if(!mpVideoWidget){
mpVideoWidget = new Phonon::VideoWidget(this);
mMediaLayout->addStretch(1);
mMediaLayout->addWidget(mpVideoWidget);
mMediaLayout->addStretch(1);
Phonon::createPath(mpMediaObject, mpVideoWidget);
adaptSizeToVideo();
mpMediaObject->play();
mpMediaObject->stop();
}
QWidget::showEvent(event);
}
}
void UBMediaWidget::hideEvent(QHideEvent* event)

@ -396,7 +396,7 @@ void UBDesktopAnnotationController::hideWindow()
void UBDesktopAnnotationController::goToUniboard()
{
onToolClicked();
onToolClicked();
hideWindow();
UBPlatformUtils::setDesktopMode(false);
@ -408,7 +408,7 @@ void UBDesktopAnnotationController::goToUniboard()
void UBDesktopAnnotationController::customCapture()
{
onToolClicked();
onToolClicked();
mIsFullyTransparent = true;
updateBackground();
@ -435,7 +435,7 @@ void UBDesktopAnnotationController::customCapture()
void UBDesktopAnnotationController::windowCapture()
{
onToolClicked();
onToolClicked();
mIsFullyTransparent = true;
updateBackground();
@ -957,7 +957,7 @@ void UBDesktopAnnotationController::refreshMask()
void UBDesktopAnnotationController::onToolClicked()
{
mDesktopEraserPalette->hide();
mDesktopMarkerPalette->hide();
mDesktopPenPalette->hide();
mDesktopEraserPalette->hide();
mDesktopMarkerPalette->hide();
mDesktopPenPalette->hide();
}

@ -61,7 +61,7 @@ class UBDesktopPalette : public UBActionPalette
void updateShowHideState(bool pShowEnabled);
void setShowHideButtonVisible(bool visible);
void setDisplaySelectButtonVisible(bool show);
void minimizeMe(eMinimizedLocation location);
void minimizeMe(eMinimizedLocation location);
void maximizeMe();
void parentResized();

@ -141,6 +141,6 @@ int UBDocumentContainer::sceneIndexFromPage(int page)
void UBDocumentContainer::addEmptyThumbPage()
{
const QPixmap* pThumb = new QPixmap();
mDocumentThumbs.append(pThumb);
const QPixmap* pThumb = new QPixmap();
mDocumentThumbs.append(pThumb);
}

@ -488,7 +488,7 @@ void UBDocumentController::duplicateSelectedItem()
if (UBApplication::applicationController->displayMode() != UBApplicationController::Document)
return;
if (mSelectionType == Page)
if (mSelectionType == Page)
{
QList<QGraphicsItem*> selectedItems = mDocumentUI->thumbnailWidget->selectedItems();
QList<int> selectedSceneIndexes;
@ -1141,26 +1141,26 @@ void UBDocumentController::selectionChanged()
mMainWindow->actionNewDocument->setEnabled((groupSelected || docSelected || pageSelected) && !trashSelected);
mMainWindow->actionExport->setEnabled((docSelected || pageSelected) && !trashSelected);
bool firstSceneSelected = false;
bool firstSceneSelected = false;
if(docSelected)
mMainWindow->actionDuplicate->setEnabled(!trashSelected);
mMainWindow->actionDuplicate->setEnabled(!trashSelected);
else if(pageSelected){
QList<QGraphicsItem*> selection = mDocumentUI->thumbnailWidget->selectedItems();
if(pageCount == 1)
mMainWindow->actionDuplicate->setEnabled(!trashSelected && pageCanBeDuplicated(UBDocumentContainer::pageFromSceneIndex(0)));
else{
for(int i = 0; i < selection.count() && !firstSceneSelected; i += 1){
if(dynamic_cast<UBSceneThumbnailPixmap*>(selection.at(i))->sceneIndex() == 0){
mMainWindow->actionDuplicate->setEnabled(!trashSelected && pageCanBeDuplicated(UBDocumentContainer::pageFromSceneIndex(0)));
firstSceneSelected = true;
}
}
if(!firstSceneSelected)
mMainWindow->actionDuplicate->setEnabled(!trashSelected);
}
QList<QGraphicsItem*> selection = mDocumentUI->thumbnailWidget->selectedItems();
if(pageCount == 1)
mMainWindow->actionDuplicate->setEnabled(!trashSelected && pageCanBeDuplicated(UBDocumentContainer::pageFromSceneIndex(0)));
else{
for(int i = 0; i < selection.count() && !firstSceneSelected; i += 1){
if(dynamic_cast<UBSceneThumbnailPixmap*>(selection.at(i))->sceneIndex() == 0){
mMainWindow->actionDuplicate->setEnabled(!trashSelected && pageCanBeDuplicated(UBDocumentContainer::pageFromSceneIndex(0)));
firstSceneSelected = true;
}
}
if(!firstSceneSelected)
mMainWindow->actionDuplicate->setEnabled(!trashSelected);
}
}
else
mMainWindow->actionDuplicate->setEnabled(false);
mMainWindow->actionDuplicate->setEnabled(false);
mMainWindow->actionOpen->setEnabled((docSelected || pageSelected) && !trashSelected);
mMainWindow->actionRename->setEnabled((groupSelected || docSelected) && !trashSelected && !defaultGroupSelected);
@ -1190,7 +1190,7 @@ void UBDocumentController::selectionChanged()
}
if(pageSelected && firstSceneSelected)
deleteEnabled = false;
deleteEnabled = false;
mMainWindow->actionDelete->setEnabled(deleteEnabled);
@ -1632,28 +1632,28 @@ int UBDocumentController::getSelectedItemIndex()
bool UBDocumentController::pageCanBeMovedUp(int page)
{
if(UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool())
return page >= 2;
else
return page >= 1;
if(UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool())
return page >= 2;
else
return page >= 1;
}
bool UBDocumentController::pageCanBeMovedDown(int page)
{
if(UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool())
return page != 0 && page < selectedDocument()->pageCount() - 1;
else
return page < selectedDocument()->pageCount() - 1;
if(UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool())
return page != 0 && page < selectedDocument()->pageCount() - 1;
else
return page < selectedDocument()->pageCount() - 1;
}
bool UBDocumentController::pageCanBeDuplicated(int page)
{
return page != 0;
return page != 0;
}
bool UBDocumentController::pageCanBeDeleted(int page)
{
return page != 0;
return page != 0;
}
void UBDocumentController::refreshDocumentThumbnailsView(UBDocumentContainer*)
@ -1685,9 +1685,9 @@ void UBDocumentController::refreshDocumentThumbnailsView(UBDocumentContainer*)
items << pixmapItem;
int pageIndex = pageFromSceneIndex(i);
if(pageIndex)
labels << tr("Page %1").arg(pageIndex);
labels << tr("Page %1").arg(pageIndex);
else
labels << tr("Title page");
labels << tr("Title page");
itemsPath.append(QUrl::fromLocalFile(proxy->persistencePath() + QString("/pages/%1").arg(UBDocumentContainer::pageFromSceneIndex(i))));
}

@ -39,7 +39,7 @@ UBGraphicsGroupContainerItem::UBGraphicsGroupContainerItem(QGraphicsItem *parent
{
setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::Object);
setDelegate(new UBGraphicsGroupContainerItemDelegate(this, 0));
setDelegate(new UBGraphicsGroupContainerItemDelegate(this, 0));
Delegate()->init();
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);

@ -79,13 +79,13 @@ void UBGraphicsPolygonItem::setUuid(const QUuid &pUuid)
void UBGraphicsPolygonItem::clearStroke()
{
if (mStroke!=NULL)
{
if (mStroke!=NULL)
{
mStroke->remove(this);
if (mStroke->polygons().empty())
delete mStroke;
mStroke = NULL;
}
}
}
UBGraphicsPolygonItem::~UBGraphicsPolygonItem()

@ -313,7 +313,7 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
UBGraphicsPolygonItem* polygonToPolygonItem(const QPolygonF pPolygon);
public slots:
void initStroke();
void initStroke();
void hideEraser();
void setBackground(bool pIsDark, bool pIsCrossed);

@ -135,18 +135,18 @@ void UBGraphicsStrokesGroup::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
UBItem* UBGraphicsStrokesGroup::deepCopy() const
{
UBGraphicsStrokesGroup* copy = new UBGraphicsStrokesGroup();
UBGraphicsStrokesGroup* copy = new UBGraphicsStrokesGroup();
QTransform groupTransform = transform();
const_cast<UBGraphicsStrokesGroup*>(this)->resetTransform();
QTransform groupTransform = transform();
const_cast<UBGraphicsStrokesGroup*>(this)->resetTransform();
QList<QGraphicsItem*> chl = childItems();
QList<QGraphicsItem*> chl = childItems();
foreach(QGraphicsItem *child, chl)
{
UBGraphicsPolygonItem *polygon = dynamic_cast<UBGraphicsPolygonItem*>(child);
foreach(QGraphicsItem *child, chl)
{
UBGraphicsPolygonItem *polygon = dynamic_cast<UBGraphicsPolygonItem*>(child);
if (polygon){
if (polygon){
UBGraphicsPolygonItem *polygonCopy = dynamic_cast<UBGraphicsPolygonItem*>(polygon->deepCopy());
if (polygonCopy)
{
@ -154,18 +154,18 @@ UBItem* UBGraphicsStrokesGroup::deepCopy() const
copy->addToGroup(pItem);
polygonCopy->setStrokesGroup(copy);
}
}
}
}
const_cast<UBGraphicsStrokesGroup*>(this)->setTransform(groupTransform);
copyItemParameters(copy);
}
const_cast<UBGraphicsStrokesGroup*>(this)->setTransform(groupTransform);
copyItemParameters(copy);
return copy;
return copy;
}
void UBGraphicsStrokesGroup::copyItemParameters(UBItem *copy) const
{
QGraphicsItem *cp = dynamic_cast<QGraphicsItem*>(copy);
QGraphicsItem *cp = dynamic_cast<QGraphicsItem*>(copy);
if(NULL != cp)
{
cp->setTransform(transform());

@ -27,7 +27,7 @@
void UBPlatformUtils::destroy()
{
destroyKeyboardLayouts();
destroyKeyboardLayouts();
}
UBPlatformUtils::UBPlatformUtils()
@ -42,19 +42,19 @@ UBPlatformUtils::~UBPlatformUtils()
bool UBPlatformUtils::hasVirtualKeyboard()
{
return keyboardLayouts!=NULL && nKeyboardLayouts!=0;
return keyboardLayouts!=NULL && nKeyboardLayouts!=0;
}
UBKeyboardLocale::~UBKeyboardLocale()
{
if (varSymbols!=NULL)
{
for(int i=0; i<SYMBOL_KEYS_COUNT; i++)
delete varSymbols[i];
delete [] varSymbols;
}
delete icon;
if (varSymbols!=NULL)
{
for(int i=0; i<SYMBOL_KEYS_COUNT; i++)
delete varSymbols[i];
delete [] varSymbols;
}
delete icon;
}
@ -63,7 +63,7 @@ UBKeyboardLocale** UBPlatformUtils::keyboardLayouts;
UBKeyboardLocale** UBPlatformUtils::getKeyboardLayouts(int& nCount)
{
nCount = nKeyboardLayouts;
return keyboardLayouts;
nCount = nKeyboardLayouts;
return keyboardLayouts;
}

@ -89,14 +89,14 @@ struct KEYCODE{
struct KEYBT
{
QChar symbol1;
QChar symbol2;
QChar symbol2;
bool capsLockSwitch;
int modifier1;
int modifier2;
KEYCODE codes[8];
KEYBT( QChar _symbol1,
QChar _symbol2,
QChar _symbol2,
bool _capsLockSwitch,
int _modifier1,
int _modifier2,
@ -130,40 +130,40 @@ struct KEYBT
class UBKeyboardLocale
{
public:
UBKeyboardLocale(const QString& _fullName,
const QString& _name,
const QString& _id,
QIcon* _icon,
KEYBT** _symbols)
:fullName(_fullName),name(_name), id(_id), icon(_icon),
class UBKeyboardLocale
{
public:
UBKeyboardLocale(const QString& _fullName,
const QString& _name,
const QString& _id,
QIcon* _icon,
KEYBT** _symbols)
:fullName(_fullName),name(_name), id(_id), icon(_icon),
constSymbols(NULL), varSymbols(_symbols)
{}
UBKeyboardLocale(const QString& _fullName,
const QString& _name,
const QString& _id,
QIcon* _icon,
{}
UBKeyboardLocale(const QString& _fullName,
const QString& _name,
const QString& _id,
QIcon* _icon,
KEYBT _symbols[])
:fullName(_fullName),name(_name), id(_id), icon(_icon),
:fullName(_fullName),name(_name), id(_id), icon(_icon),
constSymbols(_symbols), varSymbols(NULL)
{}
{}
~UBKeyboardLocale();
~UBKeyboardLocale();
const QString fullName;
const QString name;
const QString id;
QIcon* icon;
const QString fullName;
const QString name;
const QString id;
QIcon* icon;
KEYBT* operator[] (int index) const
{
return (varSymbols==NULL)? constSymbols + index : varSymbols[index];
}
private:
{
return (varSymbols==NULL)? constSymbols + index : varSymbols[index];
}
private:
KEYBT* constSymbols;
KEYBT** varSymbols;
};
KEYBT** varSymbols;
};
class UBPlatformUtils

@ -34,7 +34,7 @@
void UBPlatformUtils::init()
{
initializeKeyboardLayouts();
initializeKeyboardLayouts();
}
QString UBPlatformUtils::applicationResourcesDirectory()
@ -68,11 +68,11 @@ void UBPlatformUtils::fadeDisplayIn()
QStringList UBPlatformUtils::availableTranslations()
{
QString translationsPath = applicationResourcesDirectory() + "/" + "i18n" + "/";
QStringList translationsList = UBFileSystemUtils::allFiles(translationsPath);
QRegExp sankoreTranslationFiles(".*sankore_.*.qm");
translationsList=translationsList.filter(sankoreTranslationFiles);
return translationsList.replaceInStrings(QRegExp("(.*)sankore_(.*).qm"),"\\2");
QString translationsPath = applicationResourcesDirectory() + "/" + "i18n" + "/";
QStringList translationsList = UBFileSystemUtils::allFiles(translationsPath);
QRegExp sankoreTranslationFiles(".*sankore_.*.qm");
translationsList=translationsList.filter(sankoreTranslationFiles);
return translationsList.replaceInStrings(QRegExp("(.*)sankore_(.*).qm"),"\\2");
}
QString UBPlatformUtils::translationPath(QString pFilePrefix,QString pLanguage)
@ -351,57 +351,57 @@ KEYBT FRENCH_LOCALE[] = {
KEYBT SWISS_FRENCH_LOCALE[] = {
/* § °*/ KEYBTDECL(0xa7, 0xb0, false, 41),
/* 1 +*/ KEYBTDECL(0x31, 0x2b, false, 2),
/* § °*/ KEYBTDECL(0xa7, 0xb0, false, 41),
/* 1 +*/ KEYBTDECL(0x31, 0x2b, false, 2),
/* 2 "*/ KEYBTDECL(0x32, 0x22, false, 3),
/* 3 **/ KEYBTDECL(0x33, 0x2a, false, 4),
/* 3 **/ KEYBTDECL(0x33, 0x2a, false, 4),
/* 4 ç*/ KEYBTDECL(0x34, 0xe7, false, 5),
/* 5 %*/ KEYBTDECL(0x35, 0x25, false, 6),
/* 6 &*/ KEYBTDECL(0x36, 0x26, false, 7),
/* 7 /*/ KEYBTDECL(0x37, 0x2f, false, 8),
/* 8 (*/ KEYBTDECL(0x38, 0x28, false, 9),
/* 9 )*/ KEYBTDECL(0x39, 0x29, false, 10),
/* 0 =*/ KEYBTDECL(0x30, 0x3d, false, 11),
/* ' ?*/ KEYBTDECL(0x27, 0x5f, false, 12),
/* ^ `*/ KEYBT(0x5e, 0x60, false, 1, 2, KEYCODE(0x5e, 13, 0), KEYCODE(0x60, 13, 1)),
/* q Q*/ KEYBTDECL(0x71, 0x51, true, 16),
/* w W*/ KEYBTDECL(0x77, 0x57, true, 17),
/* e E*/ KEYBTDECLEX8(0x65, 0x45, true, 18, 0x65, 0x45, 0xea, 0xca, 0xe8, 0xc8, 0xeb, 0xcb),
/* 9 )*/ KEYBTDECL(0x39, 0x29, false, 10),
/* 0 =*/ KEYBTDECL(0x30, 0x3d, false, 11),
/* ' ?*/ KEYBTDECL(0x27, 0x5f, false, 12),
/* ^ `*/ KEYBT(0x5e, 0x60, false, 1, 2, KEYCODE(0x5e, 13, 0), KEYCODE(0x60, 13, 1)),
/* q Q*/ KEYBTDECL(0x71, 0x51, true, 16),
/* w W*/ KEYBTDECL(0x77, 0x57, true, 17),
/* e E*/ KEYBTDECLEX8(0x65, 0x45, true, 18, 0x65, 0x45, 0xea, 0xca, 0xe8, 0xc8, 0xeb, 0xcb),
/* r R*/ KEYBTDECL(0x72, 0x52, true, 19),
/* t T*/ KEYBTDECL(0x74, 0x54, true, 20),
/* z Z*/ KEYBTDECL(0x7a, 0x5a, true, 21),
/* u U*/ KEYBTDECLEX8(0x75, 0x55, true, 22, 0x75, 0x55, 0xfb, 0xdb, 0xf9, 0xd9, 0xfc, 0xdc),
/* i I*/ KEYBTDECLEX8(0x69, 0x49, true, 23, 0x69, 0x49, 0xee, 0xce, 0xec, 0xcc, 0xef, 0xcf),
/* o O*/ KEYBTDECLEX8(0x6f, 0x4f, true, 24, 0x6f, 0x4f, 0xf4, 0xd4, 0xf2, 0xd2, 0xf6, 0xd6),
/* p P*/ KEYBTDECL(0x70, 0x50, true, 25),
/* è ü*/ KEYBTDECL(0xe8, 0xfa, false, 26),
/* ¨ !*/ KEYBT(0xa8, 0x21, false, 3, 0, KEYCODE(0xa8, 27, 0), KEYCODE(0x21, 27, 1)),
/* a A*/ KEYBTDECLEX8(0x61, 0x41, true, 30, 0x61, 0x41, 0xe2, 0xc2, 0xe0, 0xc0, 0xe4, 0xc4),
/* s S*/ KEYBTDECL(0x73, 0x53, true, 31),
/* d D*/ KEYBTDECL(0x64, 0x44, true, 32),
/* f F*/ KEYBTDECL(0x66, 0x46, true, 33),
/* g G*/ KEYBTDECL(0x67, 0x47, true, 34),
/* h H*/ KEYBTDECL(0x68, 0x48, true, 35),
/* j J*/ KEYBTDECL(0x6a, 0x4a, true, 36),
/* k K*/ KEYBTDECL(0x6b, 0x4b, true, 37),
/* l L*/ KEYBTDECL(0x6c, 0x4c, true, 38),
/* é ö*/ KEYBTDECL(0xe9, 0xf6, false, 39),
/* à ä*/ KEYBTDECL(0xe0, 0xe4, false, 40),
/* $ £*/ KEYBTDECL(0x24, 0xa3, false, 43),
/* < >*/ KEYBTDECL(0x3c, 0x3e, false, 44),
/* y Y*/ KEYBTDECLEX8(0x79, 0x59, true, 45, 0x79, 0x59, 0, 0, 0, 0, 0xff, 0),
/* x X*/ KEYBTDECL(0x78, 0x58, true, 46),
/* c C*/ KEYBTDECL(0x63, 0x43, true, 47),
/* v V*/ KEYBTDECL(0x76, 0x56, true, 48),
/* b B*/ KEYBTDECL(0x62, 0x42, true, 49),
/* n N*/ KEYBTDECL(0x6e, 0x4e, true, 50),
/* m M*/ KEYBTDECL(0x6d, 0x4d, true, 51),
/* , ;*/ KEYBTDECL(0x2c, 0x3b, false, 52),
/* . :*/ KEYBTDECL(0x2e, 0x3a, false, 53),
/* - _*/ KEYBTDECL(0x2d, 0x5f, false, 54)};
/* t T*/ KEYBTDECL(0x74, 0x54, true, 20),
/* z Z*/ KEYBTDECL(0x7a, 0x5a, true, 21),
/* u U*/ KEYBTDECLEX8(0x75, 0x55, true, 22, 0x75, 0x55, 0xfb, 0xdb, 0xf9, 0xd9, 0xfc, 0xdc),
/* i I*/ KEYBTDECLEX8(0x69, 0x49, true, 23, 0x69, 0x49, 0xee, 0xce, 0xec, 0xcc, 0xef, 0xcf),
/* o O*/ KEYBTDECLEX8(0x6f, 0x4f, true, 24, 0x6f, 0x4f, 0xf4, 0xd4, 0xf2, 0xd2, 0xf6, 0xd6),
/* p P*/ KEYBTDECL(0x70, 0x50, true, 25),
/* è ü*/ KEYBTDECL(0xe8, 0xfa, false, 26),
/* ¨ !*/ KEYBT(0xa8, 0x21, false, 3, 0, KEYCODE(0xa8, 27, 0), KEYCODE(0x21, 27, 1)),
/* a A*/ KEYBTDECLEX8(0x61, 0x41, true, 30, 0x61, 0x41, 0xe2, 0xc2, 0xe0, 0xc0, 0xe4, 0xc4),
/* s S*/ KEYBTDECL(0x73, 0x53, true, 31),
/* d D*/ KEYBTDECL(0x64, 0x44, true, 32),
/* f F*/ KEYBTDECL(0x66, 0x46, true, 33),
/* g G*/ KEYBTDECL(0x67, 0x47, true, 34),
/* h H*/ KEYBTDECL(0x68, 0x48, true, 35),
/* j J*/ KEYBTDECL(0x6a, 0x4a, true, 36),
/* k K*/ KEYBTDECL(0x6b, 0x4b, true, 37),
/* l L*/ KEYBTDECL(0x6c, 0x4c, true, 38),
/* é ö*/ KEYBTDECL(0xe9, 0xf6, false, 39),
/* à ä*/ KEYBTDECL(0xe0, 0xe4, false, 40),
/* $ £*/ KEYBTDECL(0x24, 0xa3, false, 43),
/* < >*/ KEYBTDECL(0x3c, 0x3e, false, 44),
/* y Y*/ KEYBTDECLEX8(0x79, 0x59, true, 45, 0x79, 0x59, 0, 0, 0, 0, 0xff, 0),
/* x X*/ KEYBTDECL(0x78, 0x58, true, 46),
/* c C*/ KEYBTDECL(0x63, 0x43, true, 47),
/* v V*/ KEYBTDECL(0x76, 0x56, true, 48),
/* b B*/ KEYBTDECL(0x62, 0x42, true, 49),
/* n N*/ KEYBTDECL(0x6e, 0x4e, true, 50),
/* m M*/ KEYBTDECL(0x6d, 0x4d, true, 51),
/* , ;*/ KEYBTDECL(0x2c, 0x3b, false, 52),
/* . :*/ KEYBTDECL(0x2e, 0x3a, false, 53),
/* - _*/ KEYBTDECL(0x2d, 0x5f, false, 54)};
void UBPlatformUtils::initializeKeyboardLayouts()
@ -418,9 +418,9 @@ void UBPlatformUtils::initializeKeyboardLayouts()
void UBPlatformUtils::destroyKeyboardLayouts()
{
for(int i=0; i<nKeyboardLayouts; i++)
delete keyboardLayouts[i];
delete [] keyboardLayouts;
keyboardLayouts = NULL;
delete keyboardLayouts[i];
delete [] keyboardLayouts;
keyboardLayouts = NULL;
}
QString UBPlatformUtils::urlFromClipboard()

@ -33,7 +33,7 @@
void UBPlatformUtils::init()
{
initializeKeyboardLayouts();
initializeKeyboardLayouts();
}
@ -70,11 +70,11 @@ void UBPlatformUtils::fadeDisplayIn()
QStringList UBPlatformUtils::availableTranslations()
{
QString translationsPath = applicationResourcesDirectory() + "/" + "i18n" + "/";
QStringList translationsList = UBFileSystemUtils::allFiles(translationsPath);
QRegExp sankoreTranslationFiles(".*sankore_.*.qm");
translationsList=translationsList.filter(sankoreTranslationFiles);
return translationsList.replaceInStrings(QRegExp("(.*)sankore_(.*).qm"),"\\2");
QString translationsPath = applicationResourcesDirectory() + "/" + "i18n" + "/";
QStringList translationsList = UBFileSystemUtils::allFiles(translationsPath);
QRegExp sankoreTranslationFiles(".*sankore_.*.qm");
translationsList=translationsList.filter(sankoreTranslationFiles);
return translationsList.replaceInStrings(QRegExp("(.*)sankore_(.*).qm"),"\\2");
}
QString UBPlatformUtils::translationPath(QString pFilePrefix,QString pLanguage)
@ -139,282 +139,282 @@ void UBPlatformUtils::setDesktopMode(bool desktop)
void UBPlatformUtils::setWindowNonActivableFlag(QWidget* widget, bool nonAcivable)
{
long exStyle = (nonAcivable) ? GetWindowLong(widget->winId(), GWL_EXSTYLE) | WS_EX_NOACTIVATE
: GetWindowLong(widget->winId(), GWL_EXSTYLE) & ~WS_EX_NOACTIVATE;
long exStyle = (nonAcivable) ? GetWindowLong(widget->winId(), GWL_EXSTYLE) | WS_EX_NOACTIVATE
: GetWindowLong(widget->winId(), GWL_EXSTYLE) & ~WS_EX_NOACTIVATE;
SetWindowLong(widget->winId(), GWL_EXSTYLE, exStyle);
SetWindowLong(widget->winId(), GWL_EXSTYLE, exStyle);
}
#define KEYBTDECL(s1, s2, clSwitch) KEYBT(s1, s2, clSwitch, 0, 0, KEYCODE(s1), KEYCODE(s2))
KEYBT RUSSIAN_LOCALE [] =
{
/* Ј і */ KEYBTDECL(0x451, 0x401, true),
/* 1 ! */ KEYBTDECL(0x31, 0x21, false),
/* 2 " */ KEYBTDECL(0x32, 0x5c, false),
/* 3 ? */ KEYBTDECL(0x33, 0x2116, false),
/* 4 ; */ KEYBTDECL(0x34, 0x3b, false),
/* 5 % */ KEYBTDECL(0x35, 0x25, false),
/* 6 : */ KEYBTDECL(0x36, 0x3a, false),
/* 7 ? */ KEYBTDECL(0x37, 0x3f, false),
/* 8 * */ KEYBTDECL(0x38, 0x2a, false),
/* 9 ( */ KEYBTDECL(0x39, 0x28, false),
/* 0 ) */ KEYBTDECL(0x30, 0x29, false),
/* - _ */ KEYBTDECL(0x2d, 0x4f, false),
/* = + */ KEYBTDECL(0x3d, 0x2b, false),
/* К к */ KEYBTDECL(0x439, 0x419, true),
/* Г г */ KEYBTDECL(0x446, 0x426, true),
/* Х х */ KEYBTDECL(0x443, 0x423, true),
/* Л л */ KEYBTDECL(0x43a, 0x41a, true),
/* Е е */ KEYBTDECL(0x435, 0x415, true),
/* О о */ KEYBTDECL(0x43d, 0x41d, true),
/* З з */ KEYBTDECL(0x433, 0x413, true),
/* Ы ы */ KEYBTDECL(0x448, 0x428, true),
/* Э э */ KEYBTDECL(0x449, 0x429, true),
/* Ъ ъ */ KEYBTDECL(0x437, 0x417, true),
/* И и */ KEYBTDECL(0x445, 0x425, true),
/* Я я */ KEYBTDECL(0x44a, 0x42a, true),
/* Ж ж */ KEYBTDECL(0x444, 0x424, true),
/* Щ щ */ KEYBTDECL(0x44b, 0x42b, true),
/* Ч ч */ KEYBTDECL(0x432, 0x412, true),
/* Б б */ KEYBTDECL(0x430, 0x410, true),
/* Р р */ KEYBTDECL(0x43f, 0x41f, true),
/* Т т */ KEYBTDECL(0x440, 0x420, true),
/* П п */ KEYBTDECL(0x43e, 0x41e, true),
/* М м */ KEYBTDECL(0x43b, 0x41b, true),
/* Д д */ KEYBTDECL(0x434, 0x414, true),
/* Ц ц */ KEYBTDECL(0x436, 0x416, true),
/* Ь ь */ KEYBTDECL(0x44d, 0x42d, true),
/* \ / */ KEYBTDECL(0x5c, 0x2f, false),
/* С с */ KEYBTDECL(0x44f, 0x42f, true),
/* Ю ю */ KEYBTDECL(0x447, 0x427, true),
/* У у */ KEYBTDECL(0x441, 0x421, true),
/* Н н */ KEYBTDECL(0x43c, 0x41c, true),
/* Й й */ KEYBTDECL(0x438, 0x418, true),
/* Ф ф */ KEYBTDECL(0x442, 0x422, true),
/* Ш ш */ KEYBTDECL(0x44c, 0x42c, true),
/* В в */ KEYBTDECL(0x431, 0x411, true),
/* А а */ KEYBTDECL(0x44e, 0x42e, true),
/* . , */ KEYBTDECL(0x2e, 0x2c, false)};
/* Ј і */ KEYBTDECL(0x451, 0x401, true),
/* 1 ! */ KEYBTDECL(0x31, 0x21, false),
/* 2 " */ KEYBTDECL(0x32, 0x5c, false),
/* 3 ? */ KEYBTDECL(0x33, 0x2116, false),
/* 4 ; */ KEYBTDECL(0x34, 0x3b, false),
/* 5 % */ KEYBTDECL(0x35, 0x25, false),
/* 6 : */ KEYBTDECL(0x36, 0x3a, false),
/* 7 ? */ KEYBTDECL(0x37, 0x3f, false),
/* 8 * */ KEYBTDECL(0x38, 0x2a, false),
/* 9 ( */ KEYBTDECL(0x39, 0x28, false),
/* 0 ) */ KEYBTDECL(0x30, 0x29, false),
/* - _ */ KEYBTDECL(0x2d, 0x4f, false),
/* = + */ KEYBTDECL(0x3d, 0x2b, false),
/* К к */ KEYBTDECL(0x439, 0x419, true),
/* Г г */ KEYBTDECL(0x446, 0x426, true),
/* Х х */ KEYBTDECL(0x443, 0x423, true),
/* Л л */ KEYBTDECL(0x43a, 0x41a, true),
/* Е е */ KEYBTDECL(0x435, 0x415, true),
/* О о */ KEYBTDECL(0x43d, 0x41d, true),
/* З з */ KEYBTDECL(0x433, 0x413, true),
/* Ы ы */ KEYBTDECL(0x448, 0x428, true),
/* Э э */ KEYBTDECL(0x449, 0x429, true),
/* Ъ ъ */ KEYBTDECL(0x437, 0x417, true),
/* И и */ KEYBTDECL(0x445, 0x425, true),
/* Я я */ KEYBTDECL(0x44a, 0x42a, true),
/* Ж ж */ KEYBTDECL(0x444, 0x424, true),
/* Щ щ */ KEYBTDECL(0x44b, 0x42b, true),
/* Ч ч */ KEYBTDECL(0x432, 0x412, true),
/* Б б */ KEYBTDECL(0x430, 0x410, true),
/* Р р */ KEYBTDECL(0x43f, 0x41f, true),
/* Т т */ KEYBTDECL(0x440, 0x420, true),
/* П п */ KEYBTDECL(0x43e, 0x41e, true),
/* М м */ KEYBTDECL(0x43b, 0x41b, true),
/* Д д */ KEYBTDECL(0x434, 0x414, true),
/* Ц ц */ KEYBTDECL(0x436, 0x416, true),
/* Ь ь */ KEYBTDECL(0x44d, 0x42d, true),
/* \ / */ KEYBTDECL(0x5c, 0x2f, false),
/* С с */ KEYBTDECL(0x44f, 0x42f, true),
/* Ю ю */ KEYBTDECL(0x447, 0x427, true),
/* У у */ KEYBTDECL(0x441, 0x421, true),
/* Н н */ KEYBTDECL(0x43c, 0x41c, true),
/* Й й */ KEYBTDECL(0x438, 0x418, true),
/* Ф ф */ KEYBTDECL(0x442, 0x422, true),
/* Ш ш */ KEYBTDECL(0x44c, 0x42c, true),
/* В в */ KEYBTDECL(0x431, 0x411, true),
/* А а */ KEYBTDECL(0x44e, 0x42e, true),
/* . , */ KEYBTDECL(0x2e, 0x2c, false)};
KEYBT ENGLISH_LOCALE[] = {
/* ` ~ */ KEYBTDECL(0x60, 0x7e, false),
/* 1 ! */ KEYBTDECL(0x31, 0x21, false),
/* 2 @ */ KEYBTDECL(0x32, 0x40, false),
/* 3 # */ KEYBTDECL(0x33, 0x23, false),
/* 4 $ */ KEYBTDECL(0x34, 0x24, false),
/* 5 % */ KEYBTDECL(0x35, 0x25, false),
/* 6 ^ */ KEYBTDECL(0x36, 0x5e, false),
/* 7 & */ KEYBTDECL(0x37, 0x26, false),
/* 8 * */ KEYBTDECL(0x38, 0x2a, false),
/* 9 ( */ KEYBTDECL(0x39, 0x28, false),
/* 0 ) */ KEYBTDECL(0x30, 0x29, false),
/* - _ */ KEYBTDECL(0x2d, 0x5f, false),
/* = + */ KEYBTDECL(0x3d, 0x2b, false),
/* q Q */ KEYBTDECL(0x71, 0x51, true),
/* w W */ KEYBTDECL(0x77, 0x57, true),
/* e E */ KEYBTDECL(0x65, 0x45, true),
/* r R */ KEYBTDECL(0x72, 0x52, true),
/* t T */ KEYBTDECL(0x74, 0x54, true),
/* y Y */ KEYBTDECL(0x79, 0x59, true),
/* u U */ KEYBTDECL(0x75, 0x55, true),
/* i I */ KEYBTDECL(0x69, 0x49, true),
/* o O */ KEYBTDECL(0x6f, 0x4f, true),
/* p P */ KEYBTDECL(0x70, 0x50, true),
/* [ { */ KEYBTDECL(0x5b, 0x7b, false),
/* ] } */ KEYBTDECL(0x5d, 0x7d, false),
/* a A */ KEYBTDECL(0x61, 0x41, true),
/* s S */ KEYBTDECL(0x73, 0x53, true),
/* d D */ KEYBTDECL(0x64, 0x44, true),
/* f F */ KEYBTDECL(0x66, 0x46, true),
/* g G */ KEYBTDECL(0x67, 0x47, true),
/* h H */ KEYBTDECL(0x68, 0x48, true),
/* j J */ KEYBTDECL(0x6a, 0x4a, true),
/* k K */ KEYBTDECL(0x6b, 0x4b, true),
/* l L */ KEYBTDECL(0x6c, 0x4c, true),
/* ; : */ KEYBTDECL(0x3b, 0x3a, false),
/* ' " */ KEYBTDECL(0x27, 0x22, false),
/* \ | */ KEYBTDECL(0x5c, 0x7c, false),
/* z Z */ KEYBTDECL(0x7a, 0x5a, true),
/* x X */ KEYBTDECL(0x78, 0x58, true),
/* c C */ KEYBTDECL(0x63, 0x43, true),
/* v V */ KEYBTDECL(0x76, 0x56, true),
/* b B */ KEYBTDECL(0x62, 0x42, true),
/* n N */ KEYBTDECL(0x6e, 0x4e, true),
/* m M */ KEYBTDECL(0x6d, 0x4d, true),
/* , < */ KEYBTDECL(0x2c, 0x3c, false),
/* . > */ KEYBTDECL(0x2e, 0x3e, false),
/* / ? */ KEYBTDECL(0x2f, 0x5f, false)};
/* ` ~ */ KEYBTDECL(0x60, 0x7e, false),
/* 1 ! */ KEYBTDECL(0x31, 0x21, false),
/* 2 @ */ KEYBTDECL(0x32, 0x40, false),
/* 3 # */ KEYBTDECL(0x33, 0x23, false),
/* 4 $ */ KEYBTDECL(0x34, 0x24, false),
/* 5 % */ KEYBTDECL(0x35, 0x25, false),
/* 6 ^ */ KEYBTDECL(0x36, 0x5e, false),
/* 7 & */ KEYBTDECL(0x37, 0x26, false),
/* 8 * */ KEYBTDECL(0x38, 0x2a, false),
/* 9 ( */ KEYBTDECL(0x39, 0x28, false),
/* 0 ) */ KEYBTDECL(0x30, 0x29, false),
/* - _ */ KEYBTDECL(0x2d, 0x5f, false),
/* = + */ KEYBTDECL(0x3d, 0x2b, false),
/* q Q */ KEYBTDECL(0x71, 0x51, true),
/* w W */ KEYBTDECL(0x77, 0x57, true),
/* e E */ KEYBTDECL(0x65, 0x45, true),
/* r R */ KEYBTDECL(0x72, 0x52, true),
/* t T */ KEYBTDECL(0x74, 0x54, true),
/* y Y */ KEYBTDECL(0x79, 0x59, true),
/* u U */ KEYBTDECL(0x75, 0x55, true),
/* i I */ KEYBTDECL(0x69, 0x49, true),
/* o O */ KEYBTDECL(0x6f, 0x4f, true),
/* p P */ KEYBTDECL(0x70, 0x50, true),
/* [ { */ KEYBTDECL(0x5b, 0x7b, false),
/* ] } */ KEYBTDECL(0x5d, 0x7d, false),
/* a A */ KEYBTDECL(0x61, 0x41, true),
/* s S */ KEYBTDECL(0x73, 0x53, true),
/* d D */ KEYBTDECL(0x64, 0x44, true),
/* f F */ KEYBTDECL(0x66, 0x46, true),
/* g G */ KEYBTDECL(0x67, 0x47, true),
/* h H */ KEYBTDECL(0x68, 0x48, true),
/* j J */ KEYBTDECL(0x6a, 0x4a, true),
/* k K */ KEYBTDECL(0x6b, 0x4b, true),
/* l L */ KEYBTDECL(0x6c, 0x4c, true),
/* ; : */ KEYBTDECL(0x3b, 0x3a, false),
/* ' " */ KEYBTDECL(0x27, 0x22, false),
/* \ | */ KEYBTDECL(0x5c, 0x7c, false),
/* z Z */ KEYBTDECL(0x7a, 0x5a, true),
/* x X */ KEYBTDECL(0x78, 0x58, true),
/* c C */ KEYBTDECL(0x63, 0x43, true),
/* v V */ KEYBTDECL(0x76, 0x56, true),
/* b B */ KEYBTDECL(0x62, 0x42, true),
/* n N */ KEYBTDECL(0x6e, 0x4e, true),
/* m M */ KEYBTDECL(0x6d, 0x4d, true),
/* , < */ KEYBTDECL(0x2c, 0x3c, false),
/* . > */ KEYBTDECL(0x2e, 0x3e, false),
/* / ? */ KEYBTDECL(0x2f, 0x5f, false)};
KEYBT FRENCH_LOCALE[] = {
/* ? ? */ KEYBTDECL(0xb2, 0xb2, true),
/* & 1 */ KEYBTDECL(0x26, 0x31, true),
/* ? 2 */ KEYBTDECL(0xe9, 0x32, true),
/* " 3 */ KEYBTDECL(0x22, 0x33, true),
/* ' 4 */ KEYBTDECL(0x27, 0x34, true),
/* ( 5 */ KEYBTDECL(0x28, 0x35, true),
/* - 6 */ KEYBTDECL(0x2d, 0x36, true),
/* ? 7 */ KEYBTDECL(0xe8, 0x37, true),
/* _ 8 */ KEYBTDECL(0x5f, 0x38, true),
/* ? 9 */ KEYBTDECL(0xe7, 0x39, true),
/* ? 0 */ KEYBTDECL(0xe0, 0x30, true),
/* ) ? */ KEYBTDECL(0x29, 0xb0, true),
/* = + */ KEYBTDECL(0x3d, 0x2b, true),
/* a A */ KEYBT(0x61, 0x41, true, 0, 0, 0x61, 0x41, 0xe2, 0xc2, 0xe4, 0xc4),
/* z Z */ KEYBTDECL(0x7a, 0x5a, true),
/* e E */ KEYBT(0x65, 0x45, true, 0, 0, 0x65, 0x45, 0xea, 0xca, 0xeb, 0xcb),
/* r R */ KEYBTDECL(0x72, 0x52, true),
/* t T */ KEYBTDECL(0x74, 0x54, true),
/* y Y */ KEYBT(0x79, 0x59, true, 0, 0, 0x79, 0x59, 0, 0, 0xff),
/* u U */ KEYBT(0x75, 0x55, true, 0, 0, 0x75, 0x55, 0xfb, 0xdb, 0xfc, 0xdc),
/* i I */ KEYBT(0x69, 0x49, true, 0, 0, 0x69, 0x49, 0xee, 0xce, 0xef, 0xcf),
/* o O */ KEYBT(0x6f, 0x4f, true, 0, 0, 0x6f, 0x4f, 0xf4, 0xd4, 0xf6, 0xd6),
/* p P */ KEYBTDECL(0x70, 0x50, true),
/* ^ ? */ KEYBT(0x5e, 0xa8, true, 1, 2, 0x5e, 0xa8),
/* $ ? } */ KEYBTDECL(0x24, 0xa3, true),
/* q Q */ KEYBTDECL(0x71, 0x51, true),
/* s S */ KEYBTDECL(0x73, 0x53, true),
/* d D */ KEYBTDECL(0x64, 0x44, true),
/* f F */ KEYBTDECL(0x66, 0x46, true),
/* g G */ KEYBTDECL(0x67, 0x47, true),
/* h H */ KEYBTDECL(0x68, 0x48, true),
/* j J */ KEYBTDECL(0x6a, 0x4a, true),
/* k K */ KEYBTDECL(0x6b, 0x4b, true),
/* l L */ KEYBTDECL(0x6c, 0x4c, true),
/* m M */ KEYBTDECL(0x6d, 0x4d, true),
/* ? % */ KEYBTDECL(0xf9, 0x25, true),
/* * ? */ KEYBTDECL(0x2a, 0xb5, true),
/* w W */ KEYBTDECL(0x77, 0x57, true),
/* x X */ KEYBTDECL(0x78, 0x58, true),
/* c C */ KEYBTDECL(0x63, 0x43, true),
/* v V */ KEYBTDECL(0x76, 0x56, true),
/* b B */ KEYBTDECL(0x62, 0x42, true),
/* n N */ KEYBTDECL(0x6e, 0x4e, true),
/* , ? */ KEYBTDECL(0x2c, 0x3f, true),
/* ; . */ KEYBTDECL(0x3b, 0x2e, true),
/* : / */ KEYBTDECL(0x3a, 0x2f, true),
/* ! ? */ KEYBTDECL(0x21, 0xa7, true)};
/* ? ? */ KEYBTDECL(0xb2, 0xb2, true),
/* & 1 */ KEYBTDECL(0x26, 0x31, true),
/* ? 2 */ KEYBTDECL(0xe9, 0x32, true),
/* " 3 */ KEYBTDECL(0x22, 0x33, true),
/* ' 4 */ KEYBTDECL(0x27, 0x34, true),
/* ( 5 */ KEYBTDECL(0x28, 0x35, true),
/* - 6 */ KEYBTDECL(0x2d, 0x36, true),
/* ? 7 */ KEYBTDECL(0xe8, 0x37, true),
/* _ 8 */ KEYBTDECL(0x5f, 0x38, true),
/* ? 9 */ KEYBTDECL(0xe7, 0x39, true),
/* ? 0 */ KEYBTDECL(0xe0, 0x30, true),
/* ) ? */ KEYBTDECL(0x29, 0xb0, true),
/* = + */ KEYBTDECL(0x3d, 0x2b, true),
/* a A */ KEYBT(0x61, 0x41, true, 0, 0, 0x61, 0x41, 0xe2, 0xc2, 0xe4, 0xc4),
/* z Z */ KEYBTDECL(0x7a, 0x5a, true),
/* e E */ KEYBT(0x65, 0x45, true, 0, 0, 0x65, 0x45, 0xea, 0xca, 0xeb, 0xcb),
/* r R */ KEYBTDECL(0x72, 0x52, true),
/* t T */ KEYBTDECL(0x74, 0x54, true),
/* y Y */ KEYBT(0x79, 0x59, true, 0, 0, 0x79, 0x59, 0, 0, 0xff),
/* u U */ KEYBT(0x75, 0x55, true, 0, 0, 0x75, 0x55, 0xfb, 0xdb, 0xfc, 0xdc),
/* i I */ KEYBT(0x69, 0x49, true, 0, 0, 0x69, 0x49, 0xee, 0xce, 0xef, 0xcf),
/* o O */ KEYBT(0x6f, 0x4f, true, 0, 0, 0x6f, 0x4f, 0xf4, 0xd4, 0xf6, 0xd6),
/* p P */ KEYBTDECL(0x70, 0x50, true),
/* ^ ? */ KEYBT(0x5e, 0xa8, true, 1, 2, 0x5e, 0xa8),
/* $ ? } */ KEYBTDECL(0x24, 0xa3, true),
/* q Q */ KEYBTDECL(0x71, 0x51, true),
/* s S */ KEYBTDECL(0x73, 0x53, true),
/* d D */ KEYBTDECL(0x64, 0x44, true),
/* f F */ KEYBTDECL(0x66, 0x46, true),
/* g G */ KEYBTDECL(0x67, 0x47, true),
/* h H */ KEYBTDECL(0x68, 0x48, true),
/* j J */ KEYBTDECL(0x6a, 0x4a, true),
/* k K */ KEYBTDECL(0x6b, 0x4b, true),
/* l L */ KEYBTDECL(0x6c, 0x4c, true),
/* m M */ KEYBTDECL(0x6d, 0x4d, true),
/* ? % */ KEYBTDECL(0xf9, 0x25, true),
/* * ? */ KEYBTDECL(0x2a, 0xb5, true),
/* w W */ KEYBTDECL(0x77, 0x57, true),
/* x X */ KEYBTDECL(0x78, 0x58, true),
/* c C */ KEYBTDECL(0x63, 0x43, true),
/* v V */ KEYBTDECL(0x76, 0x56, true),
/* b B */ KEYBTDECL(0x62, 0x42, true),
/* n N */ KEYBTDECL(0x6e, 0x4e, true),
/* , ? */ KEYBTDECL(0x2c, 0x3f, true),
/* ; . */ KEYBTDECL(0x3b, 0x2e, true),
/* : / */ KEYBTDECL(0x3a, 0x2f, true),
/* ! ? */ KEYBTDECL(0x21, 0xa7, true)};
KEYBT SWISS_FRENCH_LOCALE[] = {
/* § °*/ KEYBTDECL(0xa7, 0xb0, false),
/* 1 +*/ KEYBTDECL(0x31, 0x2b, false),
/* § °*/ KEYBTDECL(0xa7, 0xb0, false),
/* 1 +*/ KEYBTDECL(0x31, 0x2b, false),
/* 2 "*/ KEYBTDECL(0x32, 0x22, false),
/* 3 **/ KEYBTDECL(0x33, 0x2a, false),
/* 3 **/ KEYBTDECL(0x33, 0x2a, false),
/* 4 ç*/ KEYBTDECL(0x34, 0xe7, false),
/* 5 %*/ KEYBTDECL(0x35, 0x25, false),
/* 6 &*/ KEYBTDECL(0x36, 0x26, false),
/* 7 /*/ KEYBTDECL(0x37, 0x2f, false),
/* 8 (*/ KEYBTDECL(0x38, 0x28, false),
/* 9 )*/ KEYBTDECL(0x39, 0x29, false),
/* 0 =*/ KEYBTDECL(0x30, 0x3d, false),
/* ' ?*/ KEYBTDECL(0x27, 0x5f, false),
/* ^ `*/ KEYBT(0x5e, 0x60, false, 1, 2, 0x5e, 0x60),
/* q Q*/ KEYBTDECL(0x71, 0x51, true),
/* w W*/ KEYBTDECL(0x77, 0x57, true),
/* e E*/ KEYBT(0x65, 0x45, true, 0, 0, 0x65, 0x45, 0xea, 0xca, 0xe8, 0xc8, 0xeb, 0xcb),
/* 9 )*/ KEYBTDECL(0x39, 0x29, false),
/* 0 =*/ KEYBTDECL(0x30, 0x3d, false),
/* ' ?*/ KEYBTDECL(0x27, 0x5f, false),
/* ^ `*/ KEYBT(0x5e, 0x60, false, 1, 2, 0x5e, 0x60),
/* q Q*/ KEYBTDECL(0x71, 0x51, true),
/* w W*/ KEYBTDECL(0x77, 0x57, true),
/* e E*/ KEYBT(0x65, 0x45, true, 0, 0, 0x65, 0x45, 0xea, 0xca, 0xe8, 0xc8, 0xeb, 0xcb),
/* r R*/ KEYBTDECL(0x72, 0x52, true),
/* t T*/ KEYBTDECL(0x74, 0x54, true),
/* z Z*/ KEYBTDECL(0x7a, 0x5a, true),
/* u U*/ KEYBT(0x75, 0x55, true, 0, 0, 0x75, 0x55, 0xfb, 0xdb, 0xf9, 0xd9, 0xfc, 0xdc),
/* i I*/ KEYBT(0x69, 0x49, true, 0, 0, 0x69, 0x49, 0xee, 0xce, 0xec, 0xcc, 0xef, 0xcf),
/* o O*/ KEYBT(0x6f, 0x4f, true, 0, 0, 0x6f, 0x4f, 0xf4, 0xd4, 0xf2, 0xd2, 0xf6, 0xd6),
/* p P*/ KEYBTDECL(0x70, 0x50, true),
/* è ü*/ KEYBTDECL(0xe8, 0xfa, false),
/* ¨ !*/ KEYBT(0xa8, 0x21, false, 3, 0, 0xa8, 0x21),
/* a A*/ KEYBT(0x61, 0x41, true, 0, 0, 0x61, 0x41, 0xe2, 0xc2, 0xe0, 0xc0, 0xe4, 0xc4),
/* s S*/ KEYBTDECL(0x73, 0x53, true),
/* d D*/ KEYBTDECL(0x64, 0x44, true),
/* f F*/ KEYBTDECL(0x66, 0x46, true),
/* g G*/ KEYBTDECL(0x67, 0x47, true),
/* h H*/ KEYBTDECL(0x68, 0x48, true),
/* j J*/ KEYBTDECL(0x6a, 0x4a, true),
/* k K*/ KEYBTDECL(0x6b, 0x4b, true),
/* l L*/ KEYBTDECL(0x6c, 0x4c, true),
/* é ö*/ KEYBTDECL(0xe9, 0xf6, false),
/* à ä*/ KEYBTDECL(0xe0, 0xe4, false),
/* $ £*/ KEYBTDECL(0x24, 0xa3, false),
/* < >*/ KEYBTDECL(0x3c, 0x3e, false),
/* y Y*/ KEYBT(0x79, 0x59, true, 0, 0, 0x79, 0x59, 0, 0, 0, 0, 0xff),
/* x X*/ KEYBTDECL(0x78, 0x58, true),
/* c C*/ KEYBTDECL(0x63, 0x43, true),
/* v V*/ KEYBTDECL(0x76, 0x56, true),
/* b B*/ KEYBTDECL(0x62, 0x42, true),
/* n N*/ KEYBTDECL(0x6e, 0x4e, true),
/* m M*/ KEYBTDECL(0x6d, 0x4d, true),
/* , ;*/ KEYBTDECL(0x2c, 0x3b, false),
/* . :*/ KEYBTDECL(0x2e, 0x3a, false),
/* - _*/ KEYBTDECL(0x2d, 0x5f, false)};
/* t T*/ KEYBTDECL(0x74, 0x54, true),
/* z Z*/ KEYBTDECL(0x7a, 0x5a, true),
/* u U*/ KEYBT(0x75, 0x55, true, 0, 0, 0x75, 0x55, 0xfb, 0xdb, 0xf9, 0xd9, 0xfc, 0xdc),
/* i I*/ KEYBT(0x69, 0x49, true, 0, 0, 0x69, 0x49, 0xee, 0xce, 0xec, 0xcc, 0xef, 0xcf),
/* o O*/ KEYBT(0x6f, 0x4f, true, 0, 0, 0x6f, 0x4f, 0xf4, 0xd4, 0xf2, 0xd2, 0xf6, 0xd6),
/* p P*/ KEYBTDECL(0x70, 0x50, true),
/* è ü*/ KEYBTDECL(0xe8, 0xfa, false),
/* ¨ !*/ KEYBT(0xa8, 0x21, false, 3, 0, 0xa8, 0x21),
/* a A*/ KEYBT(0x61, 0x41, true, 0, 0, 0x61, 0x41, 0xe2, 0xc2, 0xe0, 0xc0, 0xe4, 0xc4),
/* s S*/ KEYBTDECL(0x73, 0x53, true),
/* d D*/ KEYBTDECL(0x64, 0x44, true),
/* f F*/ KEYBTDECL(0x66, 0x46, true),
/* g G*/ KEYBTDECL(0x67, 0x47, true),
/* h H*/ KEYBTDECL(0x68, 0x48, true),
/* j J*/ KEYBTDECL(0x6a, 0x4a, true),
/* k K*/ KEYBTDECL(0x6b, 0x4b, true),
/* l L*/ KEYBTDECL(0x6c, 0x4c, true),
/* é ö*/ KEYBTDECL(0xe9, 0xf6, false),
/* à ä*/ KEYBTDECL(0xe0, 0xe4, false),
/* $ £*/ KEYBTDECL(0x24, 0xa3, false),
/* < >*/ KEYBTDECL(0x3c, 0x3e, false),
/* y Y*/ KEYBT(0x79, 0x59, true, 0, 0, 0x79, 0x59, 0, 0, 0, 0, 0xff),
/* x X*/ KEYBTDECL(0x78, 0x58, true),
/* c C*/ KEYBTDECL(0x63, 0x43, true),
/* v V*/ KEYBTDECL(0x76, 0x56, true),
/* b B*/ KEYBTDECL(0x62, 0x42, true),
/* n N*/ KEYBTDECL(0x6e, 0x4e, true),
/* m M*/ KEYBTDECL(0x6d, 0x4d, true),
/* , ;*/ KEYBTDECL(0x2c, 0x3b, false),
/* . :*/ KEYBTDECL(0x2e, 0x3a, false),
/* - _*/ KEYBTDECL(0x2d, 0x5f, false)};
KEYBT GERMAN_LOCALE[] = {
/* ^ ? */ KEYBTDECL(0x5f, 0xb0, false),
/* 1 ! */ KEYBTDECL(0x31, 0x21, true),
/* 2 " */ KEYBTDECL(0x32, 0x22, true),
/* 3 § */ KEYBTDECL(0x33, 0xa7, true),
/* 4 $ */ KEYBTDECL(0x34, 0x24, true),
/* 5 % */ KEYBTDECL(0x35, 0x25, true),
/* 6 & */ KEYBTDECL(0x36, 0x26, true),
/* 7 / */ KEYBTDECL(0x37, 0x2f, true),
/* 8 ( */ KEYBTDECL(0x38, 0x28, true),
/* 9 ) */ KEYBTDECL(0x39, 0x29, true),
/* 0 = */ KEYBTDECL(0x30, 0x3d, true),
/* ? ? */ KEYBTDECL(0xdf, 0x3f, true),
/* ` ? */ KEYBTDECL(0x60, 0xb4, false),
/* q Q */ KEYBTDECL(0x71, 0x51, true),
/* w W */ KEYBTDECL(0x77, 0x57, true),
/* e E */ KEYBTDECL(0x65, 0x45, true),
/* r R */ KEYBTDECL(0x72, 0x52, true),
/* t T */ KEYBTDECL(0x74, 0x54, true),
/* z Z */ KEYBTDECL(0x7a, 0x5a, true),
/* u U */ KEYBTDECL(0x75, 0x55, true),
/* i I */ KEYBTDECL(0x69, 0x49, true),
/* o O */ KEYBTDECL(0x6f, 0x4f, true),
/* p P */ KEYBTDECL(0x70, 0x50, true),
/* ? ? */ KEYBTDECL(0xfc, 0xdc, true),
/* + * */ KEYBTDECL(0x2b, 0x2a, true),
/* a A */ KEYBTDECL(0x61, 0x41, true),
/* s S */ KEYBTDECL(0x73, 0x53, true),
/* d D */ KEYBTDECL(0x64, 0x44, true),
/* f F */ KEYBTDECL(0x66, 0x46, true),
/* g G */ KEYBTDECL(0x67, 0x47, true),
/* h H */ KEYBTDECL(0x68, 0x48, true),
/* j J */ KEYBTDECL(0x6a, 0x4a, true),
/* k K */ KEYBTDECL(0x6b, 0x4b, true),
/* l L */ KEYBTDECL(0x6c, 0x4c, true),
/* ? ? */ KEYBTDECL(0xf6, 0xd6, true),
/* ? ? */ KEYBTDECL(0xe4, 0xc4, true),
/* ' # */ KEYBTDECL(0x27, 0x23, true),
/* y Y */ KEYBTDECL(0x79, 0x59, true),
/* x X */ KEYBTDECL(0x78, 0x58, true),
/* c C */ KEYBTDECL(0x63, 0x43, true),
/* v V */ KEYBTDECL(0x76, 0x56, true),
/* b B */ KEYBTDECL(0x62, 0x42, true),
/* n N */ KEYBTDECL(0x6e, 0x4e, true),
/* m M */ KEYBTDECL(0x6d, 0x4d, true),
/* , ; */ KEYBTDECL(0x2c, 0x3b, true),
/* . : */ KEYBTDECL(0x2e, 0x3a, true),
/* _ - */ KEYBTDECL(0x5f, 0x2d, false)};
/* ^ ? */ KEYBTDECL(0x5f, 0xb0, false),
/* 1 ! */ KEYBTDECL(0x31, 0x21, true),
/* 2 " */ KEYBTDECL(0x32, 0x22, true),
/* 3 § */ KEYBTDECL(0x33, 0xa7, true),
/* 4 $ */ KEYBTDECL(0x34, 0x24, true),
/* 5 % */ KEYBTDECL(0x35, 0x25, true),
/* 6 & */ KEYBTDECL(0x36, 0x26, true),
/* 7 / */ KEYBTDECL(0x37, 0x2f, true),
/* 8 ( */ KEYBTDECL(0x38, 0x28, true),
/* 9 ) */ KEYBTDECL(0x39, 0x29, true),
/* 0 = */ KEYBTDECL(0x30, 0x3d, true),
/* ? ? */ KEYBTDECL(0xdf, 0x3f, true),
/* ` ? */ KEYBTDECL(0x60, 0xb4, false),
/* q Q */ KEYBTDECL(0x71, 0x51, true),
/* w W */ KEYBTDECL(0x77, 0x57, true),
/* e E */ KEYBTDECL(0x65, 0x45, true),
/* r R */ KEYBTDECL(0x72, 0x52, true),
/* t T */ KEYBTDECL(0x74, 0x54, true),
/* z Z */ KEYBTDECL(0x7a, 0x5a, true),
/* u U */ KEYBTDECL(0x75, 0x55, true),
/* i I */ KEYBTDECL(0x69, 0x49, true),
/* o O */ KEYBTDECL(0x6f, 0x4f, true),
/* p P */ KEYBTDECL(0x70, 0x50, true),
/* ? ? */ KEYBTDECL(0xfc, 0xdc, true),
/* + * */ KEYBTDECL(0x2b, 0x2a, true),
/* a A */ KEYBTDECL(0x61, 0x41, true),
/* s S */ KEYBTDECL(0x73, 0x53, true),
/* d D */ KEYBTDECL(0x64, 0x44, true),
/* f F */ KEYBTDECL(0x66, 0x46, true),
/* g G */ KEYBTDECL(0x67, 0x47, true),
/* h H */ KEYBTDECL(0x68, 0x48, true),
/* j J */ KEYBTDECL(0x6a, 0x4a, true),
/* k K */ KEYBTDECL(0x6b, 0x4b, true),
/* l L */ KEYBTDECL(0x6c, 0x4c, true),
/* ? ? */ KEYBTDECL(0xf6, 0xd6, true),
/* ? ? */ KEYBTDECL(0xe4, 0xc4, true),
/* ' # */ KEYBTDECL(0x27, 0x23, true),
/* y Y */ KEYBTDECL(0x79, 0x59, true),
/* x X */ KEYBTDECL(0x78, 0x58, true),
/* c C */ KEYBTDECL(0x63, 0x43, true),
/* v V */ KEYBTDECL(0x76, 0x56, true),
/* b B */ KEYBTDECL(0x62, 0x42, true),
/* n N */ KEYBTDECL(0x6e, 0x4e, true),
/* m M */ KEYBTDECL(0x6d, 0x4d, true),
/* , ; */ KEYBTDECL(0x2c, 0x3b, true),
/* . : */ KEYBTDECL(0x2e, 0x3a, true),
/* _ - */ KEYBTDECL(0x5f, 0x2d, false)};
void UBPlatformUtils::initializeKeyboardLayouts()
{
nKeyboardLayouts = 5;
keyboardLayouts = new UBKeyboardLocale*[nKeyboardLayouts];
nKeyboardLayouts = 5;
keyboardLayouts = new UBKeyboardLocale*[nKeyboardLayouts];
keyboardLayouts[0] = new UBKeyboardLocale(tr("English"), "en", "", new QIcon(":/images/flags/en.png"), ENGLISH_LOCALE);
keyboardLayouts[1] = new UBKeyboardLocale(tr("Russian"), "ru", "", new QIcon(":/images/flags/ru.png"),RUSSIAN_LOCALE);
keyboardLayouts[2] = new UBKeyboardLocale(tr("French"), "fr", "", new QIcon(":/images/flags/fr.png"), FRENCH_LOCALE);
@ -424,10 +424,10 @@ void UBPlatformUtils::initializeKeyboardLayouts()
void UBPlatformUtils::destroyKeyboardLayouts()
{
for(int i=0; i<nKeyboardLayouts; i++)
delete keyboardLayouts[i];
delete [] keyboardLayouts;
keyboardLayouts = NULL;
for(int i=0; i<nKeyboardLayouts; i++)
delete keyboardLayouts[i];
delete [] keyboardLayouts;
keyboardLayouts = NULL;
}
QString UBPlatformUtils::urlFromClipboard()

File diff suppressed because it is too large Load Diff

@ -42,7 +42,7 @@ class UBDocumentProxy;
#include "UBDockPaletteWidget.h"
#define TABSIZE 50 //Height of the tab of the palette
#define TABSIZE 50 //Height of the tab of the palette
#define CLICKTIME 1000000 //Clicktime to expand or collapse palette
/**

@ -55,5 +55,5 @@ UBDockTeacherGuideWidget::~UBDockTeacherGuideWidget()
UBTeacherGuideWidget* UBDockTeacherGuideWidget::teacherGuideWidget()
{
return mpTeacherGuideWidget;
return mpTeacherGuideWidget;
}

@ -87,8 +87,8 @@ UBDocumentNavigator::~UBDocumentNavigator()
void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
{
mThumbsWithLabels.clear();
foreach(QGraphicsItem* it, mScene->items())
mThumbsWithLabels.clear();
foreach(QGraphicsItem* it, mScene->items())
{
mScene->removeItem(it);
delete it;
@ -106,15 +106,15 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
QString label = pageIndex == 0 ? tr("Title page") : tr("Page %0").arg(pageIndex);
UBThumbnailTextItem *labelItem = new UBThumbnailTextItem(label);
UBImgTextThumbnailElement thumbWithText(pixmapItem, labelItem);
thumbWithText.setBorder(border());
mThumbsWithLabels.append(thumbWithText);
UBImgTextThumbnailElement thumbWithText(pixmapItem, labelItem);
thumbWithText.setBorder(border());
mThumbsWithLabels.append(thumbWithText);
mScene->addItem(pixmapItem);
mScene->addItem(labelItem);
mScene->addItem(pixmapItem);
mScene->addItem(labelItem);
}
// Draw the items
// Draw the items
refreshScene();
}
@ -173,7 +173,7 @@ void UBDocumentNavigator::refreshScene()
UBImgTextThumbnailElement& item = mThumbsWithLabels[i];
int columnIndex = i % mNbColumns;
int rowIndex = i / mNbColumns;
item.Place(rowIndex, columnIndex, mThumbnailWidth, thumbnailHeight);
item.Place(rowIndex, columnIndex, mThumbnailWidth, thumbnailHeight);
}
scene()->setSceneRect(scene()->itemsBoundingRect());
}
@ -258,29 +258,29 @@ void UBDocumentNavigator::mousePressEvent(QMouseEvent *event)
if(NULL != pTextItem)
{
for(int i = 0; i < mThumbsWithLabels.size(); i++)
{
const UBImgTextThumbnailElement& el = mThumbsWithLabels.at(i);
if(el.getCaption() == pTextItem)
{
pCrntItem = el.getThumbnail();
break;
}
}
{
const UBImgTextThumbnailElement& el = mThumbsWithLabels.at(i);
if(el.getCaption() == pTextItem)
{
pCrntItem = el.getThumbnail();
break;
}
}
}
}
int index = 0;
for(int i = 0; i < mThumbsWithLabels.size(); i++)
for(int i = 0; i < mThumbsWithLabels.size(); i++)
{
if (mThumbsWithLabels.at(i).getThumbnail() == pCrntItem)
if (mThumbsWithLabels.at(i).getThumbnail() == pCrntItem)
{
index = i;
break;
}
}
UBApplication::boardController->setActiveDocumentScene(index);
}
QGraphicsView::mousePressEvent(event);
}
QGraphicsView::mousePressEvent(event);
}
void UBDocumentNavigator::mouseReleaseEvent(QMouseEvent *event)

@ -34,7 +34,7 @@
#include "document/UBDocumentContainer.h"
#include "UBThumbnailWidget.h"
#define NO_PAGESELECTED -1
#define NO_PAGESELECTED -1
class UBDocumentNavigator : public QGraphicsView
{
@ -68,8 +68,8 @@ private:
QGraphicsScene* mScene;
/** The current selected item */
//UBSceneThumbnailNavigPixmap* mCrntItem;
/** The list of current thumbnails with labels*/
QList<UBImgTextThumbnailElement> mThumbsWithLabels;
/** The list of current thumbnails with labels*/
QList<UBImgTextThumbnailElement> mThumbsWithLabels;
/** The current number of columns */
int mNbColumns;
/** The current thumbnails width */

@ -38,12 +38,12 @@ UBDocumentThumbnailWidget::UBDocumentThumbnailWidget(QWidget* parent)
: UBThumbnailWidget(parent)
, mDropCaretRectItem(0)
, mClosestDropItem(0)
, mDragEnabled(true)
, mDragEnabled(true)
, mScrollMagnitude(0)
{
bCanDrag = false;
bCanDrag = false;
mScrollTimer = new QTimer(this);
connect(mScrollTimer, SIGNAL(timeout()), this, SLOT(autoScroll()));
connect(mScrollTimer, SIGNAL(timeout()), this, SLOT(autoScroll()));
}
@ -78,18 +78,18 @@ void UBDocumentThumbnailWidget::mouseMoveEvent(QMouseEvent *event)
{
int pageIndex = UBDocumentContainer::pageFromSceneIndex(sceneItem->sceneIndex());
if(pageIndex != 0){
QDrag *drag = new QDrag(this);
QList<UBMimeDataItem> mimeDataItems;
foreach (QGraphicsItem *item, selectedItems())
mimeDataItems.append(UBMimeDataItem(sceneItem->proxy(), mGraphicItems.indexOf(item)));
QDrag *drag = new QDrag(this);
QList<UBMimeDataItem> mimeDataItems;
foreach (QGraphicsItem *item, selectedItems())
mimeDataItems.append(UBMimeDataItem(sceneItem->proxy(), mGraphicItems.indexOf(item)));
UBMimeData *mime = new UBMimeData(mimeDataItems);
drag->setMimeData(mime);
UBMimeData *mime = new UBMimeData(mimeDataItems);
drag->setMimeData(mime);
drag->setPixmap(sceneItem->pixmap().scaledToWidth(100));
drag->setHotSpot(QPoint(drag->pixmap().width()/2, drag->pixmap().height() / 2));
drag->setPixmap(sceneItem->pixmap().scaledToWidth(100));
drag->setHotSpot(QPoint(drag->pixmap().width()/2, drag->pixmap().height() / 2));
drag->exec(Qt::MoveAction);
drag->exec(Qt::MoveAction);
}
}
@ -111,43 +111,43 @@ void UBDocumentThumbnailWidget::dragEnterEvent(QDragEnterEvent *event)
void UBDocumentThumbnailWidget::dragLeaveEvent(QDragLeaveEvent *event)
{
Q_UNUSED(event);
if (mScrollTimer->isActive())
{
mScrollMagnitude = 0;
mScrollTimer->stop();
}
if (mScrollTimer->isActive())
{
mScrollMagnitude = 0;
mScrollTimer->stop();
}
deleteDropCaret();
UBThumbnailWidget::dragLeaveEvent(event);
}
void UBDocumentThumbnailWidget::autoScroll()
{
this->verticalScrollBar()->setValue(this->verticalScrollBar()->value() + mScrollMagnitude);
this->verticalScrollBar()->setValue(this->verticalScrollBar()->value() + mScrollMagnitude);
}
void UBDocumentThumbnailWidget::dragMoveEvent(QDragMoveEvent *event)
{
QRect boundingFrame = frameRect();
//setting up automatic scrolling
const int SCROLL_DISTANCE = 16;
int bottomDist = boundingFrame.bottom() - event->pos().y(), topDist = boundingFrame.top() - event->pos().y();
if(qAbs(bottomDist) <= SCROLL_DISTANCE)
{
mScrollMagnitude = (SCROLL_DISTANCE - bottomDist)*4;
if(verticalScrollBar()->isVisible() && !mScrollTimer->isActive()) mScrollTimer->start(100);
}
else if(qAbs(topDist) <= SCROLL_DISTANCE)
{
mScrollMagnitude = (- SCROLL_DISTANCE - topDist)*4;
if(verticalScrollBar()->isVisible() && !mScrollTimer->isActive()) mScrollTimer->start(100);
}
else
{
mScrollMagnitude = 0;
mScrollTimer->stop();
}
QList<UBSceneThumbnailPixmap*> pixmapItems;
QRect boundingFrame = frameRect();
//setting up automatic scrolling
const int SCROLL_DISTANCE = 16;
int bottomDist = boundingFrame.bottom() - event->pos().y(), topDist = boundingFrame.top() - event->pos().y();
if(qAbs(bottomDist) <= SCROLL_DISTANCE)
{
mScrollMagnitude = (SCROLL_DISTANCE - bottomDist)*4;
if(verticalScrollBar()->isVisible() && !mScrollTimer->isActive()) mScrollTimer->start(100);
}
else if(qAbs(topDist) <= SCROLL_DISTANCE)
{
mScrollMagnitude = (- SCROLL_DISTANCE - topDist)*4;
if(verticalScrollBar()->isVisible() && !mScrollTimer->isActive()) mScrollTimer->start(100);
}
else
{
mScrollMagnitude = 0;
mScrollTimer->stop();
}
QList<UBSceneThumbnailPixmap*> pixmapItems;
foreach (QGraphicsItem *item, scene()->items(mapToScene(boundingFrame)))
{
UBSceneThumbnailPixmap* sceneItem = dynamic_cast<UBSceneThumbnailPixmap*>(item);
@ -161,11 +161,11 @@ void UBDocumentThumbnailWidget::dragMoveEvent(QDragMoveEvent *event)
int pageIndex = -1;
if(mClosestDropItem){
pageIndex = UBDocumentContainer::pageFromSceneIndex(mClosestDropItem->sceneIndex());
if(pageIndex == 0){
event->acceptProposedAction();
return;
}
pageIndex = UBDocumentContainer::pageFromSceneIndex(mClosestDropItem->sceneIndex());
if(pageIndex == 0){
event->acceptProposedAction();
return;
}
}
if (!mClosestDropItem)
{
@ -219,19 +219,19 @@ void UBDocumentThumbnailWidget::dragMoveEvent(QDragMoveEvent *event)
void UBDocumentThumbnailWidget::dropEvent(QDropEvent *event)
{
if (mScrollTimer->isActive())
{
mScrollMagnitude = 0;
mScrollTimer->stop();
}
deleteDropCaret();
if (mScrollTimer->isActive())
{
mScrollMagnitude = 0;
mScrollTimer->stop();
}
deleteDropCaret();
if (mClosestDropItem)
{
int targetIndex = mDropIsRight ? mGraphicItems.indexOf(mClosestDropItem) + 1 : mGraphicItems.indexOf(mClosestDropItem);
if(UBDocumentContainer::pageFromSceneIndex(targetIndex) == 0){
event->ignore();
return;
event->ignore();
return;
}
QList<UBMimeDataItem> mimeDataItems;

@ -49,8 +49,8 @@ class UBDocumentThumbnailWidget: public UBThumbnailWidget
signals:
void sceneDropped(UBDocumentProxy* proxy, int source, int target);
private slots:
void autoScroll();
private slots:
void autoScroll();
protected:
@ -68,8 +68,8 @@ class UBDocumentThumbnailWidget: public UBThumbnailWidget
UBSceneThumbnailPixmap *mClosestDropItem;
bool mDropIsRight;
bool mDragEnabled;
QTimer* mScrollTimer;
int mScrollMagnitude;
QTimer* mScrollTimer;
int mScrollMagnitude;
};
#endif /* UBDOCUMENTTHUMBNAILWIDGET_H_ */

@ -116,10 +116,10 @@ void UBDocumentTreeWidget::dragLeaveEvent(QDragLeaveEvent *event)
Q_UNUSED(event);
if (mScrollTimer->isActive())
{
mScrollMagnitude = 0;
mScrollTimer->stop();
}
{
mScrollMagnitude = 0;
mScrollTimer->stop();
}
if (mDropTargetProxyTi)
{
@ -131,25 +131,25 @@ void UBDocumentTreeWidget::dragLeaveEvent(QDragLeaveEvent *event)
void UBDocumentTreeWidget::dragMoveEvent(QDragMoveEvent *event)
{
QRect boundingFrame = frameRect();
//setting up automatic scrolling
const int SCROLL_DISTANCE = 4;
int bottomDist = boundingFrame.bottom() - event->pos().y(), topDist = boundingFrame.top() - event->pos().y();
if(qAbs(bottomDist) <= SCROLL_DISTANCE)
{
mScrollMagnitude = (SCROLL_DISTANCE - bottomDist)*4;
if(verticalScrollBar()->isVisible() && !mScrollTimer->isActive()) mScrollTimer->start(100);
}
else if(qAbs(topDist) <= SCROLL_DISTANCE)
{
mScrollMagnitude = (- SCROLL_DISTANCE - topDist)*4;
if(verticalScrollBar()->isVisible() && !mScrollTimer->isActive()) mScrollTimer->start(100);
}
else
{
mScrollMagnitude = 0;
mScrollTimer->stop();
}
QRect boundingFrame = frameRect();
//setting up automatic scrolling
const int SCROLL_DISTANCE = 4;
int bottomDist = boundingFrame.bottom() - event->pos().y(), topDist = boundingFrame.top() - event->pos().y();
if(qAbs(bottomDist) <= SCROLL_DISTANCE)
{
mScrollMagnitude = (SCROLL_DISTANCE - bottomDist)*4;
if(verticalScrollBar()->isVisible() && !mScrollTimer->isActive()) mScrollTimer->start(100);
}
else if(qAbs(topDist) <= SCROLL_DISTANCE)
{
mScrollMagnitude = (- SCROLL_DISTANCE - topDist)*4;
if(verticalScrollBar()->isVisible() && !mScrollTimer->isActive()) mScrollTimer->start(100);
}
else
{
mScrollMagnitude = 0;
mScrollTimer->stop();
}
QTreeWidgetItem* underlyingItem = this->itemAt(event->pos());
@ -461,5 +461,5 @@ bool UBDocumentGroupTreeItem::isDefaultFolder() const
void UBDocumentTreeWidget::autoScroll()
{
this->verticalScrollBar()->setValue(this->verticalScrollBar()->value() + mScrollMagnitude);
this->verticalScrollBar()->setValue(this->verticalScrollBar()->value() + mScrollMagnitude);
}

@ -51,14 +51,14 @@ class UBDocumentTreeWidget : public QTreeWidget
void itemChangedValidation(QTreeWidgetItem * item, int column);
void autoScroll();
void autoScroll();
private:
UBDocumentProxyTreeItem *mSelectedProxyTi;
QTreeWidgetItem *mDropTargetProxyTi;
QBrush mBackground;
QTimer* mScrollTimer;
int mScrollMagnitude;
QTimer* mScrollTimer;
int mScrollMagnitude;
};

@ -26,7 +26,7 @@
#include "gui/UBFeaturesWidget.h"
UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWidget* parent, const char* name ) : QWidget (parent)
, featuresController(controller)
, featuresController(controller)
, mButtonGroup(NULL)
, mSearchBar(NULL)
, mLayout(NULL)
@ -46,7 +46,7 @@ UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWid
, mpRemoveFavoriteBtn(NULL)
, mpNewFolderBtn(NULL)
{
setObjectName(name);
setObjectName(name);
setStyleSheet(QString("background: #EEEEEE; border-radius : 10px; border : 2px solid #999999;"));
setAcceptDrops(true);
@ -106,8 +106,8 @@ UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWid
connect(mpNewFolderAction, SIGNAL(triggered()), this, SLOT(onActionNewFolder()));*/
connect(mpFavoriteAction,SIGNAL(triggered()), this, SLOT(onActionFavorite()));
connect(mSearchBar, SIGNAL(textChanged(QString)), this, SLOT(onSearchTextChanged(QString)));
connect(mpNewFolderAction, SIGNAL(triggered()), this, SLOT(onActionNewFolder()));
connect(mSearchBar, SIGNAL(textChanged(QString)), this, SLOT(onSearchTextChanged(QString)));
connect(mpNewFolderAction, SIGNAL(triggered()), this, SLOT(onActionNewFolder()));
connect(mpRemoveFavorite, SIGNAL(triggered()), this, SLOT(onActionRemoveFavorite()));
connect(mpRescanModelAction, SIGNAL(triggered()), this , SLOT(onActionRescanModel()));
connect(mpDeleteAction,SIGNAL(triggered()), this, SLOT(onActionTrash()));
@ -123,33 +123,33 @@ UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWid
mLayout->addWidget(mpDeleteBtn);
mLayout->addWidget(mpCloseBtn);
mLayout->addWidget(mpRemoveFavoriteBtn);
setCurrentState( IN_ROOT );
mpDeleteBtn->setAcceptDrops(true);
setAcceptDrops( true );
setCurrentState( IN_ROOT );
mpDeleteBtn->setAcceptDrops(true);
setAcceptDrops( true );
}
void UBFeaturesActionBar::setCurrentState( UBFeaturesActionBarState state )
{
currentState = state;
setButtons();
currentState = state;
setButtons();
}
void UBFeaturesActionBar::setButtons()
{
switch( currentState )
{
case IN_FOLDER:
mpFavoriteBtn->show();
case IN_FOLDER:
mpFavoriteBtn->show();
mpSocialBtn->hide();
mSearchBar->show();
mpDeleteBtn->show();
mpCloseBtn->hide();
mpRemoveFavoriteBtn->hide();
mpNewFolderBtn->show();
mpNewFolderBtn->setEnabled(true);
mpDeleteBtn->setEnabled(true);
mpNewFolderBtn->setEnabled(true);
mpDeleteBtn->setEnabled(true);
// mpRescanModelBtn->show();
break;
break;
case IN_ROOT:
mpFavoriteBtn->show();
mpSocialBtn->hide();
@ -158,8 +158,8 @@ void UBFeaturesActionBar::setButtons()
mpCloseBtn->hide();
mpRemoveFavoriteBtn->hide();
mpNewFolderBtn->show();
mpNewFolderBtn->setEnabled(false);
mpDeleteBtn->setEnabled(false);
mpNewFolderBtn->setEnabled(false);
mpDeleteBtn->setEnabled(false);
// mpRescanModelBtn->show();
break;
case IN_PROPERTIES:
@ -184,8 +184,8 @@ void UBFeaturesActionBar::setButtons()
mpNewFolderBtn->hide();
// mpRescanModelBtn->hide();
break;
case IN_TRASH:
mpFavoriteBtn->hide();
case IN_TRASH:
mpFavoriteBtn->hide();
mpSocialBtn->hide();
mSearchBar->show();
mpDeleteBtn->show();
@ -196,7 +196,7 @@ void UBFeaturesActionBar::setButtons()
//mpRemoveFavoriteBtn->show();
mpNewFolderBtn->hide();
// mpRescanModelBtn->hide();
break;
break;
default:
break;
}
@ -253,7 +253,7 @@ void UBFeaturesActionBar::dragEnterEvent( QDragEnterEvent *event )
}
void UBFeaturesActionBar::dropEvent(QDropEvent *event)
{
{
const UBFeaturesMimeData *fMimeData = qobject_cast<const UBFeaturesMimeData*>(event->mimeData());
if (!fMimeData) {
@ -273,22 +273,22 @@ void UBFeaturesActionBar::dropEvent(QDropEvent *event)
}
}
event->setDropAction(Qt::MoveAction);
event->accept();
event->accept();
emit deleteElements(fMimeData);
} else if (dest == mpFavoriteBtn) {
event->setDropAction( Qt::CopyAction);
event->accept();
event->accept();
emit addToFavorite(fMimeData);
} else if (dest == mpRemoveFavoriteBtn) {
event->setDropAction( Qt::MoveAction );
event->accept();
event->setDropAction( Qt::MoveAction );
event->accept();
emit removeFromFavorite(fMimeData);
}
}
}
UBFeaturesActionBar::~UBFeaturesActionBar()

@ -50,26 +50,26 @@ public:
enum UBFeaturesActionBarState
{
IN_ROOT,
IN_FOLDER,
IN_PROPERTIES,
IN_FAVORITE,
IN_TRASH
IN_ROOT,
IN_FOLDER,
IN_PROPERTIES,
IN_FAVORITE,
IN_TRASH
};
class UBFeaturesActionBar : public QWidget
{
Q_OBJECT
Q_OBJECT
public:
UBFeaturesActionBar(UBFeaturesController *controller, QWidget* parent=0, const char* name="UBFeaturesActionBar");
UBFeaturesActionBar(UBFeaturesController *controller, QWidget* parent=0, const char* name="UBFeaturesActionBar");
~UBFeaturesActionBar();
void setCurrentState( UBFeaturesActionBarState state );
void setCurrentState( UBFeaturesActionBarState state );
void cleanText(){ mSearchBar->clear(); }
signals:
void searchElement(const QString &text);
void newFolderToCreate();
void searchElement(const QString &text);
void newFolderToCreate();
void deleteElements(const UBFeaturesMimeData *data);
void addToFavorite(const UBFeaturesMimeData *data);
void removeFromFavorite(const UBFeaturesMimeData *data);
@ -79,8 +79,8 @@ signals:
void rescanModel();
private slots:
void onSearchTextChanged(QString txt);
void onActionNewFolder();
void onSearchTextChanged(QString txt);
void onActionNewFolder();
void onActionFavorite();
void onActionRemoveFavorite();
void onActionTrash();
@ -90,17 +90,17 @@ private slots:
protected:
void dragEnterEvent( QDragEnterEvent *event );
void dropEvent( QDropEvent *event );
void dropEvent( QDropEvent *event );
private:
void setButtons();
UBFeaturesController *featuresController;
UBFeaturesActionBarState currentState;
void setButtons();
UBFeaturesController *featuresController;
UBFeaturesActionBarState currentState;
eButtonSet mCrntButtonSet;
eButtonSet mCrntButtonSet;
eButtonSet mPreviousButtonSet;
QButtonGroup* mButtonGroup;
QButtonGroup* mButtonGroup;
QLineEdit* mSearchBar;
QHBoxLayout* mLayout;
QAction* mpFavoriteAction;

@ -328,7 +328,7 @@ void UBFeaturesWidget::onPreviewLoaded(int id, bool pSuccess, QUrl sourceUrl, QU
void UBFeaturesWidget::onAddDownloadedFileToLibrary(bool pSuccess, QUrl sourceUrl, QString pContentHeader, QByteArray pData, QString pTitle)
{
if (pSuccess) {
qDebug() << pData.length();
qDebug() << pData.length();
controller->addDownloadedFile(sourceUrl, pData, pContentHeader, pTitle);
controller->refreshModels();
}
@ -371,20 +371,20 @@ void UBFeaturesWidget::removeElementsFromFavorite()
void UBFeaturesWidget::switchToListView()
{
// stackedWidget->setCurrentIndex(ID_LISTVIEW);
// currentStackedWidget = ID_LISTVIEW;
// stackedWidget->setCurrentIndex(ID_LISTVIEW);
// currentStackedWidget = ID_LISTVIEW;
}
void UBFeaturesWidget::switchToProperties()
{
// stackedWidget->setCurrentIndex(ID_PROPERTIES);
// currentStackedWidget = ID_PROPERTIES;
// stackedWidget->setCurrentIndex(ID_PROPERTIES);
// currentStackedWidget = ID_PROPERTIES;
}
void UBFeaturesWidget::switchToWebView()
{
// stackedWidget->setCurrentIndex(ID_WEBVIEW);
// currentStackedWidget = ID_WEBVIEW;
// stackedWidget->setCurrentIndex(ID_WEBVIEW);
// currentStackedWidget = ID_WEBVIEW;
}
QStringList UBFeaturesMimeData::formats() const
@ -1141,7 +1141,7 @@ QVariant UBFeaturesModel::data(const QModelIndex &index, int role) const
} else if (role == Qt::UserRole) {
return featuresList->at(index.row()).getVirtualPath();
} else if (role == Qt::UserRole + 1) {
} else if (role == Qt::UserRole + 1) {
//return featuresList->at(index.row()).getType();
UBFeature f = featuresList->at(index.row());
return QVariant::fromValue( f );
@ -1446,12 +1446,12 @@ bool UBFeaturesPathProxyModel::filterAcceptsRow( int sourceRow, const QModelInde
{
QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
UBFeature feature = sourceModel()->data(index, Qt::UserRole + 1).value<UBFeature>();
return feature.isFolder() && path.startsWith( feature.getFullVirtualPath()) ;
}
QString UBFeaturesItemDelegate::displayText ( const QVariant & value, const QLocale & locale ) const
QString UBFeaturesItemDelegate::displayText ( const QVariant & value, const QLocale & locale ) const
{
Q_UNUSED(locale)
@ -1473,7 +1473,7 @@ UBFeaturesPathItemDelegate::UBFeaturesPathItemDelegate(QObject *parent) : QStyle
arrowPixmap = new QPixmap(":images/navig_arrow.png");
}
QString UBFeaturesPathItemDelegate::displayText ( const QVariant & value, const QLocale & locale ) const
QString UBFeaturesPathItemDelegate::displayText ( const QVariant & value, const QLocale & locale ) const
{
Q_UNUSED(value)
Q_UNUSED(locale)

@ -76,10 +76,10 @@ class UBFeaturesWidget : public UBDockPaletteWidget
{
Q_OBJECT
public:
UBFeaturesWidget(QWidget* parent=0, const char* name="UBFeaturesWidget");
UBFeaturesWidget(QWidget* parent=0, const char* name="UBFeaturesWidget");
virtual ~UBFeaturesWidget();
bool visibleInMode(eUBDockPaletteWidgetMode mode)
bool visibleInMode(eUBDockPaletteWidgetMode mode)
{
return mode == eUBDockPaletteWidget_BOARD
|| mode == eUBDockPaletteWidget_DESKTOP;
@ -87,9 +87,9 @@ public:
UBFeaturesController * getFeaturesController() const { return controller; }
void importImage(const QImage &image, const QString &fileName = QString());
static const int minThumbnailSize = 20;
static const int maxThumbnailSize = 100;
static const int defaultThumbnailSize = 40;
static const int minThumbnailSize = 20;
static const int maxThumbnailSize = 100;
static const int defaultThumbnailSize = 40;
static const char *objNamePathList;
static const char *objNameFeatureList;
@ -148,7 +148,7 @@ private:
class UBFeaturesListView : public QListView
{
Q_OBJECT
Q_OBJECT
public:
UBFeaturesListView( QWidget* parent=0, const char* name="UBFeaturesListView" );
@ -337,7 +337,7 @@ private slots:
//void onBack();
private:
void populateMetadata();
void populateMetadata();
void adaptSize();
QVBoxLayout* mpLayout;
@ -363,7 +363,7 @@ public:
class UBFeaturesModel : public QAbstractListModel
{
Q_OBJECT
Q_OBJECT
signals:
void dataRestructured();
@ -372,18 +372,18 @@ public:
UBFeaturesModel(QList<UBFeature> *pFeaturesList, QObject *parent = 0) : QAbstractListModel(parent), featuresList(pFeaturesList) {;}
virtual ~UBFeaturesModel(){;}
void deleteFavoriteItem( const QString &path );
void deleteFavoriteItem( const QString &path );
void deleteItem( const QString &path );
void deleteItem(const UBFeature &feature);
QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
QMimeData *mimeData( const QModelIndexList &indexes ) const;
QStringList mimeTypes() const;
int rowCount( const QModelIndex &parent ) const;
Qt::ItemFlags flags( const QModelIndex &index ) const;
QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
QMimeData *mimeData( const QModelIndexList &indexes ) const;
QStringList mimeTypes() const;
int rowCount( const QModelIndex &parent ) const;
Qt::ItemFlags flags( const QModelIndex &index ) const;
bool dropMimeData(const QMimeData *mimeData, Qt::DropAction action, int row, int column, const QModelIndex &parent);
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
bool removeRow(int row, const QModelIndex &parent = QModelIndex());
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
bool removeRow(int row, const QModelIndex &parent = QModelIndex());
//bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
//bool insertRow(int row, const QModelIndex &parent = QModelIndex());
@ -395,69 +395,69 @@ public slots:
void addItem( const UBFeature &item );
private:
QList <UBFeature> *featuresList;
QList <UBFeature> *featuresList;
};
class UBFeaturesProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
Q_OBJECT
public:
UBFeaturesProxyModel(QObject *parent = 0) : QSortFilterProxyModel(parent) {;}
virtual ~UBFeaturesProxyModel() {}
protected:
virtual bool filterAcceptsRow ( int sourceRow, const QModelIndex & sourceParent ) const;
virtual bool filterAcceptsRow ( int sourceRow, const QModelIndex & sourceParent ) const;
};
class UBFeaturesSearchProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
Q_OBJECT
public:
UBFeaturesSearchProxyModel(QObject *parent = 0) : QSortFilterProxyModel(parent), mFilterPrefix() {;}
virtual ~UBFeaturesSearchProxyModel() {}
void setFilterPrefix(const QString &newPrefix) {mFilterPrefix = newPrefix;}
protected:
virtual bool filterAcceptsRow ( int sourceRow, const QModelIndex & sourceParent ) const;
virtual bool filterAcceptsRow ( int sourceRow, const QModelIndex & sourceParent ) const;
private:
QString mFilterPrefix;
};
class UBFeaturesPathProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
Q_OBJECT
public:
UBFeaturesPathProxyModel(QObject *parent = 0) : QSortFilterProxyModel(parent) {;}
virtual ~UBFeaturesPathProxyModel() {}
void setPath( const QString &p ) { path = p; }
protected:
virtual bool filterAcceptsRow ( int sourceRow, const QModelIndex & sourceParent ) const;
virtual bool filterAcceptsRow ( int sourceRow, const QModelIndex & sourceParent ) const;
private:
QString path;
QString path;
};
class UBFeaturesItemDelegate : public QStyledItemDelegate
{
Q_OBJECT
Q_OBJECT
public:
UBFeaturesItemDelegate(QObject *parent = 0, const QListView *lw = 0) : QStyledItemDelegate(parent) { listView = lw; }
~UBFeaturesItemDelegate() {}
//UBFeaturesItemDelegate(const QListView *lw = 0) { listView = lw; };
//void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
//UBFeaturesItemDelegate(const QListView *lw = 0) { listView = lw; };
//void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
//QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
virtual QString displayText ( const QVariant & value, const QLocale & locale ) const;
virtual QString displayText ( const QVariant & value, const QLocale & locale ) const;
private:
const QListView *listView;
const QListView *listView;
};
class UBFeaturesPathItemDelegate : public QStyledItemDelegate
{
Q_OBJECT
Q_OBJECT
public:
UBFeaturesPathItemDelegate(QObject *parent = 0);
~UBFeaturesPathItemDelegate();
virtual QString displayText ( const QVariant & value, const QLocale & locale ) const;
void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
~UBFeaturesPathItemDelegate();
virtual QString displayText ( const QVariant & value, const QLocale & locale ) const;
void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
private:
QPixmap *arrowPixmap;
QPixmap *arrowPixmap;
};

@ -284,46 +284,46 @@ void UBFloatingPalette::minimizePalette(const QPoint& pos)
if(!mCanBeMinimized)
{
// If this floating palette cannot be minimized, we exit this method.
return;
return;
}
if(mMinimizedLocation == eMinimizedLocation_None)
{
// Verify if we have to minimize this palette
if(pos.x() == 5)
{
mMinimizedLocation = eMinimizedLocation_Left;
}
// else if(pos.y() == 5)
// {
// mMinimizedLocation = eMinimizedLocation_Top;
// }
// Verify if we have to minimize this palette
if(pos.x() == 5)
{
mMinimizedLocation = eMinimizedLocation_Left;
}
// else if(pos.y() == 5)
// {
// mMinimizedLocation = eMinimizedLocation_Top;
// }
else if(pos.x() == parentWidget()->width() - getParentRightOffset() - width() - 5)
{
mMinimizedLocation = eMinimizedLocation_Right;
}
// else if(pos.y() == parentSize.height() - height() - 5)
// {
// mMinimizedLocation = eMinimizedLocation_Bottom;
// }
// Minimize the Palette
if(mMinimizedLocation != eMinimizedLocation_None)
{
emit minimizeStart(mMinimizedLocation);
}
{
mMinimizedLocation = eMinimizedLocation_Right;
}
// else if(pos.y() == parentSize.height() - height() - 5)
// {
// mMinimizedLocation = eMinimizedLocation_Bottom;
// }
// Minimize the Palette
if(mMinimizedLocation != eMinimizedLocation_None)
{
emit minimizeStart(mMinimizedLocation);
}
}
else
{
// Restore the palette
if(pos.x() > 5 &&
pos.y() > 5 &&
// Restore the palette
if(pos.x() > 5 &&
pos.y() > 5 &&
pos.x() < parentWidget()->width() - getParentRightOffset() - width() - 5 &&
pos.y() < parentWidget()->size().height() - height() - 5)
{
mMinimizedLocation = eMinimizedLocation_None;
emit maximizeStart();
}
{
mMinimizedLocation = eMinimizedLocation_None;
emit maximizeStart();
}
}
}

@ -76,10 +76,10 @@ UBKeyboardPalette::UBKeyboardPalette(QWidget *parent)
createCtrlButtons();
nCurrentLocale = UBSettings::settings()->KeyboardLocale->get().toInt();
if (nCurrentLocale < 0 || nCurrentLocale >= nLocalesCount)
nCurrentLocale = 0;
if (locales!=NULL)
setInput(locales[nCurrentLocale]);
if (nCurrentLocale < 0 || nCurrentLocale >= nLocalesCount)
nCurrentLocale = 0;
if (locales!=NULL)
setInput(locales[nCurrentLocale]);
setContentsMargins( 22, 22, 22, 22 );
@ -193,7 +193,7 @@ void UBKeyboardPalette::setLocale(int nLocale)
onLocaleChanged(locales[nCurrentLocale]);
update();
UBSettings::settings()->KeyboardLocale->set(nCurrentLocale);
UBSettings::settings()->KeyboardLocale->set(nCurrentLocale);
}
emit localeChanged(nLocale);
}

@ -34,21 +34,21 @@
void UBKeyboardButton::sendUnicodeSymbol(KEYCODE keycode)
{
if (keycode.modifier)
CGEventPost(kCGSessionEventTap, CGEventCreateKeyboardEvent(NULL, 56, true));
CGEventPost(kCGSessionEventTap, CGEventCreateKeyboardEvent(NULL, 56, true));
CGEventPost(kCGSessionEventTap, CGEventCreateKeyboardEvent(NULL, keycode.code, true));
CGEventPost(kCGSessionEventTap, CGEventCreateKeyboardEvent(NULL, keycode.code, false));
if (keycode.modifier)
CGEventPost(kCGSessionEventTap, CGEventCreateKeyboardEvent(NULL, 56, false));
CGEventPost(kCGSessionEventTap, CGEventCreateKeyboardEvent(NULL, 56, false));
}
void UBKeyboardButton::sendControlSymbol(int nSymbol)
{
CGEventRef event1 = CGEventCreateKeyboardEvent(NULL, nSymbol, true);
CGEventRef event2 = CGEventCreateKeyboardEvent(NULL, nSymbol, false);
CGEventRef event1 = CGEventCreateKeyboardEvent(NULL, nSymbol, true);
CGEventRef event2 = CGEventCreateKeyboardEvent(NULL, nSymbol, false);
CGEventPost(kCGHIDEventTap, event1);
CGEventPost(kCGHIDEventTap, event2);
CGEventPost(kCGHIDEventTap, event1);
CGEventPost(kCGHIDEventTap, event2);
}
void UBKeyboardPalette::createCtrlButtons()

@ -32,42 +32,42 @@
void UBKeyboardButton::sendUnicodeSymbol(KEYCODE keycode)
{
INPUT input[2];
input[0].type = INPUT_KEYBOARD;
input[0].ki.wVk = 0;
INPUT input[2];
input[0].type = INPUT_KEYBOARD;
input[0].ki.wVk = 0;
input[0].ki.wScan = keycode.symbol;
input[0].ki.dwFlags = KEYEVENTF_UNICODE;
input[0].ki.time = 0;
input[0].ki.dwExtraInfo = 0;
input[0].ki.dwFlags = KEYEVENTF_UNICODE;
input[0].ki.time = 0;
input[0].ki.dwExtraInfo = 0;
input[1].type = INPUT_KEYBOARD;
input[1].ki.wVk = 0;
input[1].type = INPUT_KEYBOARD;
input[1].ki.wVk = 0;
input[1].ki.wScan = keycode.symbol;
input[1].ki.dwFlags = KEYEVENTF_UNICODE | KEYEVENTF_KEYUP;
input[1].ki.time = 0;
input[1].ki.dwExtraInfo = 0;
input[1].ki.dwFlags = KEYEVENTF_UNICODE | KEYEVENTF_KEYUP;
input[1].ki.time = 0;
input[1].ki.dwExtraInfo = 0;
::SendInput(2, input, sizeof(input[0]));
::SendInput(2, input, sizeof(input[0]));
}
void UBKeyboardButton::sendControlSymbol(int nSymbol)
{
INPUT input[2];
input[0].type = INPUT_KEYBOARD;
input[0].ki.wVk = nSymbol;
input[0].ki.wScan = 0;
input[0].ki.dwFlags = 0;
input[0].ki.time = 0;
input[0].ki.dwExtraInfo = 0;
input[1].type = INPUT_KEYBOARD;
input[1].ki.wVk = nSymbol;
input[1].ki.wScan = 0;
input[1].ki.dwFlags = KEYEVENTF_KEYUP;
input[1].ki.time = 0;
input[1].ki.dwExtraInfo = 0;
::SendInput(2, input, sizeof(input[0]));
INPUT input[2];
input[0].type = INPUT_KEYBOARD;
input[0].ki.wVk = nSymbol;
input[0].ki.wScan = 0;
input[0].ki.dwFlags = 0;
input[0].ki.time = 0;
input[0].ki.dwExtraInfo = 0;
input[1].type = INPUT_KEYBOARD;
input[1].ki.wVk = nSymbol;
input[1].ki.wScan = 0;
input[1].ki.dwFlags = KEYEVENTF_KEYUP;
input[1].ki.time = 0;
input[1].ki.dwExtraInfo = 0;
::SendInput(2, input, sizeof(input[0]));
}
void UBKeyboardPalette::createCtrlButtons()

@ -63,9 +63,7 @@ UBLeftPalette::~UBLeftPalette()
void UBLeftPalette::onDocumentSet(UBDocumentProxy* documentProxy)
{
// //This is necessary to force the teacher guide to be showed in priority each time a document is set
// if(documentProxy && UBSettings::settings()->teacherGuidePageZeroActivated->get().toBool())
Q_UNUSED(documentProxy)
// the tab zero is forced
mLastOpenedTabForMode.insert(eUBDockPaletteWidget_BOARD, 0);
}

@ -33,9 +33,9 @@
* @param name as the object name
*/
UBNavigatorPalette::UBNavigatorPalette(QWidget *parent, const char *name):
UBDockPalette(eUBDockPaletteType_LEFT, parent, name)
, mNavigator(NULL)
, mLayout(NULL)
UBDockPalette(eUBDockPaletteType_LEFT, parent, name)
, mNavigator(NULL)
, mLayout(NULL)
, mHLayout(NULL)
, mPageNbr(NULL)
, mClock(NULL)
@ -98,13 +98,13 @@ UBNavigatorPalette::~UBNavigatorPalette()
}
if(NULL != mLayout)
{
delete mLayout;
mLayout = NULL;
delete mLayout;
mLayout = NULL;
}
if(NULL != mNavigator)
{
delete mNavigator;
mNavigator = NULL;
delete mNavigator;
mNavigator = NULL;
}
}

@ -58,7 +58,7 @@ class UBResources : public QObject
QCursor playCursor;
QCursor textCursor;
QCursor rotateCursor;
QCursor drawLineRulerCursor;
QCursor drawLineRulerCursor;
};
#endif /* UBRESOURCES_H_ */

@ -39,17 +39,17 @@ UBRightPalette::UBRightPalette(QWidget *parent, const char *name):
mCollapseWidth = 150;
bool isCollapsed = false;
if(mCurrentMode == eUBDockPaletteWidget_BOARD){
mLastWidth = UBSettings::settings()->rightLibPaletteBoardModeWidth->get().toInt();
isCollapsed = UBSettings::settings()->rightLibPaletteBoardModeIsCollapsed->get().toBool();
mLastWidth = UBSettings::settings()->rightLibPaletteBoardModeWidth->get().toInt();
isCollapsed = UBSettings::settings()->rightLibPaletteBoardModeIsCollapsed->get().toBool();
}
else{
mLastWidth = UBSettings::settings()->rightLibPaletteDesktopModeWidth->get().toInt();
isCollapsed = UBSettings::settings()->rightLibPaletteDesktopModeIsCollapsed->get().toBool();
mLastWidth = UBSettings::settings()->rightLibPaletteDesktopModeWidth->get().toInt();
isCollapsed = UBSettings::settings()->rightLibPaletteDesktopModeIsCollapsed->get().toBool();
}
if(isCollapsed)
resize(0,parentWidget()->height());
resize(0,parentWidget()->height());
else
resize(mLastWidth, parentWidget()->height());
resize(mLastWidth, parentWidget()->height());
}
/**
@ -77,18 +77,18 @@ void UBRightPalette::mouseMoveEvent(QMouseEvent *event)
*/
void UBRightPalette::resizeEvent(QResizeEvent *event)
{
int newWidth = width();
if(mCurrentMode == eUBDockPaletteWidget_BOARD){
if(newWidth > mCollapseWidth)
UBSettings::settings()->rightLibPaletteBoardModeWidth->set(newWidth);
UBSettings::settings()->rightLibPaletteBoardModeIsCollapsed->set(newWidth == 0);
}
else{
if(newWidth > mCollapseWidth)
UBSettings::settings()->rightLibPaletteDesktopModeWidth->set(newWidth);
UBSettings::settings()->rightLibPaletteDesktopModeIsCollapsed->set(newWidth == 0);
}
UBDockPalette::resizeEvent(event);
int newWidth = width();
if(mCurrentMode == eUBDockPaletteWidget_BOARD){
if(newWidth > mCollapseWidth)
UBSettings::settings()->rightLibPaletteBoardModeWidth->set(newWidth);
UBSettings::settings()->rightLibPaletteBoardModeIsCollapsed->set(newWidth == 0);
}
else{
if(newWidth > mCollapseWidth)
UBSettings::settings()->rightLibPaletteDesktopModeWidth->set(newWidth);
UBSettings::settings()->rightLibPaletteDesktopModeIsCollapsed->set(newWidth == 0);
}
UBDockPalette::resizeEvent(event);
emit resized();
}
@ -104,19 +104,19 @@ void UBRightPalette::updateMaxWidth()
bool UBRightPalette::switchMode(eUBDockPaletteWidgetMode mode)
{
int newModeWidth;
if(mode == eUBDockPaletteWidget_BOARD){
mLastWidth = UBSettings::settings()->rightLibPaletteBoardModeWidth->get().toInt();
newModeWidth = mLastWidth;
if(UBSettings::settings()->rightLibPaletteBoardModeIsCollapsed->get().toBool())
newModeWidth = 0;
}
else{
mLastWidth = UBSettings::settings()->rightLibPaletteDesktopModeWidth->get().toInt();
newModeWidth = mLastWidth;
if(UBSettings::settings()->rightLibPaletteDesktopModeIsCollapsed->get().toBool())
newModeWidth = 0;
}
resize(newModeWidth,height());
return UBDockPalette::switchMode(mode);
int newModeWidth;
if(mode == eUBDockPaletteWidget_BOARD){
mLastWidth = UBSettings::settings()->rightLibPaletteBoardModeWidth->get().toInt();
newModeWidth = mLastWidth;
if(UBSettings::settings()->rightLibPaletteBoardModeIsCollapsed->get().toBool())
newModeWidth = 0;
}
else{
mLastWidth = UBSettings::settings()->rightLibPaletteDesktopModeWidth->get().toInt();
newModeWidth = mLastWidth;
if(UBSettings::settings()->rightLibPaletteDesktopModeIsCollapsed->get().toBool())
newModeWidth = 0;
}
resize(newModeWidth,height());
return UBDockPalette::switchMode(mode);
}

@ -932,7 +932,7 @@ void UBTeacherGuidePageZeroWidget::fillComboBoxes()
QStringList licences;
licences << tr("Attribution-ShareAlike CC BY-SA")
<< tr("Attribution CC BY")
<< tr("Attribution-NoDerivs CC BY-ND")
<< tr("Attribution-NoDerivs CC BY-ND")
<< tr("Attribution-NonCommercial CC BY-NC")
<< tr("Attribution-NonCommercial-NoDerivs CC BY-NC-ND")
<< tr("Attribution-NonCommercial-ShareAlike CC BY-NC-SA")
@ -1168,8 +1168,8 @@ bool UBTeacherGuidePageZeroWidget::isModified()
void UBTeacherGuidePageZeroWidget::resizeEvent(QResizeEvent* ev)
{
emit resized();
QWidget::resizeEvent(ev);
emit resized();
QWidget::resizeEvent(ev);
}
/***************************************************************************
@ -1209,54 +1209,54 @@ UBTeacherGuideWidget::~UBTeacherGuideWidget()
void UBTeacherGuideWidget::onActiveSceneChanged()
{
if (UBApplication::boardController->currentPage() == 0) {
if(mpPageZeroWidget->isModified())
mpPageZeroWidget->switchToMode(tUBTGZeroPageMode_PRESENTATION);
else
mpPageZeroWidget->switchToMode(tUBTGZeroPageMode_EDITION);
if(mpPageZeroWidget->isModified())
mpPageZeroWidget->switchToMode(tUBTGZeroPageMode_PRESENTATION);
else
mpPageZeroWidget->switchToMode(tUBTGZeroPageMode_EDITION);
setCurrentWidget(mpPageZeroWidget);
}
else{
if(mpEditionWidget->isModified()){
if(mpEditionWidget->isModified()){
mCurrentData = mpEditionWidget->getData();
mpPresentationWidget->showData(mCurrentData);
setCurrentWidget(mpPresentationWidget);
}
else
setCurrentWidget(mpEditionWidget);
setCurrentWidget(mpPresentationWidget);
}
else
setCurrentWidget(mpEditionWidget);
}
}
void UBTeacherGuideWidget::onTriggeredAction(bool checked)
{
Q_UNUSED(checked);
if(!mKeyboardActionFired)
showPresentationMode();
mKeyboardActionFired=false;
Q_UNUSED(checked);
if(!mKeyboardActionFired)
showPresentationMode();
mKeyboardActionFired=false;
}
void UBTeacherGuideWidget::onTriggeredKeyboardAction(bool checked)
{
Q_UNUSED(checked);
mKeyboardActionFired = true;
Q_UNUSED(checked);
mKeyboardActionFired = true;
}
void UBTeacherGuideWidget::connectToStylusPalette()
{
connect(UBApplication::mainWindow->actionPen, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionEraser, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionMarker, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionPointer, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionPlay, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionZoomIn, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionZoomOut, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionPen, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionEraser, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionMarker, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionPointer, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionPlay, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionZoomIn, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionZoomOut, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionCapture, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionHand, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionLine, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionText, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionSelector, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(onTriggeredKeyboardAction(bool)));
connect(UBApplication::mainWindow->actionHand, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionLine, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionText, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionSelector, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(onTriggeredKeyboardAction(bool)));
}
void UBTeacherGuideWidget::showPresentationMode()

@ -147,7 +147,7 @@ public:
bool isModified();
signals:
void resized();
void resized();
public slots:
void onActiveSceneChanged();
@ -245,8 +245,8 @@ private:
bool mKeyboardActionFired;
private slots:
void onTriggeredAction(bool checked);
void onTriggeredKeyboardAction(bool checked);
void onTriggeredAction(bool checked);
void onTriggeredKeyboardAction(bool checked);
};
#endif // UBTEACHERGUIDEWIDGET_H

@ -173,11 +173,11 @@ void UBTGAdaptableText::showEvent(QShowEvent* e)
{
Q_UNUSED(e);
if(!mIsUpdatingSize && !hasFocus() && mHasPlaceHolder && toPlainText().isEmpty() && !isReadOnly()){
setTextColor(QColor(Qt::lightGray));
setPlainText(mPlaceHolderText);
setTextColor(QColor(Qt::lightGray));
setPlainText(mPlaceHolderText);
}
else
// If the teacherguide is collapsed, don't updated the size. Or set the size as the expanded size
// If the teacherguide is collapsed, don't updated the size. Or set the size as the expanded size
onTextChanged();
}
@ -194,16 +194,16 @@ void UBTGAdaptableText::onTextChanged()
{
qreal documentSize = document()->size().height();
if(height() == documentSize + mBottomMargin){
return;
return;
}
mIsUpdatingSize = true;
if(documentSize < mMinimumHeight){
setFixedHeight(mMinimumHeight);
setFixedHeight(mMinimumHeight);
}
else{
setFixedHeight(documentSize+mBottomMargin);
setFixedHeight(documentSize+mBottomMargin);
}
updateGeometry();
@ -239,45 +239,45 @@ void UBTGAdaptableText::bottomMargin(int newValue)
void UBTGAdaptableText::focusInEvent(QFocusEvent* e)
{
if(isReadOnly()){
e->ignore();
}
managePlaceholder(true);
QTextEdit::focusInEvent(e);
if(isReadOnly()){
e->ignore();
}
managePlaceholder(true);
QTextEdit::focusInEvent(e);
}
void UBTGAdaptableText::focusOutEvent(QFocusEvent* e)
{
managePlaceholder(false);
QTextEdit::focusOutEvent(e);
managePlaceholder(false);
QTextEdit::focusOutEvent(e);
}
void UBTGAdaptableText::managePlaceholder(bool focus)
{
if(focus){
if(toPlainText() == mPlaceHolderText){
setTextColor(QColor(Qt::black));
setPlainText("");
}
setCursorToTheEnd();
}
else{
if(toPlainText().isEmpty()){
setTextColor(QColor(Qt::lightGray));
setPlainText(mPlaceHolderText);
}
}
if(focus){
if(toPlainText() == mPlaceHolderText){
setTextColor(QColor(Qt::black));
setPlainText("");
}
setCursorToTheEnd();
}
else{
if(toPlainText().isEmpty()){
setTextColor(QColor(Qt::lightGray));
setPlainText(mPlaceHolderText);
}
}
}
void UBTGAdaptableText::setCursorToTheEnd()
{
QTextDocument* doc = document();
if(NULL != doc){
QTextBlock block = doc->lastBlock();
QTextCursor cursor(doc);
cursor.setPosition(block.position() + block.length() - 1);
setTextCursor(cursor);
}
QTextDocument* doc = document();
if(NULL != doc){
QTextBlock block = doc->lastBlock();
QTextCursor cursor(doc);
cursor.setPosition(block.position() + block.length() - 1);
setTextCursor(cursor);
}
}
/***************************************************************************
@ -288,10 +288,10 @@ UBDraggableWeb::UBDraggableWeb(QString& relativePath, QWidget* parent): QWebView
, mDragStarted(false)
{
if(!relativePath.startsWith("file://"))
mRelativePath = QUrl::fromLocalFile(relativePath).toString();
else
mRelativePath = relativePath;
if(!relativePath.startsWith("file://"))
mRelativePath = QUrl::fromLocalFile(relativePath).toString();
else
mRelativePath = relativePath;
//NOOP
}
@ -438,7 +438,7 @@ tUBGEElementNode* UBTGMediaWidget::saveData()
tUBGEElementNode* result = new tUBGEElementNode();
QString relativePath = mMediaPath;
relativePath = relativePath.replace(UBApplication::boardController->selectedDocument()->persistencePath()+"/","");
result->name = "media";
result->name = "media";
result->attributes.insert("title",mpTitle->text());
result->attributes.insert("relativePath",relativePath);
result->attributes.insert("mediaType",mMediaType);
@ -598,7 +598,7 @@ void UBTGMediaWidget::mousePressEvent(QMouseEvent *event)
QMimeData *mimeData = new QMimeData();
QList<QUrl> urlList;
#ifdef Q_WS_WIN
urlList << QUrl::fromLocalFile(mMediaPath);
urlList << QUrl::fromLocalFile(mMediaPath);
#else
urlList << QUrl(mMediaPath);
#endif
@ -644,11 +644,11 @@ UBTGUrlWidget::~UBTGUrlWidget()
void UBTGUrlWidget::onUrlEditionFinished()
{
QString url = mpUrl->text();
if(url.length() && !url.startsWith("http://") && !url.startsWith("https://") && !url.startsWith("ftp://") && !url.startsWith("sftp://") && !url.startsWith("http://")){
mpUrl->setText("http://" + mpUrl->text());
setFocus();
}
QString url = mpUrl->text();
if(url.length() && !url.startsWith("http://") && !url.startsWith("https://") && !url.startsWith("ftp://") && !url.startsWith("sftp://") && !url.startsWith("http://")){
mpUrl->setText("http://" + mpUrl->text());
setFocus();
}
}
void UBTGUrlWidget::initializeWithDom(QDomElement element)

@ -224,11 +224,11 @@ void UBThumbnailWidget::mousePressEvent(QMouseEvent *event)
return;
}
//if(sceneItem){
// int pageIndex = UBDocumentContainer::pageFromSceneIndex(sceneItem->sceneIndex());
// if(pageIndex == 0){
// int pageIndex = UBDocumentContainer::pageFromSceneIndex(sceneItem->sceneIndex());
// if(pageIndex == 0){
// event->ignore();
// return;
// }
// }
//}
mMousePressScenePos = mapToScene(mMousePressPos);
@ -846,15 +846,15 @@ void UBSceneThumbnailNavigPixmap::mousePressEvent(QGraphicsSceneMouseEvent *even
void UBSceneThumbnailNavigPixmap::updateButtonsState()
{
bCanDelete = false;
bCanDelete = false;
bCanMoveUp = false;
bCanMoveDown = false;
bCanDuplicate = false;
if(proxy()){
int pageIndex = UBDocumentContainer::pageFromSceneIndex(sceneIndex());
UBDocumentController* documentController = UBApplication::documentController;
bCanDelete = documentController->pageCanBeDeleted(pageIndex);
int pageIndex = UBDocumentContainer::pageFromSceneIndex(sceneIndex());
UBDocumentController* documentController = UBApplication::documentController;
bCanDelete = documentController->pageCanBeDeleted(pageIndex);
bCanMoveUp = documentController->pageCanBeMovedUp(pageIndex);
bCanMoveDown = documentController->pageCanBeMovedDown(pageIndex);
bCanDuplicate = documentController->pageCanBeDuplicated(pageIndex);
@ -866,14 +866,14 @@ void UBSceneThumbnailNavigPixmap::updateButtonsState()
void UBSceneThumbnailNavigPixmap::deletePage()
{
if(UBApplication::mainWindow->yesNoQuestion(QObject::tr("Remove Page"), QObject::tr("Are you sure you want to remove 1 page from the selected document '%0'?").arg(UBApplication::documentController->selectedDocument()->metaData(UBSettings::documentName).toString()))){
UBApplication::boardController->deleteScene(sceneIndex());
}
if(UBApplication::mainWindow->yesNoQuestion(QObject::tr("Remove Page"), QObject::tr("Are you sure you want to remove 1 page from the selected document '%0'?").arg(UBApplication::documentController->selectedDocument()->metaData(UBSettings::documentName).toString()))){
UBApplication::boardController->deleteScene(sceneIndex());
}
}
void UBSceneThumbnailNavigPixmap::duplicatePage()
{
UBApplication::boardController->duplicateScene(sceneIndex());
UBApplication::boardController->duplicateScene(sceneIndex());
}
void UBSceneThumbnailNavigPixmap::moveUpPage()
@ -891,17 +891,17 @@ void UBSceneThumbnailNavigPixmap::moveDownPage()
void UBImgTextThumbnailElement::Place(int row, int col, qreal width, qreal height)
{
int labelSpacing = 0;
if(this->caption)
{
if(this->caption)
{
QFontMetrics fm(this->caption->font());
labelSpacing = UBSettings::thumbnailSpacing + fm.height();
}
if(this->thumbnail)
{
}
if(this->thumbnail)
{
int w = this->thumbnail->boundingRect().width();
int h = this->thumbnail->boundingRect().height();
qreal scaleWidth = width / w;
qreal scaleWidth = width / w;
qreal scaleHeight = height / h;
qreal scaleFactor = qMin(scaleWidth, scaleHeight);
UBThumbnail* pix = dynamic_cast<UBThumbnail*>(this->thumbnail);
@ -924,8 +924,8 @@ void UBImgTextThumbnailElement::Place(int row, int col, qreal width, qreal heigh
this->thumbnail->setPos(pos);
if(this->caption)
{
if(this->caption)
{
QFontMetrics fm(this->caption->font());
QString elidedText = fm.elidedText(this->caption->toPlainText(), Qt::ElideRight, width);
@ -935,6 +935,6 @@ void UBImgTextThumbnailElement::Place(int row, int col, qreal width, qreal heigh
qreal labelWidth = fm.width(elidedText);
pos.setX(border + (width - labelWidth) / 2 + col * (width + border));
this->caption->setPos(pos);
}
}
}
}
}

@ -408,27 +408,27 @@ class UBThumbnailTextItem : public QGraphicsTextItem
class UBImgTextThumbnailElement
{
private:
UBSceneThumbnailNavigPixmap* thumbnail;
UBThumbnailTextItem* caption;
int border;
UBSceneThumbnailNavigPixmap* thumbnail;
UBThumbnailTextItem* caption;
int border;
public:
UBImgTextThumbnailElement(UBSceneThumbnailNavigPixmap* thumb, UBThumbnailTextItem* text): border(0)
{
this->thumbnail = thumb;
this->caption = text;
}
UBImgTextThumbnailElement(UBSceneThumbnailNavigPixmap* thumb, UBThumbnailTextItem* text): border(0)
{
this->thumbnail = thumb;
this->caption = text;
}
UBSceneThumbnailNavigPixmap* getThumbnail() const { return this->thumbnail; }
void setThumbnail(UBSceneThumbnailNavigPixmap* newGItem) { this->thumbnail = newGItem; }
UBSceneThumbnailNavigPixmap* getThumbnail() const { return this->thumbnail; }
void setThumbnail(UBSceneThumbnailNavigPixmap* newGItem) { this->thumbnail = newGItem; }
UBThumbnailTextItem* getCaption() const { return this->caption; }
void setCaption(UBThumbnailTextItem* newcaption) { this->caption = newcaption; }
UBThumbnailTextItem* getCaption() const { return this->caption; }
void setCaption(UBThumbnailTextItem* newcaption) { this->caption = newcaption; }
void Place(int row, int col, qreal width, qreal height);
void Place(int row, int col, qreal width, qreal height);
int getBorder() const { return this->border; }
void setBorder(int newBorder) { this->border = newBorder; }
int getBorder() const { return this->border; }
void setBorder(int newBorder) { this->border = newBorder; }
};

@ -36,7 +36,7 @@ class UBNetworkAccessManager : public QNetworkAccessManager
UBNetworkAccessManager(QObject *parent = 0);
virtual QNetworkReply *get(const QNetworkRequest &request);
virtual QNetworkReply *get(const QNetworkRequest &request);
protected:
virtual QNetworkReply * createRequest ( Operation op, const QNetworkRequest & req, QIODevice * outgoingData = 0 );

@ -43,7 +43,7 @@ namespace merge_lib
protected:
void _retrieveBoxFromParent()
{
{
std::string content = _page->getObjectContent();
std::string mediaBox;
Object * parent = _page;
@ -72,8 +72,8 @@ namespace merge_lib
{
unsigned int startOfMediaBox = _page->getObjectContent().rfind(">>");
_page->insertToContent(startOfMediaBox, mediaBox);
_changeObjectContent(startOfMediaBox);
}
_changeObjectContent(startOfMediaBox);
}
}
private:
virtual void _changeObjectContent(unsigned int startOfPageElement) = 0;

@ -65,7 +65,7 @@ namespace merge_lib
_page->insertToContent(startOfPageElement, matrix.str());
}
void _pageElementNotFound()
{
{
_retrieveBoxFromParent();
}
};

@ -114,7 +114,7 @@ void Document::saveAs(const char * newFileName)
for ( sizeIterator = sizesAndGenerationNumbers.begin() ; sizeIterator != sizesAndGenerationNumbers.end(); sizeIterator++ )
{
out << std::setfill('0')<<std::setw(10)<<sizeInXref << " " << std::setw(5) << (*sizeIterator).second.second << " n \n";
sizeInXref = sizeInXref + (*sizeIterator).second.first;
sizeInXref = sizeInXref + (*sizeIterator).second.first;
}
out << "trailer\n<<\n/Size " << numberOfObjects << "\n/Info 1 0 R\n"
<< "/Root " << _root->getObjectNumber() << " 0 R\n >>\nstartxref\n" << sizeInXref << "\n%%EOF";

@ -120,7 +120,7 @@ bool LZWDecode::decode(std::string & encoded)
// LZW decoding
std::string decoded;
struct DecodingTable
{
{
int length;
int head;
unsigned tail;
@ -128,7 +128,7 @@ bool LZWDecode::decode(std::string & encoded)
int prevCode = 0;
int newChar = 0;
unsigned curSequence[4097];
unsigned curSequence[4097];
int nextLength = 0;
clearTable();
@ -219,7 +219,7 @@ bool LZWDecode::decode(std::string & encoded)
{
_predict->decode(encoded);
}
return true;
return true;
}

@ -50,12 +50,12 @@ namespace merge_lib
std::string &_encoded;
size_t _curSymbolIndex;
int _earlyChange; // early parameter
int _readBuf;
int _readBits;
int _earlyChange; // early parameter
int _readBuf;
int _readBits;
int _nextCode;
int _bitsToRead;
bool _first;
bool _first;
int _curSequenceLength;
};
}

@ -49,7 +49,7 @@ namespace merge_lib
{
if(_wasCropBoxHandlerCalled())
{
PageElementHandler * tempNextHandler = _nextHandler;
PageElementHandler * tempNextHandler = _nextHandler;
_nextHandler = new RemoveHimselfHandler(_page, _handlerName);
_nextHandler->addNextHandler(tempNextHandler);
return;
@ -61,7 +61,7 @@ namespace merge_lib
_page->insertToContent(startOfPageElement, matrix);
}
void _pageElementNotFound()
{
{
if(_wasCropBoxHandlerCalled())
return;
_retrieveBoxFromParent();

@ -36,7 +36,7 @@ std::string NUMBERANDWHITESPACE(" 0123456789");
Object::~Object()
{
{
_parents.clear();
_children.clear();
_content.clear();
@ -107,8 +107,8 @@ void Object::forgetAboutChildren(unsigned int leftBound, unsigned int rightBound
{
std::vector<Object *> children = getChildrenByBounds(leftBound, rightBound);
for(size_t i = 0; i < children.size(); ++i)
{
_children.erase(_children.find(children[i]->getObjectNumber()));
{
_children.erase(_children.find(children[i]->getObjectNumber()));
}
}
@ -250,9 +250,9 @@ void Object::insertToContent(unsigned int position, const std::string & inserted
}
void Object::insertToContent(unsigned int position, const char * insertedStr, unsigned int length)
{
{
_recalculateReferencePositions(position, length);
_content.insert(position, insertedStr, length);
_content.insert(position, insertedStr, length);
}
//vector <object number, its size>
@ -263,9 +263,9 @@ void Object::serialize(std::ofstream & out, std::map< unsigned int, std::pair<un
std::string stream;
if(_hasStream && !_hasStreamInContent)
{
{
getStream(stream);
stream.append("endstream\n");
stream.append("endstream\n");
}
// xxxx + " " + "0" + " " + "obj" + "\n" + _content.size() + "endobj\n", where x - is a digit
unsigned long long objectSizeForXref = (static_cast<unsigned int>(std::log10(static_cast<double>(_number))) + 1) + 14 + _content.size() + stream.size();
@ -285,13 +285,13 @@ void Object::serialize(std::ofstream & out, std::map< unsigned int, std::pair<un
}
}
void Object::recalculateObjectNumbers(unsigned int & newNumber)
{
{
_recalculateObjectNumbers(newNumber);
resetIsPassed();
}
void Object::_recalculateObjectNumbers(unsigned int & newNumber)
{
{
_setObjectNumber(newNumber);
Children::iterator childIterator;
@ -396,7 +396,7 @@ bool Object::findObject(const std::string & token, Object* & foundObject, unsign
bool result = _findObject(token, foundObject, tokenPositionInContent);
resetIsPassed();
if(result)
{
{
return true;
}
return false;
@ -425,7 +425,7 @@ void Object::_addParent(Object * child)
}
void Object::_serialize(std::ofstream & out, const std::string & stream)
{
out << _number << " " << _generationNumber << " obj\n" << _content << stream << "endobj\n";
out << _number << " " << _generationNumber << " obj\n" << _content << stream << "endobj\n";
out.flush();
}

@ -36,137 +36,137 @@
namespace merge_lib
{
//This class represents pdf objects, and defines methods for performing
//all necessary operations on pdf objects
//Each object consists of two parts: content and object's number
//<object number> <number> obj
//<content>
//endobj
//Object can contain several links to other object. These objects has been named "children".
//Each reference (child object) should be kept with it position(s) in object's content.
//After each content modification, all references should be changed too.
//This convention lighten the recalculation object numbers work.
class Object
{
public:
friend class PageElementHandler;
typedef std::vector<unsigned int> ReferencePositionsInContent;
typedef std::pair<Object *, ReferencePositionsInContent > ChildAndItPositionInContent;
typedef std::map <unsigned int, ChildAndItPositionInContent> Children;
Object(unsigned int objectNumber, unsigned int generationNumber, const std::string & objectContent,
std::string fileName = "", std::pair<unsigned int, unsigned int> streamBounds = std::make_pair ((unsigned int)0,(unsigned int)0), bool hasStream = false
):
_number(objectNumber), _generationNumber(generationNumber), _oldNumber(objectNumber), _content(objectContent),_parents(),_children(),_isPassed(false),
//This class represents pdf objects, and defines methods for performing
//all necessary operations on pdf objects
//Each object consists of two parts: content and object's number
//<object number> <number> obj
//<content>
//endobj
//Object can contain several links to other object. These objects has been named "children".
//Each reference (child object) should be kept with it position(s) in object's content.
//After each content modification, all references should be changed too.
//This convention lighten the recalculation object numbers work.
class Object
{
public:
friend class PageElementHandler;
typedef std::vector<unsigned int> ReferencePositionsInContent;
typedef std::pair<Object *, ReferencePositionsInContent > ChildAndItPositionInContent;
typedef std::map <unsigned int, ChildAndItPositionInContent> Children;
Object(unsigned int objectNumber, unsigned int generationNumber, const std::string & objectContent,
std::string fileName = "", std::pair<unsigned int, unsigned int> streamBounds = std::make_pair ((unsigned int)0,(unsigned int)0), bool hasStream = false
):
_number(objectNumber), _generationNumber(generationNumber), _oldNumber(objectNumber), _content(objectContent),_parents(),_children(),_isPassed(false),
_streamBounds(streamBounds), _fileName(fileName), _hasStream(hasStream), _hasStreamInContent(false)
{
}
virtual ~Object();
Object * getClone(std::vector<Object *> & clones);
void addChild(Object * child, const std::vector<unsigned int> childPositionsInContent);
void addChild(const Children & children);
ReferencePositionsInContent removeChild(Object * child);
void forgetAboutChildren(unsigned int leftBound, unsigned int rightBound);
Object * getChild(unsigned int objectNumber);
bool findObject(const std::string & token, Object* & foundObject, unsigned int & tokenPositionInContent);
std::vector<Object *> getChildrenByBounds(unsigned int leftBound, unsigned int rightBound);
std::vector<Object *> getSortedByPositionChildren(unsigned int leftBound, unsigned int rightBound);
void removeChildrenByBounds(unsigned int leftBound, unsigned int rightBound);
const Children & getChildren();
void removeHimself();
unsigned int getObjectNumber() const;
unsigned int getgenerationNumber() const;
std::string & getObjectContent();
void setObjectContent(const std::string & objectContent);
void appendContent(const std::string & addToContent);
void eraseContent(unsigned int from, unsigned int size);
void insertToContent(unsigned int position, const char * insertedStr, unsigned int length);
void insertToContent(unsigned int position, const std::string & insertedStr);
//vector <object number, its size>
void serialize(std::ofstream & out, std::map< unsigned int, std::pair<unsigned long long, unsigned int > > & sizesAndGenerationNumbers);
void recalculateObjectNumbers(unsigned int & newNumber);
bool isPassed()
{
return _isPassed;
}
void retrieveMaxObjectNumber(unsigned int & maxNumber);
void resetIsPassed()
{
if(_isPassed)
_isPassed = false;
Children::iterator it;
for ( it=_children.begin() ; it != _children.end(); it++ )
{
if((*it).second.first->isPassed())
(*it).second.first->resetIsPassed();
}
}
unsigned int getOldNumber()
{
return _oldNumber;
}
void setObjectNumber(unsigned int objNumber)
{
_number = objNumber;
_oldNumber = objNumber;
}
bool getStream(std::string &);
bool hasStream();
bool getHeader(std::string &content);
void forgetStreamInFile()
{
_hasStreamInContent = true;
_hasStream = true;
}
std::string getNameSimpleValue(const std::string &content, const std::string &patten, size_t pos = 0);
unsigned int getChildPosition(const Object * child); //throw (Exception)
const std::set<Object *> & getParents()
{
return _parents;
}
{
}
virtual ~Object();
Object * getClone(std::vector<Object *> & clones);
void addChild(Object * child, const std::vector<unsigned int> childPositionsInContent);
void addChild(const Children & children);
ReferencePositionsInContent removeChild(Object * child);
void forgetAboutChildren(unsigned int leftBound, unsigned int rightBound);
Object * getChild(unsigned int objectNumber);
bool findObject(const std::string & token, Object* & foundObject, unsigned int & tokenPositionInContent);
std::vector<Object *> getChildrenByBounds(unsigned int leftBound, unsigned int rightBound);
std::vector<Object *> getSortedByPositionChildren(unsigned int leftBound, unsigned int rightBound);
void removeChildrenByBounds(unsigned int leftBound, unsigned int rightBound);
const Children & getChildren();
void removeHimself();
unsigned int getObjectNumber() const;
unsigned int getgenerationNumber() const;
std::string & getObjectContent();
void setObjectContent(const std::string & objectContent);
void appendContent(const std::string & addToContent);
void eraseContent(unsigned int from, unsigned int size);
void insertToContent(unsigned int position, const char * insertedStr, unsigned int length);
void insertToContent(unsigned int position, const std::string & insertedStr);
//vector <object number, its size>
void serialize(std::ofstream & out, std::map< unsigned int, std::pair<unsigned long long, unsigned int > > & sizesAndGenerationNumbers);
void recalculateObjectNumbers(unsigned int & newNumber);
bool isPassed()
{
return _isPassed;
}
void retrieveMaxObjectNumber(unsigned int & maxNumber);
void resetIsPassed()
{
if(_isPassed)
_isPassed = false;
Children::iterator it;
for ( it=_children.begin() ; it != _children.end(); it++ )
{
if((*it).second.first->isPassed())
(*it).second.first->resetIsPassed();
}
}
unsigned int getOldNumber()
{
return _oldNumber;
}
void setObjectNumber(unsigned int objNumber)
{
_number = objNumber;
_oldNumber = objNumber;
}
bool getStream(std::string &);
bool hasStream();
bool getHeader(std::string &content);
void forgetStreamInFile()
{
_hasStreamInContent = true;
_hasStream = true;
}
std::string getNameSimpleValue(const std::string &content, const std::string &patten, size_t pos = 0);
unsigned int getChildPosition(const Object * child); //throw (Exception)
const std::set<Object *> & getParents()
{
return _parents;
}
Object* findPatternInObjOrParents(const std::string &pattern);
private:
//methods
Object(const Object & copy);
Object * _getClone(std::map<unsigned int, Object *> & clones);
void _addChild(Object * child, const ReferencePositionsInContent & childPositionsInContent);
void _setObjectNumber(unsigned int objectNumber);
void _addParent(Object * child);
bool _findObject(const std::string & token, Object* & foundObject, unsigned int & tokenPositionInContent);
void _serialize(std::ofstream & out, const std::string & stream);
void _recalculateObjectNumbers(unsigned int & maxNumber);
void _recalculateReferencePositions(unsigned int changedReference, int displacement);
void _retrieveMaxObjectNumber(unsigned int & maxNumber);
void _serialize(std::ofstream & out, std::map<unsigned int, unsigned long long> & sizes);
private:
//methods
Object(const Object & copy);
Object * _getClone(std::map<unsigned int, Object *> & clones);
void _addChild(Object * child, const ReferencePositionsInContent & childPositionsInContent);
void _setObjectNumber(unsigned int objectNumber);
void _addParent(Object * child);
bool _findObject(const std::string & token, Object* & foundObject, unsigned int & tokenPositionInContent);
void _serialize(std::ofstream & out, const std::string & stream);
void _recalculateObjectNumbers(unsigned int & maxNumber);
void _recalculateReferencePositions(unsigned int changedReference, int displacement);
void _retrieveMaxObjectNumber(unsigned int & maxNumber);
void _serialize(std::ofstream & out, std::map<unsigned int, unsigned long long> & sizes);
bool _getStreamFromContent(std::string & stream);
//members
unsigned int _number;
unsigned int _generationNumber;
unsigned int _oldNumber;
std::string _content;
std::set <Object *> _parents;
Children _children;
bool _isPassed;
std::pair<unsigned int, unsigned int> _streamBounds;
std::string _fileName;
bool _hasStream;
bool _hasStreamInContent;
};
//members
unsigned int _number;
unsigned int _generationNumber;
unsigned int _oldNumber;
std::string _content;
std::set <Object *> _parents;
Children _children;
bool _isPassed;
std::pair<unsigned int, unsigned int> _streamBounds;
std::string _fileName;
bool _hasStream;
bool _hasStreamInContent;
};
}
#endif

@ -58,7 +58,7 @@ void OverlayDocumentParser::_readXRefAndCreateObjects()
for(objAndPIter = objectsAndPositions.begin(); objAndPIter != objectsAndPositions.end(); ++objAndPIter)
{
if((objAndPIter->second > objAndSIter->second) && (objAndPIter->second < nextPosition))
nextPosition = objAndPIter->second;
nextPosition = objAndPIter->second;
}
objectsAndSizes[objAndSIter->first] = nextPosition - objAndSIter->second;
}
@ -73,7 +73,7 @@ void OverlayDocumentParser::_readXRefAndCreateObjects()
if(objIter->second < partStart)
partStart = objIter->second;
}
unsigned long nextPartStart = partStart + partSize;
unsigned long nextPartStart = partStart + partSize;
if((nextPartStart) < fileSize)
_getPartOfFileContent(partStart, partSize);
@ -90,18 +90,18 @@ void OverlayDocumentParser::_readXRefAndCreateObjects()
{
std::pair<unsigned int, unsigned int> streamBounds;
unsigned int objectNumber;
unsigned int generationNumber;
unsigned int generationNumber;
bool hasObjectStream;
const std::string content = _getObjectContent(objIter->second - partStart, objectNumber, generationNumber, streamBounds, hasObjectStream);
streamBounds.first += partStart;
streamBounds.second += partStart;
Object * newObject = new Object(objectNumber, generationNumber, content, _document->_documentName ,streamBounds, hasObjectStream);
_objects[objectNumber] = newObject;
std::map<unsigned int, unsigned long>::iterator temp = objIter;
std::map<unsigned int, unsigned long>::iterator temp = objIter;
++objIter;
objectsAndPositions.erase(temp);
continue;
}
}
++objIter;
}
partStart = nextPartStart;

@ -43,20 +43,20 @@ namespace merge_lib
Document * parseDocument(const char * fileName);
protected:
unsigned int _readTrailerAndReturnRoot();
unsigned int _readTrailerAndReturnRoot();
private:
//methods
//methods
void _getFileContent(const char * fileName);
void _readXRefAndCreateObjects();
void _readXref(std::map<unsigned int, unsigned long> & objectsAndSizes);
void _getPartOfFileContent(long startOfPart, unsigned int length);
void _readXref(std::map<unsigned int, unsigned long> & objectsAndSizes);
void _getPartOfFileContent(long startOfPart, unsigned int length);
unsigned int _getStartOfXrefWithRoot();
//constants
static int DOC_PART_WITH_START_OF_XREF;
//constants
static int DOC_PART_WITH_START_OF_XREF;
//members
std::string _fileName;
//members
std::string _fileName;
};
}
#endif

@ -184,7 +184,7 @@ void Parser::_createObjectTree(const char * fileName)
for(; refsIterator != refs.end(); ++refsIterator)
{
if(_objects.count((*refsIterator).first))
currentObject->addChild(_objects[(*refsIterator).first], (*refsIterator).second);
currentObject->addChild(_objects[(*refsIterator).first], (*refsIterator).second);
}
}
_root = _objects[rootObjectNumber];

@ -60,7 +60,7 @@ namespace merge_lib
static bool tokenIsAName(const std::string &content, size_t start );
protected:
const std::string & _getObjectContent(unsigned int objectPosition, unsigned int & objectNumber, unsigned int & generationNumber, std::pair<unsigned int, unsigned int> &, bool &);
virtual unsigned int _readTrailerAndReturnRoot();
virtual unsigned int _readTrailerAndReturnRoot();
private:
//methods
virtual void _getFileContent(const char * fileName);
@ -77,7 +77,7 @@ namespace merge_lib
unsigned int _skipWhiteSpaces(const std::string & str);
unsigned int _skipWhiteSpacesFromContent(unsigned int fromPosition);
const std::map<unsigned int, Object::ReferencePositionsInContent> & _getReferences(const std::string & objectContent);
unsigned int _skipNumber(const std::string & str, unsigned int currentPosition);
unsigned int _skipNumber(const std::string & str, unsigned int currentPosition);
unsigned int _skipWhiteSpaces(const std::string & str, unsigned int fromPosition);
void _createDocument(const char * docName);
virtual unsigned int _getStartOfXrefWithRoot();

@ -28,21 +28,21 @@
namespace merge_lib
{
//This class remove field from Page object's content.
class RemoveHimselfHandler: public PageElementHandler
{
public:
RemoveHimselfHandler(Object * page, const std::string & handlerName): PageElementHandler(page)
{
_setHandlerName(handlerName);
}
virtual ~RemoveHimselfHandler()
{
}
private:
//methods
virtual void _changeObjectContent(unsigned int startOfPageElement);
};
//This class remove field from Page object's content.
class RemoveHimselfHandler: public PageElementHandler
{
public:
RemoveHimselfHandler(Object * page, const std::string & handlerName): PageElementHandler(page)
{
_setHandlerName(handlerName);
}
virtual ~RemoveHimselfHandler()
{
}
private:
//methods
virtual void _changeObjectContent(unsigned int startOfPageElement);
};
}
#endif

@ -39,7 +39,7 @@ namespace merge_lib
PageElementHandler(page),
_basePage(basePage)
{
_setHandlerName(handlerName);
_setHandlerName(handlerName);
}
virtual ~RotationHandler()
{

@ -120,7 +120,7 @@ unsigned long Utils::getFileSize(const char * fileName)
pdfFile.open (fileName, std::ios::binary );
if (pdfFile.fail())
{
std::stringstream errorMessage("File ");
std::stringstream errorMessage("File ");
errorMessage << fileName << " is absent" << "\0";
throw Exception(errorMessage);
}

@ -58,7 +58,7 @@ class PDFRenderer : public QObject
QUuid fileUuid() const { return mFileUuid; }
QByteArray fileData() const { return mFileData; }
void setDPI(int desiredDPI) { this->dpiForRendering = desiredDPI; }
void setDPI(int desiredDPI) { this->dpiForRendering = desiredDPI; }
public slots:
virtual void render(QPainter *p, int pageNumber, const QRectF &bounds = QRectF()) = 0;
@ -74,9 +74,9 @@ class PDFRenderer : public QObject
static QMap< QUuid, QPointer<PDFRenderer> > sRenderers;
protected:
int dpiForRendering;
PDFRenderer();
protected:
int dpiForRendering;
PDFRenderer();
};
#endif // PDFRENDERER_H

@ -120,15 +120,15 @@ QSizeF XPDFRenderer::pageSizeF(int pageNumber) const
{
int rotate = mDocument->getPageRotate(pageNumber);
cropWidth = mDocument->getPageCropWidth(pageNumber) * this->dpiForRendering / 72.0;
cropWidth = mDocument->getPageCropWidth(pageNumber) * this->dpiForRendering / 72.0;
cropHeight = mDocument->getPageCropHeight(pageNumber) * this->dpiForRendering / 72.0;
if (rotate == 90 || rotate == 270)
{
//switching width and height
qreal tmpVar = cropWidth;
cropWidth = cropHeight;
cropHeight = tmpVar;
qreal tmpVar = cropWidth;
cropWidth = cropHeight;
cropHeight = tmpVar;
}
}
return QSizeF(cropWidth, cropHeight);
@ -156,7 +156,7 @@ void XPDFRenderer::render(QPainter *p, int pageNumber, const QRectF &bounds)
p->drawImage(QPointF(savedTransform.dx() + mSliceX, savedTransform.dy() + mSliceY), *pdfImage);
p->setWorldTransform(savedTransform);
delete pdfImage;
}
}
}
QImage* XPDFRenderer::createPDFImage(int pageNumber, qreal xscale, qreal yscale, const QRectF &bounds)
@ -177,18 +177,18 @@ QImage* XPDFRenderer::createPDFImage(int pageNumber, qreal xscale, qreal yscale,
if (bounds.isNull())
{
mDocument->displayPage(mSplash, pageNumber, this->dpiForRendering * xscale, this->dpiForRendering *yscale,
mDocument->displayPage(mSplash, pageNumber, this->dpiForRendering * xscale, this->dpiForRendering *yscale,
rotation, useMediaBox, crop, printing);
}
else
{
mSliceX = bounds.x() * xscale;
mSliceX = bounds.x() * xscale;
mSliceY = bounds.y() * yscale;
qreal sliceW = bounds.width() * xscale;
qreal sliceH = bounds.height() * yscale;
mDocument->displayPageSlice(mSplash, pageNumber, this->dpiForRendering * xscale, this->dpiForRendering * yscale,
rotation, useMediaBox, crop, printing, mSliceX, mSliceY, sliceW, sliceH);
rotation, useMediaBox, crop, printing, mSliceX, mSliceY, sliceW, sliceH);
}
mpSplashBitmap = mSplash->getBitmap();

@ -706,15 +706,15 @@ void UBPodcastController::encodingFinished(bool ok)
{
if (!mApplicationIsClosing)
{
QString location;
QString location;
if (mPodcastRecordingPath == QDesktopServices::storageLocation(QDesktopServices::DesktopLocation))
location = tr("on your desktop ...");
else
{
QDir dir(mPodcastRecordingPath);
location = tr("in folder %1").arg(mPodcastRecordingPath);
}
if (mPodcastRecordingPath == QDesktopServices::storageLocation(QDesktopServices::DesktopLocation))
location = tr("on your desktop ...");
else
{
QDir dir(mPodcastRecordingPath);
location = tr("in folder %1").arg(mPodcastRecordingPath);
}
UBApplication::showMessage(tr("Podcast created %1").arg(location), false);
@ -829,7 +829,7 @@ void UBPodcastController::toggleRecordingPalette(bool visible)
- mRecordingPalette->width() / 2;
int top = UBApplication::boardController->controlView()->height()
- mRecordingPalette->height() - UBSettings::boardMargin;
- mRecordingPalette->height() - UBSettings::boardMargin;
QPoint controlViewPoint(left, top);
QPoint mainWindowsPoint = UBApplication::boardController->controlView()->mapTo(UBApplication::mainWindow, controlViewPoint);

@ -49,19 +49,19 @@ const int UBAbstractDrawRuler::sRoundingRadius = sLeftEdgeMargin / 2;
UBAbstractDrawRuler::UBAbstractDrawRuler()
: mShowButtons(false)
: mShowButtons(false)
, mAntiScaleRatio(1.0)
{
//we actually need to evaluate pixels per millimeter
QDesktopWidget* desktop = UBApplication::desktop();
int dpiCommon = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
//we actually need to evaluate pixels per millimeter
QDesktopWidget* desktop = UBApplication::desktop();
int dpiCommon = (desktop->physicalDpiX() + desktop->physicalDpiY()) / 2;
sPixelsPerMillimeter = qRound(dpiCommon / UBGeometryUtils::inchSize);
}
void UBAbstractDrawRuler::create(QGraphicsItem& item)
{
item.setFlag(QGraphicsItem::ItemIsMovable, true);
item.setFlag(QGraphicsItem::ItemIsMovable, true);
item.setFlag(QGraphicsItem::ItemIsSelectable, true);
item.setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
@ -94,7 +94,7 @@ QCursor UBAbstractDrawRuler::closeCursor() const
QCursor UBAbstractDrawRuler::drawRulerLineCursor() const
{
return UBResources::resources()->drawLineRulerCursor;
return UBResources::resources()->drawLineRulerCursor;
}
QColor UBAbstractDrawRuler::drawColor() const

@ -40,7 +40,7 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse
public:
UBGraphicsProtractor ();
enum Tool {None, Move, Resize, Rotate, Reset, Close, MoveMarker};
enum Tool {None, Move, Resize, Rotate, Reset, Close, MoveMarker};
qreal angle () { return mStartAngle; }
qreal markerAngle () { return mCurrentAngle; }
@ -83,17 +83,17 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse
QSizeF buttonSizeReference () const{return QSizeF(radius() / 10, mCloseSvgItem->boundingRect().height() * radius()/(10 * mCloseSvgItem->boundingRect().width()));}
QSizeF markerSizeReference () const{return QSizeF(radius() / 10, mMarkerSvgItem->boundingRect().height() * radius()/(10 * mMarkerSvgItem->boundingRect().width()));}
QRectF resetButtonRect () const;
QRectF closeButtonRect () const;
QRectF resizeButtonRect () const;
QRectF rotateButtonRect () const{return QRectF(buttonSizeReference().width() * 5.5, -buttonSizeReference().width() * 5, buttonSizeReference().width(), buttonSizeReference().width());}
QRectF markerButtonRect () const{return QRectF(radius() + 3, -markerSizeReference().height() / 2 , markerSizeReference().width(), markerSizeReference().height());}
QRectF resetButtonRect () const;
QRectF closeButtonRect () const;
QRectF resizeButtonRect () const;
QRectF rotateButtonRect () const{return QRectF(buttonSizeReference().width() * 5.5, -buttonSizeReference().width() * 5, buttonSizeReference().width(), buttonSizeReference().width());}
QRectF markerButtonRect () const{return QRectF(radius() + 3, -markerSizeReference().height() / 2 , markerSizeReference().width(), markerSizeReference().height());}
inline qreal radius () const{return rect().height() / 2 - 20;}
// Members
QPointF mPreviousMousePos;
Tool mCurrentTool;
bool mShowButtons;
bool mShowButtons;
qreal mCurrentAngle;
qreal mSpan;
qreal mStartAngle;
@ -102,12 +102,12 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse
QGraphicsSvgItem* mResetSvgItem;
QGraphicsSvgItem* mResizeSvgItem;
QGraphicsSvgItem* mMarkerSvgItem;
QGraphicsSvgItem* mRotateSvgItem;
QGraphicsSvgItem* mRotateSvgItem;
static const QRectF sDefaultRect;
virtual void rotateAroundCenter(qreal angle);
virtual QPointF rotationCenter() const;
virtual QPointF rotationCenter() const;
int sFillTransparency;
int sDrawTransparency;

@ -51,27 +51,27 @@ class UBGraphicsRuler : public UBAbstractDrawRuler, public QGraphicsRectItem, pu
virtual UBItem* deepCopy() const;
virtual void copyItemParameters(UBItem *copy) const;
virtual void StartLine(const QPointF& position, qreal width);
virtual void DrawLine(const QPointF& position, qreal width);
virtual void StartLine(const QPointF& position, qreal width);
virtual void DrawLine(const QPointF& position, qreal width);
virtual void EndLine();
protected:
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *styleOption, QWidget *widget);
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
// Events
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
void paintGraduations(QPainter *painter);
private:
bool mResizing;
bool mResizing;
bool mRotating;
@ -80,11 +80,11 @@ class UBGraphicsRuler : public UBAbstractDrawRuler, public QGraphicsRectItem, pu
void paintRotationCenter(QPainter *painter);
virtual void rotateAroundCenter(qreal angle);
QGraphicsSvgItem* mRotateSvgItem;
QGraphicsSvgItem* mResizeSvgItem;
QGraphicsSvgItem* mRotateSvgItem;
QGraphicsSvgItem* mResizeSvgItem;
void updateResizeCursor();
QCursor resizeCursor() const{return mResizeCursor;}
void updateResizeCursor();
QCursor resizeCursor() const{return mResizeCursor;}
virtual QPointF rotationCenter() const;
virtual QRectF resizeButtonRect() const;
@ -92,15 +92,15 @@ class UBGraphicsRuler : public UBAbstractDrawRuler, public QGraphicsRectItem, pu
virtual QRectF rotateButtonRect() const;
virtual UBGraphicsScene* scene() const;
QCursor mResizeCursor;
QCursor mResizeCursor;
int drawLineDirection;
int drawLineDirection;
// Constants
static const QRect sDefaultRect;
static const int sMinLength = 150; // 3sm
static const int sMaxLength = 35000; // 700sm
static const int sMinLength = 150; // 3sm
static const int sMaxLength = 35000; // 700sm
};
#endif /* UBGRAPHICSRULER_H_ */

@ -232,7 +232,7 @@ void UBWebController::tutorialWebInstance()
}
else
(*mCurrentWebBrowser)->loadUrl(currentUrl);
(*mCurrentWebBrowser)->loadUrl(currentUrl);
mStackedWidget->setCurrentIndex(Tutorial);
UBApplication::applicationController->setMirrorSourceWidget((*mCurrentWebBrowser)->paintWidget());

@ -123,8 +123,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];
@ -144,7 +144,7 @@ class UBWebController : public QObject
void toggleWebTrap(bool checked);
void onOEmbedParsed(QVector<sOEmbedContent> contents);
// void showKeyboard(bool checked);
// void showKeyboard(bool checked);
signals:
/**

@ -588,7 +588,7 @@ void WBBrowserWindow::aboutToShowBackMenu()
if (!QWebSettings::iconForUrl(item.originalUrl()).isNull())
action->setIcon(item.icon());
action->setText(item.title().isEmpty() ? item.url().toString() : item.title());
action->setText(item.title().isEmpty() ? item.url().toString() : item.title());
mHistoryBackMenu->addAction(action);
}

@ -174,8 +174,8 @@ class WBBrowserWindow : public QWidget
Ui::MainWindow* mUniboardMainWindow;
QMenu *mHistoryBackMenu;
QMenu *mHistoryForwardMenu;
QMenu *mHistoryBackMenu;
QMenu *mHistoryForwardMenu;
};
#endif // WBBROWSERMAINWINDOW_H

@ -79,7 +79,7 @@ WBExLineEdit::WBExLineEdit(QWidget *parent)
, mLineEdit(new QLineEdit(this))
, mClearButton(0)
{
setFocusPolicy(mLineEdit->focusPolicy());
setFocusPolicy(mLineEdit->focusPolicy());
setAttribute(Qt::WA_InputMethodEnabled);
setSizePolicy(mLineEdit->sizePolicy());
setBackgroundRole(mLineEdit->backgroundRole());

Loading…
Cancel
Save