diff --git a/.gitignore b/.gitignore index bef4516e36fb9200b7636c4bb1759e579c1db609..b950e2cef45eccccefbd98fe9fb144edccb1719e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .vscode -/target +build/ +target/ +src/config.rs diff --git a/Cargo.lock b/Cargo.lock index 2b9f5ffd8df74db9edd37cd3ac51fb8663e3fe32..190cd0ede4267c21fd4b32c24d3ed9d2aaf70de5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,6 +8,19 @@ version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +[[package]] +name = "async-channel" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +dependencies = [ + "concurrent-queue", + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -55,12 +68,57 @@ dependencies = [ "target-lexicon", ] +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "event-listener" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener", + "pin-project-lite", +] + [[package]] name = "field-offset" version = "0.3.6" @@ -496,6 +554,12 @@ dependencies = [ "system-deps", ] +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + [[package]] name = "pin-project-lite" version = "0.2.13" @@ -594,6 +658,7 @@ checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" name = "sequeler" version = "0.1.0" dependencies = [ + "async-channel", "gtk4", "libadwaita", ] diff --git a/Cargo.toml b/Cargo.toml index 2d194791a3ededd5f83dca705813f12086d64f7d..dff654f1049002c356313527f07897f82a7dd212 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,4 +7,5 @@ edition = "2021" [dependencies] adw = { version = "0.5.3", package = "libadwaita", features = ["v1_1"] } +async-channel = "2.1.1" gtk = { version = "0.7.3", package = "gtk4", features = ["v4_6"] } diff --git a/data/assets.gresource.xml b/data/assets.gresource.xml new file mode 100644 index 0000000000000000000000000000000000000000..fd7ef6d0db1f21de3dfa49c9108b6faa8917cc5f --- /dev/null +++ b/data/assets.gresource.xml @@ -0,0 +1,6 @@ + + + + stylesheet.css + + diff --git a/data/assets/icons/128x128/com.github.alecaddd.sequeler.svg b/data/assets/icons/128x128/com.github.alecaddd.sequeler.svg new file mode 100644 index 0000000000000000000000000000000000000000..24a7a51b6d732cbb0cc6759958ca2b31993cddb7 --- /dev/null +++ b/data/assets/icons/128x128/com.github.alecaddd.sequeler.svg @@ -0,0 +1,3036 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/128x128/com.github.alecaddd.sequelerDevel.svg b/data/assets/icons/128x128/com.github.alecaddd.sequelerDevel.svg new file mode 100644 index 0000000000000000000000000000000000000000..d2756ef58608c30f7af357681a91ef099f918ac4 --- /dev/null +++ b/data/assets/icons/128x128/com.github.alecaddd.sequelerDevel.svg @@ -0,0 +1,4007 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/16x16/com.github.alecaddd.sequeler.svg b/data/assets/icons/16x16/com.github.alecaddd.sequeler.svg new file mode 100644 index 0000000000000000000000000000000000000000..c62ebeebd816150ad075b91ae02f9c282c5cc007 --- /dev/null +++ b/data/assets/icons/16x16/com.github.alecaddd.sequeler.svg @@ -0,0 +1,472 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/16x16/com.github.alecaddd.sequelerDevel.svg b/data/assets/icons/16x16/com.github.alecaddd.sequelerDevel.svg new file mode 100644 index 0000000000000000000000000000000000000000..3d1c55b712cb610094dc1bcb41fdd5d6dce19dd8 --- /dev/null +++ b/data/assets/icons/16x16/com.github.alecaddd.sequelerDevel.svg @@ -0,0 +1,494 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/24x24/com.github.alecaddd.sequeler.svg b/data/assets/icons/24x24/com.github.alecaddd.sequeler.svg new file mode 100644 index 0000000000000000000000000000000000000000..4c203f43d47747cb1a0ce7c330e01621bd2a90d0 --- /dev/null +++ b/data/assets/icons/24x24/com.github.alecaddd.sequeler.svg @@ -0,0 +1,708 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/24x24/com.github.alecaddd.sequelerDevel.svg b/data/assets/icons/24x24/com.github.alecaddd.sequelerDevel.svg new file mode 100644 index 0000000000000000000000000000000000000000..c0ec9f82ddf29589aa6bbdf25543b53eb8372453 --- /dev/null +++ b/data/assets/icons/24x24/com.github.alecaddd.sequelerDevel.svg @@ -0,0 +1,708 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/32x32/com.github.alecaddd.sequeler.svg b/data/assets/icons/32x32/com.github.alecaddd.sequeler.svg new file mode 100644 index 0000000000000000000000000000000000000000..3706e947f850e31076b6d1363e44a34def14e93b --- /dev/null +++ b/data/assets/icons/32x32/com.github.alecaddd.sequeler.svg @@ -0,0 +1,1016 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/32x32/com.github.alecaddd.sequelerDevel.svg b/data/assets/icons/32x32/com.github.alecaddd.sequelerDevel.svg new file mode 100644 index 0000000000000000000000000000000000000000..2f9040c852fb9e30bb6337d5d54b6b7688bff6ed --- /dev/null +++ b/data/assets/icons/32x32/com.github.alecaddd.sequelerDevel.svg @@ -0,0 +1,1249 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/48x48/com.github.alecaddd.sequeler.svg b/data/assets/icons/48x48/com.github.alecaddd.sequeler.svg new file mode 100644 index 0000000000000000000000000000000000000000..cfc774ed06c33585524b34610d9daec93d9cd15a --- /dev/null +++ b/data/assets/icons/48x48/com.github.alecaddd.sequeler.svg @@ -0,0 +1,1240 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/48x48/com.github.alecaddd.sequelerDevel.svg b/data/assets/icons/48x48/com.github.alecaddd.sequelerDevel.svg new file mode 100644 index 0000000000000000000000000000000000000000..92571adb5938ef4cbd8a5434be1772c7148c48ba --- /dev/null +++ b/data/assets/icons/48x48/com.github.alecaddd.sequelerDevel.svg @@ -0,0 +1,1486 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/64x64/com.github.alecaddd.sequeler.svg b/data/assets/icons/64x64/com.github.alecaddd.sequeler.svg new file mode 100644 index 0000000000000000000000000000000000000000..e9418e9b364d7ed3224892f7bd7c72d2cb0e8ec0 --- /dev/null +++ b/data/assets/icons/64x64/com.github.alecaddd.sequeler.svg @@ -0,0 +1,1265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/64x64/com.github.alecaddd.sequelerDevel.svg b/data/assets/icons/64x64/com.github.alecaddd.sequelerDevel.svg new file mode 100644 index 0000000000000000000000000000000000000000..e67ef0645dbd92d751a01311dc893d2a5601ce01 --- /dev/null +++ b/data/assets/icons/64x64/com.github.alecaddd.sequelerDevel.svg @@ -0,0 +1,1569 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/actions/application-logout.svg b/data/assets/icons/actions/application-logout.svg new file mode 100644 index 0000000000000000000000000000000000000000..e4b67e5fe159943fc996979ce1923bb0baff3ac8 --- /dev/null +++ b/data/assets/icons/actions/application-logout.svg @@ -0,0 +1,487 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/actions/office-database-edit.svg b/data/assets/icons/actions/office-database-edit.svg new file mode 100644 index 0000000000000000000000000000000000000000..6d6b60c543606529a01f5b4a53aeea926c34d8f4 --- /dev/null +++ b/data/assets/icons/actions/office-database-edit.svg @@ -0,0 +1,481 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/actions/office-database-new.svg b/data/assets/icons/actions/office-database-new.svg new file mode 100644 index 0000000000000000000000000000000000000000..98d264e5593c9fcbee924b6f4cbef8373609abdd --- /dev/null +++ b/data/assets/icons/actions/office-database-new.svg @@ -0,0 +1,414 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/actions/office-database-remove.svg b/data/assets/icons/actions/office-database-remove.svg new file mode 100644 index 0000000000000000000000000000000000000000..f279a929e2ee4969fdad9745559901519c3a5626 --- /dev/null +++ b/data/assets/icons/actions/office-database-remove.svg @@ -0,0 +1,414 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/assets/icons/status/table-empty.svg b/data/assets/icons/status/table-empty.svg new file mode 100644 index 0000000000000000000000000000000000000000..56adfdaef7450ae8f1293b951eacd3f5629a6737 --- /dev/null +++ b/data/assets/icons/status/table-empty.svg @@ -0,0 +1,517 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/data/assets/icons/status/table.svg b/data/assets/icons/status/table.svg new file mode 100644 index 0000000000000000000000000000000000000000..5df266e47a6039e8ff4bc3cb83e11bfdb2865678 --- /dev/null +++ b/data/assets/icons/status/table.svg @@ -0,0 +1,512 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/data/assets/screenshots/sequeler-screenshot.png b/data/assets/screenshots/sequeler-screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..807fbe140cdaade493c4abade821a08523701e82 Binary files /dev/null and b/data/assets/screenshots/sequeler-screenshot.png differ diff --git a/data/assets/screenshots/sequeler-screenshot1.png b/data/assets/screenshots/sequeler-screenshot1.png new file mode 100644 index 0000000000000000000000000000000000000000..d201f2b8f5a0645c08f5a09f43e3ee5587cd8837 Binary files /dev/null and b/data/assets/screenshots/sequeler-screenshot1.png differ diff --git a/data/assets/screenshots/sequeler-screenshot2.png b/data/assets/screenshots/sequeler-screenshot2.png new file mode 100644 index 0000000000000000000000000000000000000000..95b767efbb5adcc5039bb8f6f64bd5fd49a43ba6 Binary files /dev/null and b/data/assets/screenshots/sequeler-screenshot2.png differ diff --git a/data/assets/sequeler-logo-transparent.png b/data/assets/sequeler-logo-transparent.png new file mode 100644 index 0000000000000000000000000000000000000000..7c63cc890000e59e2cf9ae65dbabf9a4e31b7004 Binary files /dev/null and b/data/assets/sequeler-logo-transparent.png differ diff --git a/data/assets/sequeler.png b/data/assets/sequeler.png new file mode 100644 index 0000000000000000000000000000000000000000..100eec32134c4fb462abaa8541fb456700647afb Binary files /dev/null and b/data/assets/sequeler.png differ diff --git a/data/com.gitlab.alecaddd.sequeler.appdata.xml.in.in b/data/com.gitlab.alecaddd.sequeler.appdata.xml.in.in new file mode 100644 index 0000000000000000000000000000000000000000..97314ff47d066d79462e9eccc290c66d1a1a9c3e --- /dev/null +++ b/data/com.gitlab.alecaddd.sequeler.appdata.xml.in.in @@ -0,0 +1,561 @@ + + + + @appid@ + CC0-1.0 + GPL-3.0+ + Sequeler + Friendly SQL Client + +

+ Easily connect to your local or remote database +

+

+ Store your Database Connections in the library, connect over SSH tunnel, type and execute SQL commands directly in the app, and do everything you need to do without the necessity of opening the terminal. +

+

+ Supported Databases: +

+ +

+ Features Include: +

+ +
+ + @appid@ + + + + +

Odin release

+
    +
  • Update elementary OS Platform runtime.
  • +
  • Update screenshots.
  • +
+
+
+ + +

Odin release

+
    +
  • Updated translations for Ukranian, Russian, Indonisian, Chinese, Lithuanian, Portugese, Turkish, and Arabic.
  • +
+
+
+ + +

New Features

+
    +
  • Create, Edit, and Delete databases.
  • +
  • New context menu to copy and edit tables.
  • +
  • Support unencrypted connections.
  • +
+

Bug Fixes

+
    +
  • Fix copy column data.
  • +
+

Translations

+
    +
  • Updated translations for Ukranian, Russian, French, and German.
  • +
+
+
+ + +

Reduced CPU usage by 2%.

+

Update translations for Italian, Spanish, Catalan, French, Hindi, Russian, and Turkish.

+
+
+ + +

More fixes!

+

0.7.8 changelog

+
    +
  • Fixed usage attempt of wrong Vala method.
  • +
+

0.7.7 changelog

+
    +
  • Fix nasty GSettings bug causing the app to crash.
  • +
  • Implement GDA Placeholder statement.
  • +
  • Improve Query Tab iconography.
  • +
+

0.7.6 changelog

+
    +
  • Fix ORDER BY in PostgreSQL Relationship view.
  • +
  • Improve MySQL structure view.
  • +
  • Drop Granite.Settings in favour of GLib.Settings.
  • +
  • Implement Granite.Notebook on the Query tab.
  • +
  • Show query error messages inline.
  • +
+
+
+ + +

More fixes!

+
    +
  • Fixed usage attempt of wrong Vala method.
  • +
+
+
+ + +

Because 0.7.6 never happened!

+
    +
  • Fix nasty GSettings bug causing the app to crash.
  • +
  • Implement GDA Placeholder statement.
  • +
  • Improve Query Tab iconography.
  • +
+
+
+ + +

Query Tab Bonanza!

+
    +
  • Fix ORDER BY in PostgreSQL Relationship view.
  • +
  • Improve MySQL structure view.
  • +
  • Drop Granite.Settings in favour of GLib.Settings.
  • +
  • Implement Granite.Notebook on the Query tab.
  • +
  • Show query error messages inline.
  • +
+
+
+ + +

New features and improvements

+
    +
  • You can now duplicate connections.
  • +
  • Sorting columns now works as expected by actually running the ORDER BY query.
  • +
  • Quickly jump to a specific result page with the handy dandy pagination popover.
  • +
  • Show Comment Column inside table structure view.
  • +
+
+
+ + +

The 2020 release!

+
    +
  • Manually reorder saved connection.
  • +
  • Allow selecting a custom SSH public key.
  • +
  • Fix SSH tunnel crashes.
  • +
+
+
+ + +

Raw Query Improvements

+
    +
  • Strip comments from SQL raw queries.
  • +
  • Better handle complex queries on multiple lines.
  • +
  • Speed up query rendering.
  • +
+
+
+ + +

Sweet Query Tab Improvements

+
    +
  • Edit font size of the Query Tab.
  • +
  • Edit background style of the Query Tab.
  • +
  • Save and remember the Query Tab size.
  • +
+
+
+ + +

PostgreSQL Fixes

+
    +
  • Fixed PostgreSQL relationship table.
  • +
  • Fixed wrong response message when handling non select queries.
  • +
+
+
+ + +

Bite-Size fixes

+
    +
  • Removed unused libfixposix.
  • +
  • Fixed pagination issue when clicking too fast while fetching big data.
  • +
+
+
+ + +

Bug fixes and improvements

+
    +
  • Rewritten pagination to use LIMIT and OFFSET.
  • +
  • Faster pagination and content viewing for big data.
  • +
  • Show records count in table's list.
  • +
  • Bug fixes and other improvements.
  • +
+
+
+ + +

Bug fixes and improvements

+
    +
  • Properly handle EXPLAIN SQL statement.
  • +
  • Properly handle querying capitlized PostgreSQL tables.
  • +
  • Improved async methods for internal views.
  • +
  • Updated translations.
  • +
+
+
+ + +

Critical bug fix!

+
    +
  • CRITICAL: Fixes missing GSettings Schema, restore lost connections.
  • +
  • Other small bug fixes and improvements.
  • +
+
+
+ + +

Implemented SSH tunneling

+
    +
  • WARNING: This release packs many updates and something could break. Please, backup your connections.
  • +
  • Connect via SSH to a remote Database.
  • +
  • Major code refactor to handle UI updates via async methods.
  • +
  • Use Stack container to show a loading Spinner during fetch or data processing methods.
  • +
  • Major performance improvements to the table search and dropdown schema switcher.
  • +
  • Bug fixes and other improvements.
  • +
+
+
+ + +

Fancy New Icon!

+
    +
  • New fancy Icon.
  • +
  • Use GtkNativeDialog.
  • +
  • Bug fixes and Improvements.
  • +
+
+
+ + +

Open SQLite files

+
    +
  • Open SQLite files directly in Sequeler.
  • +
  • Right click to copy data inside a column.
  • +
  • Bug fixes and Improvements.
  • +
+
+
+ + +

UI Fixes and Performance Improvements

+
    +
  • UI fix for logout button.
  • +
  • View shortcuts on preferences dropdown.
  • +
  • Performance Improvements.
  • +
  • Italian translation.
  • +
+
+
+ + +

Export all the things!

+
    +
  • Export results from Query Tab.
  • +
  • Export in CSV or Plain Text format.
  • +
  • Sort Columns order everywhere.
  • +
  • Brazilian translation.
  • +
+
+
+ + +

Here comes the power of Pagination!!!

+
    +
  • Paginate results in the Content tab.
  • +
  • Query messages UI improvements.
  • +
  • Relations table bug fixes.
  • +
+
+
+ + +

We got Multi SQL Query support.

+
    +
  • Ability to handle multiple SQL queries.
  • +
  • Execute the currently highlighted query.
  • +
  • Improved Library Popover UI.
  • +
  • Use native GTK+ CSS attributes for better Light/Dark mode.
  • +
  • Random UI improvements.
  • +
+
+
+ + +

Urgent! Fixed broken Tabs for translated version.

+
+
+ + +

Light and Dark Mode Switch!

+
    +
  • Better Dark/Light mode switch in header bar.
  • +
  • Add Russian translation.
  • +
  • Updated Welcome screen with New Window command.
  • +
  • Code cleanup.
  • +
+
+
+ + +

Official Juno release!

+
    +
  • Missing filter name on SQLite File Dialog.
  • +
+
+
+ + +

We got Search!

+
    +
  • Search table names in sidebar.
  • +
  • Fixes issue in connecting directly on a non saved connection.
  • +
  • Updated Lithuanian translation.
  • +
  • Italian translation.
  • +
+
+
+ + +

Improved Password Security.

+
    +
  • Safely store passwords in LibSecret.
  • +
  • Auto upgrade on startup to remove passwords from GSettings.
  • +
  • Fixes issues with identical table names from other database in the same connection.
  • +
  • Alphabetically ordered tables.
  • +
  • Improvements in showing MySql/MariaDB Table Structure.
  • +
  • Many more bugs for you to discover.
  • +
+
+
+ + +

New Icon and Import/Export Library.

+
    +
  • Fancy new icon.
  • +
  • Import and Export connections library.
  • +
  • Fixed random crash when opening and closing multiple connections.
  • +
  • Bug fixes and improvements.
  • +
+
+
+ + +

Bug fixes and improvements.

+
    +
  • Fixed PostgreSQL Schema show options.
  • +
  • Fixed crash on new connection dialog when opening the connection before saving.
  • +
+
+
+ + +

Little side dish update.

+
    +
  • Fixed save window state on close.
  • +
  • Bug fixes and improvements.
  • +
+
+
+ + +

Alternate coloured rows!

+
    +
  • Manually reload Content, Structure, and Relations.
  • +
  • Show Table schema, content, and constraint relationships.
  • +
  • Properly handle compound queries.
  • +
  • Fix PostgreSQL table switch.
  • +
+
+
+ + +

Complete rewrite of the entire code base!

+
    +
  • Handle multiple Windows/Instances and multiple open connections.
  • +
  • Show Table schema, content, and constraint relationships.
  • +
  • Quicker response on big select queries
  • +
  • Better error handling.
  • +
  • Bug fixes and improvements.
  • +
+
+
+ + +

Better error handling, less crashes!

+
    +
  • The app doesn't crash when dealing with big values
  • +
  • Handling errors related to columns
  • +
  • Quicker response on big select queries
  • +
  • Some small clean up
  • +
  • Fixes issue with SQL Lite encrypted path
  • +
+
+
+ + +

Better error handling, less crashes!

+
    +
  • The app doesn't crash when dealing with big values
  • +
  • Handling errors related to columns
  • +
  • Quicker response on big select queries
  • +
  • Some small clean up
  • +
+
+
+ + +

New Icon, Better error messages!

+
    +
  • New shiny icon
  • +
  • View SQL error message on error
  • +
  • FIX: Show proper PostgreSql Schema Table in Sidebar
  • +
  • Snappiest query execution ever for local databases
  • +
  • The usual bundle of bugs for you to discover
  • +
+
+
+ + +

Summoning the power of async methods!

+
    +
  • All DataBase queries are now async methods, super fast.
  • +
  • The UI doesn't freeze anymore during a long process
  • +
  • Granite SourceList to display list of tables
  • +
  • Tabs to switch between the Query Builder and the Table Structure
  • +
  • ComboBox to select table schemas from the open connection
  • +
  • Many more bugs and issues for you to have fun with
  • +
+
+
+ + +

Bug Fixes and Improvements

+
    +
  • Display Table lists for SQLite and PostgreSQL
  • +
  • Refresh Table List view if tables change
  • +
  • Removed unused GSettings
  • +
+
+
+ + +

This is so good you won't believe it. New Library UI, Schema Table, Custom Port, and more

+
    +
  • A brand new Library View directly in your home screen, super tight and organized
  • +
  • Custom Port field for those snazzy geeks who don't just use 3306
  • +
  • A shiny new Sidebar View to list all your DataBase Tables
  • +
  • Code cleanup and speed improvements
  • +
  • Usual abundance of bugs and issues for you to have fun with!
  • +
+
+
+ + +

Major Update: Releasing a sweet table to view Query Results!

+
    +
  • Did I say we got a sweet table to view query results?
  • +
  • New shortcut (ctrl+enter) to execute query
  • +
  • Solved bug while connecting to DB directly from the Connection Dialog
  • +
  • UI Improvements to Connection Dialog
  • +
  • Added Spanish and Lithuanian translations
  • +
+
+
+ + +

UI fixes

+
    +
  • Visual improvements to the library view
  • +
+
+
+ + +

Initial Release

+
    +
  • Store your Database connections
  • +
  • Quickly connect to a Local or Remote Database
  • +
  • Write SQL queries in the built-in code editor
  • +
+
+
+
+ + + https://raw.githubusercontent.com/Alecaddd/sequeler/master/data/assets/screenshots/sequeler-screenshot.png + + + https://raw.githubusercontent.com/Alecaddd/sequeler/master/data/assets/screenshots/sequeler-screenshot1.png + + + https://raw.githubusercontent.com/Alecaddd/sequeler/master/data/assets/screenshots/sequeler-screenshot2.png + + + Alessandro Castellani + @appid@.desktop + https://github.com/Alecaddd/sequeler + https://www.paypal.me/alecaddd + https://github.com/Alecaddd/sequeler/issues + https://github.com/Alecaddd/sequeler/issues + https://hosted.weblate.org/projects/sequeler + castellani.ale@gmail.com + + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + none + + + #3f3f3f + #ffffff + 25 + pk_live_Arrxw947rfYpLQK7VcSv4766 + + + HiDpiIcon + HighContrast + ModernToolkit + +
diff --git a/data/com.gitlab.alecaddd.sequeler.desktop.in.in b/data/com.gitlab.alecaddd.sequeler.desktop.in.in new file mode 100644 index 0000000000000000000000000000000000000000..49cf7bab6de32689ce7db298517ee3ff9d60ceb6 --- /dev/null +++ b/data/com.gitlab.alecaddd.sequeler.desktop.in.in @@ -0,0 +1,13 @@ +[Desktop Entry] +Name=Sequeler +GenericName=Sequeler App +Comment=Friendly SQL Client +Categories=Utility;Development; +TryExec=@binary@ +Exec=@binary@ %U +Icon=@icon@ +Terminal=false +Type=Application +Keywords=SQL;MySql;Database;MariaDB;S3;PostgreSQL; +MimeType=application/x-sqlite3;application/vnd.sqlite3; +StartupWMClass=Sequeler diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..a3581af856cafe9abf888549c7168cb861af76b6 --- /dev/null +++ b/data/meson.build @@ -0,0 +1,109 @@ +icon_sizes = ['16', '24', '32', '48', '64', '128'] + +icons_dir = join_paths(get_option('datadir'), 'icons', 'hicolor') +foreach size : icon_sizes + asset = join_paths('assets', 'icons', '@0@x@0@'.format(size), '@0@.svg'.format(meson.project_name())) + install_data( + asset, + install_dir: join_paths(icons_dir, '@0@x@0@'.format(size), 'apps'), + rename: '@0@.svg'.format(application_id) + ) + install_data( + asset, + install_dir: join_paths(icons_dir, '@0@x@0@@2'.format(size), 'apps'), + rename: '@0@.svg'.format(application_id) + ) +endforeach + +install_data( + join_paths('assets', 'icons', '128x128', '@0@.svg'.format(meson.project_name())), + install_dir: join_paths(icons_dir , 'scalable', 'apps'), + rename: '@0@.svg'.format(application_id) +) + +install_data( + join_paths('assets', 'icons', 'status', 'table.svg'), + install_dir: join_paths(icons_dir , '16x16', 'status'), +) + +install_data( + join_paths('assets', 'icons', 'status', 'table-empty.svg'), + install_dir: join_paths(icons_dir , '16x16', 'status'), +) + +install_data( + join_paths('assets', 'icons', 'actions', 'office-database-new.svg'), + install_dir: join_paths(icons_dir , '24x24', 'actions'), +) + +install_data( + join_paths('assets', 'icons', 'actions', 'office-database-remove.svg'), + install_dir: join_paths(icons_dir , '24x24', 'actions'), +) + +install_data( + join_paths('assets', 'icons', 'actions', 'office-database-edit.svg'), + install_dir: join_paths(icons_dir , '24x24', 'actions'), +) + +install_data( + join_paths('assets', 'icons', 'actions', 'application-logout.svg'), + install_dir: join_paths(icons_dir , '24x24', 'actions'), +) + +# Install the Desktop file +desktop_conf = configuration_data() +desktop_conf.set('icon', application_id) +desktop_conf.set('binary', application_id) + +desktop_file = i18n.merge_file( + input: configure_file( + input: '@0@.desktop.in.in'.format(meson.project_name()), + output: '@0@.desktop.in'.format(application_id), + configuration: desktop_conf + ), + output:'@0@.desktop'.format(application_id), + po_dir: join_paths(meson.source_root(), 'po', 'extra'), + type: 'desktop', + install: true, + install_dir: join_paths(get_option('datadir'), 'applications') +) + +# Validate desktop file +desktop_file_validate = find_program('desktop-file-validate', required: false) +if desktop_file_validate.found() + test( + 'validate-desktop', + desktop_file_validate, + args: [ + desktop_file.full_path() + ] + ) +endif + +# Install the AppData file +appdata_conf = configuration_data() +appdata_conf.set('appid', application_id) + +appdata_file = i18n.merge_file( + input: configure_file( + input: '@0@.appdata.xml.in.in'.format(meson.project_name()), + output: '@0@.appdata.xml.in'.format(application_id), + configuration: appdata_conf + ), + output: '@0@.appdata.xml'.format(application_id), + po_dir: join_paths(meson.source_root(), 'po'), + install: true, + install_dir: join_paths(get_option('datadir'), 'metainfo') +) + +# Validate AppData file +appstream_util = find_program('appstream-util', required: false) +if appstream_util.found() + test( + 'validate-appdata', appstream_util, + args: [ + 'validate-relax', appdata_file.full_path() + ] + ) +endif diff --git a/data/stylesheet.css b/data/stylesheet.css new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/meson.build b/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..ecb9fa72e485cdb23a965c89c223a0eca8f290e0 --- /dev/null +++ b/meson.build @@ -0,0 +1,48 @@ +project('com.gitlab.alecaddd.sequeler', + 'rust', + version: '0.0.1', + license: 'GPL-3.0-or-later', + meson_version: '>= 0.61') + +# i18n = import('i18n') +gnome = import('gnome') + +base_id = 'com.gitlab.alecaddd.sequeler' +application_id = base_id + +dependency('glib-2.0', version: '>= 2.72') # update when changing gtk version +dependency('gio-2.0', version: '>= 2.72') # always same version as glib +dependency('gtk4', version: '>= 4.6.9') +dependency( + 'libadwaita-1', version: '>= 1.1.7', + fallback: ['libadwaita', 'libadwaita_dep'], + default_options: ['tests=false', 'examples=false', 'vapi=false'] +) + +# glib_compile_resources = find_program('glib-compile-resources', required: true) +glib_compile_schemas = find_program('glib-compile-schemas', required: true) +# appstreamcli = find_program('appstreamcli', required: false) +cargo = find_program('cargo', required: true) +cargo_version = run_command(cargo, '--version', check: true).stdout().strip() +message(cargo_version) +rustc_version = run_command('rustc', '--version', check: true).stdout().strip() +message(rustc_version) + +prefix = get_option('prefix') +bindir = prefix / get_option('bindir') +localedir = prefix / get_option('localedir') + +datadir = prefix / get_option('datadir') +pkgdatadir = datadir / meson.project_name() +# podir = meson.project_source_root() / 'po' +gettext_package = meson.project_name() +version = meson.project_version() + +subdir('schema') +subdir('src') + +gnome.post_install( + gtk_update_icon_cache: true, + glib_compile_schemas: true, + update_desktop_database: true, +) diff --git a/schema/com.gitlab.alecaddd.sequeler.gschema.xml.in b/schema/com.gitlab.alecaddd.sequeler.gschema.xml.in new file mode 100644 index 0000000000000000000000000000000000000000..36601d9009dfe1694688016cd518b3cc204aa46a --- /dev/null +++ b/schema/com.gitlab.alecaddd.sequeler.gschema.xml.in @@ -0,0 +1,17 @@ + + + + + -1 + Default window width + + + -1 + Default window height + + + false + Default window maximized behaviour + + + diff --git a/schema/meson.build b/schema/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..045c3cefae26b30a7f0be4c375339077a2fa361e --- /dev/null +++ b/schema/meson.build @@ -0,0 +1,27 @@ +schema_path = '/com/gitlab/alecaddd/sequeler/' +schema_conf = configuration_data() +schema_conf.set('appid', application_id) +schema_conf.set('schema-path', schema_path) + +# GSchema +gschema_conf = configuration_data() +gschema_conf.set('app-id', application_id) +gschema_conf.set('gettext-package', gettext_package) + +configure_file( + input: '@0@.gschema.xml.in'.format(base_id), + output: '@0@.gschema.xml'.format(application_id), + configuration: gschema_conf, + install: true, + install_dir: datadir / 'glib-2.0' / 'schemas' +) + +# Validate GSchema +if glib_compile_schemas.found() + test( + 'validate-gschema', glib_compile_schemas, + args: [ + '--strict', '--dry-run', meson.current_source_dir() + ] + ) +endif diff --git a/src/config.rs.in b/src/config.rs.in new file mode 100644 index 0000000000000000000000000000000000000000..deea1ea4ea1fec72573b02dffb258e9800bb0aa5 --- /dev/null +++ b/src/config.rs.in @@ -0,0 +1,9 @@ +use crate::application::AppProfile; + +pub const APP_ID: &str = @APP_ID@; +pub const GETTEXT_PACKAGE: &str = @GETTEXT_PACKAGE@; +pub const LOCALEDIR: &str = @LOCALEDIR@; +pub const PKGDATADIR: &str = @PKGDATADIR@; +pub const PROFILE: AppProfile = AppProfile::@PROFILE@; +pub const RESOURCES_FILE: &str = concat!(@PKGDATADIR@, "/resources.gresource"); +pub const VERSION: &str = @VERSION@; diff --git a/src/custom_window/imp.rs b/src/custom_window/imp.rs new file mode 100644 index 0000000000000000000000000000000000000000..ffedc8050fe3995fe1327e0e785d1fe1a158af78 --- /dev/null +++ b/src/custom_window/imp.rs @@ -0,0 +1,60 @@ +/* + This file is part of Sequeler. + + Sequeler is free software: you can redistribute it and/or modify it under the terms of the GNU + General Public License as published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + Sequeler is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along with Sequeler. If not, + see . + + Authored by: Alessandro "Alecaddd" Castellani +*/ + +use gio::Settings; +use gtk::subclass::prelude::*; +use gtk::{gio, glib, ApplicationWindow}; +use std::cell::{OnceCell, RefCell}; + +#[derive(Default)] +pub struct Window { + pub settings: OnceCell, + pub tasks: RefCell>, +} + +#[glib::object_subclass] +impl ObjectSubclass for Window { + const NAME: &'static str = "Sequeler"; + type Type = super::Window; + type ParentType = ApplicationWindow; +} + +impl ObjectImpl for Window { + fn constructed(&self) { + self.parent_constructed(); + // Load latest window state. + let obj = self.obj(); + obj.setup_settings(); + obj.load_window_size(); + } +} + +impl WidgetImpl for Window {} + +impl WindowImpl for Window { + // Save window state right before the window will be closed. + fn close_request(&self) -> glib::Propagation { + // Save window size. + self.obj() + .save_window_size() + .expect("Failed to save window state."); + // Allow to invoke other event handlers. + glib::Propagation::Proceed + } +} + +impl ApplicationWindowImpl for Window {} diff --git a/src/custom_window/mod.rs b/src/custom_window/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..fbcf317a9b41bbafcbc5656f6f98f7a58eef7a77 --- /dev/null +++ b/src/custom_window/mod.rs @@ -0,0 +1,86 @@ +/* + This file is part of Sequeler. + + Sequeler is free software: you can redistribute it and/or modify it under the terms of the GNU + General Public License as published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + Sequeler is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License along with Sequeler. If not, + see . + + Authored by: Alessandro "Alecaddd" Castellani +*/ + +mod imp; + +use gio::Settings; +use glib::Object; +use gtk::prelude::*; +use gtk::subclass::prelude::*; +use gtk::{gio, glib, Application}; + +use crate::APP_ID; + +glib::wrapper! { + pub struct Window(ObjectSubclass) + @extends gtk::ApplicationWindow, gtk::Window, gtk::Widget, + @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager; +} + +impl Window { + pub fn new(app: &Application) -> Self { + // Create a new window. + Object::builder().property("application", app).build() + } + + fn setup_settings(&self) { + let settings = Settings::new(APP_ID); + self.imp() + .settings + .set(settings) + .expect("`settings` should not be set before calling `setup_settings`."); + } + + fn settings(&self) -> &Settings { + self.imp() + .settings + .get() + .expect("`settings` should be set in `setup_settings`.") + } + + pub fn save_window_size(&self) -> Result<(), glib::BoolError> { + // Get the size of the window. + let size = self.default_size(); + + // Set the window state in `settings`. + self.settings().set_int("window-width", size.0)?; + self.settings().set_int("window-height", size.1)?; + self.settings() + .set_boolean("is-maximized", self.is_maximized())?; + + Ok(()) + } + + fn load_window_size(&self) { + // Get the previous window state from `settings`. + let width = self.settings().int("window-width"); + let width = if width == -1 { 600 } else { width }; + + let height = self.settings().int("window-height"); + let height = if height == -1 { 300 } else { height }; + + let is_maximized = self.settings().boolean("is-maximized"); + + // Set the size of the window. + self.set_default_size(width, height); + + // If the window was maximized when it was closed, maximize it again. + if is_maximized { + self.maximize(); + } + } +} diff --git a/src/integer_object/imp.rs b/src/integer_object/imp.rs new file mode 100644 index 0000000000000000000000000000000000000000..071c838594750ef57abd20b3e73f6ab58e198199 --- /dev/null +++ b/src/integer_object/imp.rs @@ -0,0 +1,22 @@ +use std::cell::Cell; + +use glib::Properties; +use gtk::glib; +use gtk::prelude::*; +use gtk::subclass::prelude::*; + +#[derive(Properties, Default)] +#[properties(wrapper_type = super::IntegerObject)] +pub struct IntegerObject { + #[property(get, set)] + number: Cell, +} + +#[glib::object_subclass] +impl ObjectSubclass for IntegerObject { + const NAME: &'static str = "MyGtkAppIntegerObject"; + type Type = super::IntegerObject; +} + +#[glib::derived_properties] +impl ObjectImpl for IntegerObject {} diff --git a/src/integer_object/mod.rs b/src/integer_object/mod.rs new file mode 100644 index 0000000000000000000000000000000000000000..b3c0fcaa1e74b8af146aa253cdc252d2e2012e82 --- /dev/null +++ b/src/integer_object/mod.rs @@ -0,0 +1,18 @@ +mod imp; + +use glib::Object; +use gtk::glib; + +glib::wrapper! { + pub struct IntegerObject(ObjectSubclass); +} + +impl IntegerObject { + pub fn new(number: i32) -> Self { + Object::builder().property("number", number).build() + } + + pub fn increase_number(self) { + self.set_number(self.number() + 1); + } +} diff --git a/src/main.rs b/src/main.rs index 8665e62a592b8ae1aa0516093948bed3b875fda8..bb2efc4018b181eb7cb071a5b8dc9571c62aa4c2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,73 +15,101 @@ Authored by: Alessandro "Alecaddd" Castellani */ -mod widgets; - -use widgets::CustomButton; -use std::rc::Rc; -use std::cell::Cell; +mod custom_window; +mod integer_object; +// use gio::Settings; +use custom_window::Window; use gtk::prelude::*; -use gtk::{self, glib}; +use gtk::{glib, Application, PolicyType, ScrolledWindow}; -const APP_ID: &str = "com.github.alecaddd.sequeler"; +const APP_ID: &str = "com.gitlab.alecaddd.sequeler"; fn main() -> glib::ExitCode { - let app = gtk::Application::builder().application_id(APP_ID).build(); + let app = Application::builder().application_id(APP_ID).build(); app.connect_activate(build_ui); app.run() } -fn build_ui(app: >k::Application) { - let button_increase = CustomButton::with_label("Increase"); - button_increase.set_margin_top(12); - button_increase.set_margin_bottom(12); - button_increase.set_margin_start(12); - button_increase.set_margin_end(12); - - let button_decrease = CustomButton::with_label("Decrease"); - button_decrease.set_margin_top(12); - button_decrease.set_margin_bottom(12); - button_decrease.set_margin_start(12); - button_decrease.set_margin_end(12); - - // let number = Rc::new(Cell::new(0)); - let label = gtk::Label::builder() - .label(&button_increase.number().to_string()) +fn build_ui(app: &Application) { + // let vector: Vec = (0..=100_000).map(IntegerObject::new).collect(); + // let model = gio::ListStore::new::(); + // model.extend_from_slice(&vector); + + // let factory = SignalListItemFactory::new(); + // factory.connect_setup(move |_, list_item| { + // let label = Label::new(None); + // list_item + // .downcast_ref::() + // .expect("Needs to be ListItem") + // .set_child(Some(&label)); + // }); + + // factory.connect_bind(move |_, list_item| { + // let integer_object = list_item + // .downcast_ref::() + // .expect("Needs to be ListItem") + // .item() + // .and_downcast::() + // .expect("The item has to be a `IntegerObject`."); + + // let label = list_item + // .downcast_ref::() + // .expect("Needs to be ListItem") + // .child() + // .and_downcast::