Commit ce7b9a4e authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

bump gtk-rs

this also glib::get_os_info which requires glib >2.64 closes #10
parent 7ee28771
...@@ -5,10 +5,9 @@ authors = ["Bilal Elmoussaoui <bil.elmoussaoui@gmail.com>"] ...@@ -5,10 +5,9 @@ authors = ["Bilal Elmoussaoui <bil.elmoussaoui@gmail.com>"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
glib = "0.9" glib = { version = "0.10", features = ["v2_64"] }
gdk = "0.12" gdk = "0.13"
gtk = { version = "0.8", features= ["v3_16"] } gtk = { version = "0.9", features= ["v3_16"] }
gio = "0.8" gio = "0.9"
log = "0.4" log = "0.4"
gettext-rs= { version = "0.4", features = ["gettext-system"] } gettext-rs= { version = "0.4", features = ["gettext-system"] }
...@@ -4,12 +4,3 @@ ...@@ -4,12 +4,3 @@
#### Note for distributions:
You can customize the distribution name, version and the displayed icon using the config options
```
-Ddistro_name=Fedora -Ddistro_version=3.32 -Ddistro_icon_name=fedora-logo
```
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
"tags" : [ "tags" : [
"nightly" "nightly"
], ],
"desktop-file-name-suffix" : " (Devel)",
"finish-args" : [ "finish-args" : [
"--share=ipc", "--share=ipc",
"--socket=fallback-x11", "--socket=fallback-x11",
...@@ -23,7 +22,6 @@ ...@@ -23,7 +22,6 @@
"--share=network" "--share=network"
], ],
"env" : { "env" : {
"RUSTFLAGS" : "--remap-path-prefix =../",
"CARGO_HOME" : "/run/build/gnome-tour/cargo", "CARGO_HOME" : "/run/build/gnome-tour/cargo",
"RUST_BACKTRACE" : "1" "RUST_BACKTRACE" : "1"
} }
...@@ -38,7 +36,7 @@ ...@@ -38,7 +36,7 @@
"sources" : [ "sources" : [
{ {
"type" : "git", "type" : "git",
"url" : "https://gitlab.gnome.org/bilelmoussaoui/gnome-tour.git" "url" : "https://gitlab.gnome.org/GNOME/gnome-tour.git"
} }
] ]
} }
......
...@@ -8,7 +8,7 @@ gnome = import('gnome') ...@@ -8,7 +8,7 @@ gnome = import('gnome')
base_id = 'org.gnome.Tour' base_id = 'org.gnome.Tour'
dependency('glib-2.0', version: '>= 2.56') dependency('glib-2.0', version: '>= 2.64')
dependency('gio-2.0', version: '>= 2.56') dependency('gio-2.0', version: '>= 2.56')
dependency('gdk-pixbuf-2.0') dependency('gdk-pixbuf-2.0')
dependency('gtk+-3.0', version: '>= 3.16') dependency('gtk+-3.0', version: '>= 3.16')
......
...@@ -9,23 +9,3 @@ option ( ...@@ -9,23 +9,3 @@ option (
description: 'The build profile for GNOME Tour. One of "default" or "development".' description: 'The build profile for GNOME Tour. One of "default" or "development".'
) )
option (
'distro_name',
type: 'string',
value: 'GNOME',
description: 'Distro name, used for branding.'
)
option (
'distro_icon_name',
type: 'string',
value: 'start-here-symbolic',
description: 'Distro icon name, used for branding.'
)
option (
'distro_version',
type: 'string',
value: '3.36',
description: 'Distro version, used for branding.'
)
...@@ -5,6 +5,3 @@ pub static NAME_SUFFIX: &str = @NAME_SUFFIX@; ...@@ -5,6 +5,3 @@ pub static NAME_SUFFIX: &str = @NAME_SUFFIX@;
pub static VERSION: &str = @VERSION@; pub static VERSION: &str = @VERSION@;
pub static GETTEXT_PACKAGE: &str = @GETTEXT_PACKAGE@; pub static GETTEXT_PACKAGE: &str = @GETTEXT_PACKAGE@;
pub static LOCALEDIR: &str = @LOCALEDIR@; pub static LOCALEDIR: &str = @LOCALEDIR@;
pub static DISTRO_NAME: &str = @DISTRO_NAME@;
pub static DISTRO_VERSION: &str = @DISTRO_VERSION@;
pub static DISTRO_ICON_NAME: &str = @DISTRO_ICON_NAME@;
...@@ -6,9 +6,6 @@ global_conf.set_quoted('NAME_SUFFIX', name_suffix) ...@@ -6,9 +6,6 @@ global_conf.set_quoted('NAME_SUFFIX', name_suffix)
global_conf.set_quoted('VERSION', version + version_suffix) global_conf.set_quoted('VERSION', version + version_suffix)
global_conf.set_quoted('GETTEXT_PACKAGE', gettext_package) global_conf.set_quoted('GETTEXT_PACKAGE', gettext_package)
global_conf.set_quoted('LOCALEDIR', localedir) global_conf.set_quoted('LOCALEDIR', localedir)
global_conf.set_quoted('DISTRO_NAME', get_option('distro_name'))
global_conf.set_quoted('DISTRO_VERSION', get_option('distro_version'))
global_conf.set_quoted('DISTRO_ICON_NAME', get_option('distro_icon_name'))
config = configure_file( config = configure_file(
input: 'config.rs.in', input: 'config.rs.in',
output: 'config.rs', output: 'config.rs',
......
...@@ -10,7 +10,7 @@ pub(crate) fn init() -> Result<(), Error> { ...@@ -10,7 +10,7 @@ pub(crate) fn init() -> Result<(), Error> {
// Create Resource it will live as long the value lives. // Create Resource it will live as long the value lives.
let gbytes = Bytes::from_static(res_bytes.as_ref()); let gbytes = Bytes::from_static(res_bytes.as_ref());
let resource = Resource::new_from_data(&gbytes)?; let resource = Resource::from_data(&gbytes)?;
// Register the resource so it won't be dropped and will continue to live in // Register the resource so it won't be dropped and will continue to live in
// memory. // memory.
......
...@@ -52,7 +52,7 @@ impl ImagePageWidget { ...@@ -52,7 +52,7 @@ impl ImagePageWidget {
container.set_valign(gtk::Align::Center); container.set_valign(gtk::Align::Center);
container.set_property_margin(48); container.set_property_margin(48);
let image = gtk::Image::new_from_resource(&self.resource_uri); let image = gtk::Image::from_resource(&self.resource_uri);
image.set_valign(gtk::Align::Start); image.set_valign(gtk::Align::Start);
container.add(&image); container.add(&image);
......
use crate::config;
use gettextrs::gettext; use gettextrs::gettext;
use gtk::prelude::*; use gtk::prelude::*;
...@@ -22,11 +21,15 @@ impl WelcomePageWidget { ...@@ -22,11 +21,15 @@ impl WelcomePageWidget {
self.widget.set_margin_top(24); self.widget.set_margin_top(24);
self.widget.set_margin_bottom(24); self.widget.set_margin_bottom(24);
let logo = gtk::Image::new_from_icon_name(Some(config::DISTRO_ICON_NAME), gtk::IconSize::Dialog); let name = glib::get_os_info("NAME").unwrap_or("GNOME".into());
let version = glib::get_os_info("VERSION").unwrap_or("3.36".into());
let icon = glib::get_os_info("LOGO").unwrap_or("start-here-symbolic".into());
let logo = gtk::Image::from_icon_name(Some(&icon), gtk::IconSize::Dialog);
logo.set_pixel_size(196); logo.set_pixel_size(196);
self.widget.add(&logo); self.widget.add(&logo);
let title = gtk::Label::new(Some(&gettext(format!("Welcome to {} {}", config::DISTRO_NAME, config::DISTRO_VERSION)))); let title = gtk::Label::new(Some(&gettext(format!("Welcome to {} {}", name, version))));
title.set_margin_top(36); title.set_margin_top(36);
title.get_style_context().add_class("large-title"); title.get_style_context().add_class("large-title");
self.widget.add(&title); self.widget.add(&title);
......
...@@ -50,7 +50,7 @@ impl Window { ...@@ -50,7 +50,7 @@ impl Window {
self.headerbar.set_page_nr(current_page + 1, total_pages); self.headerbar.set_page_nr(current_page + 1, total_pages);
if current_page == total_pages { if current_page == total_pages {
self.widget.destroy(); self.widget.close();
} else { } else {
self.paginator.next(); self.paginator.next();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment