[gnome-sound-recorder] UI signal for recordStart/Stop button



commit dcade7db647db5ffc818c32e48c12938e100ed0e
Author: Kavan Mevada <kavanmevada gmail com>
Date:   Mon Jun 1 19:29:51 2020 +0530

    UI signal for recordStart/Stop button

 data/ui/window.ui | 2 ++
 src/mainWindow.js | 9 +++------
 2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/data/ui/window.ui b/data/ui/window.ui
index eae7907..7238c34 100644
--- a/data/ui/window.ui
+++ b/data/ui/window.ui
@@ -28,6 +28,7 @@
                 <property name="receives_default">False</property>
                 <property name="valign">center</property>
                 <property name="always_show_image">True</property>
+                <signal name="clicked" handler="onRecordStart" swapped="no"/>
                 <child>
                   <object class="GtkBox">
                     <property name="visible">True</property>
@@ -158,6 +159,7 @@
                     <property name="halign">center</property>
                     <property name="valign">end</property>
                     <property name="margin_top">8</property>
+                    <signal name="clicked" handler="onRecordStop" swapped="no"/>
                     <child>
                       <object class="GtkImage">
                         <property name="visible">True</property>
diff --git a/src/mainWindow.js b/src/mainWindow.js
index be39ff0..042fe4c 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -35,7 +35,7 @@ var view = null;
 
 var MainWindow = GObject.registerClass({
     Template: 'resource:///org/gnome/SoundRecorder/ui/window.ui',
-    InternalChildren: ['recordStartButton', 'recordStopButton', 'recordTimeLabel', 'mainStack', 
'recordGrid', 'listBox', 'emptyIcon'],
+    InternalChildren: ['recordTimeLabel', 'mainStack', 'recordGrid', 'listBox', 'emptyIcon'],
 }, class MainWindow extends Handy.ApplicationWindow {
 
     _init(params) {
@@ -84,13 +84,10 @@ var MainWindow = GObject.registerClass({
         });
 
         this._emptyIcon.icon_name = `${pkg.name}-symbolic`;
-
-        this._recordStartButton.connect('clicked', () => this._onRecordStart());
-        this._recordStopButton.connect('clicked', () => this._onRecordStop());
         this.show();
     }
 
-    _onRecordStart() {
+    onRecordStart() {
         this.player.stop();
         this._mainStack.set_visible_child_name('recorderView');
         this._record.startRecording();
@@ -98,7 +95,7 @@ var MainWindow = GObject.registerClass({
         this.wave = new Waveform.WaveForm(this._recordGrid, null);
     }
 
-    _onRecordStop() {
+    onRecordStop() {
         Record.pipeState = Record.PipelineStates.STOPPED;
         this._record.stopRecording();
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]