mirror of
https://github.com/devinacker/bsnes-plus.git
synced 2025-04-02 10:52:46 -04:00
43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
class FileBrowser : public FileDialog {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
function<void (const string&)> onChange;
|
|
function<void (const string&)> onActivate;
|
|
function<void (const string&)> onAccept;
|
|
|
|
void chooseFile();
|
|
void chooseFolder();
|
|
enum CartridgeMode { LoadDirect, LoadBase, LoadSlot1, LoadSlot2 } cartridgeMode;
|
|
void loadCartridge(CartridgeMode, signed = -1);
|
|
|
|
bool popupOpen() const { return nativeOpen; }
|
|
|
|
FileBrowser();
|
|
|
|
private slots:
|
|
void change(const string&);
|
|
void activate(const string&);
|
|
void accept(const string&);
|
|
void toggleApplyPatch();
|
|
|
|
private:
|
|
QVBoxLayout *previewLayout;
|
|
QLabel *previewInfo;
|
|
QWidget *previewImage;
|
|
QWidget *previewSpacer;
|
|
QCheckBox *previewApplyPatch;
|
|
|
|
bool nativeOpen;
|
|
|
|
string resolveFilename(const string&);
|
|
void onChangeCartridge(const string&);
|
|
void onAcceptCartridge(const string&);
|
|
|
|
void acceptNormal(const string &filename);
|
|
void acceptBsx(const string &filename);
|
|
void acceptSufamiTurbo(const string &filename);
|
|
void acceptSuperGameBoy(const string &filename);
|
|
};
|
|
|
|
extern FileBrowser *fileBrowser;
|