make bluetooth service singleton
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/button.h>
|
||||
|
||||
#include "components/popover.hpp"
|
||||
|
||||
#include "gtkmm/button.h"
|
||||
|
||||
class BluetoothWidget : public Popover {
|
||||
class BluetoothWidget : public Gtk::Box {
|
||||
public:
|
||||
BluetoothWidget(std::string icon, std::string title);
|
||||
BluetoothWidget();
|
||||
|
||||
void setPowerState(bool state);
|
||||
void setIsDiscovering(bool state);
|
||||
@@ -17,19 +14,16 @@ class BluetoothWidget : public Popover {
|
||||
sigc::signal<void()> onIsDiscoveringButtonClickedSignal;
|
||||
|
||||
void update();
|
||||
|
||||
private:
|
||||
bool isPowered = false;
|
||||
bool isPowered = false;
|
||||
bool isDiscovering = false;
|
||||
|
||||
Gtk::Box container;
|
||||
Gtk::Box statusArea;
|
||||
|
||||
Gtk::Box *deviceList = nullptr;
|
||||
|
||||
Gtk::Button *scanButton = nullptr;
|
||||
Gtk::Box *deviceList = nullptr;
|
||||
Gtk::Button *scanButton = nullptr;
|
||||
Gtk::Button *powerButton = nullptr;
|
||||
|
||||
|
||||
void onPowerButtonClicked();
|
||||
void onScanButtonClicked();
|
||||
|
||||
|
||||
17
include/widgets/controlCenter.hpp
Normal file
17
include/widgets/controlCenter.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "components/popover.hpp"
|
||||
#include "services/bluetooth.hpp"
|
||||
#include "widgets/bluetooth.hpp"
|
||||
#include "gtkmm/box.h"
|
||||
|
||||
class ControlCenter : public Popover {
|
||||
public:
|
||||
ControlCenter(std::string icon, std::string name);
|
||||
|
||||
private:
|
||||
Gtk::Box container;
|
||||
|
||||
BluetoothWidget *bluetoothWidget = nullptr;
|
||||
BluetoothService *bluetoothService = BluetoothService::getInstance();
|
||||
};
|
||||
Reference in New Issue
Block a user