Skip to content

Commit cb90f92

Browse files
authored
Added Notification timeout to widgets (#4256)
Signed-off-by: Justin Charles <charlesjustin2124@gmail.com>
1 parent a5da155 commit cb90f92

File tree

13 files changed

+38
-38
lines changed

13 files changed

+38
-38
lines changed

js/widgets/arpeggio.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ class Arpeggio {
236236
};
237237

238238
this.makeClickable();
239-
this._activity.textMsg(_("Click in the grid to add steps to the arpeggio."));
239+
activity.textMsg(_("Click in the grid to add steps to the arpeggio."), 3000);
240240
}
241241

242242
/**

js/widgets/meterwidget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ class MeterWidget {
298298
this.activity.logo.runLogoCommands(widgetBlock);
299299
};
300300

301-
this.activity.textMsg(_("Click in the circle to select strong beats for the meter."));
301+
activity.textMsg(_("Click in the circle to select strong beats for the meter."), 3000);
302302
widgetWindow.sendToCenter();
303303
this._scale.call(this.widgetWindow);
304304
}

js/widgets/modewidget.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ class ModeWidget {
160160
this._setMode();
161161

162162
//.TRANS: A circle of notes represents the musical mode.
163-
this.activity.textMsg(_("Click in the circle to select notes for the mode."));
163+
activity.textMsg(_("Click in the circle to select notes for the mode."), 3000);
164164
setTimeout(this.widgetWindow.sendToCenter, 0);
165165
}
166166

@@ -1014,7 +1014,7 @@ class ModeWidget {
10141014
// Create a new stack for the chunk.
10151015
// console.debug(newStack);
10161016
this.activity.blocks.loadNewBlocks(newStack);
1017-
this.activity.textMsg(_("New action block generated."));
1017+
activity.textMsg(_("New action block generated."), 3000);
10181018

10191019
// And save a stack of pitchnumbers to be used with the define mode
10201020
newStack = [

js/widgets/musickeyboard.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3210,8 +3210,8 @@ function MusicKeyboard(activity) {
32103210
this.activity.blocks.loadNewBlocks(newStack);
32113211
}
32123212

3213-
if (actionGroups > 1) this.activity.textMsg(_("New action blocks generated."));
3214-
else this.activity.textMsg(_("New action block generated."));
3213+
if (actionGroups > 1) activity.textMsg(_("New action blocks generated."), 3000);
3214+
else activity.textMsg(_("New action block generated."), 3000);
32153215
};
32163216

32173217
/**
@@ -3396,18 +3396,18 @@ function MusicKeyboard(activity) {
33963396
// re-init widget
33973397
if (this.midiON) {
33983398
this.midiButton.style.background = "#00FF00";
3399-
this.activity.textMsg(_("MIDI device present."));
3399+
activity.textMsg(_("MIDI device present."), 3000);
34003400
return;
34013401
}
34023402
midiAccess.inputs.forEach((input) => {
34033403
input.onmidimessage = onMIDIMessage;
34043404
});
34053405
if (midiAccess.inputs.size) {
34063406
this.midiButton.style.background = "#00FF00";
3407-
this.activity.textMsg(_("MIDI device present."));
3407+
activity.textMsg(_("MIDI device present."), 3000);
34083408
this.midiON = true;
34093409
} else {
3410-
this.activity.textMsg(_("No MIDI device found."));
3410+
activity.textMsg(_("No MIDI device found."), 3000);
34113411
}
34123412
};
34133413

@@ -3417,7 +3417,7 @@ function MusicKeyboard(activity) {
34173417
* @memberof ClassName
34183418
*/
34193419
const onMIDIFailure = () => {
3420-
this.activity.errorMsg(_("Failed to get MIDI access in browser."));
3420+
activity.errorMsg(_("Failed to get MIDI access in browser."), 3000);
34213421
this.midiON = false;
34223422
};
34233423

js/widgets/phrasemaker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ class PhraseMaker {
10721072
}
10731073

