Fixed API preferences missing in tool widgets.

preferencesAboutTextFull
Yimgo 12 years ago
parent 338c6390b2
commit 39b023e36f
  1. 15
      src/api/UBW3CWidgetAPI.cpp
  2. 2
      src/gui/UBToolWidget.cpp

@ -147,17 +147,16 @@ QString UBW3CWidgetPreferenceAPI::getItem(const QString& key)
QMap<QString, QString> docPref = mGraphicsW3CWidget->UBGraphicsWidgetItem::preferences();
if (docPref.contains(key))
return docPref.value(key);
}
QMap<QString, UBGraphicsW3CWidgetItem::PreferenceValue> w3cPrefs = mGraphicsW3CWidget->preferences();
if (w3cPrefs.contains(key)) {
UBGraphicsW3CWidgetItem::PreferenceValue pref = w3cPrefs.value(key);
return pref.value;
}
QMap<QString, UBGraphicsW3CWidgetItem::PreferenceValue> w3cPrefs = mGraphicsW3CWidget->preferences();
else
return "";
if (w3cPrefs.contains(key)) {
UBGraphicsW3CWidgetItem::PreferenceValue pref = w3cPrefs.value(key);
return pref.value;
}
}
return QString();
}
int UBW3CWidgetPreferenceAPI::length()

@ -111,7 +111,7 @@ void UBToolWidget::initialize()
void UBToolWidget::javaScriptWindowObjectCleared()
{
UBWidgetUniboardAPI *uniboardAPI = new UBWidgetUniboardAPI(UBApplication::boardController->activeScene());
UBWidgetUniboardAPI *uniboardAPI = new UBWidgetUniboardAPI(UBApplication::boardController->activeScene(), mGraphicsWidgetItem);
mGraphicsWebView->page()->mainFrame()->addToJavaScriptWindowObject("sankore", uniboardAPI);

Loading…
Cancel
Save