2017-09-08 11:59:42 +00:00
|
|
|
/* Copyright (c) Mark Harmstone 2016-17
|
|
|
|
*
|
|
|
|
* This file is part of WinBtrfs.
|
|
|
|
*
|
|
|
|
* WinBtrfs is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public Licence as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the Licence, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* WinBtrfs 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 Lesser General Public Licence for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public Licence
|
|
|
|
* along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
|
2017-11-26 13:16:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-09-08 11:59:42 +00:00
|
|
|
#include <windows.h>
|
|
|
|
#ifndef __REACTOS__
|
|
|
|
#include "../btrfsioctl.h"
|
|
|
|
#else
|
|
|
|
#include "btrfsioctl.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class BtrfsBalance {
|
|
|
|
public:
|
2018-12-16 11:04:40 +00:00
|
|
|
BtrfsBalance(const wstring& drive, bool RemoveDevice = false, bool ShrinkDevice = false) {
|
|
|
|
removing = false;
|
|
|
|
devices = nullptr;
|
2017-09-08 11:59:42 +00:00
|
|
|
called_from_RemoveDevice = RemoveDevice;
|
|
|
|
called_from_ShrinkDevice = ShrinkDevice;
|
2018-12-16 11:04:40 +00:00
|
|
|
fn = drive;
|
2017-09-08 11:59:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ShowBalance(HWND hwndDlg);
|
|
|
|
INT_PTR CALLBACK BalanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
INT_PTR CALLBACK BalanceOptsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
|
|
|
|
|
|
private:
|
2018-12-16 11:04:40 +00:00
|
|
|
void ShowBalanceOptions(HWND hwndDlg, uint8_t type);
|
2017-09-08 11:59:42 +00:00
|
|
|
void SaveBalanceOpts(HWND hwndDlg);
|
|
|
|
void StartBalance(HWND hwndDlg);
|
2018-12-16 11:04:40 +00:00
|
|
|
void RefreshBalanceDlg(HWND hwndDlg, bool first);
|
2017-09-08 11:59:42 +00:00
|
|
|
void PauseBalance(HWND hwndDlg);
|
|
|
|
void StopBalance(HWND hwndDlg);
|
|
|
|
|
2018-12-16 11:04:40 +00:00
|
|
|
uint32_t balance_status;
|
2017-09-08 11:59:42 +00:00
|
|
|
btrfs_balance_opts data_opts, metadata_opts, system_opts;
|
2018-12-16 11:04:40 +00:00
|
|
|
uint8_t opts_type;
|
2017-09-08 11:59:42 +00:00
|
|
|
btrfs_query_balance bqb;
|
2018-12-16 11:04:40 +00:00
|
|
|
bool cancelling;
|
|
|
|
bool removing;
|
|
|
|
bool shrinking;
|
|
|
|
wstring fn;
|
2017-09-08 11:59:42 +00:00
|
|
|
btrfs_device* devices;
|
2018-12-16 11:04:40 +00:00
|
|
|
bool readonly;
|
|
|
|
bool called_from_RemoveDevice, called_from_ShrinkDevice;
|
2017-09-08 11:59:42 +00:00
|
|
|
};
|