10741074
if (this.isInitial) {
1075-
this.activity.textMsg(_("Click on the table to add notes."));
1075+
activity.textMsg(_("Click on the table to add notes."), 3000);
10761076
this.widgetWindow.sendToCenter();
10771077
this.inInitial = false;
10781078
}
@@ -4613,7 +4613,7 @@ class PhraseMaker {
46134613
__playNote(time, noteCounter) {
46144614
// Show lyrics while playing notes.
46154615
if (this.lyricsON) {
4616-
this.activity.textMsg(this._lyrics[noteCounter]);
4616+
activity.textMsg(this._lyrics[noteCounter], 3000);
46174617
}
46184618
// If the widget is closed, stop playing.
46194619
if (!this.widgetWindow.isVisible()) {
@@ -5499,6 +5499,6 @@ class PhraseMaker {
54995499

55005500
// Create a new stack for the chunk.
55015501
this.activity.blocks.loadNewBlocks(newStack);
5502-
this.activity.textMsg(_("New action block generated."));
5502+
activity.textMsg(_("New action block generated."), 3000 );
55035503
}
55045504
}

js/widgets/pitchdrummatrix.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ class PitchDrumMatrix {
353353
}
354354
};
355355

356-
this.activity.textMsg(_("Click in the grid to map notes to drums."));
356+
activity.textMsg(_("Click in the grid to map notes to drums."), 3000);
357357
}
358358

359359
/**
@@ -749,7 +749,7 @@ class PitchDrumMatrix {
749749
}, pairs.length * 1000);
750750
} else {
751751
if (!this.widgetWindow._maximized) {
752-
this.activity.textMsg(_("Click in the grid to map notes to drums."));
752+
activity.textMsg(_("Click in the grid to map notes to drums."), 3000);
753753
}
754754
icon.innerHTML =
755755
'&nbsp;&nbsp;<img src="header-icons/' +

js/widgets/pitchslider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class PitchSlider {
133133
MakeToolbar(id);
134134
}
135135

136-
this.activity.textMsg(_("Click on the slider to create a note block."));
136+
activity.textMsg(_("Click on the slider to create a note block."), 3000);
137137
setTimeout(this.widgetWindow.sendToCenter, 0);
138138
}
139139

js/widgets/pitchstaircase.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ class PitchStaircase {
577577
}
578578

579579
this.activity.blocks.loadNewBlocks(newStack);
580-
this.activity.textMsg(_("New action block generated."));
580+
activity.textMsg(_("New action block generated."), 3000);
581581
}
582582

583583
/**
@@ -693,7 +693,7 @@ class PitchStaircase {
693693
widgetWindow.getWidgetBody().append(this._pscTable);
694694
this._refresh();
695695

696-
this.activity.textMsg(_("Click on a note to create a new step."));
696+
activity.textMsg(_("Click on a note to create a new step."), 3000);
697697

698698
widgetWindow.onmaximize = () => {
699699
if (widgetWindow._maximized) {

js/widgets/rhythmruler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ class RhythmRuler {
814814
}
815815
}
816816

817-
this.activity.textMsg(_("Click on the ruler to divide it."));
817+
activity.textMsg(_("Click on the ruler to divide it."), 3000);
818818
// this._piemenuRuler(this._rulerSelected);
819819
}
820820

@@ -2251,7 +2251,7 @@ class RhythmRuler {
22512251
}
22522252

22532253
this.activity.blocks.loadNewBlocks(newStack);
2254-
this.activity.textMsg(_("New action block generated."));
2254+
activity.textMsg(_("New action block generated."), 3000);
22552255
}
22562256

22572257
/**
@@ -2469,7 +2469,7 @@ class RhythmRuler {
24692469
}
24702470

24712471
this.activity.blocks.loadNewBlocks(newStack);
2472-
this.activity.textMsg(_("New action block generated."));
2472+
activity.textMsg(_("New action block generated."), 3000);
24732473
if (selectedRuler > this.Rulers.length - 2) {
24742474
return;
24752475
} else {

js/widgets/sampler.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,15 @@ function SampleWidget() {
234234
* @returns {void}
235235
*/
236236
this.displayRecordingStartMessage = function () {
237-
this.activity.textMsg(_("Recording started"));
237+
activity.textMsg(_("Recording started"), 3000);
238238
}
239239

240240
/**
241241
* Displays a message indicating that recording has stopped.
242242
* @returns {void}
243243
*/
244244
this.displayRecordingStopMessage = function () {
245-
this.activity.textMsg(_("Recording complete"));
245+
activity.textMsg(_("Recording complete"), 3000);
246246
}
247247

248248

@@ -280,7 +280,7 @@ function SampleWidget() {
280280
];
281281

282282
that.activity.blocks.loadNewBlocks(newStack);
283-
that.activity.textMsg(_("A new sample block was generated."));
283+
activity.textMsg(_("A new sample block was generated."), 3000);
284284
}, 1000);
285285
};
286286

@@ -500,7 +500,7 @@ function SampleWidget() {
500500

501501
this.setTimbre();
502502

503-
this.activity.textMsg(_("Upload a sample and adjust its pitch center."));
503+
activity.textMsg(_("Upload a sample and adjust its pitch center."), 3000);
504504
this.pause();
505505

506506
widgetWindow.sendToCenter();

0 commit comments

Comments
 (0)