2010-12-21 21:01:39 +01:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include "../WiiQt/includes.h"
|
|
|
|
#include "../WiiQt/nusdownloader.h"
|
|
|
|
#include "../WiiQt/nandbin.h"
|
|
|
|
#include "../WiiQt/uidmap.h"
|
|
|
|
#include "../WiiQt/sharedcontentmap.h"
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class MainWindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MainWindow( QWidget *parent = 0 );
|
|
|
|
~MainWindow();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::MainWindow *ui;
|
|
|
|
QTreeWidgetItem *root;
|
|
|
|
bool nandInited;
|
|
|
|
bool uidDirty;
|
|
|
|
bool sharedDirty;
|
|
|
|
bool nandDirty;
|
|
|
|
|
|
|
|
NusDownloader nus;
|
|
|
|
NandBin nand;
|
|
|
|
UIDmap uid;
|
|
|
|
SharedContentMap shared;
|
|
|
|
bool FlushNand();
|
|
|
|
|
|
|
|
void ShowMessage( const QString& mes );
|
|
|
|
|
|
|
|
bool InitNand( const QString &path );
|
|
|
|
bool UpdateTree();
|
|
|
|
|
|
|
|
QString PathFromItem( QTreeWidgetItem *item );
|
|
|
|
QTreeWidgetItem *ItemFromPath( const QString &path );
|
|
|
|
QTreeWidgetItem *FindItem( const QString &s, QTreeWidgetItem *parent );
|
|
|
|
|
|
|
|
bool InstallNUSItem( NusJob job );
|
|
|
|
quint16 CreateIfNeeded( const QString &path, quint32 uid, quint16 gid, quint8 attr, quint8 user_perm, quint8 group_perm, quint8 other_perm );
|
2011-05-16 09:46:42 +02:00
|
|
|
bool InstallSharedContent( const QByteArray &stuff, const QByteArray &hash = QByteArray() );
|
2010-12-21 21:01:39 +01:00
|
|
|
|
2011-05-16 09:46:42 +02:00
|
|
|
void SaveSettings();
|
|
|
|
void LoadSettings();
|
2011-01-15 23:21:43 +01:00
|
|
|
#if 0
|
2011-05-16 09:46:42 +02:00
|
|
|
void TryToAddDefaultSettings();
|
2011-01-15 23:21:43 +01:00
|
|
|
#endif
|
2011-05-16 09:46:42 +02:00
|
|
|
void AddStuffToMetaFolder();
|
|
|
|
QByteArray GenMeta( const QString &desc, quint64 tid, quint16 version );
|
2011-01-08 20:14:47 +01:00
|
|
|
|
2011-05-27 23:34:22 +02:00
|
|
|
void WriteTestLog();
|
|
|
|
|
2010-12-21 21:01:39 +01:00
|
|
|
public slots:
|
|
|
|
//slots for getting info from the NUS downloader
|
2011-05-17 21:02:45 +02:00
|
|
|
void GetError( const QString &message, const NusJob &job );
|
2010-12-21 21:01:39 +01:00
|
|
|
void GetError( const QString &message );
|
|
|
|
void NusIsDone();
|
2011-05-17 21:02:45 +02:00
|
|
|
void ReceiveTitleFromNus( const NusJob &job );
|
2010-12-21 21:01:39 +01:00
|
|
|
|
|
|
|
private slots:
|
2011-05-16 09:46:42 +02:00
|
|
|
void on_actionFormat_triggered();
|
|
|
|
void on_actionWrite_meta_entries_triggered();
|
|
|
|
void on_pushButton_CachePathBrowse_clicked();
|
2010-12-21 21:01:39 +01:00
|
|
|
void on_actionAbout_triggered();
|
|
|
|
void on_pushButton_initNand_clicked();
|
|
|
|
void on_actionNew_nand_from_keys_triggered();
|
|
|
|
void on_actionFlush_triggered();
|
|
|
|
void on_actionSetting_txt_triggered();
|
|
|
|
void on_actionImportWad_triggered();
|
|
|
|
void on_pushButton_nandPath_clicked();
|
|
|
|
void on_pushButton_GetTitle_clicked();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|