Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
1.2 KB
Raw Blame
/*
 *  SPDX-FileCopyrightText: 2020 Dmitrii Utkin <[email protected]>
 *
 *  SPDX-License-Identifier: LGPL-2.1-only
 */

#ifndef WIDGET_H
#define WIDGET_H

#include "recorder_snapshots_scanner.h"

#include <QDialog>

namespace Ui {
class RecorderSnapshotsManager;
}

class QItemSelection;
class RecorderDirectoryCleaner;

class RecorderSnapshotsManager : public QDialog
{
    Q_OBJECT

public:
    RecorderSnapshotsManager(QWidget *parent = nullptr);
    ~RecorderSnapshotsManager();

    void execFor(const QString &snapshotsDirectory);

protected:
    void closeEvent(QCloseEvent *event) override;

private Q_SLOTS:
    void reject() override;

    void onScanningFinished(SnapshotDirInfoList snapshots);
    void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
    void onButtonSelectAllClicked();
    void onButtonCleanUpClicked();
    void onButtonCancelCleanUpClicked();
    void onCleanUpFinished();

private:
    void startScanning();
    void updateSpaceToBeFreed();
    void abortCleanUp();

private:
    Ui::RecorderSnapshotsManager *ui;
    RecorderSnapshotsScanner *scanner;
    RecorderDirectoryCleaner* cleaner;
    QPushButton* cleanUpButton;
};

#endif // WIDGET_H