@@ -78,7 +78,10 @@ AddInstrumentDialog::~AddInstrumentDialog()
7878 */
7979bool AddInstrumentDialog::DoRender ()
8080{
81+ // Get the tutorial wizard and see if we're on the "connect to scope" page
8182 auto tutorial = m_parent->GetTutorialWizard ();
83+ if (tutorial && (tutorial->GetCurrentStep () != TutorialWizard::TUTORIAL_02_CONNECT ) )
84+ tutorial = nullptr ;
8285
8386 ImGui::InputText (" Nickname" , &m_nickname);
8487 HelpMarker (
@@ -99,10 +102,7 @@ bool AddInstrumentDialog::DoRender()
99102
100103 // Show speech bubble for tutorial
101104 bool showedBubble = false ;
102- if (tutorial &&
103- (tutorial->GetCurrentStep () == TutorialWizard::TUTORIAL_02_CONNECT ) &&
104- (m_drivers[m_selectedDriver] != " demo" ) &&
105- !dropdownOpen )
105+ if (tutorial && (m_drivers[m_selectedDriver] != " demo" ) && !dropdownOpen )
106106 {
107107 auto pos = ImGui::GetCursorScreenPos ();
108108 ImVec2 anchorPos (pos.x + 10 *ImGui::GetFontSize (), pos.y );
@@ -129,11 +129,7 @@ bool AddInstrumentDialog::DoRender()
129129 );
130130
131131 // Show speech bubble for tutorial
132- if (tutorial &&
133- (tutorial->GetCurrentStep () == TutorialWizard::TUTORIAL_02_CONNECT ) &&
134- (m_transports[m_selectedTransport] != " null" ) &&
135- !dropdownOpen &&
136- !showedBubble)
132+ if (tutorial && (m_transports[m_selectedTransport] != " null" ) && !dropdownOpen && !showedBubble)
137133 {
138134 auto pos = ImGui::GetCursorScreenPos ();
139135 ImVec2 anchorPos (pos.x + 10 *ImGui::GetFontSize (), pos.y );
@@ -161,20 +157,33 @@ bool AddInstrumentDialog::DoRender()
161157 if (m_nickname.empty ())
162158 {
163159 ShowErrorPopup (
164- " Nickname error" ,
165- " Nickname shall be not empty " );
160+ " Nickname error" ,
161+ " The nickname cannot be left blank " );
166162 }
167163 else
168164 {
169165 auto transport = MakeTransport ();
170166 if (transport)
171167 {
172168 if (DoConnect (transport))
169+ {
170+ if (tutorial)
171+ tutorial->AdvanceToNextStep ();
172+
173173 return false ;
174+ }
174175 }
175176 }
176177 }
177178
179+ if (tutorial && !dropdownOpen && !showedBubble)
180+ {
181+ auto pos = ImGui::GetCursorScreenPos ();
182+ ImVec2 anchorPos (pos.x + 2 *ImGui::GetFontSize (), pos.y );
183+ tutorial->DrawSpeechBubble (anchorPos, ImGuiDir_Up, " Add the scope to your session" );
184+ showedBubble = true ;
185+ }
186+
178187 return true ;
179188}
180189
0 commit comments