Skip to content

Commit

Permalink
Revises setup wizard (#1138)
Browse files Browse the repository at this point in the history
  • Loading branch information
ultimaweapon authored Nov 24, 2024
1 parent 3756a60 commit 87f11ff
Show file tree
Hide file tree
Showing 31 changed files with 159 additions and 2,766 deletions.
767 changes: 0 additions & 767 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ members = [
"src/obconf",
"src/param",
"src/pfs",
"src/pkg",
"src/tls",
]

Expand Down
2 changes: 0 additions & 2 deletions gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ add_executable(obliteration WIN32 MACOSX_BUNDLE
main.cpp
main_window.cpp
path.cpp
pkg_extractor.cpp
pkg_installer.cpp
profile_models.cpp
progress_dialog.cpp
resources.cpp
Expand Down
4 changes: 1 addition & 3 deletions gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ path = "src/main.rs"
required-features = ["slint"]

[features]
slint = ["dep:slint", "dep:clap", "dep:rfd", "dep:open"]
slint = ["dep:slint", "dep:clap", "dep:open"]
qt = []

[dependencies]
Expand All @@ -31,8 +31,6 @@ obfw = { git = "https://github.com/obhq/firmware-dumper.git", features = [
] }
open = { version = "5.3.1", optional = true }
param = { path = "../src/param" }
pkg = { path = "../src/pkg" }
rfd = { version = "0.14.0", optional = true }
serde = { version = "1.0.209", features = ["derive"] }
thiserror = "1.0"
uuid = { version = "1.11.0", features = ["serde", "v4"] }
Expand Down
2 changes: 1 addition & 1 deletion gui/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fn main() {
fn build_bin() {
// Compile Slint.
slint_build::compile_with_config(
"ui/main.slint",
PathBuf::from_iter(["ui", "main.slint"]),
CompilerConfiguration::new().with_style(String::from("fluent-dark")),
)
.unwrap();
Expand Down
12 changes: 0 additions & 12 deletions gui/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,6 @@ char *param_title_id_get(const Param *p);

char *param_version_get(const Param *p);

Pkg *pkg_open(const char *file, struct RustError **error);

void pkg_close(Pkg *pkg);

Param *pkg_get_param(const Pkg *pkg, struct RustError **error);

struct RustError *pkg_extract(const Pkg *pkg, const char *dir, void (*status)(const char*,
size_t,
uint64_t,
uint64_t,
void*), void *ud);

struct Profile *profile_new(const char *name);

struct Profile *profile_load(const char *path, struct RustError **err);
Expand Down
9 changes: 0 additions & 9 deletions gui/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,6 @@ inline void Rust<Param>::free()
}
}

template<>
inline void Rust<Pkg>::free()
{
if (m_ptr) {
pkg_close(m_ptr);
m_ptr = nullptr;
}
}

template<>
inline void Rust<Profile>::free()
{
Expand Down
35 changes: 0 additions & 35 deletions gui/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "game_models.hpp"
#include "launch_settings.hpp"
#include "path.hpp"
#include "pkg_installer.hpp"
#include "profile_models.hpp"
#include "resources.hpp"
#include "screen.hpp"
Expand Down Expand Up @@ -61,15 +60,12 @@ MainWindow::MainWindow(

// File menu.
auto fileMenu = menuBar()->addMenu("&File");
auto installPkg = new QAction("&Install PKG", this);
auto openSystemFolder = new QAction("Open System &Folder", this);
auto quit = new QAction("&Quit", this);

connect(installPkg, &QAction::triggered, this, &MainWindow::installPkg);
connect(openSystemFolder, &QAction::triggered, this, &MainWindow::openSystemFolder);
connect(quit, &QAction::triggered, this, &MainWindow::close);

fileMenu->addAction(installPkg);
fileMenu->addAction(openSystemFolder);
fileMenu->addSeparator();
fileMenu->addAction(quit);
Expand Down Expand Up @@ -228,37 +224,6 @@ void MainWindow::closeEvent(QCloseEvent *event)
QMainWindow::closeEvent(event);
}

void MainWindow::installPkg()
{
// Browse a PKG.
auto path = QDir::toNativeSeparators(QFileDialog::getOpenFileName(this, "Install PKG", QString(), "PKG Files (*.pkg)"));

if (path.isEmpty()) {
return;
}

// Run installer.
PkgInstaller installer(readGamesDirectorySetting(), path, this);

if (!installer.exec()) {
return;
}

// Add to game list if new game.
auto &id = installer.gameId();
bool success = false;

if (!id.isEmpty()) {
success = loadGame(id);
} else {
success = true;
}

if (success) {
QMessageBox::information(this, "Success", "Package installed successfully.");
}
}

void MainWindow::openSystemFolder()
{
QString folderPath = readSystemDirectorySetting();
Expand Down
1 change: 0 additions & 1 deletion gui/main_window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class MainWindow final : public QMainWindow {
protected:
void closeEvent(QCloseEvent *event) override;
private slots:
void installPkg();
void openSystemFolder();
void reportIssue();
void aboutObliteration();
Expand Down
35 changes: 0 additions & 35 deletions gui/pkg_extractor.cpp

This file was deleted.

22 changes: 0 additions & 22 deletions gui/pkg_extractor.hpp

This file was deleted.

Loading

0 comments on commit 87f11ff

Please sign in to comment.