Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions data/net.nokyan.Resources.gschema.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,21 @@
<default>false</default>
<summary>Whether to show niceness values for CPU priorities</summary>
</key>
<key name="show-logout-button" type="b">
<default>false</default>
<summary>Show logout button in interface</summary>
</key>
<key name="show-reboot-button" type="b">
<default>false</default>
<summary>Show reboot button in interface</summary>
</key>
<key name="show-shutdown-button" type="b">
<default>false</default>
<summary>Show shutdown button in interface</summary>
</key>
<key name="show-kill-window-button" type="b">
<default>false</default>
<summary>Show kill window button in interface when KWin is detected</summary>
</key>
</schema>
</schemalist>
30 changes: 30 additions & 0 deletions data/resources/ui/dialogs/settings_dialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,36 @@
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">System Action Buttons</property>
<property name="description" translatable="yes">Control the visibility of system action buttons in the interface</property>
<child>
<object class="AdwSwitchRow" id="show_kill_window_button_row">
<property name="title" translatable="yes">Show Kill Window Button</property>
<property name="subtitle" translatable="yes">Display kill window button when KWin is detected</property>
</object>
</child>
<child>
<object class="AdwSwitchRow" id="show_logout_button_row">
<property name="title" translatable="yes">Show Logout Button</property>
<property name="subtitle" translatable="yes">Display logout button in the interface</property>
</object>
</child>
<child>
<object class="AdwSwitchRow" id="show_reboot_button_row">
<property name="title" translatable="yes">Show Reboot Button</property>
<property name="subtitle" translatable="yes">Display reboot button in the interface</property>
</object>
</child>
<child>
<object class="AdwSwitchRow" id="show_shutdown_button_row">
<property name="title" translatable="yes">Show Shutdown Button</property>
<property name="subtitle" translatable="yes">Display shutdown button in the interface</property>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
Expand Down
101 changes: 83 additions & 18 deletions data/resources/ui/pages/applications.ui
Original file line number Diff line number Diff line change
Expand Up @@ -79,28 +79,93 @@
<property name="margin-end">16</property>
<property name="hexpand">true</property>
<property name="spacing">16</property>
<property name="halign">end</property>
<child>
<object class="GtkButton" id="information_button">
<property name="icon-name">info-symbolic</property>
<property name="sensitive">false</property>
<property name="tooltip-text" translatable="yes">Show App Information</property>
<accessibility>
<property name="label" translatable="yes">Show App Information</property>
</accessibility>
<style>
<class name="circular"/>
</style>
<object class="GtkBox">
<property name="spacing">16</property>
<property name="halign">start</property>
<child>
<object class="GtkButton" id="kill_window_button">
<property name="icon-name">window-close-symbolic</property>
<property name="tooltip-text" translatable="yes">Kill a Window</property>
<property name="action-name">app.kill-window</property>
<property name="visible">False</property>
<accessibility>
<property name="label" translatable="yes">Kill a Window</property>
</accessibility>
<style>
<class name="circular"/>
</style>
</object>
</child>
<child>
<object class="GtkButton" id="logout_button">
<property name="icon-name">system-log-out-symbolic</property>
<property name="tooltip-text" translatable="yes">Logout</property>
<property name="action-name">app.logout</property>
<accessibility>
<property name="label" translatable="yes">Logout</property>
</accessibility>
<style>
<class name="circular"/>
</style>
</object>
</child>
<child>
<object class="GtkButton" id="reboot_button">
<property name="icon-name">system-reboot-symbolic</property>
<property name="tooltip-text" translatable="yes">Reboot</property>
<property name="action-name">app.reboot</property>
<accessibility>
<property name="label" translatable="yes">Reboot</property>
</accessibility>
<style>
<class name="circular"/>
</style>
</object>
</child>
<child>
<object class="GtkButton" id="shutdown_button">
<property name="icon-name">system-shutdown-symbolic</property>
<property name="tooltip-text" translatable="yes">Shutdown</property>
<property name="action-name">app.shutdown</property>
<accessibility>
<property name="label" translatable="yes">Shutdown</property>
</accessibility>
<style>
<class name="circular"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="AdwSplitButton" id="end_application_button">
<property name="label" translatable="yes">End App</property>
<property name="menu-model">end_app_menu</property>
<property name="sensitive">false</property>
<style>
<class name="destructive-action"/>
</style>
<object class="GtkBox">
<property name="spacing">16</property>
<property name="halign">end</property>
<property name="hexpand">true</property>
<child>
<object class="GtkButton" id="information_button">
<property name="icon-name">info-symbolic</property>
<property name="sensitive">false</property>
<property name="tooltip-text" translatable="yes">Show App Information</property>
<accessibility>
<property name="label" translatable="yes">Show App Information</property>
</accessibility>
<style>
<class name="circular"/>
</style>
</object>
</child>
<child>
<object class="AdwSplitButton" id="end_application_button">
<property name="label" translatable="yes">End App</property>
<property name="menu-model">end_app_menu</property>
<property name="sensitive">false</property>
<style>
<class name="destructive-action"/>
</style>
</object>
</child>
</object>
</child>
</object>
Expand Down
127 changes: 96 additions & 31 deletions data/resources/ui/pages/processes.ui
Original file line number Diff line number Diff line change
Expand Up @@ -125,41 +125,106 @@
<property name="margin-end">16</property>
<property name="hexpand">true</property>
<property name="spacing">16</property>
<property name="halign">end</property>
<child>
<object class="GtkButton" id="options_button">
<property name="icon-name">options-symbolic</property>
<property name="sensitive">false</property>
<property name="tooltip-text" translatable="yes">Show Process Options</property>
<accessibility>
<property name="label" translatable="yes">Show Process Options</property>
</accessibility>
<style>
<class name="circular"/>
</style>
</object>
</child>
<child>
<object class="GtkButton" id="information_button">
<property name="icon-name">info-symbolic</property>
<property name="sensitive">false</property>
<property name="tooltip-text" translatable="yes">Show Process Information</property>
<accessibility>
<property name="label" translatable="yes">Show Process Information</property>
</accessibility>
<style>
<class name="circular"/>
</style>
<object class="GtkBox">
<property name="spacing">16</property>
<property name="halign">start</property>
<child>
<object class="GtkButton" id="kill_window_button">
<property name="icon-name">window-close-symbolic</property>
<property name="tooltip-text" translatable="yes">Kill a Window</property>
<property name="action-name">app.kill-window</property>
<property name="visible">False</property>
<accessibility>
<property name="label" translatable="yes">Kill a Window</property>
</accessibility>
<style>
<class name="circular"/>
</style>
</object>
</child>
<child>
<object class="GtkButton" id="logout_button">
<property name="icon-name">system-log-out-symbolic</property>
<property name="tooltip-text" translatable="yes">Logout</property>
<property name="action-name">app.logout</property>
<accessibility>
<property name="label" translatable="yes">Logout</property>
</accessibility>
<style>
<class name="circular"/>
</style>
</object>
</child>
<child>
<object class="GtkButton" id="reboot_button">
<property name="icon-name">system-reboot-symbolic</property>
<property name="tooltip-text" translatable="yes">Reboot</property>
<property name="action-name">app.reboot</property>
<accessibility>
<property name="label" translatable="yes">Reboot</property>
</accessibility>
<style>
<class name="circular"/>
</style>
</object>
</child>
<child>
<object class="GtkButton" id="shutdown_button">
<property name="icon-name">system-shutdown-symbolic</property>
<property name="tooltip-text" translatable="yes">Shutdown</property>
<property name="action-name">app.shutdown</property>
<accessibility>
<property name="label" translatable="yes">Shutdown</property>
</accessibility>
<style>
<class name="circular"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="AdwSplitButton" id="end_process_button">
<property name="label" translatable="yes">End Process</property>
<property name="menu-model">end_process_menu</property>
<property name="sensitive">false</property>
<style>
<class name="destructive-action"/>
</style>
<object class="GtkBox">
<property name="spacing">16</property>
<property name="halign">end</property>
<property name="hexpand">true</property>
<child>
<object class="GtkButton" id="options_button">
<property name="icon-name">options-symbolic</property>
<property name="sensitive">false</property>
<property name="tooltip-text" translatable="yes">Show Process Options</property>
<accessibility>
<property name="label" translatable="yes">Show Process Options</property>
</accessibility>
<style>
<class name="circular"/>
</style>
</object>
</child>
<child>
<object class="GtkButton" id="information_button">
<property name="icon-name">info-symbolic</property>
<property name="sensitive">false</property>
<property name="tooltip-text" translatable="yes">Show Process Information</property>
<accessibility>
<property name="label" translatable="yes">Show Process Information</property>
</accessibility>
<style>
<class name="circular"/>
</style>
</object>
</child>
<child>
<object class="AdwSplitButton" id="end_process_button">
<property name="label" translatable="yes">End Process</property>
<property name="menu-model">end_process_menu</property>
<property name="sensitive">false</property>
<style>
<class name="destructive-action"/>
</style>
</object>
</child>
</object>
</child>
</object>
Expand Down
45 changes: 44 additions & 1 deletion src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,48 @@ impl Application {
}
));
self.add_action(&action_process_options);

