Your ROOT_URL in app.ini is http://git.osmesh.ru/ but you are visiting http://91.221.70.94:3000/MOS/OpenBoard/commit/c33a10579a775594e53a38e3fa0311bfd1416480
You should set ROOT_URL correctly, otherwise the web may not work correctly.
4 changed files with
25 additions and
13 deletions
src/document/UBDocumentContainer.cpp
src/document/UBDocumentContainer.h
src/document/UBDocumentController.cpp
src/gui/UBThumbnailWidget.cpp
@ -52,12 +52,18 @@ void UBDocumentContainer::duplicatePages(QList<int>& pageIndexes)
emit documentThumbnailsUpdated ( this ) ;
}
void UBDocumentContainer : : movePageToIndex ( int source , int target )
bool UBDocumentContainer : : movePageToIndex ( int source , int target )
{
if ( source = = 0 )
{
// Title page - cant be moved
return false ;
}
UBPersistenceManager : : persistenceManager ( ) - > moveSceneToIndex ( mCurrentDocument , source , target ) ;
deleteThumbPage ( source ) ;
insertThumbPage ( target ) ;
emit documentThumbnailsUpdated ( this ) ;
return true ;
}
void UBDocumentContainer : : deletePages ( QList < int > & pageIndexes )
@ -37,7 +37,7 @@ class UBDocumentContainer : public QObject
static int sceneIndexFromPage ( int sceneIndex ) ;
void duplicatePages ( QList < int > & pageIndexes ) ;
void movePageToIndex ( int source , int target ) ;
bool movePageToIndex ( int source , int target ) ;
void deletePages ( QList < int > & pageIndexes ) ;
void addPage ( int index ) ;
void updatePage ( int index ) ;
@ -1032,12 +1032,13 @@ bool UBDocumentController::addFileToDocument(UBDocumentProxy* document)
void UBDocumentController : : moveSceneToIndex ( UBDocumentProxy * proxy , int source , int target )
{
UBDocumentContainer : : movePageToIndex ( source , target ) ;
proxy - > setMetaData ( UBSettings : : documentUpdatedAt , UBStringUtils : : toUtcIsoDateTime ( QDateTime : : currentDateTime ( ) ) ) ;
UBMetadataDcSubsetAdaptor : : persist ( proxy ) ;
if ( UBDocumentContainer : : movePageToIndex ( source , target ) )
{
proxy - > setMetaData ( UBSettings : : documentUpdatedAt , UBStringUtils : : toUtcIsoDateTime ( QDateTime : : currentDateTime ( ) ) ) ;
UBMetadataDcSubsetAdaptor : : persist ( proxy ) ;
mDocumentUI - > thumbnailWidget - > hightlightItem ( target ) ;
mDocumentUI - > thumbnailWidget - > hightlightItem ( target ) ;
}
}
@ -210,13 +210,18 @@ void UBThumbnailWidget::mousePressEvent(QMouseEvent *event)
mMousePressPos = event - > pos ( ) ;
UBSceneThumbnailPixmap * sceneItem = dynamic_cast < UBSceneThumbnailPixmap * > ( itemAt ( mMousePressPos ) ) ;
if ( sceneItem ) {
int pageIndex = UBDocumentContainer : : pageFromSceneIndex ( sceneItem - > sceneIndex ( ) ) ;
if ( pageIndex = = 0 ) {
event - > ignore ( ) ;
return ;
}
if ( sceneItem = = NULL )
{
event - > ignore ( ) ;
return ;
}
//if(sceneItem){
// int pageIndex = UBDocumentContainer::pageFromSceneIndex(sceneItem->sceneIndex());
// if(pageIndex == 0){
// event->ignore();
// return;
// }
//}
mMousePressScenePos = mapToScene ( mMousePressPos ) ;
QGraphicsItem * underlyingItem = itemAt ( mMousePressPos ) ;