mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 04:07:11 +02:00
adding back reload scripts
This commit is contained in:
parent
38916a3023
commit
ea10dc176a
3 changed files with 23 additions and 20 deletions
|
@ -20,9 +20,9 @@
|
|||
#include <OffscreenQmlDialog.h>
|
||||
|
||||
AboutUtil::AboutUtil(QObject *parent) : QObject(parent) {
|
||||
QLocale locale_;
|
||||
m_DateConverted = QDate::fromString(BuildInfo::BUILD_TIME, "dd/MM/yyyy").
|
||||
toString(locale_.dateFormat(QLocale::ShortFormat));
|
||||
QLocale locale;
|
||||
_dateConverted = QDate::fromString(BuildInfo::BUILD_TIME, "dd/MM/yyyy").
|
||||
toString(locale.dateFormat(QLocale::ShortFormat));
|
||||
}
|
||||
|
||||
AboutUtil *AboutUtil::getInstance()
|
||||
|
@ -31,17 +31,17 @@ AboutUtil *AboutUtil::getInstance()
|
|||
return &instance;
|
||||
}
|
||||
|
||||
QString AboutUtil::buildDate() const
|
||||
QString AboutUtil::getBuildDate() const
|
||||
{
|
||||
return m_DateConverted;
|
||||
return _dateConverted;
|
||||
}
|
||||
|
||||
QString AboutUtil::buildVersion() const
|
||||
QString AboutUtil::getBuildVersion() const
|
||||
{
|
||||
return BuildInfo::VERSION;
|
||||
}
|
||||
|
||||
QString AboutUtil::qtVersion() const
|
||||
QString AboutUtil::getQtVersion() const
|
||||
{
|
||||
return qVersion();
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ QString AboutUtil::qtVersion() const
|
|||
void AboutUtil::openUrl(const QString& url) const {
|
||||
|
||||
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
|
||||
auto tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"));
|
||||
auto tablet = tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system");
|
||||
auto hmd = DependencyManager::get<HMDScriptingInterface>();
|
||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||
|
||||
|
|
|
@ -16,27 +16,24 @@
|
|||
#include <QObject>
|
||||
|
||||
class AboutUtil : public QObject {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(QString buildDate READ buildDate CONSTANT)
|
||||
Q_PROPERTY(QString buildVersion READ buildVersion CONSTANT)
|
||||
Q_PROPERTY(QString qtVersion READ qtVersion CONSTANT)
|
||||
|
||||
AboutUtil(QObject* parent = nullptr);
|
||||
Q_PROPERTY(QString buildDate READ getBuildDate CONSTANT)
|
||||
Q_PROPERTY(QString buildVersion READ getBuildVersion CONSTANT)
|
||||
Q_PROPERTY(QString qtVersion READ getQtVersion CONSTANT)
|
||||
public:
|
||||
static AboutUtil* getInstance();
|
||||
~AboutUtil() {}
|
||||
|
||||
QString buildDate() const;
|
||||
QString buildVersion() const;
|
||||
QString qtVersion() const;
|
||||
QString getBuildDate() const;
|
||||
QString getBuildVersion() const;
|
||||
QString getQtVersion() const;
|
||||
|
||||
public slots:
|
||||
void openUrl(const QString &url) const;
|
||||
private:
|
||||
|
||||
QString m_DateConverted;
|
||||
AboutUtil(QObject* parent = nullptr);
|
||||
QString _dateConverted;
|
||||
};
|
||||
|
||||
#endif // hifi_AboutUtil_h
|
||||
|
|
|
@ -3642,7 +3642,6 @@ void Application::keyPressEvent(QKeyEvent* event) {
|
|||
_keysPressed.insert(event->key());
|
||||
|
||||
_controllerScriptingInterface->emitKeyPressEvent(event); // send events to any registered scripts
|
||||
|
||||
// if one of our scripts have asked to capture this event, then stop processing it
|
||||
if (_controllerScriptingInterface->isKeyCaptured(event)) {
|
||||
return;
|
||||
|
@ -3727,6 +3726,13 @@ void Application::keyPressEvent(QKeyEvent* event) {
|
|||
}
|
||||
break;
|
||||
|
||||
case Qt::Key_R:
|
||||
if (isMeta && !event->isAutoRepeat()) {
|
||||
DependencyManager::get<ScriptEngines>()->reloadAllScripts();
|
||||
DependencyManager::get<OffscreenUi>()->clearCache();
|
||||
}
|
||||
break;
|
||||
|
||||
case Qt::Key_Asterisk:
|
||||
Menu::getInstance()->triggerOption(MenuOption::DefaultSkybox);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue