2020-01-09 13:59:19 +01:00
|
|
|
#ifndef __EvtMainFrame__
|
|
|
|
#define __EvtMainFrame__
|
|
|
|
|
|
|
|
// wxMASSManager
|
|
|
|
// Copyright (C) 2020 Guillaume Jacquemin
|
|
|
|
//
|
|
|
|
// 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, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// 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/>.
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2020-01-10 00:01:24 +01:00
|
|
|
#include <wx/fswatcher.h>
|
2020-06-20 10:45:49 +02:00
|
|
|
#include <wx/imaglist.h>
|
2020-01-10 00:01:24 +01:00
|
|
|
|
2020-01-12 14:54:23 +01:00
|
|
|
#include "../MassManager/MassManager.h"
|
|
|
|
|
2020-01-09 13:59:19 +01:00
|
|
|
#include "MainFrame.h"
|
|
|
|
|
|
|
|
class EvtMainFrame: public MainFrame {
|
|
|
|
public:
|
|
|
|
EvtMainFrame(wxWindow* parent);
|
|
|
|
~EvtMainFrame();
|
|
|
|
|
2020-01-12 14:54:23 +01:00
|
|
|
auto ready() -> bool;
|
|
|
|
|
2020-01-09 13:59:19 +01:00
|
|
|
protected:
|
2020-06-20 10:45:49 +02:00
|
|
|
// M.A.S.S.-related events
|
2020-06-21 21:39:39 +02:00
|
|
|
void importMassEvent(wxCommandEvent&);
|
|
|
|
void exportMassEvent(wxCommandEvent&);
|
|
|
|
void moveMassEvent(wxCommandEvent&);
|
|
|
|
void deleteMassEvent(wxCommandEvent&);
|
2020-06-13 22:29:23 +02:00
|
|
|
void renameMassEvent(wxCommandEvent&);
|
2020-01-11 14:22:20 +01:00
|
|
|
void backupEvent(wxCommandEvent&);
|
2020-01-09 13:59:19 +01:00
|
|
|
void openSaveDirEvent(wxCommandEvent&);
|
2020-01-16 01:21:25 +01:00
|
|
|
void stagingSelectionEvent(wxCommandEvent&);
|
2020-01-16 01:21:47 +01:00
|
|
|
void deleteStagedEvent(wxCommandEvent&);
|
2020-06-21 21:39:39 +02:00
|
|
|
void openStagingDirEvent(wxCommandEvent&);
|
2020-01-09 13:59:19 +01:00
|
|
|
void installedSelectionEvent(wxListEvent&);
|
|
|
|
void listColumnDragEvent(wxListEvent&);
|
2020-06-20 10:45:49 +02:00
|
|
|
|
|
|
|
// Screenshot events
|
|
|
|
void screenshotListSelectionEvent(wxListEvent&);
|
|
|
|
void screenshotFilenameSortingEvent(wxCommandEvent&);
|
|
|
|
void screenshotCreationDateSortingEvent(wxCommandEvent&);
|
|
|
|
void screenshotAscendingSortingEvent(wxCommandEvent&);
|
|
|
|
void screenshotDescendingSortingEvent(wxCommandEvent&);
|
|
|
|
void viewScreenshotEvent(wxCommandEvent&);
|
|
|
|
void viewScreenshotEvent(wxListEvent&);
|
|
|
|
void deleteScreenshotEvent(wxCommandEvent&);
|
|
|
|
void openScreenshotDirEvent(wxCommandEvent&);
|
|
|
|
|
|
|
|
// General events
|
2020-01-10 00:01:24 +01:00
|
|
|
void fileUpdateEvent(wxFileSystemWatcherEvent& event);
|
2020-01-10 12:23:25 +01:00
|
|
|
void gameCheckTimerEvent(wxTimerEvent&);
|
2020-01-09 13:59:19 +01:00
|
|
|
|
|
|
|
private:
|
2020-06-20 10:45:49 +02:00
|
|
|
void unitFileEventHandler(int event_type, const wxString& event_file, const wxFileSystemWatcherEvent& event);
|
|
|
|
void stagingFileEventHandler(int event_type, const wxString& event_file, const wxFileSystemWatcherEvent& event);
|
|
|
|
void screenshotFileEventHandler(int event_type, const wxString& event_file);
|
|
|
|
|
2020-01-09 13:59:19 +01:00
|
|
|
void initialiseListView();
|
2020-01-10 12:23:25 +01:00
|
|
|
void isGameRunning();
|
2020-01-09 13:59:19 +01:00
|
|
|
void refreshListView();
|
2020-01-10 22:50:41 +01:00
|
|
|
void getActiveSlot();
|
2020-01-09 13:59:19 +01:00
|
|
|
void updateCommandsState();
|
2020-01-12 14:54:23 +01:00
|
|
|
void refreshHangar(int slot);
|
2020-01-09 13:59:19 +01:00
|
|
|
|
2020-06-20 10:45:49 +02:00
|
|
|
void updateScreenshotList();
|
|
|
|
void viewScreenshot();
|
|
|
|
|
2020-01-09 13:59:19 +01:00
|
|
|
void infoMessage(const wxString& message);
|
|
|
|
void warningMessage(const wxString& message);
|
|
|
|
void errorMessage(const wxString& message);
|
|
|
|
|
2020-01-12 14:54:23 +01:00
|
|
|
MassManager _manager;
|
2020-01-10 00:01:24 +01:00
|
|
|
|
|
|
|
wxFileSystemWatcher _watcher;
|
|
|
|
int _lastWatcherEventType = 0;
|
2020-06-20 10:45:49 +02:00
|
|
|
|
|
|
|
wxImageList _screenshotThumbs{160, 160, true, 0};
|
2020-01-09 13:59:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __EvtMainFrame__
|