Commit Graph

20 Commits (319bc3914b457486e7123207f8eb893ac235d6d2)

Author SHA1 Message Date
Nefo Fortressia 319bc3914b
Merge branch 'main' into feat/new-file 2021-12-28 08:55:01 +07:00
Nefo Fortressia c6da158bb6
feat: implement saving file normally
Merge branch 'feat/save' of https://gitea.treehouse.systems/fortressia/echidna

See #21
2021-12-27 21:03:08 +07:00
Nefo Fortressia e0d353a10b
refactor: remove double pointer in setting a file's tab title
This is because the file name is an &OsStr converted to &str and thus already a pointer.
2021-12-18 17:34:27 +07:00
Nefo Fortressia 5e574299f3 Merge branch 'main' into 'feat/save'
# Conflicts:
#   src/components/window/file.rs
2021-12-18 04:53:27 +00:00
Nefo Fortressia 38f072617f refactor: use GtkFileChooserNative for file dialogs
Merge branch 'refactor/file-chooser-native' into 'main'

Closes #22

See merge request EchidnaHQ/Echidna!19
2021-12-16 10:17:44 +00:00
Nefo Fortressia d8c7f104ab
feat: implement "Save" menu 2021-12-16 14:06:33 +07:00
Nefo Fortressia 52d1bdf7db
refactor: move the code for saving files to EchidnaCoreEditor
Additionally add support for normal saving ("Save File").

This change gives support for saving files other than the current one.

EchidnaWindow.save_file_as() was only able to save the current tab opened.
2021-12-16 14:04:53 +07:00
Nefo Fortressia ce8fb5dd12
refactor: separate get_current_tab() from save_file_as()
EchidnaWindow.get_current_tab() can now be used independently.

This will help with reusing it in another places. I think it will be used a lot.

Additionally, it will return Result<A, &str> instead of panicking, as it's a utils function now and should never panic.
2021-12-16 11:08:42 +07:00
Nefo Fortressia d480fdb02b
refactor: move saving file code to save_file_as()
save_file_as() can now be run independently.
2021-12-15 19:45:19 +07:00
Nefo Fortressia cfe8c4dbe4
refactor: use GtkFileChooserNative for file dialogs
GtkFileChooserNative uses the platform's APIs, and thus the Portal API.

This is important since we want to integrate this well with Flatpak.

See:
https://docs.flatpak.org/en/latest/portals-gtk.html
2021-12-14 08:45:21 +07:00
Nefo Fortressia b9a0719750
refactor: migrate panic!() usage to Rust 2021
This commit refactors code to conform to some changes in Rust 2021:
- The panic!() macro now uses format_args!() like println!().
- The usage of panic!(x) is now deprecated if x is not a string literal.

See:
https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html
2021-12-13 11:25:10 +07:00
Nefo Fortressia 87fdfc8d9c
feat: implement win.new-file action 2021-11-14 10:29:51 +07:00
Nefo Fortressia af347c8962 feat: make tabs closeable
Not yet implemented for the placeholder Getting Started page.
2021-11-03 17:06:51 +07:00
Nefo Fortressia 9594ed6539 style: format files with Rustfmt 2021-10-31 17:30:19 +07:00
Nefo Fortressia 390485b3b1 feat: implement win.save-file-as action 2021-10-31 16:58:20 +07:00
Nefo Fortressia 6144feb857 refactor: move editor code to a separate EchidnaCoreEditor widget
This allows for a more component-based codebase, like those in web development.

Also added barebone minimap and refactored the file loading.

Should have commited them in a separate commit, but I'm just used to overusing git add -p.
2021-10-28 17:17:27 +07:00
Nefo Fortressia 6c6afa740f style: format source files with Rustfmt tooling 2021-10-26 16:46:41 +07:00
Nefo Fortressia 8c05235e13 refactor: simplify FileImplementedEditor::action_open_file()
No need the 'window' parameter as we can just use &self
2021-10-26 16:44:40 +07:00
Nefo Fortressia 52d5b5e486 style: add missing license headers
The MPL is a file-based license, rather than a codebase-based license.

Each files need to be marked as MPL.

If we don't do mark them, they may cause confusion.
2021-10-24 16:43:35 +07:00
Nefo Fortressia 385f2dda32 refactor: move all traits to EchidnaWindow struct
Before, all the traits are implemented for EchidnaApplication.

This is added to better support using the app with many windows open.

EchidnaApplication may be obsolete now, but I'm not removing it for now.
2021-10-24 14:20:53 +07:00