mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
collect profile features into one shared struct
This commit is contained in:
parent
ec7a668cd9
commit
25b63c0e02
5 changed files with 111 additions and 62 deletions
|
|
@ -8,7 +8,7 @@ use database::Database;
|
|||
use widget::Widget;
|
||||
use window::Window;
|
||||
|
||||
use crate::action::Browser as BrowserAction;
|
||||
use crate::{action::Browser as BrowserAction, Profile};
|
||||
use adw::ApplicationWindow;
|
||||
use gtk::{
|
||||
gio::{Cancellable, File, SimpleAction},
|
||||
|
|
@ -17,7 +17,7 @@ use gtk::{
|
|||
FileLauncher,
|
||||
};
|
||||
use sqlite::Transaction;
|
||||
use std::{path::PathBuf, rc::Rc};
|
||||
use std::rc::Rc;
|
||||
|
||||
pub struct Browser {
|
||||
window: Rc<Window>,
|
||||
|
|
@ -27,9 +27,7 @@ pub struct Browser {
|
|||
impl Browser {
|
||||
// Construct
|
||||
pub fn new(
|
||||
// Extras
|
||||
profile_path: PathBuf,
|
||||
// Actions
|
||||
profile: Rc<Profile>,
|
||||
browser_action: Rc<BrowserAction>,
|
||||
action_page_new: SimpleAction,
|
||||
action_page_close: SimpleAction,
|
||||
|
|
@ -92,7 +90,7 @@ impl Browser {
|
|||
|
||||
browser_action.profile().connect_activate({
|
||||
move |_, _| {
|
||||
FileLauncher::new(Some(&File::for_path(&profile_path))).launch(
|
||||
FileLauncher::new(Some(&File::for_path(profile.config_path()))).launch(
|
||||
None::<>k::Window>,
|
||||
None::<&Cancellable>,
|
||||
|result| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue