mirror of
https://github.com/snowfallorg/nix-software-center.git
synced 2024-08-18 01:20:21 +03:00
Add version numbers to installation page
This commit is contained in:
parent
9862e7f9fe
commit
8df50cf670
@ -43,6 +43,7 @@ pub struct PkgModel {
|
|||||||
summary: Option<String>,
|
summary: Option<String>,
|
||||||
description: Option<String>,
|
description: Option<String>,
|
||||||
icon: Option<String>,
|
icon: Option<String>,
|
||||||
|
version: Option<String>,
|
||||||
|
|
||||||
homepage: Option<String>,
|
homepage: Option<String>,
|
||||||
licenses: Vec<License>,
|
licenses: Vec<License>,
|
||||||
@ -126,6 +127,7 @@ pub struct PkgInitModel {
|
|||||||
pub pname: String,
|
pub pname: String,
|
||||||
pub summary: Option<String>,
|
pub summary: Option<String>,
|
||||||
pub description: Option<String>,
|
pub description: Option<String>,
|
||||||
|
pub version: Option<String>,
|
||||||
pub icon: Option<String>,
|
pub icon: Option<String>,
|
||||||
pub screenshots: Vec<String>,
|
pub screenshots: Vec<String>,
|
||||||
pub homepage: Option<String>,
|
pub homepage: Option<String>,
|
||||||
@ -297,6 +299,15 @@ impl Component for PkgModel {
|
|||||||
#[watch]
|
#[watch]
|
||||||
set_label: &model.pkg,
|
set_label: &model.pkg,
|
||||||
},
|
},
|
||||||
|
gtk::Label {
|
||||||
|
add_css_class: "dim-label",
|
||||||
|
set_halign: gtk::Align::Start,
|
||||||
|
set_wrap: true,
|
||||||
|
set_wrap_mode: pango::WrapMode::WordChar,
|
||||||
|
set_natural_wrap_mode: gtk::NaturalWrapMode::Word,
|
||||||
|
#[watch]
|
||||||
|
set_label: &model.version.clone().unwrap_or_else(|| "Unknown".to_string()),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1011,6 +1022,7 @@ impl Component for PkgModel {
|
|||||||
pname: String::default(),
|
pname: String::default(),
|
||||||
summary: None,
|
summary: None,
|
||||||
description: None,
|
description: None,
|
||||||
|
version: None,
|
||||||
icon: None,
|
icon: None,
|
||||||
homepage: None,
|
homepage: None,
|
||||||
licenses: vec![],
|
licenses: vec![],
|
||||||
@ -1127,6 +1139,7 @@ impl Component for PkgModel {
|
|||||||
self.set_pkg(pkgmodel.pkg);
|
self.set_pkg(pkgmodel.pkg);
|
||||||
self.set_name(pkgmodel.name);
|
self.set_name(pkgmodel.name);
|
||||||
self.set_icon(pkgmodel.icon);
|
self.set_icon(pkgmodel.icon);
|
||||||
|
self.set_version(pkgmodel.version);
|
||||||
self.set_platforms(pkgmodel.platforms);
|
self.set_platforms(pkgmodel.platforms);
|
||||||
self.set_maintainers(pkgmodel.maintainers);
|
self.set_maintainers(pkgmodel.maintainers);
|
||||||
self.set_licenses(pkgmodel.licenses);
|
self.set_licenses(pkgmodel.licenses);
|
||||||
|
@ -902,11 +902,12 @@ impl Component for AppModel {
|
|||||||
String,
|
String,
|
||||||
String,
|
String,
|
||||||
String,
|
String,
|
||||||
|
String,
|
||||||
),
|
),
|
||||||
_,
|
_,
|
||||||
> = sqlx::query_as(
|
> = sqlx::query_as(
|
||||||
r#"
|
r#"
|
||||||
SELECT pname, system, description, longdescription, homepage, license, platforms, maintainers
|
SELECT pname, version, system, description, longdescription, homepage, license, platforms, maintainers
|
||||||
FROM pkgs JOIN meta ON (pkgs.attribute = meta.attribute) WHERE pkgs.attribute = $1
|
FROM pkgs JOIN meta ON (pkgs.attribute = meta.attribute) WHERE pkgs.attribute = $1
|
||||||
"#,
|
"#,
|
||||||
)
|
)
|
||||||
@ -916,6 +917,7 @@ FROM pkgs JOIN meta ON (pkgs.attribute = meta.attribute) WHERE pkgs.attribute =
|
|||||||
|
|
||||||
if let Ok((
|
if let Ok((
|
||||||
pname,
|
pname,
|
||||||
|
version,
|
||||||
system,
|
system,
|
||||||
description,
|
description,
|
||||||
longdescription,
|
longdescription,
|
||||||
@ -1154,6 +1156,11 @@ FROM pkgs JOIN meta ON (pkgs.attribute = meta.attribute) WHERE pkgs.attribute =
|
|||||||
|
|
||||||
let out = PkgInitModel {
|
let out = PkgInitModel {
|
||||||
name,
|
name,
|
||||||
|
version: if version.is_empty() {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
Some(version.to_string())
|
||||||
|
},
|
||||||
pname,
|
pname,
|
||||||
summary,
|
summary,
|
||||||
description,
|
description,
|
||||||
|
Loading…
Reference in New Issue
Block a user