Skip to content

Commit

Permalink
Update Eruption GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
X3n0m0rph59 committed Jul 1, 2023
1 parent fc78782 commit 68910c7
Show file tree
Hide file tree
Showing 15 changed files with 2,535 additions and 2,459 deletions.
Binary file modified eruption-gui-gtk3/resources/resources.gresource
Binary file not shown.
5 changes: 2 additions & 3 deletions eruption-gui-gtk3/resources/resources.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
<file>img/roccat-kone-aimo-remastered.png</file>
<file>img/roccat-kain-100.png</file>
<file>img/roccat-kain-2xx.png</file>
<file compressed="true">styles/app.css</file>
<file compressed="true">styles/app-windows.css</file>
<file compressed="true">styles/default.css</file>
<file compressed="true">styles/windows.css</file>
<file compressed="true">ui/main.glade</file>
<file compressed="true">ui/about.glade</file>
<file compressed="true">ui/rule.glade</file>
<file compressed="true">ui/no-connection-template.ui</file>
<file compressed="true">ui/no-device-template.ui</file>
<file compressed="true">ui/keyboard-device-template.ui</file>
<file compressed="true">ui/mouse-device-template.ui</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ window {

.client {
padding: 8px;
background-image: -gtk-gradient(linear, 0 0, 1 1,
/* background-image: -gtk-gradient(linear, 0 0, 1 1,
color-stop(0, rgb(49, 49, 49)),
color-stop(1, rgb(23, 23, 23)));
color-stop(1, rgb(23, 23, 23))); */
}

.icon {
Expand Down
4,299 changes: 2,205 additions & 2,094 deletions eruption-gui-gtk3/resources/ui/main.glade

Large diffs are not rendered by default.

107 changes: 0 additions & 107 deletions eruption-gui-gtk3/resources/ui/no-connection-template.ui

This file was deleted.

24 changes: 16 additions & 8 deletions eruption-gui-gtk3/src/dbus_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ pub fn get_devices_zone_allocations() -> Result<Vec<(u64, Zone)>> {
y: v.1 .1,
width: v.1 .2,
height: v.1 .3,
enabled: v.1 .4,
},
)
})
Expand All @@ -651,8 +652,13 @@ pub fn set_devices_zone_allocations(zones: &[(u64, Zone)]) -> Result<()> {

let zones = zones
.iter()
.map(|(device, zone)| (*device, (zone.x, zone.y, zone.width, zone.height)))
.collect::<Vec<(u64, (i32, i32, i32, i32))>>();
.map(|(device, zone)| {
(
*device,
(zone.x, zone.y, zone.width, zone.height, zone.enabled),
)
})
.collect::<Vec<(u64, (i32, i32, i32, i32, bool))>>();

status_proxy.set_devices_zone_allocations(zones)?;

Expand All @@ -670,13 +676,13 @@ pub fn set_device_zone_allocation(device: u64, zone: &Zone) -> Result<()> {
Duration::from_secs(constants::DBUS_TIMEOUT_MILLIS as u64),
);

let zone = (zone.x, zone.y, zone.width, zone.height);
let zone = (zone.x, zone.y, zone.width, zone.height, zone.enabled);
status_proxy.set_device_zone_allocation(device, zone)?;

Ok(())
}

/// Enable or disable rendering on a managed device
/// Enable or disable a managed device
pub fn set_device_enabled(device_index: u64, enabled: bool) -> Result<()> {
use devices::OrgEruptionDevice;

Expand All @@ -692,16 +698,18 @@ pub fn set_device_enabled(device_index: u64, enabled: bool) -> Result<()> {
Ok(())
}

/// Enable or disable rendering on a managed device
pub fn is_device_enabled(_device_index: u64) -> Result<bool> {
/// Is a managed device enabled or disabled
pub fn is_device_enabled(device_index: u64) -> Result<bool> {
use devices::OrgEruptionDevice;

let conn = Connection::new_system()?;
let _devices_proxy = conn.with_proxy(
let devices_proxy = conn.with_proxy(
"org.eruption",
"/org/eruption/devices",
Duration::from_secs(constants::DBUS_TIMEOUT_MILLIS as u64),
);

let result = true; // devices_proxy.is_device_enabled(device_index)?;
let result = devices_proxy.is_device_enabled(device_index)?;

Ok(result)
}
Expand Down
Loading

0 comments on commit 68910c7

Please sign in to comment.