mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
implement proxy settings dialog (rules tab)
This commit is contained in:
parent
b548fb16d3
commit
e548efc93f
12 changed files with 660 additions and 12 deletions
31
src/app/browser/action/proxy.rs
Normal file
31
src/app/browser/action/proxy.rs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
use gtk::{gio::SimpleAction, glib::uuid_string_random};
|
||||
|
||||
/// [SimpleAction](https://docs.gtk.org/gio/class.SimpleAction.html) wrapper for `Profile` action of `Browser` group
|
||||
pub struct Proxy {
|
||||
pub simple_action: SimpleAction,
|
||||
}
|
||||
|
||||
impl Default for Proxy {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl Proxy {
|
||||
// Constructors
|
||||
|
||||
/// Create new `Self`
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
simple_action: SimpleAction::new(&uuid_string_random(), None),
|
||||
}
|
||||
}
|
||||
|
||||
// Events
|
||||
|
||||
/// Define callback function for
|
||||
/// [SimpleAction::activate](https://docs.gtk.org/gio/signal.SimpleAction.activate.html) signal
|
||||
pub fn connect_activate(&self, callback: impl Fn() + 'static) {
|
||||
self.simple_action.connect_activate(move |_, _| callback());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue