Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
874e42a2
Commit
874e42a2
authored
May 27, 2011
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reviewed the code a little bit
parent
dbd2aeca
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
76 additions
and
3402 deletions
+76
-3402
Sankore_3.1.pro
Sankore_3.1.pro
+0
-1
library.ui
resources/forms/library.ui
+0
-922
UBBoardController.cpp
src/board/UBBoardController.cpp
+1
-21
UBBoardController.h
src/board/UBBoardController.h
+0
-1
UBLibraryController.cpp
src/board/UBLibraryController.cpp
+61
-1832
UBLibraryController.h
src/board/UBLibraryController.h
+0
-246
UBLibraryTreeWidget.cpp
src/board/UBLibraryTreeWidget.cpp
+0
-247
UBLibraryTreeWidget.h
src/board/UBLibraryTreeWidget.h
+0
-62
board.pri
src/board/board.pri
+0
-2
UBApplication.cpp
src/core/UBApplication.cpp
+5
-56
UBLibPathViewer.cpp
src/gui/UBLibPathViewer.cpp
+9
-12
No files found.
Sankore_3.1.pro
View file @
874e42a2
...
...
@@ -65,7 +65,6 @@ FORMS += resources/forms/mainWindow.ui \
resources
/
forms
/
preferences
.
ui
\
resources
/
forms
/
brushProperties
.
ui
\
resources
/
forms
/
documents
.
ui
\
resources
/
forms
/
library
.
ui
\
resources
/
forms
/
blackoutWidget
.
ui
\
resources
/
forms
/
trapFlash
.
ui
\
resources
/
forms
/
youTubePublishingDialog
.
ui
\
...
...
resources/forms/library.ui
deleted
100644 → 0
View file @
dbd2aeca
This diff is collapsed.
Click to expand it.
src/board/UBBoardController.cpp
View file @
874e42a2
...
...
@@ -332,7 +332,6 @@ void UBBoardController::connectToolbar()
connect
(
mMainWindow
->
actionRedo
,
SIGNAL
(
triggered
()),
UBApplication
::
undoStack
,
SLOT
(
redo
()));
connect
(
mMainWindow
->
actionBack
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
previousScene
()));
connect
(
mMainWindow
->
actionForward
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
nextScene
()));
connect
(
mMainWindow
->
actionLibrary
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
showLibraryDialog
(
bool
)));
connect
(
mMainWindow
->
actionSleep
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
blackout
()));
connect
(
mMainWindow
->
actionVirtualKeyboard
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
showKeyboard
(
bool
)));
connect
(
mMainWindow
->
actionImportPage
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
importPage
()));
...
...
@@ -526,19 +525,6 @@ void UBBoardController::showDocumentsDialog()
}
void
UBBoardController
::
showLibraryDialog
(
bool
show
)
{
if
(
!
mLibraryController
)
{
mLibraryController
=
new
UBLibraryController
(
mMainWindow
->
centralWidget
(),
this
);
connect
(
mLibraryController
,
SIGNAL
(
dialogClosed
(
int
)),
this
,
SLOT
(
libraryDialogClosed
(
int
)));
}
mLibraryController
->
showLibraryDialog
(
show
);
}
void
UBBoardController
::
libraryDialogClosed
(
int
ret
)
{
Q_UNUSED
(
ret
);
...
...
@@ -920,7 +906,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
bool
acceptFlash
=
true
;
#ifdef Q_WS_X11
acceptFlash
=
false
;
acceptFlash
=
false
;
#endif
if
(
acceptFlash
)
{
...
...
@@ -1371,10 +1357,6 @@ UBToolWidget* UBBoardController::addTool(const QUrl& toolUrl)
UBToolWidget
*
UBBoardController
::
addTool
(
const
QUrl
&
toolUrl
,
QPointF
scenePos
)
{
UBToolWidget
*
toolWidget
=
new
UBToolWidget
(
toolUrl
,
mMainWindow
);
// Deleted in UBBoardController::removeTool
if
(
mLibraryController
&&
mLibraryController
->
libraryWindow
())
toolWidget
->
stackUnder
(
mLibraryController
->
libraryWindow
());
QPoint
pos
=
mControlView
->
mapToGlobal
(
mControlView
->
mapFromScene
(
scenePos
));
pos
-=
QPoint
(
toolWidget
->
width
()
/
2
,
toolWidget
->
height
()
/
2
);
...
...
@@ -1551,8 +1533,6 @@ void UBBoardController::updateBackgroundState()
newBackgroundStyle
=
"QWidget {background-color: #F1F1F1}"
;
}
// if (mControlContainer->styleSheet() != newBackgroundStyle)
// mControlContainer->setStyleSheet(newBackgroundStyle);
}
...
...
src/board/UBBoardController.h
View file @
874e42a2
...
...
@@ -149,7 +149,6 @@ class UBBoardController : public QObject
void
setActiveDocumentScene
(
UBDocumentProxy
*
pDocumentProxy
,
int
pSceneIndex
=
0
);
void
showDocumentsDialog
();
void
showLibraryDialog
(
bool
show
);
void
showKeyboard
(
bool
show
);
...
...
src/board/UBLibraryController.cpp
View file @
874e42a2
This diff is collapsed.
Click to expand it.
src/board/UBLibraryController.h
View file @
874e42a2
...
...
@@ -6,8 +6,6 @@
#include "web/UBWebPage.h"
#include "ui_library.h"
class
UBGraphicsScene
;
class
UBBoardController
;
class
QGraphicsSvgItem
;
...
...
@@ -82,14 +80,6 @@ class UBLibraryController : public QObject
UBLibraryController
(
QWidget
*
parentWidget
,
UBBoardController
*
boardController
);
virtual
~
UBLibraryController
();
QWidget
*
libraryWindow
()
{
return
mLibraryWindow
;
}
static
QStringList
onlineLibraries
();
static
void
preloadFirstOnlineLibrary
();
QList
<
UBLibElement
*>
getContent
(
UBLibElement
*
pElement
);
void
moveContent
(
QList
<
UBLibElement
*>
sourceList
,
UBLibElement
*
pDestination
);
void
trashElements
(
QList
<
UBLibElement
*>
trashList
);
...
...
@@ -117,42 +107,10 @@ class UBLibraryController : public QObject
public
slots
:
void
removeBackground
();
void
showLibraryDialog
(
bool
show
);
void
refreshShapeThumbnailsView
();
void
refreshImageThumbnailsView
();
void
refreshInteractiveThumbnailsView
();
void
refreshVideoThumbnailsView
();
void
refreshSoundThumbnailsView
();
void
addShape
();
void
setShapeAsBackground
();
void
addToPage
();
void
setAsBackground
();
void
addImage
();
void
addVideo
();
void
addAudio
();
void
addInteractiveToCurrentPage
();
void
addImagesToCurrentPage
(
const
QList
<
QUrl
>&
images
);
void
addVideosToCurrentPage
(
const
QList
<
QUrl
>&
videos
);
void
addAudiosToCurrentPage
(
const
QList
<
QUrl
>&
sounds
);
void
addInteractivesToCurrentPage
(
const
QList
<
QUrl
>&
interactiveWidgets
);
void
setImageAsBackground
();
void
closeWindow
();
void
addObjectFromFilesystemToPage
();
void
needRefreshOnNextDisplay
()
{
mNeedRefreshOnNextDisplay
=
true
;
}
protected
:
...
...
@@ -186,215 +144,11 @@ class UBLibraryController : public QObject
UBLibElement
*
isOnFavoriteList
(
UBLibElement
*
element
);
void
loadLibraries
();
QWidget
*
mParentWidget
;
UBBoardController
*
mBoardController
;
QDialog
*
mLibraryWindow
;
Ui
::
library
*
mLibraryUI
;
// TODO UB 4.x break this logic, by carrying the path within the thumb item (see Video items path)
//
QMap
<
QGraphicsSvgItem
*
,
QString
>
mSvgItemToFilepath
;
//shape mapping
QMap
<
QGraphicsSvgItem
*
,
QString
>
mSvgImageItemToFilepath
;
// svg image mapping
QMap
<
QGraphicsPixmapItem
*
,
QString
>
mPixmapItemToFilepath
;
// other image mapping
QMap
<
QGraphicsPixmapItem
*
,
QString
>
mInteractiveItemToFilepath
;
// interactive widget mapping
QMap
<
QGraphicsPixmapItem
*
,
QString
>
mSoundItemToFilepath
;
// sounds mapping
UBLibraryWebView
*
mImageWebView
;
UBLibraryWebView
*
mVideoWebView
;
UBLibraryWebView
*
mInteractiveWebView
;
QTreeWidgetItem
*
mImageOnlineTi
;
QTreeWidgetItem
*
mVideoOnlineTi
;
QTreeWidgetItem
*
mInteractiveOnlineTi
;
QTreeWidgetItem
*
mInteractiveUniboardTi
;
struct
TabIndex
{
enum
Enum
{
Gip
=
0
,
Interactive
=
1
,
Image
=
2
,
Video
=
3
,
Shape
=
4
,
Sound
=
5
};
};
int
mLastItemOffsetIndex
;
QStringList
mLibraryFileToDownload
;
bool
mNeedRefreshOnNextDisplay
;
private
slots
:
void
tabChanged
(
int
value
);
void
zoomSliderValueChanged
(
int
value
);
void
createNewFolder
();
void
addInteractivesToLibrary
();
void
addImagesToLibrary
();
void
removeItemsFromLibrary
(
UBThumbnailWidget
*
pThumbnailView
);
void
removeDir
();
void
remove
();
void
itemSelectionChanged
();
void
itemChanged
(
QTreeWidgetItem
*
item
,
int
column
);
void
selectionChanged
();
void
thumbnailViewResized
();
void
getLibraryListResponse
(
bool
,
const
QByteArray
&
);
};
class
UBLibraryFolderItem
:
public
QTreeWidgetItem
{
public
:
UBLibraryFolderItem
(
const
QDir
&
pDir
,
const
QString
&
name
,
QTreeWidgetItem
*
parent
,
bool
pCanWrite
,
const
QStringList
&
pExtensionsToHide
);
virtual
~
UBLibraryFolderItem
(){}
void
refreshSubDirs
();
QDir
dir
()
{
return
mDir
;
}
void
setDir
(
const
QDir
&
dir
)
{
mDir
=
dir
;
}
bool
canWrite
()
{
return
mCanWrite
;
}
void
setCanWrite
(
bool
canWrite
)
{
mCanWrite
=
canWrite
;
}
private
:
const
QStringList
mExtensionsToHide
;
QDir
mDir
;
bool
mCanWrite
;
};
class
UBOnlineLibraryItem
:
public
QTreeWidgetItem
{
public
:
UBOnlineLibraryItem
(
const
QUrl
&
pUrl
,
const
QString
&
name
,
QTreeWidgetItem
*
parent
)
:
QTreeWidgetItem
(
parent
)
,
mUrl
(
pUrl
)
{
setText
(
0
,
UBLibraryController
::
trUtf8
(
name
.
toUtf8
()));
setIcon
(
0
,
QWebSettings
::
iconForUrl
(
pUrl
));
}
virtual
~
UBOnlineLibraryItem
(){}
QUrl
url
()
const
{
return
mUrl
;
}
private
:
QUrl
mUrl
;
};
class
UBLibraryWebView
:
public
QWebView
{
Q_OBJECT
;
public
:
UBLibraryWebView
(
QWidget
*
parent
=
0
);
virtual
~
UBLibraryWebView
(){};
virtual
void
mousePressEvent
(
QMouseEvent
*
event
)
{
QWebView
::
mousePressEvent
(
event
);
}
virtual
void
mouseMoveEvent
(
QMouseEvent
*
event
)
{
QWebView
::
mouseMoveEvent
(
event
);
}
virtual
void
mouseReleaseEvent
(
QMouseEvent
*
event
)
{
QWebView
::
mouseReleaseEvent
(
event
);
}
void
load
(
const
QUrl
&
url
)
{
mCurrentLibraryItem
=
0
;
QWebView
::
load
(
url
);
}
void
load
(
const
QUrl
&
url
,
UBOnlineLibraryItem
*
pLibraryItem
)
{
mCurrentLibraryItem
=
pLibraryItem
;
QWebView
::
load
(
url
);
}
protected
:
virtual
QWebView
*
createWindow
(
QWebPage
::
WebWindowType
type
);
private
slots
:
void
javaScriptWindowObjectCleared
();
void
newIconAvailable
();
void
loadFinished
(
bool
ok
);
private
:
UBOnlineLibraryItem
*
mCurrentLibraryItem
;
};
class
UBLibraryPreloader
:
public
QObject
{
Q_OBJECT
;
public
:
UBLibraryPreloader
(
QObject
*
pParent
);
virtual
~
UBLibraryPreloader
(){};
private
slots
:
void
loadLibrary
();
void
getLibraryListResponse
(
bool
ok
,
const
QByteArray
&
replyContent
);
void
loadFinished
(
bool
ok
);
private
:
QWebView
*
mWebView
;
};
#endif
/* UBLIBRARYCONTROLLER_H_ */
src/board/UBLibraryTreeWidget.cpp
deleted
100644 → 0
View file @
dbd2aeca
/*
* UBLibraryTreeWidget.cpp
*
* Created on: 28 juil. 2009
* Author: Luc
*/
#include "UBLibraryTreeWidget.h"
#include "frameworks/UBFileSystemUtils.h"
#include "core/UBApplication.h"
#include "core/UBSettings.h"
#include "board/UBBoardController.h"
#include "network/UBHttpGet.h"
#include "domain/UBW3CWidget.h"
#include "UBLibraryController.h"
UBLibraryTreeWidget
::
UBLibraryTreeWidget
(
QWidget
*
parent
)
:
QTreeWidget
(
parent
)
,
mDropFolderItem
(
0
)
{
setDragDropMode
(
QAbstractItemView
::
DropOnly
);
setAcceptDrops
(
true
);
viewport
()
->
setAcceptDrops
(
true
);
setDropIndicatorShown
(
true
);
}
UBLibraryTreeWidget
::~
UBLibraryTreeWidget
()
{
// NOOP
}
bool
UBLibraryTreeWidget
::
supportMimeData
(
const
QMimeData
*
pMimeData
)
{
foreach
(
QString
mimeType
,
mMimeTypes
)
{
foreach
(
QString
format
,
pMimeData
->
formats
())
{
if
(
format
.
startsWith
(
mimeType
))
{
return
true
;
}
}
}
foreach
(
QUrl
url
,
pMimeData
->
urls
())
{
foreach
(
QString
ext
,
mFileExtensions
)
{
if
(
url
.
toString
().
endsWith
(
ext
))
{
return
true
;
}
}
}
foreach
(
QUrl
url
,
pMimeData
->
urls
())
{
foreach
(
QString
protocole
,
mProtocoles
)
{
if
(
url
.
toString
().
startsWith
(
protocole
))
{
return
true
;
}
}
}
return
false
;
}
void
UBLibraryTreeWidget
::
dragEnterEvent
(
QDragEnterEvent
*
event
)
{
mDropFolderItem
=
0
;
if
(
supportMimeData
(
event
->
mimeData
()))
{
event
->
acceptProposedAction
();
return
;
}
else
{
QTreeWidget
::
dragEnterEvent
(
event
);
}
}
void
UBLibraryTreeWidget
::
dragMoveEvent
(
QDragMoveEvent
*
event
)
{
QTreeWidgetItem
*
ti
=
itemAt
(
event
->
pos
());
UBLibraryFolderItem
*
lfi
=
dynamic_cast
<
UBLibraryFolderItem
*>
(
ti
);
if
(
lfi
&&
lfi
->
canWrite
()
&&
!
(
lfi
==
currentItem
()))
{
event
->
acceptProposedAction
();
return
;
}
QTreeWidget
::
dragMoveEvent
(
event
);
}
void
UBLibraryTreeWidget
::
dropEvent
(
QDropEvent
*
event
)
{
QTreeWidgetItem
*
ti
=
itemAt
(
event
->
pos
());
UBLibraryFolderItem
*
lfi
=
dynamic_cast
<
UBLibraryFolderItem
*>
(
ti
);
if
(
lfi
)
{
UBLibraryFolderItem
*
sourceLfi
=
dynamic_cast
<
UBLibraryFolderItem
*>
(
currentItem
());
mDropFolderItem
=
lfi
;
QDir
dir
=
lfi
->
dir
();
foreach
(
QUrl
url
,
event
->
mimeData
()
->
urls
())
{
// is it local ?
QString
localFile
=
url
.
toLocalFile
();
if
(
localFile
.
length
()
>
0
)
{
QFileInfo
fileInfo
(
localFile
);
//is it a file ?
if
(
fileInfo
.
isFile
())
{
// copy file to dir
QFile
file
(
localFile
);
if
(
sourceLfi
&&
sourceLfi
->
canWrite
())
{
file
.
rename
(
dir
.
filePath
(
fileInfo
.
fileName
()));
emit
contentChanged
();
}
else
{
file
.
copy
(
dir
.
filePath
(
fileInfo
.
fileName
()));
}
}
else
if
(
fileInfo
.
isDir
())
{
if
(
sourceLfi
&&
sourceLfi
->
canWrite
())
{
UBFileSystemUtils
::
moveDir
(
localFile
,
dir
.
filePath
(
fileInfo
.
fileName
()));
emit
contentChanged
();
}
else
{
UBFileSystemUtils
::
copyDir
(
localFile
,
dir
.
filePath
(
fileInfo
.
fileName
()));
}
}
}
else
if
(
url
.
toString
().
startsWith
(
"uniboardTool://"
))
{
UBApplication
::
boardController
->
libraryController
()
->
addNativeToolToFavorites
(
url
);
}
else
{
UBHttpGet
*
httpGet
=
new
UBHttpGet
(
this
);
// TODO UB 4.6 we are leaking here, tree widget is never destroyed
connect
(
httpGet
,
SIGNAL
(
downloadFinished
(
bool
,
QUrl
,
QString
,
QByteArray
,
QPointF
,
QSize
,
bool
)),
this
,
SLOT
(
downloadFinished
(
bool
,
QUrl
,
QString
,
QByteArray
)));
UBApplication
::
setOverrideCursor
(
Qt
::
WaitCursor
);
UBApplication
::
showMessage
(
tr
(
"Downloading content from %1"
).
arg
(
url
.
toString
()),
true
);
httpGet
->
get
(
url
);
}
}
event
->
acceptProposedAction
();
return
;
}
else
{
QTreeWidget
::
dropEvent
(
event
);
}
}
void
UBLibraryTreeWidget
::
downloadFinished
(
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pContentTypeHeader
,
QByteArray
pData
)
{
if
(
!
pSuccess
)
{
UBApplication
::
showMessage
(
tr
(
"Downloading content %1 failed"
).
arg
(
sourceUrl
.
toString
()));
}
else
{
UBApplication
::
showMessage
(
tr
(
"Download finished"
));
QStringList
urlPathParts
=
sourceUrl
.
path
().
split
(
"/"
);
if
(
urlPathParts
.
length
()
>
0
&&
mDropFolderItem
)
{
QString
fileName
=
urlPathParts
.
last
();
QString
ext
=
UBFileSystemUtils
::
fileExtensionFromMimeType
(
pContentTypeHeader
);
if
(
!
fileName
.
endsWith
(
ext
))
{
fileName
+=
"."
+
ext
;
}
QString
filePath
=
mDropFolderItem
->
dir
().
filePath
(
fileName
);
QString
nextItemPath
=
UBFileSystemUtils
::
nextAvailableFileName
(
filePath
);
if
(
UBSettings
::
widgetFileExtensions
.
contains
(
ext
))
{
QTemporaryFile
tempFile
;
if
(
tempFile
.
open
())
{
tempFile
.
write
(
pData
);
tempFile
.
close
();
QDir
widgetDir
(
nextItemPath
);
UBFileSystemUtils
::
expandZipToDir
(
tempFile
,
widgetDir
);
}
}
else
if
(
UBW3CWidget
::
hasNPAPIWrapper
(
pContentTypeHeader
))
{
QString
widgetPath
=
UBW3CWidget
::
createNPAPIWrapperInDir
(
sourceUrl
.
toString
()
,
mDropFolderItem
->
dir
(),
pContentTypeHeader
);
}
else
{
QFile
itemFile
(
nextItemPath
);
if
(
itemFile
.
open
(
QIODevice
::
WriteOnly
))
{
itemFile
.
write
(
pData
);
itemFile
.
close
();
}
}
}
}
UBApplication
::
restoreOverrideCursor
();
}
src/board/UBLibraryTreeWidget.h
deleted
100644 → 0
View file @
dbd2aeca
/*
* UBLibraryTreeWidget.h
*
* Created on: 28 juil. 2009
* Author: Luc
*/
#ifndef UBLIBRARYTREEWIDGET_H_
#define UBLIBRARYTREEWIDGET_H_
#include <QtGui>
class
UBLibraryFolderItem
;
class
UBLibraryTreeWidget
:
public
QTreeWidget
{
Q_OBJECT
;
public
:
UBLibraryTreeWidget
(
QWidget
*
parent
=
0
);
virtual
~
UBLibraryTreeWidget
();
void
setMimeTypes
(
const
QStringList
&
pMimeTypes
)
{
mMimeTypes
=
pMimeTypes
;
}
void
setFileExtensions
(
const
QStringList
&
pFileExtensions
)
{
mFileExtensions
=
pFileExtensions
;
}
void
setProtocoles
(
const
QStringList
&
pProtocoles
)
{
mProtocoles
=
pProtocoles
;
}
bool
supportMimeData
(
const
QMimeData
*
pMimeData
);
signals
:
void
contentChanged
();
protected
:
virtual
void
dragEnterEvent
(
QDragEnterEvent
*
event
);
virtual
void
dragMoveEvent
(
QDragMoveEvent
*
event
);
virtual
void
dropEvent
(
QDropEvent
*
event
);
private
slots
:
void
downloadFinished
(
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pContentTypeHeader
,
QByteArray
pData
);
private
:
UBLibraryFolderItem
*
mDropFolderItem
;
QStringList
mMimeTypes
;
QStringList
mFileExtensions
;
QStringList
mProtocoles
;
};
#endif
/* UBLIBRARYTREEWIDGET_H_ */
src/board/board.pri
View file @
874e42a2
...
...
@@ -3,14 +3,12 @@ HEADERS += src/board/UBBoardController.h \
src/board/UBBoardPaletteManager.h \
src/board/UBBoardView.h \
src/board/UBLibraryController.h \
src/board/UBLibraryTreeWidget.h \
src/board/UBDrawingController.h
SOURCES += src/board/UBBoardController.cpp \
src/board/UBBoardPaletteManager.cpp \
src/board/UBBoardView.cpp \
src/board/UBLibraryController.cpp \
src/board/UBLibraryTreeWidget.cpp \
src/board/UBDrawingController.cpp
...
...
src/core/UBApplication.cpp
View file @
874e42a2
...
...
@@ -140,8 +140,6 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv)
}
else
{
// Make sure we don't mix English language with unsupported language dates
//QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
localString
=
"en_US"
;
}
...
...
@@ -182,6 +180,10 @@ UBApplication::~UBApplication()
// delete staticMemoryCleaner;
staticMemoryCleaner
=
0
;
delete
mUniboardSankoreTransition
;
mUniboardSankoreTransition
=
0
;
}
int
UBApplication
::
exec
(
const
QString
&
pFileToImport
)
...
...
@@ -231,7 +233,7 @@ int UBApplication::exec(const QString& pFileToImport)
#else
connect
(
mainWindow
->
actionHideApplication
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
showMinimized
()));
#endif
mPreferencesController
=
new
UBPreferencesController
(
mainWindow
);
connect
(
mainWindow
->
actionPreferences
,
SIGNAL
(
triggered
()),
mPreferencesController
,
SLOT
(
show
()));
...
...
@@ -256,9 +258,6 @@ int UBApplication::exec(const QString& pFileToImport)
// installEventFilter(new UBIdleTimer(this));
//#endif
// TODO UB 4.x make it better and reenable it ... or dump
//installEventFilter(new UBMousePressFilter);
applicationController
->
initScreenLayout
();
boardController
->
setupLayout
();
...
...
@@ -299,8 +298,6 @@ int UBApplication::exec(const QString& pFileToImport)
}
}
UBLibraryController
::
preloadFirstOnlineLibrary
();
mUniboardSankoreTransition
=
new
UniboardSankoreTransition
();
mUniboardSankoreTransition
->
documentTransition
();
...
...
@@ -526,30 +523,6 @@ bool UBApplication::handleOpenMessage(const QString& pMessage)
return
true
;
}
#if defined(Q_WS_MACX) && !defined(QT_MAC_USE_COCOA)
bool
UBApplication
::
macEventFilter
(
EventHandlerCallRef
caller
,
EventRef
event
)
{
Q_UNUSED
(
caller
);
if
((
GetEventClass
(
event
)
==
kEventClassCommand
)
&&
(
GetEventKind
(
event
)
==
kEventProcessCommand
))
{
HICommand
cmd
;
GetEventParameter
(
event
,
kEventParamDirectObject
,
typeHICommand
,
0
,
sizeof
(
cmd
),
0
,
&
cmd
);
if
(
cmd
.
commandID
==
kHICommandHide
)
{
// Override the command + H (Hide Uniboard) behavior
applicationController
->
showDesktop
();
return
true
;
}
}
return
false
;
}
#endif
void
UBStyle
::
drawItemText
(
QPainter
*
painter
,
const
QRect
&
rect
,
int
alignment
,
const
QPalette
&
pal
,
bool
enabled
,
const
QString
&
text
,
QPalette
::
ColorRole
textRole
)
const
{
...
...
@@ -577,30 +550,6 @@ void UBStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment,
painter
->
setPen
(
pen
);
}
/*
*
#if defined(Q_WS_MACX)
if (pal.brush(textRole).color() == Qt::black)
{
painter->save();
painter->translate(0, 0.1);
QBrush brush = pal.brush(QPalette::Light);
QColor color = brush.color();
color.setAlpha(color.alpha() * 0.6);
brush.setColor(color);
painter->setPen(QPen(brush, savedPen.widthF() * 0.8));
painter->drawText(rect, alignment, text);
painter->restore();
}
#endif
*/
painter
->
drawText
(
rect
,
alignment
,
text
);
if
(
textRole
!=
QPalette
::
NoRole
)
...
...
src/gui/UBLibPathViewer.cpp
View file @
874e42a2
...
...
@@ -172,20 +172,17 @@ void UBLibPathViewer::addItem(UBChainedLibElement *elem)
*/
void
UBLibPathViewer
::
resizeEvent
(
QResizeEvent
*
event
)
{
qDebug
()
<<
"old"
<<
event
->
oldSize
();
qDebug
()
<<
"new"
<<
event
->
size
();
if
(
event
->
oldSize
()
==
event
->
size
())
event
->
ignore
();
else
{
if
(
NULL
!=
mpContainer
){
mpContainer
->
setMinimumWidth
(
width
()
-
20
);
}
viewport
()
->
resize
(
width
()
-
10
,
viewport
()
->
height
());
if
(
NULL
!=
mpContainer
)
mpContainer
->
setMinimumWidth
(
width
()
-
20
);
viewport
()
->
resize
(
width
()
-
10
,
viewport
()
->
height
());
updateScrolls
();
event
->
accept
();
updateScrolls
();
event
->
accept
();
}
}
...
...
@@ -422,8 +419,8 @@ void UBPathScene::dropEvent(QGraphicsSceneDragDropEvent *event)
// The drag comes from this application, we have now to get the list of UBLibElements*
QList
<
QString
>
qlDroppedElems
;
foreach
(
QUrl
url
,
pMimeData
->
urls
())
qlDroppedElems
<<
url
.
toString
();
foreach
(
QUrl
url
,
pMimeData
->
urls
())
qlDroppedElems
<<
url
.
toString
();
if
(
!
qlDroppedElems
.
empty
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment