56 lines
1.5 KiB
C++
56 lines
1.5 KiB
C++
/*
|
|
* BastionGuard™
|
|
* Copyright (C) 2025–2026 Calogero Scarnà
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, version 3.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
*
|
|
* BastionGuard™ is a trademark of Calogero Scarnà.
|
|
* The BastionGuard™ name and branding are not licensed under the GPL.
|
|
*/
|
|
|
|
#pragma once
|
|
#include <gtkmm.h>
|
|
#include "Backend.hpp"
|
|
|
|
class SambaPage : public Gtk::Box {
|
|
public:
|
|
SambaPage();
|
|
virtual ~SambaPage() = default;
|
|
|
|
private:
|
|
struct SambaColumns : public Gtk::TreeModel::ColumnRecord {
|
|
SambaColumns() {
|
|
add(col_path);
|
|
add(col_color);
|
|
}
|
|
Gtk::TreeModelColumn<Glib::ustring> col_path;
|
|
Gtk::TreeModelColumn<Glib::ustring> col_color;
|
|
};
|
|
|
|
SambaColumns sambaCols;
|
|
Glib::RefPtr<Gtk::ListStore> sambaStore;
|
|
Gtk::TreeView sambaView;
|
|
|
|
Gtk::Switch switchEnable;
|
|
Gtk::Button btnAdd, btnRemove, btnScan, btnSave;
|
|
|
|
bool loading_ = false;
|
|
|
|
void loadConfig();
|
|
void saveConfig();
|
|
void refreshUI();
|
|
|
|
void onAddDir();
|
|
void onRemoveDir();
|
|
void onScanNow();
|
|
};
|