From eda237f1466ee738befabfa62697a959d6eb04b1 Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Sun, 15 Sep 2024 22:31:29 +0300 Subject: [PATCH] Begin unofficial sources graft --- locales/en_US.json | 4 ++- src/bin/gui/apt_manage_page/mod.rs | 53 ++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/locales/en_US.json b/locales/en_US.json index 367622b..6decdbc 100644 --- a/locales/en_US.json +++ b/locales/en_US.json @@ -87,5 +87,7 @@ "flatpak_ignored_viewport_page_title": "Flatpak Updates Were Failed & Ignored", "apt_manage_page_title": "APT Settings", "system_mirror_label0_label": "System Repository Mirror", - "system_mirror_label1_label": "The Default URI/Mirror Used by the Base PikaOS System APT Repositories\n(Nest, Cockatiel, Canary, Pigeon, Parrot, Raven)" + "system_mirror_label1_label": "The Default URI/Mirror Used by the Base PikaOS System APT Repositories\n(Nest, Cockatiel, Canary, Pigeon, Parrot, Raven)", + "unofficial_sources_label": "Un-Official APT Sources", + "unofficial_sources_label1_label": "Un-Official Custom APT Sources Added by The User or Some User Run Script\nThese Sources May Result in ABI/Dep Hell or Security Risks, and Thus Making a \"package-request\" is Recommended Over These Sources" } \ No newline at end of file diff --git a/src/bin/gui/apt_manage_page/mod.rs b/src/bin/gui/apt_manage_page/mod.rs index 3049741..4827f1f 100644 --- a/src/bin/gui/apt_manage_page/mod.rs +++ b/src/bin/gui/apt_manage_page/mod.rs @@ -41,6 +41,8 @@ pub fn apt_manage_page( .orientation(Orientation::Vertical) .build(); + // + let system_mirror_label0 = gtk::Label::builder() .label(t!("system_mirror_label0_label")) .halign(gtk::Align::Start) @@ -49,6 +51,7 @@ pub fn apt_manage_page( .margin_top(15) .margin_start(15) .margin_end(15) + .margin_bottom(5) .build(); system_mirror_label0.add_css_class("heading"); @@ -71,9 +74,59 @@ pub fn apt_manage_page( .margin_end(15) .build(); + // + + let unofficial_sources_label0 = gtk::Label::builder() + .label(t!("unofficial_sources_label")) + .halign(gtk::Align::Start) + .valign(gtk::Align::Start) + .hexpand(true) + .margin_top(15) + .margin_start(15) + .margin_end(15) + .margin_bottom(5) + .build(); + unofficial_sources_label0.add_css_class("heading"); + + let unofficial_sources_label1 = gtk::Label::builder() + .label(t!("unofficial_sources_label1_label")) + .halign(gtk::Align::Start) + .valign(gtk::Align::Start) + .hexpand(true) + .margin_start(15) + .margin_end(15) + .build(); + + let unofficial_sources_boxedlist = ListBox::builder() + .selection_mode(SelectionMode::None) + .margin_bottom(3) + .margin_top(3) + .margin_end(3) + .margin_start(3) + .build(); + + let unofficial_sources_viewport = ScrolledWindow::builder() + .vexpand(true) + .hexpand(true) + .has_frame(true) + .margin_bottom(15) + .margin_top(15) + .margin_end(15) + .margin_start(15) + .child(&unofficial_sources_boxedlist) + .height_request(390) + .build(); + unofficial_sources_viewport.add_css_class("round-all-scroll"); + + // + main_box.append(&system_mirror_label0); main_box.append(&system_mirror_label1); main_box.append(&system_mirror_entry); + // + main_box.append(&unofficial_sources_label0); + main_box.append(&unofficial_sources_label1); + main_box.append(&unofficial_sources_viewport); main_box } \ No newline at end of file