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
775c9b9e
Commit
775c9b9e
authored
12 years ago
by
shibakaneki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
51afc034
88ad16b4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
124 additions
and
13 deletions
+124
-13
Sankore 3.1.iss
Sankore 3.1.iss
+5
-1
release.win7.vc9.64.bat
release.win7.vc9.64.bat
+1
-1
release.win7.vc9.bat
release.win7.vc9.bat
+1
-1
UBFeaturesActionBar.cpp
src/gui/UBFeaturesActionBar.cpp
+17
-2
UBFeaturesActionBar.h
src/gui/UBFeaturesActionBar.h
+4
-0
UBFeaturesWidget.cpp
src/gui/UBFeaturesWidget.cpp
+90
-6
UBFeaturesWidget.h
src/gui/UBFeaturesWidget.h
+6
-2
No files found.
Sankore 3.1.iss
View file @
775c9b9e
...
...
@@ -45,7 +45,10 @@ Type: files ; Name: "{app}\*.dll"
[Files]
Source: "..\Sankore-ThirdParty\microsoft\vcredist_x86.exe"; DestDir:"{tmp}"
Source: ".\build\win32\release\product\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "build\win32\release\product\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
;Sankore plugins
Source: "plugins\cffadaptor\build\win32\release\lib\CFF_Adaptor.dll"; DestDir: "{app}"; Flags: ignoreversion
;OpenSSL
Source: "..\Sankore-ThirdParty\openssl\win32\libeay32.dll"; DestDir:"{app}"; Flags: ignoreversion
...
...
@@ -60,6 +63,7 @@ Source: "..\Qt-sankore3.1\lib\QtWebKit4.dll"; DestDir: "{app}"; Flags: ignorever
Source: "..\Qt-sankore3.1\lib\phonon4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\lib\QtNetwork4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\lib\QtSvg4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Qt-sankore3.1\lib\QtOpenGL4.dll"; DestDir: "{app}"; Flags: ignoreversion
;Qt plugins
Source: "..\Qt-sankore3.1\plugins\accessible\qtaccessiblecompatwidgets4.dll"; DestDir: "{app}\accessible"; Flags: ignoreversion
...
...
This diff is collapsed.
Click to expand it.
release.win7.vc9.64.bat
View file @
775c9b9e
...
...
@@ -62,7 +62,7 @@ nmake release-install
copy %BASE_QT_TRANSLATIONS_DIRECTORY%\qt_*.qm build\win32\release\product\i18n\
del build\win32\release\product\i18n\qt_help*
del "
.\
build\win32\release\product\Sankore.pdb"
del "build\win32\release\product\Sankore.pdb"
set INSTALLER_NAME=Open-Sankore
...
...
This diff is collapsed.
Click to expand it.
release.win7.vc9.bat
View file @
775c9b9e
...
...
@@ -66,7 +66,7 @@ copy resources\customizations build\win32\release\product\
del build\win32\release\product\i18n\qt_help*
del "
.\
build\win32\release\product\Sankore.pdb"
del "build\win32\release\product\Sankore.pdb"
set INSTALLER_NAME=Open-Sankore
...
...
This diff is collapsed.
Click to expand it.
src/gui/UBFeaturesActionBar.cpp
View file @
775c9b9e
...
...
@@ -66,8 +66,8 @@ UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWid
mButtonGroup
->
addButton
(
mpRemoveFavoriteBtn
);
mButtonGroup
->
addButton
(
mpNewFolderBtn
);
// Connect signals & slots
connect
(
mpFavoriteAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
onActionFavorite
()));
/*
connect(mpSocialAction,SIGNAL(triggered()), this, SLOT(onActionSocial()));
/*
connect(mpFavoriteAction,SIGNAL(triggered()), this, SLOT(onActionFavorite()));
connect(mpSocialAction,SIGNAL(triggered()), this, SLOT(onActionSocial()));
connect(mpSearchAction,SIGNAL(triggered()), this, SLOT(onActionSearch()));
connect(mpDeleteAction,SIGNAL(triggered()), this, SLOT(onActionTrash()));
connect(mpCloseAction, SIGNAL(triggered()), this, SLOT(onActionClose()));
...
...
@@ -75,8 +75,11 @@ UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWid
connect(mSearchBar, SIGNAL(textChanged(QString)), this, SLOT(onSearchTextChanged(QString)));
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
(
mpRemoveFavorite
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
onActionRemoveFavorite
()));
connect
(
mpDeleteAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
onActionTrash
()));
// Build the default toolbar
mLayout
->
addWidget
(
mpFavoriteBtn
);
...
...
@@ -148,6 +151,8 @@ void UBFeaturesActionBar::setButtons()
mpFavoriteBtn
->
hide
();
mpSocialBtn
->
hide
();
mSearchBar
->
show
();
mpDeleteBtn
->
show
();
mpDeleteBtn
->
setEnabled
(
true
);
//mpSearchBtn->show();
//mpDeleteBtn->hide();
mpCloseBtn
->
hide
();
...
...
@@ -175,6 +180,16 @@ void UBFeaturesActionBar::onActionFavorite()
emit
addElementsToFavorite
();
}
void
UBFeaturesActionBar
::
onActionRemoveFavorite
()
{
emit
removeElementsFromFavorite
();
}
void
UBFeaturesActionBar
::
onActionTrash
()
{
emit
deleteSelectedElements
();
}
/*
void UBFeaturesActionBar::dragMoveEvent(QDragMoveEvent *event)
{
...
...
This diff is collapsed.
Click to expand it.
src/gui/UBFeaturesActionBar.h
View file @
775c9b9e
...
...
@@ -31,10 +31,14 @@ signals:
void
addToFavorite
(
const
QMimeData
&
data
);
void
removeFromFavorite
(
const
QMimeData
&
data
);
void
addElementsToFavorite
();
void
removeElementsFromFavorite
();
void
deleteSelectedElements
();
private
slots
:
void
onSearchTextChanged
(
QString
txt
);
void
onActionNewFolder
();
void
onActionFavorite
();
void
onActionRemoveFavorite
();
void
onActionTrash
();
protected
:
//void dragMoveEvent(QDragMoveEvent *event);
void
dragEnterEvent
(
QDragEnterEvent
*
event
);
...
...
This diff is collapsed.
Click to expand it.
src/gui/UBFeaturesWidget.cpp
View file @
775c9b9e
...
...
@@ -121,7 +121,9 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name):UBDockPale
connect
(
mActionBar
,
SIGNAL
(
deleteElements
(
const
QMimeData
&
)
),
this
,
SLOT
(
deleteElements
(
const
QMimeData
&
)
)
);
connect
(
mActionBar
,
SIGNAL
(
addToFavorite
(
const
QMimeData
&
)
),
this
,
SLOT
(
addToFavorite
(
const
QMimeData
&
)
)
);
connect
(
mActionBar
,
SIGNAL
(
removeFromFavorite
(
const
QMimeData
&
)
),
this
,
SLOT
(
removeFromFavorite
(
const
QMimeData
&
)
)
);
connect
(
mActionBar
,
SIGNAL
(
addElementsToFavorite
()
),
this
,
SLOT
(
addElementsToFavorite
()
)
);
connect
(
mActionBar
,
SIGNAL
(
addElementsToFavorite
()
),
this
,
SLOT
(
addElementsToFavorite
()
)
);
connect
(
mActionBar
,
SIGNAL
(
removeElementsFromFavorite
()
),
this
,
SLOT
(
removeElementsFromFavorite
()
)
);
connect
(
mActionBar
,
SIGNAL
(
deleteSelectedElements
()
),
this
,
SLOT
(
deleteSelectedElements
()
)
);
connect
(
pathListView
,
SIGNAL
(
clicked
(
const
QModelIndex
&
)
),
this
,
SLOT
(
currentPathChanged
(
const
QModelIndex
&
)
)
);
connect
(
thumbSlider
,
SIGNAL
(
sliderMoved
(
int
)
),
this
,
SLOT
(
thumbnailSizeChanged
(
int
)
)
);
...
...
@@ -277,6 +279,37 @@ void UBFeaturesWidget::deleteElements( const QMimeData & mimeData )
model
->
invalidate
();
}
void
UBFeaturesWidget
::
deleteSelectedElements
()
{
QModelIndexList
selected
=
featuresListView
->
selectionModel
()
->
selectedIndexes
();
QList
<
QUrl
>
urls
;
foreach
(
QModelIndex
sel
,
selected
)
{
UBFeature
feature
=
sel
.
data
(
Qt
::
UserRole
+
1
).
value
<
UBFeature
>
();
if
(
feature
.
isDeletable
()
)
urls
.
append
(
feature
.
getFullPath
()
);
}
foreach
(
QUrl
url
,
urls
)
{
if
(
controller
->
isTrash
(
url
)
)
{
controller
->
deleteItem
(
url
);
}
else
{
UBFeature
elem
=
controller
->
moveItemToFolder
(
url
,
controller
->
getTrashElement
()
);
controller
->
removeFromFavorite
(
url
);
featuresModel
->
addItem
(
elem
);
featuresModel
->
deleteFavoriteItem
(
url
.
toString
()
);
}
featuresModel
->
deleteItem
(
url
.
toString
()
);
}
QSortFilterProxyModel
*
model
=
dynamic_cast
<
QSortFilterProxyModel
*>
(
featuresListView
->
model
()
);
model
->
invalidate
();
}
void
UBFeaturesWidget
::
addToFavorite
(
const
QMimeData
&
mimeData
)
{
if
(
!
mimeData
.
hasUrls
()
)
...
...
@@ -335,14 +368,45 @@ void UBFeaturesWidget::onAddDownloadedFileToLibrary(bool pSuccess, QUrl sourceUr
}
void
UBFeaturesWidget
::
addElementsToFavorite
()
{
if
(
currentStackedWidget
==
ID_PROPERTIES
)
{
UBFeature
feature
=
featureProperties
->
getCurrentElement
();
if
(
feature
!=
UBFeature
()
&&
!
UBApplication
::
isFromWeb
(
feature
.
getFullPath
().
toString
()
)
)
{
UBFeature
elem
=
controller
->
addToFavorite
(
feature
.
getFullPath
()
);
featuresModel
->
addItem
(
elem
);
}
}
else
if
(
currentStackedWidget
==
ID_LISTVIEW
)
{
QModelIndexList
selected
=
featuresListView
->
selectionModel
()
->
selectedIndexes
();
for
(
int
i
=
0
;
i
<
selected
.
size
();
++
i
)
{
UBFeature
feature
=
selected
.
at
(
i
).
data
(
Qt
::
UserRole
+
1
).
value
<
UBFeature
>
();
UBFeature
elem
=
controller
->
addToFavorite
(
feature
.
getFullPath
()
);
if
(
!
elem
.
getVirtualPath
().
isEmpty
()
&&
!
elem
.
getVirtualPath
().
isNull
()
)
featuresModel
->
addItem
(
elem
);
}
}
QSortFilterProxyModel
*
model
=
dynamic_cast
<
QSortFilterProxyModel
*>
(
featuresListView
->
model
()
);
model
->
invalidate
();
}
void
UBFeaturesWidget
::
removeElementsFromFavorite
()
{
QModelIndexList
selected
=
featuresListView
->
selectionModel
()
->
selectedIndexes
();
//qSort( selected.begin(), selected.end(), qGreater<QModelIndex>() );
QList
<
QUrl
>
items
;
for
(
int
i
=
0
;
i
<
selected
.
size
();
++
i
)
{
UBFeature
feature
=
selected
.
at
(
i
).
data
(
Qt
::
UserRole
+
1
).
value
<
UBFeature
>
();
UBFeature
elem
=
controller
->
addToFavorite
(
feature
.
getFullPath
()
);
if
(
!
elem
.
getVirtualPath
().
isEmpty
()
&&
!
elem
.
getVirtualPath
().
isNull
()
)
featuresModel
->
addItem
(
elem
);
items
.
append
(
feature
.
getFullPath
()
);
}
foreach
(
QUrl
url
,
items
)
{
controller
->
removeFromFavorite
(
url
);
featuresModel
->
deleteFavoriteItem
(
url
.
toString
()
);
}
QSortFilterProxyModel
*
model
=
dynamic_cast
<
QSortFilterProxyModel
*>
(
featuresListView
->
model
()
);
model
->
invalidate
();
...
...
@@ -435,7 +499,7 @@ void UBFeaturesListView::dropEvent( QDropEvent *event )
{
event
->
setDropAction
(
Qt
::
MoveAction
);
}
QListView
::
dropEvent
(
event
);
QListView
::
dropEvent
(
event
);
}
...
...
@@ -609,6 +673,13 @@ void UBFeatureProperties::showEvent (QShowEvent *event )
adaptSize
();
}
UBFeature
UBFeatureProperties
::
getCurrentElement
()
const
{
if
(
mpElement
)
return
*
mpElement
;
return
UBFeature
();
}
void
UBFeatureProperties
::
adaptSize
()
{
if
(
NULL
!=
mpOrigPixmap
)
...
...
@@ -854,7 +925,7 @@ void UBFeaturesModel::deleteFavoriteItem( const QString &path )
{
for
(
int
i
=
0
;
i
<
featuresList
->
size
();
++
i
)
{
if
(
!
QString
::
compare
(
featuresList
->
at
(
i
).
getUrl
(),
path
,
Qt
::
CaseInsensitive
)
&&
if
(
!
QString
::
compare
(
featuresList
->
at
(
i
).
getFullPath
().
toString
(),
path
,
Qt
::
CaseInsensitive
)
&&
!
QString
::
compare
(
featuresList
->
at
(
i
).
getVirtualPath
(),
"/root/favorites"
,
Qt
::
CaseInsensitive
)
)
{
removeRow
(
i
,
QModelIndex
()
);
...
...
@@ -863,6 +934,18 @@ void UBFeaturesModel::deleteFavoriteItem( const QString &path )
}
}
void
UBFeaturesModel
::
deleteItem
(
const
QString
&
path
)
{
for
(
int
i
=
0
;
i
<
featuresList
->
size
();
++
i
)
{
if
(
!
QString
::
compare
(
featuresList
->
at
(
i
).
getFullPath
().
toString
(),
path
,
Qt
::
CaseInsensitive
)
)
{
removeRow
(
i
,
QModelIndex
()
);
return
;
}
}
}
bool
UBFeaturesModel
::
removeRows
(
int
row
,
int
count
,
const
QModelIndex
&
parent
)
{
if
(
row
<
0
)
...
...
@@ -889,6 +972,7 @@ bool UBFeaturesModel::removeRow( int row, const QModelIndex & parent )
return
true
;
}
Qt
::
ItemFlags
UBFeaturesModel
::
flags
(
const
QModelIndex
&
index
)
const
{
Qt
::
ItemFlags
defaultFlags
=
QAbstractItemModel
::
flags
(
index
);
...
...
This diff is collapsed.
Click to expand it.
src/gui/UBFeaturesWidget.h
View file @
775c9b9e
...
...
@@ -102,6 +102,8 @@ private slots:
void
onDisplayMetadata
(
QMap
<
QString
,
QString
>
);
void
onAddDownloadedFileToLibrary
(
bool
,
QUrl
,
QString
,
QByteArray
);
void
addElementsToFavorite
();
void
removeElementsFromFavorite
();
void
deleteSelectedElements
();
protected
:
bool
eventFilter
(
QObject
*
target
,
QEvent
*
event
);
};
...
...
@@ -151,8 +153,7 @@ public:
~
UBFeatureProperties
();
void
showElement
(
const
UBFeature
&
elem
);
UBFeature
getCurrentElement
()
const
;
protected
:
void
resizeEvent
(
QResizeEvent
*
event
);
void
showEvent
(
QShowEvent
*
event
);
...
...
@@ -200,6 +201,7 @@ public:
void
addItem
(
const
UBFeature
&
item
);
void
deleteFavoriteItem
(
const
QString
&
path
);
void
deleteItem
(
const
QString
&
path
);
QVariant
data
(
const
QModelIndex
&
index
,
int
role
=
Qt
::
DisplayRole
)
const
;
QMimeData
*
mimeData
(
const
QModelIndexList
&
indexes
)
const
;
...
...
@@ -209,6 +211,8 @@ public:
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 insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
//bool insertRow(int row, const QModelIndex &parent = QModelIndex());
Qt
::
DropActions
supportedDropActions
()
const
{
return
Qt
::
MoveAction
|
Qt
::
CopyAction
;
}
...
...
This diff is collapsed.
Click to expand it.
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