diff --git a/resources/i18n/sankore_ar.ts b/resources/i18n/sankore_ar.ts
new file mode 100644
index 00000000..e9d93b02
--- /dev/null
+++ b/resources/i18n/sankore_ar.ts
@@ -0,0 +1,2627 @@
+
+
+ BlackoutWidget
+
+
+
+
+
+
+
+
+
+
+ DownloadDialog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DownloadItem
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ IntranetPodcastPublishingDialog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MainWindow
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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+
+
+
+
+
+
+
+
+ UBApplicationController
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBBoardController
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBBoardPaletteManager
+
+
+
+
+
+
+
+
+
+
+ UBCapturePublisher
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBCapturePublishingDialog
+
+
+
+
+
+
+ UBDesktopPalette
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBDocumentController
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBDocumentManager
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBDocumentNavigator
+
+
+
+
+
+
+ UBDocumentPublisher
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBDocumentTreeWidget
+
+
+
+
+
+
+
+
+
+
+ UBDropMeWidget
+
+
+
+
+
+
+ UBExportDocument
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBExportFullPDF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBExportPDF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBExportWeb
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBGraphicsItemDelegate
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBGraphicsTextItem
+
+
+
+
+
+
+ UBGraphicsTextItemDelegate
+
+
+
+
+
+
+ UBGraphicsWidgetItemDelegate
+
+
+
+
+
+
+
+
+
+
+ UBImportDocument
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBImportImage
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBImportPDF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBIntranetPodcastPublisher
+
+
+
+
+
+
+
+
+
+
+ UBIntranetPodcastPublishingDialog
+
+
+
+
+
+
+ UBLibActionBar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBLibItemProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBLibraryController
+
+
+
+
+
+
+ Audio category element
+
+
+
+
+ Movies category element
+
+
+
+
+ Pictures category element
+
+
+
+
+ Shapes category element
+
+
+
+
+ Applications category element
+
+
+
+
+ Favorite category element
+
+
+
+
+ Interactives category element
+
+
+
+
+
+
+
+
+
+
+
+
+ UBNetworkAccessManager
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBNewFolderDlg
+
+
+
+
+
+
+
+
+
+
+ UBPersistenceManager
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBPodcastController
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBPreferencesController
+
+
+
+
+
+
+
+
+
+
+ UBSettings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBThumbnailAdaptor
+
+
+
+
+
+
+
+
+
+
+ UBToolsManager
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBTrapFlashController
+
+
+
+
+
+
+
+
+
+
+ UBUpdateDlg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBW3CWidget
+
+
+
+
+
+
+ UBWebPluginWidget
+
+
+
+
+
+
+ UBWebPublisher
+
+
+
+
+
+
+ UBWidgetUniboardAPI
+
+
+
+
+
+
+ UBYouTubePublisher
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBYouTubePublishingDialog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UBZoomPalette
+
+
+
+
+
+
+ WBClearButton
+
+
+
+
+
+
+ WBDownloadItem
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ unknown file size
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ WBDownloadManager
+
+
+
+
+
+
+ always >= 2
+
+
+
+
+ WBHistoryModel
+
+
+
+
+
+
+
+
+
+
+ WBHistoryTreeModel
+
+
+
+
+
+
+
+
+
+
+ WBSearchLineEdit
+
+
+
+
+
+
+ WBTabBar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ WBTabWidget
+
+
+
+
+
+
+
+
+
+
+ WBToolbarSearch
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ WBWebPage
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ WBWebView
+
+
+
+
+
+
+ YouTubePublishingDialog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ brushProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ capturePublishingDialog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ documentPublishingDialog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ documents
+
+
+
+
+
+
+
+
+
+
+ preferencesDialog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ trapFlashDialog
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/adaptors/publishing/UBDocumentPublisher.cpp b/src/adaptors/publishing/UBDocumentPublisher.cpp
index e2201f05..00ad33d6 100644
--- a/src/adaptors/publishing/UBDocumentPublisher.cpp
+++ b/src/adaptors/publishing/UBDocumentPublisher.cpp
@@ -60,8 +60,10 @@ UBDocumentPublisher::~UBDocumentPublisher()
void UBDocumentPublisher::publish()
{
//check that the username and password are stored on preferences
- mUsername = "Admin";
- mPassword = "admin";
+ UBSettings* settings = UBSettings::settings();
+
+ mUsername = settings->communityUsername();
+ mPassword = settings->communityPassword();
buildUbwFile();
UBApplication::showMessage(tr("Uploading Sankore File on Web."));
sendUbw();
diff --git a/src/api/UBWidgetUniboardAPI.cpp b/src/api/UBWidgetUniboardAPI.cpp
index 19555866..bda9d64b 100644
--- a/src/api/UBWidgetUniboardAPI.cpp
+++ b/src/api/UBWidgetUniboardAPI.cpp
@@ -375,6 +375,26 @@ QString UBWidgetUniboardAPI::lang()
return lang;
}
+void UBWidgetUniboardAPI::returnStatus(const QString& method, const QString& status)
+{
+ QString msg = QString(tr("%0 called (method=%1, status=%2)")).arg("returnStatus").arg(method).arg(status);
+ UBApplication::showMessage(msg);
+}
+
+void UBWidgetUniboardAPI::usedMethods(QStringList methods)
+{
+ // TODO: Implement this method
+ foreach(QString method, methods)
+ {
+
+ }
+}
+
+void UBWidgetUniboardAPI::response(bool correct)
+{
+ Q_UNUSED(correct);
+ // TODO: Implement this method
+}
UBDocumentDatastoreAPI::UBDocumentDatastoreAPI(UBGraphicsW3CWidgetItem *graphicsWidget)
diff --git a/src/api/UBWidgetUniboardAPI.h b/src/api/UBWidgetUniboardAPI.h
index 839b0bee..0310a84b 100644
--- a/src/api/UBWidgetUniboardAPI.h
+++ b/src/api/UBWidgetUniboardAPI.h
@@ -207,6 +207,9 @@ class UBWidgetUniboardAPI : public QObject
void addText(const QString& text, const qreal x, const qreal y, const int height = -1, const QString& font = ""
, bool bold = false, bool italic = false);
+ void returnStatus(const QString& method, const QString& status);
+ void usedMethods(QStringList methods);
+ void response(bool correct);
private:
QString uuid();
diff --git a/src/core/UBPreferencesController.cpp b/src/core/UBPreferencesController.cpp
index a8759889..2bf93f5b 100644
--- a/src/core/UBPreferencesController.cpp
+++ b/src/core/UBPreferencesController.cpp
@@ -38,6 +38,8 @@ UBPreferencesController::UBPreferencesController(QWidget *parent)
mPreferencesWindow = new QDialog(parent, Qt::Dialog);
mPreferencesUI = new Ui::preferencesDialog(); // deleted in UBPreferencesController::destructor
mPreferencesUI->setupUi(mPreferencesWindow);
+ connect(mPreferencesUI->Username_textBox, SIGNAL(editingFinished()), this, SLOT(onCommunityUsernameChanged()));
+ connect(mPreferencesUI->Password_textEdit, SIGNAL(editingFinished()), this, SLOT(onCommunityPasswordChanged()));
wire();
}
@@ -160,6 +162,9 @@ void UBPreferencesController::init()
mPreferencesUI->verticalChoice->setChecked(settings->appToolBarOrientationVertical->get().toBool());
mPreferencesUI->horizontalChoice->setChecked(!settings->appToolBarOrientationVertical->get().toBool());
+ mPreferencesUI->Username_textBox->setText(settings->communityUsername());
+ mPreferencesUI->Password_textEdit->setText(settings->communityPassword());
+
// pen tab
mPenProperties->fineSlider->setValue(settings->boardPenFineWidth->get().toDouble() * sSliderRatio);
mPenProperties->mediumSlider->setValue(settings->boardPenMediumWidth->get().toDouble() * sSliderRatio);
@@ -176,6 +181,18 @@ void UBPreferencesController::init()
}
+void UBPreferencesController::onCommunityUsernameChanged()
+{
+ UBSettings* settings = UBSettings::settings();
+ settings->setCommunityUsername(mPreferencesUI->Username_textBox->text());
+}
+
+void UBPreferencesController::onCommunityPasswordChanged()
+{
+ UBSettings* settings = UBSettings::settings();
+ settings->setCommunityPassword(mPreferencesUI->Password_textEdit->text());
+}
+
void UBPreferencesController::close()
{
//web
diff --git a/src/core/UBPreferencesController.h b/src/core/UBPreferencesController.h
index 9911539d..39c9cb51 100644
--- a/src/core/UBPreferencesController.h
+++ b/src/core/UBPreferencesController.h
@@ -55,6 +55,8 @@ class UBPreferencesController : public QObject
void toolbarPositionChanged(bool checked);
void toolbarOrientationVertical(bool checked);
void toolbarOrientationHorizontal(bool checked);
+ void onCommunityUsernameChanged();
+ void onCommunityPasswordChanged();
private:
diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp
index ec8a59e9..3707e997 100644
--- a/src/core/UBSettings.cpp
+++ b/src/core/UBSettings.cpp
@@ -313,6 +313,9 @@ void UBSettings::init()
uniboardWebAuthor = new UBSetting(this, "UniboardWeb", "Author", "");
uniboardWebGoogleMapApiKey = new UBSetting(this, "UniboardWeb", "GoogleMapAPIKey", "ABQIAAAAsWU4bIbaeCLinpZ30N_erRQEk562OPinwQkG9J-ZXUNAqYhJ5RT_z2EmpfVXiUg8c41BcsD_XM6P5g");
+ communityUser = new UBSetting(this, "Community", "Username", "");
+ communityPsw = new UBSetting(this, "Community", "Password", "");
+
QStringList uris = UBToolsManager::manager()->allToolIDs();
favoritesNativeToolUris = new UBSetting(this, "App", "FavoriteToolURIs", uris);
@@ -1292,3 +1295,22 @@ void UBSettings::setProxyPassword(const QString& password)
}
+QString UBSettings::communityUsername()
+{
+ return communityUser->get().toString();
+}
+
+void UBSettings::setCommunityUsername(const QString &username)
+{
+ communityUser->set(QVariant(username));
+}
+
+QString UBSettings::communityPassword()
+{
+ return communityPsw->get().toString();
+}
+
+void UBSettings::setCommunityPassword(const QString &password)
+{
+ communityPsw->set(QVariant(password));
+}
diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h
index d4720e66..08748383 100644
--- a/src/core/UBSettings.h
+++ b/src/core/UBSettings.h
@@ -89,6 +89,11 @@ class UBSettings : public QObject
QString proxyPassword();
void setProxyPassword(const QString& password);
+ QString communityUsername();
+ void setCommunityUsername(const QString& username);
+ QString communityPassword();
+ void setCommunityPassword(const QString& password);
+
void init();
static QString uniboardDataDirectory();
@@ -315,6 +320,9 @@ class UBSettings : public QObject
UBSetting* navigPaletteWidth;
UBSetting* libPaletteWidth;
+ UBSetting* communityUser;
+ UBSetting* communityPsw;
+
/*
static int navigPaletteWidth;
static int libPaletteWidth;
diff --git a/src/domain/UBGraphicsWidgetItem.cpp b/src/domain/UBGraphicsWidgetItem.cpp
index e7fbcc8e..7ec7cb98 100644
--- a/src/domain/UBGraphicsWidgetItem.cpp
+++ b/src/domain/UBGraphicsWidgetItem.cpp
@@ -36,7 +36,7 @@ void UBGraphicsWidgetItem::javaScriptWindowObjectCleared()
if(!mUniboardAPI)
mUniboardAPI = new UBWidgetUniboardAPI(scene(), this);
- mWebKitWidget->page()->mainFrame()->addToJavaScriptWindowObject("uniboard", mUniboardAPI);
+ mWebKitWidget->page()->mainFrame()->addToJavaScriptWindowObject("sankore", mUniboardAPI);
}
diff --git a/src/domain/UBW3CWidget.cpp b/src/domain/UBW3CWidget.cpp
index 4ca26cfb..81ec3201 100644
--- a/src/domain/UBW3CWidget.cpp
+++ b/src/domain/UBW3CWidget.cpp
@@ -169,7 +169,7 @@ void UBW3CWidget::javaScriptWindowObjectCleared()
{
UBWidgetUniboardAPI *uniboardAPI = new UBWidgetUniboardAPI(UBApplication::boardController->activeScene(), 0);
- page()->mainFrame()->addToJavaScriptWindowObject("uniboard", uniboardAPI);
+ page()->mainFrame()->addToJavaScriptWindowObject("sankore", uniboardAPI);
UBWidgetVotingSystemAPI *votingSystem = new UBWidgetVotingSystemAPI(this);
page()->mainFrame()->addToJavaScriptWindowObject("voting", votingSystem);
diff --git a/src/gui/UBToolWidget.cpp b/src/gui/UBToolWidget.cpp
index 539d8b66..60a15b9c 100644
--- a/src/gui/UBToolWidget.cpp
+++ b/src/gui/UBToolWidget.cpp
@@ -120,7 +120,7 @@ void UBToolWidget::javaScriptWindowObjectCleared()
{
UBWidgetUniboardAPI* uniboardAPI = new UBWidgetUniboardAPI(UBApplication::boardController->activeScene());
- mToolWidget->page()->mainFrame()->addToJavaScriptWindowObject("uniboard", uniboardAPI);
+ mToolWidget->page()->mainFrame()->addToJavaScriptWindowObject("sankore", uniboardAPI);
UBW3CWidget* w3c = dynamic_cast(mToolWidget);
if (w3c)