clang format
This commit is contained in:
@@ -4,8 +4,8 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <span>
|
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
#include <span>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
class HyprlandService {
|
class HyprlandService {
|
||||||
static inline std::shared_ptr<HyprlandService> instance;
|
static inline std::shared_ptr<HyprlandService> instance;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
struct Client {
|
struct Client {
|
||||||
std::string address;
|
std::string address;
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ class TimerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ringingTimerCounter++;
|
ringingTimerCounter++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeTimer(uint64_t timerId) {
|
void removeTimer(uint64_t timerId) {
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ class BluetoothSettingsRow : public Gtk::Box {
|
|||||||
set_spacing(10);
|
set_spacing(10);
|
||||||
set_margin_bottom(6);
|
set_margin_bottom(6);
|
||||||
|
|
||||||
|
|
||||||
if (!device.icon.empty()) {
|
if (!device.icon.empty()) {
|
||||||
this->icon.set_from_icon_name(device.icon);
|
this->icon.set_from_icon_name(device.icon);
|
||||||
this->icon.set_pixel_size(24);
|
this->icon.set_pixel_size(24);
|
||||||
@@ -94,12 +93,9 @@ class BluetoothSettings : public Gtk::Box {
|
|||||||
std::map<std::string, BluetoothDevice> activeBluetoothDevices;
|
std::map<std::string, BluetoothDevice> activeBluetoothDevices;
|
||||||
std::map<std::string, std::shared_ptr<BluetoothSettingsRow>> deviceRows;
|
std::map<std::string, std::shared_ptr<BluetoothSettingsRow>> deviceRows;
|
||||||
|
|
||||||
|
|
||||||
std::shared_ptr<IconButton> powerButton = std::make_shared<IconButton>(Icon::POWER_SETTINGS_NEW);
|
std::shared_ptr<IconButton> powerButton = std::make_shared<IconButton>(Icon::POWER_SETTINGS_NEW);
|
||||||
std::shared_ptr<IconButton> scanButton = std::make_shared<IconButton>(Icon::BLUETOOTH_SEARCHING);
|
std::shared_ptr<IconButton> scanButton = std::make_shared<IconButton>(Icon::BLUETOOTH_SEARCHING);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Gtk::Box connectedDevicesBox;
|
Gtk::Box connectedDevicesBox;
|
||||||
Gtk::Box availableDevicesBox;
|
Gtk::Box availableDevicesBox;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "components/mediaPlayer.hpp"
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "components/mediaPlayer.hpp"
|
||||||
#include "connection/dbus/mpris.hpp"
|
#include "connection/dbus/mpris.hpp"
|
||||||
|
|
||||||
#include "gtkmm/box.h"
|
#include "gtkmm/box.h"
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "connection/dbus/bluetooth.hpp"
|
#include "connection/dbus/bluetooth.hpp"
|
||||||
#include "widgets/controlCenter/bluetoothSettings.hpp"
|
#include "widgets/controlCenter/bluetoothSettings.hpp"
|
||||||
|
|
||||||
#include "gtkmm/box.h"
|
#include "gtkmm/box.h"
|
||||||
|
|
||||||
class SettingsWidget : public Gtk::Box {
|
class SettingsWidget : public Gtk::Box {
|
||||||
public:
|
public:
|
||||||
SettingsWidget();
|
SettingsWidget();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BluetoothSettings bluetoothSettings;
|
BluetoothSettings bluetoothSettings;
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -3,8 +3,10 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <sigc++/connection.h>
|
#include <sigc++/connection.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "components/timer.hpp"
|
#include "components/timer.hpp"
|
||||||
#include "services/timerService.hpp"
|
#include "services/timerService.hpp"
|
||||||
|
|
||||||
#include "gtkmm/box.h"
|
#include "gtkmm/box.h"
|
||||||
|
|
||||||
class TimerWidget : public Gtk::Box {
|
class TimerWidget : public Gtk::Box {
|
||||||
|
|||||||
3
main.cpp
3
main.cpp
@@ -1,7 +1,6 @@
|
|||||||
#include "app.hpp"
|
#include "app.hpp"
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
App app;
|
App app;
|
||||||
|
|
||||||
return app.run();
|
return app.run();
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#include "components/mediaPlayer.hpp"
|
|
||||||
|
|
||||||
#include "components/button/iconButton.hpp"
|
#include "components/button/iconButton.hpp"
|
||||||
|
#include "components/mediaPlayer.hpp"
|
||||||
#include "helpers/string.hpp"
|
#include "helpers/string.hpp"
|
||||||
#include "services/textureCache.hpp"
|
#include "services/textureCache.hpp"
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ Popover::~Popover() {
|
|||||||
if (popover) {
|
if (popover) {
|
||||||
popover->popdown();
|
popover->popdown();
|
||||||
popover->unparent();
|
popover->unparent();
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,8 @@ void BluetoothController::pairDevice(const std::string &object_path) {
|
|||||||
|
|
||||||
void BluetoothController::unpairDevice(const std::string &object_path) {
|
void BluetoothController::unpairDevice(const std::string &object_path) {
|
||||||
spdlog::info("Bluetooth: unpairing device {}", object_path);
|
spdlog::info("Bluetooth: unpairing device {}", object_path);
|
||||||
if (!m_adapter_proxy) return;
|
if (!m_adapter_proxy)
|
||||||
|
return;
|
||||||
|
|
||||||
auto params = Glib::VariantContainerBase::create_tuple(
|
auto params = Glib::VariantContainerBase::create_tuple(
|
||||||
Glib::Variant<Glib::DBusObjectPathString>::create(object_path));
|
Glib::Variant<Glib::DBusObjectPathString>::create(object_path));
|
||||||
@@ -148,7 +149,8 @@ void BluetoothController::onBusConnected(const Glib::RefPtr<Gio::AsyncResult> &r
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
void BluetoothController::enumerateObjects() {
|
void BluetoothController::enumerateObjects() {
|
||||||
if (!m_object_manager_proxy) return;
|
if (!m_object_manager_proxy)
|
||||||
|
return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto result = m_object_manager_proxy->call_sync("GetManagedObjects");
|
auto result = m_object_manager_proxy->call_sync("GetManagedObjects");
|
||||||
@@ -230,7 +232,8 @@ void BluetoothController::onObjectManagerSignal(
|
|||||||
.get());
|
.get());
|
||||||
|
|
||||||
auto ifaces = Glib::VariantBase::cast_dynamic<
|
auto ifaces = Glib::VariantBase::cast_dynamic<
|
||||||
Glib::Variant<std::vector<Glib::ustring>>>(parameters.get_child(1)).get();
|
Glib::Variant<std::vector<Glib::ustring>>>(parameters.get_child(1))
|
||||||
|
.get();
|
||||||
|
|
||||||
for (const auto &iface : ifaces) {
|
for (const auto &iface : ifaces) {
|
||||||
if (iface == "org.bluez.Device1") {
|
if (iface == "org.bluez.Device1") {
|
||||||
@@ -344,7 +347,8 @@ void BluetoothController::onDevicePropertiesChanged(
|
|||||||
const std::vector<Glib::ustring> &) {
|
const std::vector<Glib::ustring> &) {
|
||||||
|
|
||||||
auto it = m_devices.find(object_path);
|
auto it = m_devices.find(object_path);
|
||||||
if (it == m_devices.end()) return;
|
if (it == m_devices.end())
|
||||||
|
return;
|
||||||
|
|
||||||
auto &device = it->second;
|
auto &device = it->second;
|
||||||
|
|
||||||
@@ -406,8 +410,10 @@ BluetoothDevice BluetoothController::parseDeviceProperties(
|
|||||||
|
|
||||||
device.address = getString("Address");
|
device.address = getString("Address");
|
||||||
device.name = getString("Name");
|
device.name = getString("Name");
|
||||||
if (device.name.empty()) device.name = getString("Alias");
|
if (device.name.empty())
|
||||||
if (device.name.empty()) device.name = device.address;
|
device.name = getString("Alias");
|
||||||
|
if (device.name.empty())
|
||||||
|
device.name = device.address;
|
||||||
device.icon = getString("Icon");
|
device.icon = getString("Icon");
|
||||||
device.paired = getBool("Paired");
|
device.paired = getBool("Paired");
|
||||||
device.connected = getBool("Connected");
|
device.connected = getBool("Connected");
|
||||||
@@ -429,15 +435,15 @@ void BluetoothController::setDbusProperty(const std::string &object_path,
|
|||||||
const std::string &interface,
|
const std::string &interface,
|
||||||
const std::string &property,
|
const std::string &property,
|
||||||
const Glib::VariantBase &value) {
|
const Glib::VariantBase &value) {
|
||||||
if (!connection || object_path.empty()) return;
|
if (!connection || object_path.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto props_proxy = Gio::DBus::Proxy::create_sync(
|
auto props_proxy = Gio::DBus::Proxy::create_sync(
|
||||||
connection, "org.bluez", object_path, "org.freedesktop.DBus.Properties");
|
connection, "org.bluez", object_path, "org.freedesktop.DBus.Properties");
|
||||||
|
|
||||||
auto wrapped = Glib::Variant<Glib::VariantBase>::create(value);
|
auto wrapped = Glib::Variant<Glib::VariantBase>::create(value);
|
||||||
auto params = Glib::VariantContainerBase::create_tuple({
|
auto params = Glib::VariantContainerBase::create_tuple({Glib::Variant<Glib::ustring>::create(interface),
|
||||||
Glib::Variant<Glib::ustring>::create(interface),
|
|
||||||
Glib::Variant<Glib::ustring>::create(property),
|
Glib::Variant<Glib::ustring>::create(property),
|
||||||
wrapped});
|
wrapped});
|
||||||
|
|
||||||
|
|||||||
@@ -87,4 +87,3 @@ void ControlCenter::setActiveTab(const std::string &tab_name) {
|
|||||||
this->timerButton->setActive(true);
|
this->timerButton->setActive(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
#include <spdlog/spdlog.h>
|
#include <spdlog/spdlog.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
|
||||||
#include "gtkmm/entry.h"
|
#include "gtkmm/entry.h"
|
||||||
#include "gtkmm/eventcontrollerkey.h"
|
#include "gtkmm/eventcontrollerkey.h"
|
||||||
#include "gtkmm/label.h"
|
#include "gtkmm/label.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user