[gnome-sound-recorder] added cancel recording feature
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sound-recorder] added cancel recording feature
- Date: Sun, 14 Jun 2020 17:42:26 +0000 (UTC)
commit 3595bc01d74a72e58c6fd9567e66b02504964843
Author: Kavan Mevada <kavanmevada gmail com>
Date: Sat Jun 6 19:07:01 2020 +0530
added cancel recording feature
data/ui/window.ui | 24 ++++++++++++++++++++++++
src/window.js | 15 ++++++++++++---
2 files changed, 36 insertions(+), 3 deletions(-)
---
diff --git a/data/ui/window.ui b/data/ui/window.ui
index d941842..465c048 100644
--- a/data/ui/window.ui
+++ b/data/ui/window.ui
@@ -287,6 +287,30 @@
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="always_show_image">True</property>
+ <signal name="clicked" handler="onRecorderCancel" swapped="no"/>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon_name">edit-delete-symbolic</property>
+ </object>
+ </child>
+ <style>
+ <class name="pill-button"/>
+ </style>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
diff --git a/src/window.js b/src/window.js
index a5e46dc..2c3b260 100644
--- a/src/window.js
+++ b/src/window.js
@@ -100,14 +100,23 @@ var Window = GObject.registerClass({
this.recorder.start();
}
+ onRecorderCancel() {
+ const recording = this.recorder.stop();
+ recording.delete();
+ this._setMainView();
+ }
+
onRecorderStop() {
const recording = this.recorder.stop();
this._recordingList.insert(0, recording);
+ this._setMainView();
+ }
- this._headerRevealer.reveal_child = true;
- this._playbackStack.visible_child_name = 'recorder-start';
-
+ _setMainView() {
this.waveform.destroy();
+ this._playbackStack.visible_child_name = 'recorder-start';
+ this._mainStack.visible_child_name = 'recordings';
+ this._headerRevealer.reveal_child = true;
}
_refreshView() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]