Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
shibakaneki 13 years ago
commit c58c7d66fc
  1. 2
      Sankore_3.1.pro
  2. 2
      release.linux.sh
  3. 2
      resources/sankore.qrc
  4. 27
      src/board/UBBoardPaletteManager.cpp
  5. 1
      src/board/UBBoardPaletteManager.h
  6. 4
      src/core/UBApplicationController.cpp
  7. 7
      src/core/UBPersistenceManager.cpp
  8. 2
      src/core/UBPersistenceManager.h
  9. 1
      src/domain/UBGraphicsItemDelegate.cpp
  10. 5
      src/gui/UBDocumentNavigator.cpp
  11. 24
      src/gui/UBMainWindow.cpp
  12. 5
      src/gui/UBMainWindow.h
  13. 41
      src/gui/UBUpdateDlg.cpp
  14. 20
      src/network/UBNetworkAccessManager.cpp
  15. 3
      src/web/browser/WBWebView.cpp

@ -7,7 +7,7 @@ CONFIG += debug_and_release \
no_include_pwd no_include_pwd
VERSION_MAJ = 1 VERSION_MAJ = 1
VERSION_MIN = 28 VERSION_MIN = 35
VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error
VERSION_PATCH = 00 VERSION_PATCH = 00

@ -19,7 +19,7 @@ make clean
rm -rf build/linux/release/ rm -rf build/linux/release/
rm -rf install rm -rf install
QT_PATH="/usr/local/Trolltech/Qt-4.7.3" QT_PATH="../Qt-sankore3.1"
PLUGINS_PATH="$QT_PATH/plugins" PLUGINS_PATH="$QT_PATH/plugins"
QMAKE_PATH="$QT_PATH/bin/qmake" QMAKE_PATH="$QT_PATH/bin/qmake"

@ -319,7 +319,6 @@
<file>images/pages_open.png</file> <file>images/pages_open.png</file>
<file>images/cache_close.png</file> <file>images/cache_close.png</file>
<file>images/cache_open.png</file> <file>images/cache_open.png</file>
<file>style.qss</file>
<file>images/cache_circle.png</file> <file>images/cache_circle.png</file>
<file>images/cache_square.png</file> <file>images/cache_square.png</file>
<file>images/down_arrow.png</file> <file>images/down_arrow.png</file>
@ -333,6 +332,7 @@
<file>images/teacher_close.png</file> <file>images/teacher_close.png</file>
<file>images/teacher_open.png</file> <file>images/teacher_open.png</file>
<file>images/teacher_close_disabled.png</file> <file>images/teacher_close_disabled.png</file>
<file>style.qss</file>
<file>images/teacher_open_disabled.png</file> <file>images/teacher_open_disabled.png</file>
<file>images/libpalette/WebSearchCategory.svg</file> <file>images/libpalette/WebSearchCategory.svg</file>
</qresource> </qresource>

