44 lines
1.1 KiB
C++
44 lines
1.1 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <gtk/gtk.h>
|
|
#include "temp_monitor.h"
|
|
#include "temperature_chart.h"
|
|
#include "config_manager.h"
|
|
|
|
class MainWindow {
|
|
public:
|
|
MainWindow();
|
|
~MainWindow();
|
|
|
|
void show();
|
|
|
|
private:
|
|
void setupUI();
|
|
void updateTemperatures();
|
|
void updateLegend();
|
|
void saveWindowState();
|
|
|
|
static gboolean onDeleteWindow(GtkWidget *widget, gpointer userData);
|
|
static gboolean onUpdateTimer(gpointer userData);
|
|
static void onRefreshRateChanged(GtkSpinButton *spinButton, gpointer userData);
|
|
static void onClearButtonClicked(GtkButton *button, gpointer userData);
|
|
static void onQuitButtonClicked(GtkButton *button, gpointer userData);
|
|
static void onColorSet(GObject *object, GParamSpec *pspec, gpointer userData);
|
|
|
|
GtkWidget *window;
|
|
GtkWidget *statusLabel;
|
|
GtkSpinButton *refreshRateSpinBox;
|
|
TemperatureChart *chart;
|
|
TempMonitor *monitor;
|
|
ConfigManager *config;
|
|
guint timerID;
|
|
int refreshRateSec;
|
|
GtkWidget *legendBox;
|
|
};
|
|
|
|
// Global main loop reference for proper shutdown
|
|
extern GMainLoop *gMainLoop;
|
|
|
|
#endif // MAINWINDOW_H
|