[gnome-break-timer] Organize settings into namespaces
- From: Dylan McCall <dylanmccall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-break-timer] Organize settings into namespaces
- Date: Sun, 15 Nov 2020 05:42:11 +0000 (UTC)
commit 71749cbbfaa991ffea003d1bdcfddee02c6f40cf
Author: Dylan McCall <dylan dylanmccall ca>
Date: Sat Nov 14 21:25:02 2020 -0800
Organize settings into namespaces
src/settings/BreakManager.vala | 3 ++
src/settings/BreakSettingsDialog.vala | 21 ++++++-----
src/settings/MainWindow.vala | 17 +++++----
.../BreakInfoWidget.vala} | 6 +--
.../BreakSettingsWidget.vala} | 6 +--
.../BreakStatusWidget.vala} | 6 +--
src/settings/{ => break}/BreakType.vala | 20 +++++-----
src/settings/meson.build | 44 +++++++++++-----------
.../MicroBreakInfoWidget.vala} | 7 ++--
.../MicroBreakSettingsWidget.vala} | 8 ++--
.../MicroBreakStatusWidget.vala} | 8 ++--
src/settings/{ => microbreak}/MicroBreakType.vala | 17 +++++----
src/settings/{ => panels}/StatusPanel.vala | 20 +++++-----
src/settings/{ => panels}/WelcomePanel.vala | 4 +-
.../RestBreakInfoWidget.vala} | 7 ++--
.../RestBreakSettingsWidget.vala} | 8 ++--
.../RestBreakStatusWidget.vala} | 8 ++--
src/settings/{ => restbreak}/RestBreakType.vala | 17 +++++----
.../TimerBreakSettingsWidget.vala} | 9 +++--
.../TimerBreakStatusWidget.vala} | 9 +++--
src/settings/{ => timerbreak}/TimerBreakType.vala | 4 +-
.../{ => widgets}/BreakConfigurationChooser.vala | 2 +-
src/settings/{ => widgets}/CircleCounter.vala | 2 +-
src/settings/{ => widgets}/FixedSizeGrid.vala | 2 +-
src/settings/{ => widgets}/OverlayArrow.vala | 2 +-
src/settings/{ => widgets}/TimeChooser.vala | 2 +-
26 files changed, 148 insertions(+), 111 deletions(-)
---
diff --git a/src/settings/BreakManager.vala b/src/settings/BreakManager.vala
index d23da35..f292987 100644
--- a/src/settings/BreakManager.vala
+++ b/src/settings/BreakManager.vala
@@ -19,6 +19,9 @@
// application. Ideally, it should be common code in the future.
using BreakTimer.Common;
+using BreakTimer.Settings.Break;
+using BreakTimer.Settings.MicroBreak;
+using BreakTimer.Settings.RestBreak;
namespace BreakTimer.Settings {
diff --git a/src/settings/BreakSettingsDialog.vala b/src/settings/BreakSettingsDialog.vala
index 0c165d2..91ab2ce 100644
--- a/src/settings/BreakSettingsDialog.vala
+++ b/src/settings/BreakSettingsDialog.vala
@@ -15,6 +15,9 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
+using BreakTimer.Settings.Break;
+using BreakTimer.Settings.Widgets;
+
namespace BreakTimer.Settings {
public class BreakSettingsDialog : Gtk.Dialog {
@@ -79,21 +82,21 @@ public class BreakSettingsDialog : Gtk.Dialog {
private void update_break_configuration () {
foreach (BreakType break_type in this.break_manager.all_breaks ()) {
if (break_type.id in this.configuration_chooser.selected_break_ids) {
- break_type.settings_panel.show ();
+ break_type.settings_widget.show ();
} else {
- break_type.settings_panel.hide ();
+ break_type.settings_widget.hide ();
}
}
}
private void break_added_cb (BreakType break_type) {
- var settings_panel = break_type.settings_panel;
- breaks_grid.add (settings_panel);
- settings_panel.realize ();
- settings_panel.set_valign (Gtk.Align.CENTER);
- settings_panel.set_vexpand (true);
- settings_panel.set_margin_top (10);
- settings_panel.set_margin_bottom (10);
+ var settings_widget = break_type.settings_widget;
+ breaks_grid.add (settings_widget);
+ settings_widget.realize ();
+ settings_widget.set_valign (Gtk.Align.CENTER);
+ settings_widget.set_vexpand (true);
+ settings_widget.set_margin_top (10);
+ settings_widget.set_margin_bottom (10);
this.update_break_configuration ();
}
diff --git a/src/settings/MainWindow.vala b/src/settings/MainWindow.vala
index e5fd37f..ebd1b14 100644
--- a/src/settings/MainWindow.vala
+++ b/src/settings/MainWindow.vala
@@ -15,6 +15,9 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
+using BreakTimer.Settings.Break;
+using BreakTimer.Settings.Panels;
+
namespace BreakTimer.Settings {
public class MainWindow : Gtk.ApplicationWindow {
@@ -123,12 +126,12 @@ public class MainWindow : Gtk.ApplicationWindow {
}
private void break_added_cb (BreakType break_type) {
- var info_panel = break_type.info_panel;
- this.main_stack.add_named (info_panel, break_type.id);
- info_panel.set_margin_start (20);
- info_panel.set_margin_end (20);
- info_panel.set_halign (Gtk.Align.CENTER);
- info_panel.set_valign (Gtk.Align.CENTER);
+ var info_widget = break_type.info_widget;
+ this.main_stack.add_named (info_widget, break_type.id);
+ info_widget.set_margin_start (20);
+ info_widget.set_margin_end (20);
+ info_widget.set_halign (Gtk.Align.CENTER);
+ info_widget.set_valign (Gtk.Align.CENTER);
}
private void update_visible_panel () {
@@ -146,7 +149,7 @@ public class MainWindow : Gtk.ApplicationWindow {
this.header.set_title ( _("Welcome Tour"));
} else if (foreground_break != null) {
this.main_stack.set_visible_child_full (foreground_break.id, transition);
- this.header.set_title (foreground_break.info_panel.title);
+ this.header.set_title (foreground_break.info_widget.title);
} else {
this.main_stack.set_visible_child_full ("status_panel", transition);
this.header.set_title ( _("Break Timer"));
diff --git a/src/settings/BreakInfoPanel.vala b/src/settings/break/BreakInfoWidget.vala
similarity index 93%
rename from src/settings/BreakInfoPanel.vala
rename to src/settings/break/BreakInfoWidget.vala
index 0afe67b..44047f7 100644
--- a/src/settings/BreakInfoPanel.vala
+++ b/src/settings/break/BreakInfoWidget.vala
@@ -15,9 +15,9 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+namespace BreakTimer.Settings.Break {
-public abstract class BreakInfoPanel : Gtk.Grid {
+public abstract class BreakInfoWidget : Gtk.Grid {
public BreakType break_type { public get; private set; }
public string title { public get; private set; }
@@ -25,7 +25,7 @@ public abstract class BreakInfoPanel : Gtk.Grid {
private Gtk.Label description_label;
private Gtk.Label detail_label;
- protected BreakInfoPanel (BreakType break_type, string title) {
+ protected BreakInfoWidget (BreakType break_type, string title) {
GLib.Object ();
this.break_type = break_type;
diff --git a/src/settings/BreakSettingsPanel.vala b/src/settings/break/BreakSettingsWidget.vala
similarity index 93%
rename from src/settings/BreakSettingsPanel.vala
rename to src/settings/break/BreakSettingsWidget.vala
index aa8faa0..0000eda 100644
--- a/src/settings/BreakSettingsPanel.vala
+++ b/src/settings/break/BreakSettingsWidget.vala
@@ -15,13 +15,13 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+namespace BreakTimer.Settings.Break {
-public abstract class BreakSettingsPanel : Gtk.Grid {
+public abstract class BreakSettingsWidget : Gtk.Grid {
private Gtk.Grid header;
private Gtk.Grid details;
- protected BreakSettingsPanel (BreakType break_type, string title, string? description) {
+ protected BreakSettingsWidget (BreakType break_type, string title, string? description) {
GLib.Object ();
this.set_orientation (Gtk.Orientation.VERTICAL);
diff --git a/src/settings/BreakStatusPanel.vala b/src/settings/break/BreakStatusWidget.vala
similarity index 86%
rename from src/settings/BreakStatusPanel.vala
rename to src/settings/break/BreakStatusWidget.vala
index 3ec29d6..b9df81f 100644
--- a/src/settings/BreakStatusPanel.vala
+++ b/src/settings/break/BreakStatusWidget.vala
@@ -15,13 +15,13 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+namespace BreakTimer.Settings.Break {
-public abstract class BreakStatusPanel : Gtk.Grid {
+public abstract class BreakStatusWidget : Gtk.Grid {
public BreakType break_type { public get; private set; }
public bool is_enabled { get; set; default=false; }
- protected BreakStatusPanel (BreakType break_type) {
+ protected BreakStatusWidget (BreakType break_type) {
GLib.Object ();
this.break_type = break_type;
diff --git a/src/settings/BreakType.vala b/src/settings/break/BreakType.vala
similarity index 70%
rename from src/settings/BreakType.vala
rename to src/settings/break/BreakType.vala
index 65d4228..43fd04f 100644
--- a/src/settings/BreakType.vala
+++ b/src/settings/break/BreakType.vala
@@ -17,15 +17,15 @@
using BreakTimer.Common;
-namespace BreakTimer.Settings {
+namespace BreakTimer.Settings.Break {
public abstract class BreakType : GLib.Object {
public string id { get; private set; }
public BreakStatus? status;
- public BreakInfoPanel info_panel;
- public BreakStatusPanel status_panel;
- public BreakSettingsPanel settings_panel;
+ public BreakInfoWidget info_widget;
+ public BreakStatusWidget status_widget;
+ public BreakSettingsWidget settings_widget;
public GLib.Settings settings;
@@ -37,9 +37,9 @@ public abstract class BreakType : GLib.Object {
public signal void status_changed (BreakStatus? status);
public virtual void initialize () {
- this.info_panel = this.get_info_panel ();
- this.status_panel = this.get_status_panel ();
- this.settings_panel = this.get_settings_panel ();
+ this.info_widget = this.get_info_widget ();
+ this.status_widget = this.get_status_widget ();
+ this.settings_widget = this.get_settings_widget ();
}
protected void update_status (BreakStatus? status) {
@@ -47,9 +47,9 @@ public abstract class BreakType : GLib.Object {
this.status_changed (status);
}
- protected abstract BreakInfoPanel get_info_panel ();
- protected abstract BreakStatusPanel get_status_panel ();
- protected abstract BreakSettingsPanel get_settings_panel ();
+ protected abstract BreakInfoWidget get_info_widget ();
+ protected abstract BreakStatusWidget get_status_widget ();
+ protected abstract BreakSettingsWidget get_settings_widget ();
}
}
diff --git a/src/settings/meson.build b/src/settings/meson.build
index c844c07..7808c12 100644
--- a/src/settings/meson.build
+++ b/src/settings/meson.build
@@ -4,30 +4,30 @@
settings_sources = files(
'Application.vala',
- 'BreakConfigurationChooser.vala',
- 'BreakInfoPanel.vala',
+ 'break/BreakInfoWidget.vala',
+ 'break/BreakSettingsWidget.vala',
+ 'break/BreakStatusWidget.vala',
+ 'break/BreakType.vala',
'BreakManager.vala',
'BreakSettingsDialog.vala',
- 'BreakSettingsPanel.vala',
- 'BreakStatusPanel.vala',
- 'BreakType.vala',
- 'CircleCounter.vala',
- 'FixedSizeGrid.vala',
'main.vala',
'MainWindow.vala',
- 'MicroBreakInfoPanel.vala',
- 'MicroBreakSettingsPanel.vala',
- 'MicroBreakStatusPanel.vala',
- 'MicroBreakType.vala',
- 'OverlayArrow.vala',
- 'RestBreakInfoPanel.vala',
- 'RestBreakSettingsPanel.vala',
- 'RestBreakStatusPanel.vala',
- 'RestBreakType.vala',
- 'StatusPanel.vala',
- 'TimeChooser.vala',
- 'TimerBreakSettingsPanel.vala',
- 'TimerBreakStatusPanel.vala',
- 'TimerBreakType.vala',
- 'WelcomePanel.vala'
+ 'microbreak/MicroBreakInfoWidget.vala',
+ 'microbreak/MicroBreakSettingsWidget.vala',
+ 'microbreak/MicroBreakStatusWidget.vala',
+ 'microbreak/MicroBreakType.vala',
+ 'panels/StatusPanel.vala',
+ 'panels/WelcomePanel.vala',
+ 'restbreak/RestBreakInfoWidget.vala',
+ 'restbreak/RestBreakSettingsWidget.vala',
+ 'restbreak/RestBreakStatusWidget.vala',
+ 'restbreak/RestBreakType.vala',
+ 'timerbreak/TimerBreakSettingsWidget.vala',
+ 'timerbreak/TimerBreakStatusWidget.vala',
+ 'timerbreak/TimerBreakType.vala',
+ 'widgets/BreakConfigurationChooser.vala',
+ 'widgets/CircleCounter.vala',
+ 'widgets/FixedSizeGrid.vala',
+ 'widgets/OverlayArrow.vala',
+ 'widgets/TimeChooser.vala'
)
diff --git a/src/settings/MicroBreakInfoPanel.vala b/src/settings/microbreak/MicroBreakInfoWidget.vala
similarity index 91%
rename from src/settings/MicroBreakInfoPanel.vala
rename to src/settings/microbreak/MicroBreakInfoWidget.vala
index ff7054f..567ca0f 100644
--- a/src/settings/MicroBreakInfoPanel.vala
+++ b/src/settings/microbreak/MicroBreakInfoWidget.vala
@@ -16,13 +16,14 @@
*/
using BreakTimer.Common;
+using BreakTimer.Settings.Break;
-namespace BreakTimer.Settings {
+namespace BreakTimer.Settings.MicroBreak {
-class MicroBreakInfoPanel : BreakInfoPanel {
+class MicroBreakInfoWidget : BreakInfoWidget {
private TimerBreakStatus? status;
- public MicroBreakInfoPanel (MicroBreakType break_type) {
+ public MicroBreakInfoWidget (MicroBreakType break_type) {
base (
break_type,
_("Microbreak")
diff --git a/src/settings/MicroBreakSettingsPanel.vala b/src/settings/microbreak/MicroBreakSettingsWidget.vala
similarity index 80%
rename from src/settings/MicroBreakSettingsPanel.vala
rename to src/settings/microbreak/MicroBreakSettingsWidget.vala
index c8a986f..2e52ed5 100644
--- a/src/settings/MicroBreakSettingsPanel.vala
+++ b/src/settings/microbreak/MicroBreakSettingsWidget.vala
@@ -15,10 +15,12 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+using BreakTimer.Settings.TimerBreak;
-class MicroBreakSettingsPanel : TimerBreakSettingsPanel {
- public MicroBreakSettingsPanel (MicroBreakType break_type) {
+namespace BreakTimer.Settings.MicroBreak {
+
+class MicroBreakSettingsWidget : TimerBreakSettingsWidget {
+ public MicroBreakSettingsWidget (MicroBreakType break_type) {
base (
break_type,
_("Microbreak"),
diff --git a/src/settings/MicroBreakStatusPanel.vala b/src/settings/microbreak/MicroBreakStatusWidget.vala
similarity index 82%
rename from src/settings/MicroBreakStatusPanel.vala
rename to src/settings/microbreak/MicroBreakStatusWidget.vala
index d64902d..e482122 100644
--- a/src/settings/MicroBreakStatusPanel.vala
+++ b/src/settings/microbreak/MicroBreakStatusWidget.vala
@@ -15,10 +15,12 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+using BreakTimer.Settings.TimerBreak;
-class MicroBreakStatusPanel : TimerBreakStatusPanel {
- public MicroBreakStatusPanel (MicroBreakType break_type) {
+namespace BreakTimer.Settings.MicroBreak {
+
+class MicroBreakStatusWidget : TimerBreakStatusWidget {
+ public MicroBreakStatusWidget (MicroBreakType break_type) {
base (
break_type,
/* Label that explains a countdown timer, which shows a string such as "5 minutes" */
diff --git a/src/settings/MicroBreakType.vala b/src/settings/microbreak/MicroBreakType.vala
similarity index 70%
rename from src/settings/MicroBreakType.vala
rename to src/settings/microbreak/MicroBreakType.vala
index ffb8b5f..412b992 100644
--- a/src/settings/MicroBreakType.vala
+++ b/src/settings/microbreak/MicroBreakType.vala
@@ -15,7 +15,10 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+using BreakTimer.Settings.Break;
+using BreakTimer.Settings.TimerBreak;
+
+namespace BreakTimer.Settings.MicroBreak {
public class MicroBreakType : TimerBreakType {
public MicroBreakType () {
@@ -26,16 +29,16 @@ public class MicroBreakType : TimerBreakType {
this.duration_options = { 15, 30, 45, 60 };
}
- protected override BreakInfoPanel get_info_panel () {
- return new MicroBreakInfoPanel (this);
+ protected override BreakInfoWidget get_info_widget () {
+ return new MicroBreakInfoWidget (this);
}
- protected override BreakStatusPanel get_status_panel () {
- return new MicroBreakStatusPanel (this);
+ protected override BreakStatusWidget get_status_widget () {
+ return new MicroBreakStatusWidget (this);
}
- protected override BreakSettingsPanel get_settings_panel () {
- return new MicroBreakSettingsPanel (this);
+ protected override BreakSettingsWidget get_settings_widget () {
+ return new MicroBreakSettingsWidget (this);
}
}
diff --git a/src/settings/StatusPanel.vala b/src/settings/panels/StatusPanel.vala
similarity index 86%
rename from src/settings/StatusPanel.vala
rename to src/settings/panels/StatusPanel.vala
index d1213f8..3a351b7 100644
--- a/src/settings/StatusPanel.vala
+++ b/src/settings/panels/StatusPanel.vala
@@ -15,7 +15,9 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+using BreakTimer.Settings.Break;
+
+namespace BreakTimer.Settings.Panels {
private class StatusPanel : Gtk.Stack {
private BreakManager break_manager;
@@ -59,12 +61,12 @@ private class StatusPanel : Gtk.Stack {
}
private void break_added_cb (BreakType break_type) {
- var status_panel = break_type.status_panel;
- this.breaks_list.add (status_panel);
- status_panel.set_margin_top (18);
- status_panel.set_margin_end (20);
- status_panel.set_margin_bottom (18);
- status_panel.set_margin_start (20);
+ var status_widget = break_type.status_widget;
+ this.breaks_list.add (status_widget);
+ status_widget.set_margin_top (18);
+ status_widget.set_margin_end (20);
+ status_widget.set_margin_bottom (18);
+ status_widget.set_margin_start (20);
}
private void status_changed_cb () {
@@ -75,10 +77,10 @@ private class StatusPanel : Gtk.Stack {
var status = break_type.status;
if (status != null) {
if (status.is_enabled) {
- break_type.status_panel.show ();
+ break_type.status_widget.show ();
any_breaks_enabled = true;
} else {
- break_type.status_panel.hide ();
+ break_type.status_widget.hide ();
}
}
}
diff --git a/src/settings/WelcomePanel.vala b/src/settings/panels/WelcomePanel.vala
similarity index 98%
rename from src/settings/WelcomePanel.vala
rename to src/settings/panels/WelcomePanel.vala
index 7d16e8e..b9de5c8 100644
--- a/src/settings/WelcomePanel.vala
+++ b/src/settings/panels/WelcomePanel.vala
@@ -15,7 +15,9 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+using BreakTimer.Settings.Widgets;
+
+namespace BreakTimer.Settings.Panels {
/* TODO: It would be nice to move some of this code to a UI file built with
* Glade. Especially anything involving long strings. */
diff --git a/src/settings/RestBreakInfoPanel.vala b/src/settings/restbreak/RestBreakInfoWidget.vala
similarity index 91%
rename from src/settings/RestBreakInfoPanel.vala
rename to src/settings/restbreak/RestBreakInfoWidget.vala
index a6f83f9..b545b3d 100644
--- a/src/settings/RestBreakInfoPanel.vala
+++ b/src/settings/restbreak/RestBreakInfoWidget.vala
@@ -16,13 +16,14 @@
*/
using BreakTimer.Common;
+using BreakTimer.Settings.Break;
-namespace BreakTimer.Settings {
+namespace BreakTimer.Settings.RestBreak {
-class RestBreakInfoPanel : BreakInfoPanel {
+class RestBreakInfoWidget : BreakInfoWidget {
private TimerBreakStatus? status;
- public RestBreakInfoPanel (RestBreakType break_type) {
+ public RestBreakInfoWidget (RestBreakType break_type) {
base (
break_type,
_("Break")
diff --git a/src/settings/RestBreakSettingsPanel.vala b/src/settings/restbreak/RestBreakSettingsWidget.vala
similarity index 81%
rename from src/settings/RestBreakSettingsPanel.vala
rename to src/settings/restbreak/RestBreakSettingsWidget.vala
index d3ed03e..4651d78 100644
--- a/src/settings/RestBreakSettingsPanel.vala
+++ b/src/settings/restbreak/RestBreakSettingsWidget.vala
@@ -15,10 +15,12 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+using BreakTimer.Settings.TimerBreak;
-class RestBreakSettingsPanel : TimerBreakSettingsPanel {
- public RestBreakSettingsPanel (RestBreakType break_type) {
+namespace BreakTimer.Settings.RestBreak {
+
+class RestBreakSettingsWidget : TimerBreakSettingsWidget {
+ public RestBreakSettingsWidget (RestBreakType break_type) {
base (
break_type,
_("Full break"),
diff --git a/src/settings/RestBreakStatusPanel.vala b/src/settings/restbreak/RestBreakStatusWidget.vala
similarity index 82%
rename from src/settings/RestBreakStatusPanel.vala
rename to src/settings/restbreak/RestBreakStatusWidget.vala
index e6777c8..69fb833 100644
--- a/src/settings/RestBreakStatusPanel.vala
+++ b/src/settings/restbreak/RestBreakStatusWidget.vala
@@ -15,10 +15,12 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+using BreakTimer.Settings.TimerBreak;
-class RestBreakStatusPanel : TimerBreakStatusPanel {
- public RestBreakStatusPanel (RestBreakType break_type) {
+namespace BreakTimer.Settings.RestBreak {
+
+class RestBreakStatusWidget : TimerBreakStatusWidget {
+ public RestBreakStatusWidget (RestBreakType break_type) {
base (
break_type,
/* Label that explains a countdown timer, which shows a string such as "30 minutes" */
diff --git a/src/settings/RestBreakType.vala b/src/settings/restbreak/RestBreakType.vala
similarity index 70%
rename from src/settings/RestBreakType.vala
rename to src/settings/restbreak/RestBreakType.vala
index 0c569ee..83f5f8f 100644
--- a/src/settings/RestBreakType.vala
+++ b/src/settings/restbreak/RestBreakType.vala
@@ -15,7 +15,10 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+using BreakTimer.Settings.Break;
+using BreakTimer.Settings.TimerBreak;
+
+namespace BreakTimer.Settings.RestBreak {
public class RestBreakType : TimerBreakType {
public RestBreakType () {
@@ -26,16 +29,16 @@ public class RestBreakType : TimerBreakType {
this.duration_options = { 240, 300, 360, 480, 600 };
}
- protected override BreakInfoPanel get_info_panel () {
- return new RestBreakInfoPanel (this);
+ protected override BreakInfoWidget get_info_widget () {
+ return new RestBreakInfoWidget (this);
}
- protected override BreakStatusPanel get_status_panel () {
- return new RestBreakStatusPanel (this);
+ protected override BreakStatusWidget get_status_widget () {
+ return new RestBreakStatusWidget (this);
}
- protected override BreakSettingsPanel get_settings_panel () {
- return new RestBreakSettingsPanel (this);
+ protected override BreakSettingsWidget get_settings_widget () {
+ return new RestBreakSettingsWidget (this);
}
}
diff --git a/src/settings/TimerBreakSettingsPanel.vala b/src/settings/timerbreak/TimerBreakSettingsWidget.vala
similarity index 88%
rename from src/settings/TimerBreakSettingsPanel.vala
rename to src/settings/timerbreak/TimerBreakSettingsWidget.vala
index 0328305..b7bf00b 100644
--- a/src/settings/TimerBreakSettingsPanel.vala
+++ b/src/settings/timerbreak/TimerBreakSettingsWidget.vala
@@ -15,10 +15,13 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+using BreakTimer.Settings.Break;
+using BreakTimer.Settings.Widgets;
-public abstract class TimerBreakSettingsPanel : BreakSettingsPanel {
- protected TimerBreakSettingsPanel (TimerBreakType break_type, string title, string? description) {
+namespace BreakTimer.Settings.TimerBreak {
+
+public abstract class TimerBreakSettingsWidget : BreakSettingsWidget {
+ protected TimerBreakSettingsWidget (TimerBreakType break_type, string title, string? description) {
base (break_type, title, description);
var details_grid = new Gtk.Grid ();
diff --git a/src/settings/TimerBreakStatusPanel.vala b/src/settings/timerbreak/TimerBreakStatusWidget.vala
similarity index 91%
rename from src/settings/TimerBreakStatusPanel.vala
rename to src/settings/timerbreak/TimerBreakStatusWidget.vala
index d4ffc05..215e6c3 100644
--- a/src/settings/TimerBreakStatusPanel.vala
+++ b/src/settings/timerbreak/TimerBreakStatusWidget.vala
@@ -16,10 +16,12 @@
*/
using BreakTimer.Common;
+using BreakTimer.Settings.Break;
+using BreakTimer.Settings.Widgets;
-namespace BreakTimer.Settings {
+namespace BreakTimer.Settings.TimerBreak {
-public abstract class TimerBreakStatusPanel : BreakStatusPanel {
+public abstract class TimerBreakStatusWidget : BreakStatusWidget {
private string upcoming_text;
private string ongoing_text;
@@ -27,8 +29,9 @@ public abstract class TimerBreakStatusPanel : BreakStatusPanel {
private Gtk.Label status_label;
private Gtk.Label time_label;
- protected TimerBreakStatusPanel (TimerBreakType break_type, string upcoming_text, string ongoing_text) {
+ protected TimerBreakStatusWidget (TimerBreakType break_type, string upcoming_text, string ongoing_text) {
base (break_type);
+
this.upcoming_text = upcoming_text;
this.ongoing_text = ongoing_text;
diff --git a/src/settings/TimerBreakType.vala b/src/settings/timerbreak/TimerBreakType.vala
similarity index 98%
rename from src/settings/TimerBreakType.vala
rename to src/settings/timerbreak/TimerBreakType.vala
index 07e4caa..96fcd42 100644
--- a/src/settings/TimerBreakType.vala
+++ b/src/settings/timerbreak/TimerBreakType.vala
@@ -16,8 +16,9 @@
*/
using BreakTimer.Common;
+using BreakTimer.Settings.Break;
-namespace BreakTimer.Settings {
+namespace BreakTimer.Settings.TimerBreak {
public abstract class TimerBreakType : BreakType {
public int interval { get; protected set; }
@@ -38,6 +39,7 @@ public abstract class TimerBreakType : BreakType {
public override void initialize () {
base.initialize ();
+
GLib.Bus.watch_name (
GLib.BusType.SESSION,
Config.DAEMON_APPLICATION_ID,
diff --git a/src/settings/BreakConfigurationChooser.vala b/src/settings/widgets/BreakConfigurationChooser.vala
similarity index 98%
rename from src/settings/BreakConfigurationChooser.vala
rename to src/settings/widgets/BreakConfigurationChooser.vala
index 1f0478b..42477d2 100644
--- a/src/settings/BreakConfigurationChooser.vala
+++ b/src/settings/widgets/BreakConfigurationChooser.vala
@@ -15,7 +15,7 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+namespace BreakTimer.Settings.Widgets {
class BreakConfigurationChooser : Gtk.ComboBox {
public class Configuration : GLib.Object {
diff --git a/src/settings/CircleCounter.vala b/src/settings/widgets/CircleCounter.vala
similarity index 99%
rename from src/settings/CircleCounter.vala
rename to src/settings/widgets/CircleCounter.vala
index 2bf0f5b..116a72f 100644
--- a/src/settings/CircleCounter.vala
+++ b/src/settings/widgets/CircleCounter.vala
@@ -15,7 +15,7 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+namespace BreakTimer.Settings.Widgets {
/**
* Displays a countdown using a circle, reminiscent of a countdown timer.
diff --git a/src/settings/FixedSizeGrid.vala b/src/settings/widgets/FixedSizeGrid.vala
similarity index 98%
rename from src/settings/FixedSizeGrid.vala
rename to src/settings/widgets/FixedSizeGrid.vala
index 1fcb195..b77e8dd 100644
--- a/src/settings/FixedSizeGrid.vala
+++ b/src/settings/widgets/FixedSizeGrid.vala
@@ -15,7 +15,7 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+namespace BreakTimer.Settings.Widgets {
class FixedSizeGrid : Gtk.Grid {
public override void adjust_size_request (Gtk.Orientation orientation, ref int minimum_size, ref int
natural_size) {
diff --git a/src/settings/OverlayArrow.vala b/src/settings/widgets/OverlayArrow.vala
similarity index 99%
rename from src/settings/OverlayArrow.vala
rename to src/settings/widgets/OverlayArrow.vala
index 332f509..6402c94 100644
--- a/src/settings/OverlayArrow.vala
+++ b/src/settings/widgets/OverlayArrow.vala
@@ -15,7 +15,7 @@
* along with GNOME Break Timer. If not, see <http://www.gnu.org/licenses/>.
*/
-namespace BreakTimer.Settings {
+namespace BreakTimer.Settings.Widgets {
/* FIXME: This widget is stealing clicks when it is used in an overlay */
public class OverlayArrow : Gtk.Widget {
diff --git a/src/settings/TimeChooser.vala b/src/settings/widgets/TimeChooser.vala
similarity index 98%
rename from src/settings/TimeChooser.vala
rename to src/settings/widgets/TimeChooser.vala
index 641bdf0..ff05a07 100644
--- a/src/settings/TimeChooser.vala
+++ b/src/settings/widgets/TimeChooser.vala
@@ -17,7 +17,7 @@
using BreakTimer.Common;
-namespace BreakTimer.Settings {
+namespace BreakTimer.Settings.Widgets {
public class TimeChooser : Gtk.ComboBox {
private Gtk.ListStore list_store;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]