// Kill Window if using kwin
let action_kill_window = gio::SimpleAction::new("kill-window", None);
action_kill_window.connect_activate(clone!(
#[weak(rename_to = this)]
self,
move |_, _| {
this.main_window().shortcut_kill_window();
}
));
self.add_action(&action_kill_window);

// System actions with confirmation dialogs
let action_logout = gio::SimpleAction::new("logout", None);
action_logout.connect_activate(clone!(
#[weak(rename_to = this)]
self,
move |_, _| {
this.main_window().shortcut_logout();
}
));
self.add_action(&action_logout);

let action_reboot = gio::SimpleAction::new("reboot", None);
action_reboot.connect_activate(clone!(
#[weak(rename_to = this)]
self,
move |_, _| {
this.main_window().shortcut_reboot();
}
));
self.add_action(&action_reboot);

let action_shutdown = gio::SimpleAction::new("shutdown", None);
action_shutdown.connect_activate(clone!(
#[weak(rename_to = this)]
self,
move |_, _| {
this.main_window().shortcut_shutdown();
}
));
self.add_action(&action_shutdown);
}

// Sets up keyboard shortcuts
Expand Down Expand Up @@ -250,7 +292,8 @@ impl Application {

let settings = ResSettingsDialog::new();

settings.init();
let kwin_running = self.main_window().is_kwin_running();
settings.init(kwin_running);

settings.present(Some(&self.main_window()));
imp.settings_window_opened.set(true);
Expand Down
Loading