Commit 58207cfc authored by Sophie Herold's avatar Sophie Herold

Move back to overview based navigation

Closes #53
parent e6361ec1
Pipeline #221919 passed with stage
in 8 minutes and 21 seconds
......@@ -645,9 +645,9 @@ dependencies = [
[[package]]
name = "glib"
version = "0.10.2"
version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f11a45bde4cf9567653a14ff96cdbb01e6d2a89651746dbc118319dfdac433e"
checksum = "0c685013b7515e668f1b57a165b009d4d28cb139a8a989bbd699c10dad29d0c5"
dependencies = [
"bitflags",
"futures-channel",
......@@ -1374,9 +1374,9 @@ dependencies = [
[[package]]
name = "regex"
version = "1.4.0"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36f45b719a674bf4b828ff318906d6c133264c793eff7a41e30074a45b5099e2"
checksum = "8963b85b8ce3074fecffde43b4b0dded83ce2f367dc8d363afc56679f3ee820b"
dependencies = [
"aho-corasick",
"memchr",
......@@ -1386,9 +1386,9 @@ dependencies = [
[[package]]
name = "regex-syntax"
version = "0.6.19"
version = "0.6.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c17be88d9eaa858870aa5e48cc406c206e4600e983fc4f06bbe5750d93d09761"
checksum = "8cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c"
[[package]]
name = "ryu"
......@@ -1423,15 +1423,15 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.116"
version = "1.0.117"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5"
checksum = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a"
[[package]]
name = "serde_derive"
version = "1.0.116"
version = "1.0.117"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8"
checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e"
dependencies = [
"proc-macro2",
"quote",
......
......@@ -833,15 +833,15 @@
},
{
"type": "file",
"url": "https://static.crates.io/crates/glib/glib-0.10.2.crate",
"sha256": "5f11a45bde4cf9567653a14ff96cdbb01e6d2a89651746dbc118319dfdac433e",
"url": "https://static.crates.io/crates/glib/glib-0.10.3.crate",
"sha256": "0c685013b7515e668f1b57a165b009d4d28cb139a8a989bbd699c10dad29d0c5",
"dest": "cargo/vendor",
"dest-filename": "glib-0.10.2.crate"
"dest-filename": "glib-0.10.3.crate"
},
{
"type": "file",
"url": "data:%7B%22package%22%3A%20%225f11a45bde4cf9567653a14ff96cdbb01e6d2a89651746dbc118319dfdac433e%22%2C%20%22files%22%3A%20%7B%7D%7D",
"dest": "cargo/vendor/glib-0.10.2",
"url": "data:%7B%22package%22%3A%20%220c685013b7515e668f1b57a165b009d4d28cb139a8a989bbd699c10dad29d0c5%22%2C%20%22files%22%3A%20%7B%7D%7D",
"dest": "cargo/vendor/glib-0.10.3",
"dest-filename": ".cargo-checksum.json"
},
{
......@@ -1704,28 +1704,28 @@
},
{
"type": "file",
"url": "https://static.crates.io/crates/regex/regex-1.4.0.crate",
"sha256": "36f45b719a674bf4b828ff318906d6c133264c793eff7a41e30074a45b5099e2",
"url": "https://static.crates.io/crates/regex/regex-1.4.1.crate",
"sha256": "8963b85b8ce3074fecffde43b4b0dded83ce2f367dc8d363afc56679f3ee820b",
"dest": "cargo/vendor",
"dest-filename": "regex-1.4.0.crate"
"dest-filename": "regex-1.4.1.crate"
},
{
"type": "file",
"url": "data:%7B%22package%22%3A%20%2236f45b719a674bf4b828ff318906d6c133264c793eff7a41e30074a45b5099e2%22%2C%20%22files%22%3A%20%7B%7D%7D",
"dest": "cargo/vendor/regex-1.4.0",
"url": "data:%7B%22package%22%3A%20%228963b85b8ce3074fecffde43b4b0dded83ce2f367dc8d363afc56679f3ee820b%22%2C%20%22files%22%3A%20%7B%7D%7D",
"dest": "cargo/vendor/regex-1.4.1",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "file",
"url": "https://static.crates.io/crates/regex-syntax/regex-syntax-0.6.19.crate",
"sha256": "c17be88d9eaa858870aa5e48cc406c206e4600e983fc4f06bbe5750d93d09761",
"url": "https://static.crates.io/crates/regex-syntax/regex-syntax-0.6.20.crate",
"sha256": "8cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c",
"dest": "cargo/vendor",
"dest-filename": "regex-syntax-0.6.19.crate"
"dest-filename": "regex-syntax-0.6.20.crate"
},
{
"type": "file",
"url": "data:%7B%22package%22%3A%20%22c17be88d9eaa858870aa5e48cc406c206e4600e983fc4f06bbe5750d93d09761%22%2C%20%22files%22%3A%20%7B%7D%7D",
"dest": "cargo/vendor/regex-syntax-0.6.19",
"url": "data:%7B%22package%22%3A%20%228cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c%22%2C%20%22files%22%3A%20%7B%7D%7D",
"dest": "cargo/vendor/regex-syntax-0.6.20",
"dest-filename": ".cargo-checksum.json"
},
{
......@@ -1769,28 +1769,28 @@
},
{
"type": "file",
"url": "https://static.crates.io/crates/serde/serde-1.0.116.crate",
"sha256": "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5",
"url": "https://static.crates.io/crates/serde/serde-1.0.117.crate",
"sha256": "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a",
"dest": "cargo/vendor",
"dest-filename": "serde-1.0.116.crate"
"dest-filename": "serde-1.0.117.crate"
},
{
"type": "file",
"url": "data:%7B%22package%22%3A%20%2296fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5%22%2C%20%22files%22%3A%20%7B%7D%7D",
"dest": "cargo/vendor/serde-1.0.116",
"url": "data:%7B%22package%22%3A%20%22b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a%22%2C%20%22files%22%3A%20%7B%7D%7D",
"dest": "cargo/vendor/serde-1.0.117",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "file",
"url": "https://static.crates.io/crates/serde_derive/serde_derive-1.0.116.crate",
"sha256": "f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8",
"url": "https://static.crates.io/crates/serde_derive/serde_derive-1.0.117.crate",
"sha256": "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e",
"dest": "cargo/vendor",
"dest-filename": "serde_derive-1.0.116.crate"
"dest-filename": "serde_derive-1.0.117.crate"
},
{
"type": "file",
"url": "data:%7B%22package%22%3A%20%22f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8%22%2C%20%22files%22%3A%20%7B%7D%7D",
"dest": "cargo/vendor/serde_derive-1.0.116",
"url": "data:%7B%22package%22%3A%20%22cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e%22%2C%20%22files%22%3A%20%7B%7D%7D",
"dest": "cargo/vendor/serde_derive-1.0.117",
"dest-filename": ".cargo-checksum.json"
},
{
......
......@@ -5,17 +5,6 @@
border-right: none;
}
.margin-box {
margin: 32px;
}
.folded .margin-box {
margin: 16px;
}
#BackupList row {
padding: 10px 6px;
}
list.settings {
border: @borders 1px solid;
border-radius: 9px;
......
This diff is collapsed.
......@@ -12,20 +12,20 @@ use crate::ui;
use crate::ui::globals::*;
use crate::ui::prelude::*;
mod about;
mod archives;
#[allow(dead_code)]
mod builder;
mod config_list;
mod detail;
mod device_missing;
mod encryption_password;
mod dialog_about;
mod dialog_add_config;
mod dialog_device_missing;
mod dialog_encryption_password;
mod dialog_storage;
mod globals;
mod headerbar;
mod main_pending;
mod new_backup;
mod page_archives;
mod page_detail;
mod page_overview;
mod page_pending;
pub mod prelude;
mod storage;
mod utils;
pub fn main() {
......@@ -114,18 +114,17 @@ fn init(_app: &gtk::Application) {
.unwrap_or_else(|e| error!("loader.close() failed: {}", e));
if let Some(icon) = loader.get_pixbuf() {
gtk::Window::set_default_icon(&icon);
main_ui().start_image().set_from_pixbuf(Some(&icon));
}
init_actions();
init_timeouts();
borg::init_device_listening();
ui::archives::init();
ui::detail::init();
ui::page_archives::init();
ui::page_detail::init();
ui::headerbar::init();
ui::config_list::init();
ui::main_pending::init();
ui::page_overview::init();
ui::page_pending::init();
gtk_app().set_accels_for_action("app.quit", &["<Ctrl>Q"]);
......@@ -188,14 +187,14 @@ fn init_actions() {
let action = gio::SimpleAction::new("detail", glib::VariantTy::new("s").ok());
action.connect_activate(|_, backup_id: _| {
if let Some(backup_id) = backup_id.and_then(|v| v.get_str()) {
ui::detail::view_backup_conf(&backup_id.to_string());
ui::page_detail::view_backup_conf(&backup_id.to_string());
main_ui().window().present();
}
});
gtk_app().add_action(&action);
let action = gio::SimpleAction::new("about", None);
action.connect_activate(|_, _| ui::about::show());
action.connect_activate(|_, _| ui::dialog_about::show());
gtk_app().add_action(&action);
let action = gio::SimpleAction::new("quit", None);
......@@ -205,10 +204,6 @@ fn init_actions() {
}
});
gtk_app().add_action(&action);
let action = gio::SimpleAction::new("archives", None);
action.connect_activate(|_, _| ui::archives::show());
gtk_app().add_action(&action);
}
fn init_check_borg() {
......
pub struct About {
pub struct DialogAbout {
builder: gtk::Builder,
}
impl About {
impl DialogAbout {
pub fn new() -> Self {
Self {
builder: gtk::Builder::from_string(include_str!(concat!(data_dir!(), "/ui/about.ui"))),
builder: gtk::Builder::from_string(include_str!(concat!(
data_dir!(),
"/ui/dialog_about.ui"
))),
}
}
fn get<T: glib::IsA<glib::object::Object>>(&self, id: &str) -> T {
gtk::prelude::BuilderExtManual::get_object(&self.builder, id)
.unwrap_or_else(|| panic!("Object with id '{}' not found in 'ui/about.ui'", id))
.unwrap_or_else(|| panic!("Object with id '{}' not found in 'ui/dialog_about.ui'", id))
}
pub fn dialog(&self) -> gtk::AboutDialog {
......@@ -19,16 +22,16 @@ impl About {
}
}
pub struct DeviceMissing {
pub struct DialogAddConfig {
builder: gtk::Builder,
}
impl DeviceMissing {
impl DialogAddConfig {
pub fn new() -> Self {
Self {
builder: gtk::Builder::from_string(include_str!(concat!(
data_dir!(),
"/ui/device_missing.ui"
"/ui/dialog_add_config.ui"
))),
}
}
......@@ -36,7 +39,143 @@ impl DeviceMissing {
fn get<T: glib::IsA<glib::object::Object>>(&self, id: &str) -> T {
gtk::prelude::BuilderExtManual::get_object(&self.builder, id).unwrap_or_else(|| {
panic!(
"Object with id '{}' not found in 'ui/device_missing.ui'",
"Object with id '{}' not found in 'ui/dialog_add_config.ui'",
id
)
})
}
pub fn add_button(&self) -> gtk::Button {
self.get("add_button")
}
pub fn add_remote_page(&self) -> gtk::Box {
self.get("add_remote_page")
}
pub fn add_remote_uri(&self) -> gtk::Entry {
self.get("add_remote_uri")
}
pub fn add_repo_list(&self) -> gtk::ListBox {
self.get("add_repo_list")
}
pub fn cancel_button(&self) -> gtk::Button {
self.get("cancel_button")
}
pub fn encryption(&self) -> gtk::Stack {
self.get("encryption")
}
pub fn existing_repos(&self) -> gtk::Box {
self.get("existing_repos")
}
pub fn init_button(&self) -> gtk::Button {
self.get("init_button")
}
pub fn init_dir(&self) -> gtk::Entry {
self.get("init_dir")
}
pub fn init_local(&self) -> gtk::Box {
self.get("init_local")
}
pub fn init_location(&self) -> gtk::Stack {
self.get("init_location")
}
pub fn init_page(&self) -> gtk::Box {
self.get("init_page")
}
pub fn init_path(&self) -> gtk::FileChooserButton {
self.get("init_path")
}
pub fn init_remote(&self) -> gtk::Box {
self.get("init_remote")
}
pub fn init_repo_list(&self) -> gtk::ListBox {
self.get("init_repo_list")
}
pub fn init_url(&self) -> gtk::Entry {
self.get("init_url")
}
pub fn label1(&self) -> gtk::Label {
self.get("label1")
}
pub fn new_backup(&self) -> gtk::Dialog {
self.get("new_backup")
}
pub fn password(&self) -> gtk::Entry {
self.get("password")
}
pub fn password_confirm(&self) -> gtk::Entry {
self.get("password_confirm")
}
pub fn password_quality(&self) -> gtk::LevelBar {
self.get("password_quality")
}
pub fn password_store(&self) -> gtk::CheckButton {
self.get("password_store")
}
pub fn spacer_1(&self) -> gtk::Box {
self.get("spacer_1")
}
pub fn stack(&self) -> gtk::Stack {
self.get("stack")
}
pub fn stackswitcher1(&self) -> gtk::StackSwitcher {
self.get("stackswitcher1")
}
pub fn unencrypted(&self) -> gtk::Box {
self.get("unencrypted")
}
pub fn x(&self) -> gtk::SizeGroup {
self.get("x")
}
pub fn y(&self) -> gtk::SizeGroup {
self.get("y")
}
}
pub struct DialogDeviceMissing {
builder: gtk::Builder,
}
impl DialogDeviceMissing {
pub fn new() -> Self {
Self {
builder: gtk::Builder::from_string(include_str!(concat!(
data_dir!(),
"/ui/dialog_device_missing.ui"
))),
}
}
fn get<T: glib::IsA<glib::object::Object>>(&self, id: &str) -> T {
gtk::prelude::BuilderExtManual::get_object(&self.builder, id).unwrap_or_else(|| {
panic!(
"Object with id '{}' not found in 'ui/dialog_device_missing.ui'",
id
)
})
......@@ -63,16 +202,16 @@ impl DeviceMissing {
}
}
pub struct EncryptionPassword {
pub struct DialogEncryptionPassword {
builder: gtk::Builder,
}
impl EncryptionPassword {
impl DialogEncryptionPassword {
pub fn new() -> Self {
Self {
builder: gtk::Builder::from_string(include_str!(concat!(
data_dir!(),
"/ui/encryption_password.ui"
"/ui/dialog_encryption_password.ui"
))),
}
}
......@@ -80,7 +219,7 @@ impl EncryptionPassword {
fn get<T: glib::IsA<glib::object::Object>>(&self, id: &str) -> T {
gtk::prelude::BuilderExtManual::get_object(&self.builder, id).unwrap_or_else(|| {
panic!(
"Object with id '{}' not found in 'ui/encryption_password.ui'",
"Object with id '{}' not found in 'ui/dialog_encryption_password.ui'",
id
)
})
......@@ -111,6 +250,94 @@ impl EncryptionPassword {
}
}
pub struct DialogStorage {
builder: gtk::Builder,
}
impl DialogStorage {
pub fn new() -> Self {
Self {
builder: gtk::Builder::from_string(include_str!(concat!(
data_dir!(),
"/ui/dialog_storage.ui"
))),
}
}
fn get<T: glib::IsA<glib::object::Object>>(&self, id: &str) -> T {
gtk::prelude::BuilderExtManual::get_object(&self.builder, id).unwrap_or_else(|| {
panic!(
"Object with id '{}' not found in 'ui/dialog_storage.ui'",
id
)
})
}
pub fn device(&self) -> gtk::Label {
self.get("device")
}
pub fn dialog(&self) -> gtk::Dialog {
self.get("dialog")
}
pub fn disk(&self) -> gtk::Grid {
self.get("disk")
}
pub fn fs(&self) -> gtk::Box {
self.get("fs")
}
pub fn fs_free(&self) -> gtk::Label {
self.get("fs_free")
}
pub fn fs_size(&self) -> gtk::Label {
self.get("fs_size")
}
pub fn fs_usage(&self) -> gtk::LevelBar {
self.get("fs_usage")
}
pub fn label1(&self) -> gtk::Label {
self.get("label1")
}
pub fn label2(&self) -> gtk::Label {
self.get("label2")
}
pub fn label3(&self) -> gtk::Label {
self.get("label3")
}
pub fn label4(&self) -> gtk::Label {
self.get("label4")
}
pub fn label5(&self) -> gtk::Label {
self.get("label5")
}
pub fn path(&self) -> gtk::Label {
self.get("path")
}
pub fn remote(&self) -> gtk::Grid {
self.get("remote")
}
pub fn uri(&self) -> gtk::Label {
self.get("uri")
}
pub fn volume(&self) -> gtk::Label {
self.get("volume")
}
}
pub struct Main {
builder: gtk::Builder,
}
......@@ -127,16 +354,12 @@ impl Main {
.unwrap_or_else(|| panic!("Object with id '{}' not found in 'ui/main.ui'", id))
}
pub fn add_backup_empty(&self) -> gtk::Button {
self.get("add_backup_empty")
}
pub fn add_backup_left(&self) -> gtk::Button {
self.get("add_backup_left")
pub fn add_backup(&self) -> gtk::Button {
self.get("add_backup")
}
pub fn add_backup_right(&self) -> gtk::Button {
self.get("add_backup_right")
pub fn add_backup_empty(&self) -> gtk::Button {
self.get("add_backup_empty")
}
pub fn add_exclude(&self) -> gtk::Button {
......@@ -187,6 +410,10 @@ impl Main {
self.get("archive_username")
}
pub fn back_button(&self) -> gtk::Button {
self.get("back_button")
}
pub fn backup_exclude(&self) -> gtk::ListBox {
self.get("backup_exclude")
}
......@@ -203,14 +430,6 @@ impl Main {
self.get("browse_archive")
}
pub fn content_leaflet(&self) -> libhandy::Leaflet {
self.get("content_leaflet")
}
pub fn content_stack(&self) -> gtk::Stack {
self.get("content_stack")
}
pub fn current_path(&self) -> gtk::Label {
self.get("current_path")
}
......@@ -219,20 +438,12 @@ impl Main {
self.get("deduplicated_size")
}
pub fn error_message(&self) -> gtk::Label {
self.get("error_message")
pub fn detail_stack(&self) -> gtk::Stack {
self.get("detail_stack")
}
pub fn header_group(&self) -> libhandy::HeaderGroup {
self.get("header_group")
}
pub fn headerbar_nothing(&self) -> gtk::Box {
self.get("headerbar_nothing")
}
pub fn headerbar_right_buttons(&self) -> gtk::Stack {
self.get("headerbar_right_buttons")
pub fn error_message(&self) -> gtk::Label {
self.get("error_message")
}
pub fn home_icon(&self) -> gtk::Image {
......@@ -247,18 +458,6 @@ impl Main {
self.get("include_home")
}