diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/config.rs.in | 1 | ||||
-rw-r--r-- | src/main.rs | 4 | ||||
-rw-r--r-- | src/meson.build | 5 | ||||
-rw-r--r-- | src/settings_manager.rs | 2 | ||||
-rw-r--r-- | src/ui/history_box.rs | 8 | ||||
-rw-r--r-- | src/ui/window.rs | 6 |
6 files changed, 19 insertions, 7 deletions
diff --git a/src/config.rs.in b/src/config.rs.in index 4005031..6429916 100644 --- a/src/config.rs.in +++ b/src/config.rs.in @@ -19,3 +19,4 @@ pub static GETTEXT_PACKAGE: &str = @GETTEXT_PACKAGE@; pub static LOCALEDIR: &str = @LOCALEDIR@; pub static PKGDATADIR: &str = @PKGDATADIR@; pub static APP_ID: &str = @APP_ID@; +pub static PROFILE: &str = @PROFILE@; diff --git a/src/main.rs b/src/main.rs index a4959c0..d9b299e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,7 +22,7 @@ mod settings_manager; use self::application::FurtheranceApplication; -use config::{GETTEXT_PACKAGE, LOCALEDIR, PKGDATADIR}; +use config::{GETTEXT_PACKAGE, LOCALEDIR, PKGDATADIR, APP_ID}; use gettextrs::{bind_textdomain_codeset, bindtextdomain, textdomain}; use gtk::{gio, glib}; use gtk::prelude::*; @@ -47,7 +47,7 @@ fn main() { // Create a new GtkApplication. The application manages our main loop, // application windows, integration with the window manager/compositor, and // desktop features such as file opening and single-instance applications. - let app = FurtheranceApplication::new("com.lakoliu.Furtherance", &gio::ApplicationFlags::empty()); + let app = FurtheranceApplication::new(APP_ID, &gio::ApplicationFlags::empty()); glib::set_application_name("Furtherance"); diff --git a/src/meson.build b/src/meson.build index 66df479..c689689 100644 --- a/src/meson.build +++ b/src/meson.build @@ -14,6 +14,7 @@ conf.set_quoted('GETTEXT_PACKAGE', 'furtherance') conf.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir'))) conf.set_quoted('PKGDATADIR', pkgdatadir) conf.set_quoted('APP_ID', app_id) +conf.set_quoted('PROFILE', profile) configure_file( input: 'config.rs.in', @@ -39,13 +40,11 @@ rust_sources = files( 'ui/history_box.rs', 'ui/window.rs', - 'settings_manager.rs', - 'application.rs', 'config.rs', 'main.rs', - 'database.rs', + 'settings_manager.rs', ) sources = [cargo_sources, rust_sources] diff --git a/src/settings_manager.rs b/src/settings_manager.rs index 0343cdc..66c1092 100644 --- a/src/settings_manager.rs +++ b/src/settings_manager.rs @@ -18,7 +18,7 @@ use gtk::{gio, gio::prelude::*, glib}; use crate::config; pub fn get_settings() -> gio::Settings { - let app_id = config::APP_ID; + let app_id = config::APP_ID.trim_end_matches(".Devel"); gio::Settings::new(app_id) } diff --git a/src/ui/history_box.rs b/src/ui/history_box.rs index 4de6dce..459c751 100644 --- a/src/ui/history_box.rs +++ b/src/ui/history_box.rs @@ -22,6 +22,7 @@ use glib::subclass; use crate::ui::FurTasksPage; use crate::FurtheranceApplication; use crate::database; +use crate::config; enum View { Loading, @@ -92,6 +93,13 @@ impl FurHistoryBox { } else { self.set_view(View::Empty); } + + // Change "empty" page icon for development mode + let imp = imp::FurHistoryBox::from_instance(self); + if config::PROFILE == "development" { + imp.welcome_page.set_icon_name(Some("com.lakoliu.Furtherance.Devel")); + } + } fn set_view(&self, view: View) { diff --git a/src/ui/window.rs b/src/ui/window.rs index 3106306..92c8282 100644 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -31,6 +31,7 @@ use crate::ui::FurHistoryBox; use crate::FurtheranceApplication; use crate::database; use crate::settings_manager; +use crate::config; mod imp { use super::*; @@ -155,7 +156,10 @@ impl FurtheranceWindow { let stop_time = Rc::new(RefCell::new(Local::now())); // Development mode - // self.add_css_class("devel"); + if config::PROFILE == "development" { + self.add_css_class("devel"); + } + imp.start_button.connect_clicked(clone!( @weak self as this, |