reanimated autobot

This commit is contained in:
Igor Korsukov 2022-04-26 16:55:33 +03:00
parent 03ac2082ee
commit 66408a9cb4
8 changed files with 22 additions and 2 deletions

View file

@ -22,6 +22,7 @@
var NewScore = require("steps/NewScore.js")
var NoteInput = require("steps/NoteInput.js")
var Navigation = require("steps/Navigation.js")
var testCase = {
name: "TC1.1: Create Simple Score",
@ -29,7 +30,8 @@ var testCase = {
steps: [
{name: "Close score (if opened) and go to home to start", func: function() {
api.dispatcher.dispatch("file-close")
api.navigation.triggerControl("TopTool", "MainToolBar", "Home")
Navigation.triggerControl("TopTool", "MainToolBar", "Home")
//api.autobot.pause()
}},
{name: "Open New Score Dialog", func: function() {
NewScore.openNewScoreDialog()

View file

@ -97,7 +97,7 @@ module.exports = {
Navigation.triggerControl("NewScoreDialog", "ChooseTabPanel", "Choose instruments")
break;
case "templates":
Navigation.triggerControl("NewScoreDialog", "ChooseTabPanel", "Choose from template")
Navigation.triggerControl("NewScoreDialog", "ChooseTabPanel", "Create from template")
break;
default:
api.autobot.error("instruments: unknown tab: " + tab)

View file

@ -22,6 +22,7 @@
#include "autobot.h"
#include <QTimer>
#include <QWindow>
#include "modularity/ioc.h"
@ -58,9 +59,15 @@ void Autobot::init()
void Autobot::affectOnServices()
{
//! NOTE Move focus to main window
mainWindow()->qWindow()->requestActivate();
//! NOTE Disable reset on mouse press for testing purpose
navigation()->setIsResetOnMousePress(false);
//! NOTE Set navigation highlight
navigation()->setIsHighlight(true);
//! NOTE Only defaults shortcuts
shortcutsRegister()->reload(true);

View file

@ -33,6 +33,7 @@
#include "ui/inavigationcontroller.h"
#include "shortcuts/ishortcutsregister.h"
#include "iinteractive.h"
#include "ui/imainwindow.h"
#include "scriptengine.h"
#include "testcasecontext.h"
@ -48,6 +49,7 @@ class Autobot : public IAutobot, public async::Asyncable
INJECT(autobot, ui::INavigationController, navigation)
INJECT(autobot, shortcuts::IShortcutsRegister, shortcutsRegister)
INJECT(autobot, framework::IInteractive, interactive)
INJECT(autobot, ui::IMainWindow, mainWindow)
public:
Autobot() = default;

View file

@ -28,6 +28,9 @@ StyledDialogView {
title: "Autobot"
//! NOTE It is necessary that it can be determined that this is an object for diagnostics
contentItem.objectName: panel.objectName
contentHeight: 600
contentWidth: 400
resizable: true
@ -35,6 +38,7 @@ StyledDialogView {
x: 850
ScriptsPanel {
id: panel
anchors.fill: parent
}
}

View file

@ -27,6 +27,8 @@ Rectangle {
color: ui.theme.backgroundPrimaryColor
objectName: "DiagnosticAutobotScriptPanel"
AutobotScriptsModel {
id: scriptsModel

View file

@ -670,6 +670,8 @@ void NavigationController::goToNextSection()
nextSec = firstEnabled(m_sections); // the first to be the next
}
LOGI() << "nextSec: " << nextSec->name() << ", enabled: " << nextSec->enabled();
doActivateSection(nextSec);
m_navigationChanged.notify();

View file

@ -79,6 +79,7 @@ void PopupWindow_QQuickView::init(QQmlEngine* engine, std::shared_ptr<ui::IUiCon
void PopupWindow_QQuickView::setContent(QQuickItem* item)
{
m_view->setContent(QUrl(), nullptr, item);
m_view->setObjectName(item->objectName() + "_(PopupWindow_QQuickView)");
connect(item, &QQuickItem::implicitWidthChanged, [this, item]() {
if (!m_view->isVisible()) {