@ -106,6 +106,11 @@ UBBoardPaletteManager::~UBBoardPaletteManager()
delete mpLibWidget; delete mpLibWidget;
mpLibWidget = NULL; mpLibWidget = NULL;
} }
if(NULL != mpTeacherBarWidget)
{
delete mpTeacherBarWidget;
mpTeacherBarWidget = NULL;
}
if(NULL != mpCachePropWidget) if(NULL != mpCachePropWidget)
{ {
delete mpCachePropWidget; delete mpCachePropWidget;
@ -163,20 +168,20 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
mpPageNavigWidget = new UBPageNavigationWidget(); mpPageNavigWidget = new UBPageNavigationWidget();
mpPageNavigWidget->registerMode(eUBDockPaletteWidget_BOARD); mpPageNavigWidget->registerMode(eUBDockPaletteWidget_BOARD);
// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpPageNavigWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); // connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpPageNavigWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode)));
mpLibWidget = new UBLibWidget(); mpLibWidget = new UBLibWidget();
mpLibWidget ->registerMode(eUBDockPaletteWidget_BOARD); mpLibWidget ->registerMode(eUBDockPaletteWidget_BOARD);
mpLibWidget ->registerMode(eUBDockPaletteWidget_DESKTOP); mpLibWidget ->registerMode(eUBDockPaletteWidget_DESKTOP);
// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpLibWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); // connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpLibWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode)));
mpCachePropWidget = new UBCachePropertiesWidget(); mpCachePropWidget = new UBCachePropertiesWidget();
mpCachePropWidget->registerMode(eUBDockPaletteWidget_BOARD); mpCachePropWidget->registerMode(eUBDockPaletteWidget_BOARD);
// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpCachePropWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); // connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpCachePropWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode)));
mpTeacherBarWidget = new UBTeacherBarWidget(); mpTeacherBarWidget = new UBTeacherBarWidget();
mpTeacherBarWidget->registerMode(eUBDockPaletteWidget_BOARD); mpTeacherBarWidget->registerMode(eUBDockPaletteWidget_BOARD);
// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpTeacherBarWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); // connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpTeacherBarWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode)));
//------------------------------------------------// //------------------------------------------------//
// Add the dock palettes // Add the dock palettes
@ -236,8 +241,8 @@ void UBBoardPaletteManager::slot_changeMainMode(UBApplicationController::MainMod
void UBBoardPaletteManager::slot_changeDesktopMode(bool isDesktop) void UBBoardPaletteManager::slot_changeDesktopMode(bool isDesktop)
{ {
UBApplicationController::MainMode currMode = UBApplication::applicationController->displayMode(); UBApplicationController::MainMode currMode = UBApplication::applicationController->displayMode();
if(!isDesktop) if(!isDesktop)
{ {
switch( currMode ) switch( currMode )
{ {
case UBApplicationController::Board: case UBApplicationController::Board:
@ -246,10 +251,10 @@ void UBBoardPaletteManager::slot_changeDesktopMode(bool isDesktop)
default: default:
break; break;
} }
} }
else else
changeMode(eUBDockPaletteWidget_DESKTOP); changeMode(eUBDockPaletteWidget_DESKTOP);
} }
void UBBoardPaletteManager::setupPalettes() void UBBoardPaletteManager::setupPalettes()
@ -899,4 +904,4 @@ void UBBoardPaletteManager::refreshPalettes()
{ {
mRightPalette->update(); mRightPalette->update();
mLeftPalette->update(); mLeftPalette->update();
} }

@ -26,7 +26,6 @@
#include "gui/UBLibWidget.h" #include "gui/UBLibWidget.h"
#include "gui/UBCachePropertiesWidget.h" #include "gui/UBCachePropertiesWidget.h"
#include "gui/UBTeacherBarWidget.h" #include "gui/UBTeacherBarWidget.h"
#include "core/UBApplicationController.h" #include "core/UBApplicationController.h"

@ -563,9 +563,7 @@ void UBApplicationController::downloadJsonFinished(QString currentJson)
} }
else { else {
if (isNoUpdateDisplayed) { if (isNoUpdateDisplayed) {
QMessageBox msgBox; mMainWindow->information(tr("Update"), tr("No update available"));
msgBox.setText (tr ("No update available"));
msgBox.exec();
} }
} }
} }

@ -14,6 +14,7 @@
*/ */
#include "UBPersistenceManager.h" #include "UBPersistenceManager.h"
#include "gui/UBMainWindow.h"
#include <QtXml> #include <QtXml>
@ -1005,11 +1006,7 @@ void UBPersistenceManager::checkIfDocumentRepositoryExists()
QString humanPath = QDir::cleanPath(mDocumentRepositoryPath); QString humanPath = QDir::cleanPath(mDocumentRepositoryPath);
humanPath = QDir::toNativeSeparators(humanPath); humanPath = QDir::toNativeSeparators(humanPath);
QMessageBox::question( UBApplication::mainWindow->warning(tr("Document Repository Loss"),tr("Sankore has lost access to the document repository '%1'. Unfortunately the application must shut down to avoid data corruption. Latest changes may be lost as well.").arg(humanPath));
QApplication::activeWindow(),
tr("Document Repository Loss"),
tr("Sankore has lost access to the document repository '%1'. Unfortunately the application must shut down to avoid data corruption. Latest changes may be lost as well.").arg(humanPath),
QMessageBox::Yes);
UBApplication::quit(); UBApplication::quit();
} }

@ -74,8 +74,8 @@ class UBPersistenceManager : public QObject
virtual void persistDocumentScene(UBDocumentProxy* pDocumentProxy, virtual void persistDocumentScene(UBDocumentProxy* pDocumentProxy,
UBGraphicsScene* pScene, const int pSceneIndex); UBGraphicsScene* pScene, const int pSceneIndex);
virtual void persistTeacherBar(UBDocumentProxy* pDocumentProxy, int page, sTeacherBarInfos infos); virtual void persistTeacherBar(UBDocumentProxy* pDocumentProxy, int page, sTeacherBarInfos infos);
sTeacherBarInfos getTeacherBarInfos(UBDocumentProxy* pDocumentProxy, int page); sTeacherBarInfos getTeacherBarInfos(UBDocumentProxy* pDocumentProxy, int page);
virtual UBGraphicsScene* createDocumentSceneAt(UBDocumentProxy* pDocumentProxy, int index); virtual UBGraphicsScene* createDocumentSceneAt(UBDocumentProxy* pDocumentProxy, int index);

@ -193,6 +193,7 @@ bool UBGraphicsItemDelegate::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
bool UBGraphicsItemDelegate::weelEvent(QGraphicsSceneWheelEvent *event) bool UBGraphicsItemDelegate::weelEvent(QGraphicsSceneWheelEvent *event)
{ {
Q_UNUSED(event);
if( mDelegated->isSelected() ) if( mDelegated->isSelected() )
{ {
// event->accept(); // event->accept();

@ -141,7 +141,10 @@ void UBDocumentNavigator::updateSpecificThumbnail(int iPage)
{ {
// Save the current state of the scene // Save the current state of the scene
pScene->setModified(true); pScene->setModified(true);
UBSvgSubsetAdaptor::persistScene(mCrntDoc,pScene, iPage); if(UBApplication::boardController)
{
UBApplication::boardController->persistCurrentScene();
}
UBThumbnailAdaptor::persistScene(mCrntDoc->persistencePath(), pScene, iPage); UBThumbnailAdaptor::persistScene(mCrntDoc->persistencePath(), pScene, iPage);

@ -16,7 +16,6 @@
#include <QtGui> #include <QtGui>
#include "UBMainWindow.h" #include "UBMainWindow.h"
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "core/UBApplicationController.h" #include "core/UBApplicationController.h"
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
@ -160,3 +159,26 @@ bool UBMainWindow::yesNoQuestion(QString windowTitle, QString text)
return messageBox.clickedButton() == yesButton; return messageBox.clickedButton() == yesButton;
} }
void UBMainWindow::oneButtonMessageBox(QString windowTitle, QString text, QMessageBox::Icon type)
{
QMessageBox messageBox;
messageBox.setParent(this);
messageBox.setWindowFlags(Qt::Dialog);
messageBox.setWindowTitle(windowTitle);
messageBox.setText(text);
messageBox.addButton(tr("Ok"),QMessageBox::YesRole);
messageBox.setIcon(type);
messageBox.exec();
}
void UBMainWindow::warning(QString windowTitle, QString text)
{
oneButtonMessageBox(windowTitle,text, QMessageBox::Warning);
}
void UBMainWindow::information(QString windowTitle, QString text)
{
oneButtonMessageBox(windowTitle, text, QMessageBox::Information);
}

@ -20,6 +20,7 @@
#include <QMainWindow> #include <QMainWindow>
#include <QWidget> #include <QWidget>
#include <QWebView> #include <QWebView>
#include <QMessageBox>
class QStackedLayout; class QStackedLayout;
@ -41,7 +42,10 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow
void addDocumentsWidget(QWidget *pWidget); void addDocumentsWidget(QWidget *pWidget);
void switchToDocumentsWidget(); void switchToDocumentsWidget();
bool yesNoQuestion(QString windowTitle, QString text); bool yesNoQuestion(QString windowTitle, QString text);
void warning(QString windowTitle, QString text);
void information(QString windowTitle, QString text);
signals: signals:
void closeEvent_Signal( QCloseEvent *event ); void closeEvent_Signal( QCloseEvent *event );
@ -50,6 +54,7 @@ class UBMainWindow : public QMainWindow, public Ui::MainWindow
void onExportDone(); void onExportDone();
protected: protected:
void oneButtonMessageBox(QString windowTitle, QString text, QMessageBox::Icon type);
virtual void keyPressEvent(QKeyEvent *event); virtual void keyPressEvent(QKeyEvent *event);
virtual void closeEvent (QCloseEvent *event); virtual void closeEvent (QCloseEvent *event);

@ -12,28 +12,29 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <QMessageBox>
#include <QFileDialog> #include <QFileDialog>
#include "UBUpdateDlg.h" #include "UBUpdateDlg.h"
#include "core/UBApplication.h"
#include "UBMainWindow.h"
#include "core/memcheck.h" #include "core/memcheck.h"
UBUpdateDlg::UBUpdateDlg(QWidget *parent, int nbFiles, const QString& bkpPath) UBUpdateDlg::UBUpdateDlg(QWidget *parent, int nbFiles, const QString& bkpPath)
: QDialog(parent) : QDialog(parent)
, mMainLayout(NULL) , mMainLayout(NULL)
, mNbFilesLabel(NULL) , mNbFilesLabel(NULL)
, mBkpLabel(NULL) , mBkpLabel(NULL)
, mBkpPath(NULL) , mBkpPath(NULL)
, mBrowseBttn(NULL) , mBrowseBttn(NULL)
, mpDlgBttn(NULL) , mpDlgBttn(NULL)
, mLayout(NULL) , mLayout(NULL)
, mHLayout(NULL) , mHLayout(NULL)
, mStackedWidget(NULL) , mStackedWidget(NULL)
, mDialogWidget(NULL) , mDialogWidget(NULL)
, mProgressWidget(NULL) , mProgressWidget(NULL)
, mProgressLayout(NULL) , mProgressLayout(NULL)
, mProgressLabel(NULL) , mProgressLabel(NULL)
{ {
mDialogWidget = new QWidget(this); mDialogWidget = new QWidget(this);
@ -178,18 +179,16 @@ void UBUpdateDlg::onUpdate()
void UBUpdateDlg::onFilesUpdated(bool bResult) void UBUpdateDlg::onFilesUpdated(bool bResult)
{ {
this->hide(); this->hide();
QString qsMsg; QString qsMsg;
if (bResult) if (bResult) {
{
qsMsg = tr("Files update successful!\nPlease reboot the application to access the updated documents."); qsMsg = tr("Files update successful!\nPlease reboot the application to access the updated documents.");
} }
else else {
{
qsMsg = tr("An error occured during the update. The files have not been affected."); qsMsg = tr("An error occured during the update. The files have not been affected.");
} }
QMessageBox::information(this, tr("Files update results"), qsMsg, QMessageBox::Ok); UBApplication::mainWindow->information(tr("Files update results"), qsMsg);
} }
QString UBUpdateDlg::backupPath() QString UBUpdateDlg::backupPath()

@ -160,14 +160,18 @@ void UBNetworkAccessManager::sslErrors(QNetworkReply *reply, const QList<QSslErr
QString errors = errorStrings.join(QLatin1String("\n")); QString errors = errorStrings.join(QLatin1String("\n"));
int ret = QMessageBox::warning(mainWindow, QCoreApplication::applicationName(), QMessageBox messageBox;
tr("SSL Errors:\n\n%1\n\n%2\n\n" messageBox.setParent(mainWindow);
"Do you want to ignore these errors for this host?").arg(reply->url().toString()).arg(errors), messageBox.setWindowFlags(Qt::Dialog);
QMessageBox::Yes | QMessageBox::No, messageBox.setWindowTitle(QCoreApplication::applicationName());
QMessageBox::No); messageBox.setText(tr("SSL Errors:\n\n%1\n\n%2\n\n"
"Do you want to ignore these errors for this host?").arg(reply->url().toString()).arg(errors));
if (ret == QMessageBox::Yes) QPushButton* yesButton = messageBox.addButton(tr("Yes"),QMessageBox::YesRole);
{ messageBox.addButton(tr("No"),QMessageBox::NoRole);
messageBox.setIcon(QMessageBox::Question);
messageBox.exec();
if(messageBox.clickedButton() == yesButton) {
reply->ignoreSslErrors(); reply->ignoreSslErrors();
sslTrustedHostList.append(replyHost); sslTrustedHostList.append(replyHost);
} }

@ -168,8 +168,7 @@ void WBWebPage::handleUnsupportedContent(QNetworkReply *reply)
messageBox.setText(tr("Download PDF Document: would you prefer to download the PDF file or add it to the current Sankore document?")); messageBox.setText(tr("Download PDF Document: would you prefer to download the PDF file or add it to the current Sankore document?"));
messageBox.addButton(tr("Download"), QMessageBox::AcceptRole); messageBox.addButton(tr("Download"), QMessageBox::AcceptRole);
QAbstractButton *addButton = QAbstractButton *addButton = messageBox.addButton(tr("Add to Current Document"), QMessageBox::AcceptRole);
messageBox.addButton(tr("Add to Current Document"), QMessageBox::AcceptRole);
messageBox.exec(); messageBox.exec();
if (messageBox.clickedButton() == addButton) if (messageBox.clickedButton() == addButton)

Loading…
Cancel
Save