Skip to content

Commit

Permalink
Nomen->launcher
Browse files Browse the repository at this point in the history
Ui->properties
restruct
  • Loading branch information
oblivioncth committed Dec 8, 2024
1 parent 75ff165 commit bab05c0
Show file tree
Hide file tree
Showing 49 changed files with 1,839 additions and 1,699 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ endif()

include(OB/FetchQx)
ob_fetch_qx(
REF "0572d288936afd63ff6f5b6ce4b1fbfc0f03b0eb"
REF "98088b18de1ed812f55adaff3b030f273c42a6c2"
COMPONENTS
${FIL_QX_COMPONENTS}
)
Expand Down Expand Up @@ -104,7 +104,7 @@ ob_fetch_clifp("7139ae998b292eb595e751ba4cb8599230435358")

# Fetch Neargye's Magic Enum
include(OB/FetchMagicEnum)
ob_fetch_magicenum("v0.9.3")
ob_fetch_magicenum("v0.9.7")

# Process Targets
set(APP_TARGET_NAME ${PROJECT_NAMESPACE_LC}_${PROJECT_NAMESPACE_LC})
Expand Down
74 changes: 42 additions & 32 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,48 +23,53 @@ add_custom_target(fil_copy_clifp

# ------------------ Setup FIL --------------------------
set(FIL_SOURCE
frontend/fe-data.h
frontend/fe-data.cpp
frontend/fe-installfoundation.h
frontend/fe-installfoundation.cpp
frontend/fe-installfoundation_win.cpp
frontend/fe-installfoundation_linux.cpp
frontend/fe-install.h
frontend/fe-install.cpp
frontend/fe-items.h
frontend/fe-items.cpp
frontend/attractmode/am-data.h
frontend/attractmode/am-data.cpp
frontend/attractmode/am-install.h
frontend/attractmode/am-install.cpp
frontend/attractmode/am-install_win.cpp
frontend/attractmode/am-install_linux.cpp
frontend/attractmode/am-items.h
frontend/attractmode/am-items.cpp
frontend/attractmode/am-settings-data.h
frontend/attractmode/am-settings-data.cpp
frontend/attractmode/am-settings-items.h
frontend/attractmode/am-settings-items.cpp
import/properties.h
import/properties.cpp
import/settings.h
import/worker.h
import/worker.cpp
launcher/lr-data.h
launcher/lr-data.cpp
launcher/lr-installfoundation.h
launcher/lr-installfoundation.cpp
launcher/lr-installfoundation_win.cpp
launcher/lr-installfoundation_linux.cpp
launcher/lr-install.h
launcher/lr-install.cpp
launcher/lr-items.h
launcher/lr-items.cpp
launcher/attractmode/am-data.h
launcher/attractmode/am-data.cpp
launcher/attractmode/am-install.h
launcher/attractmode/am-install.cpp
launcher/attractmode/am-install_win.cpp
launcher/attractmode/am-install_linux.cpp
launcher/attractmode/am-items.h
launcher/attractmode/am-items.cpp
launcher/attractmode/am-settings-data.h
launcher/attractmode/am-settings-data.cpp
launcher/attractmode/am-settings-items.h
launcher/attractmode/am-settings-items.cpp
ui/mainwindow.h
ui/mainwindow.cpp
ui/mainwindow.ui
ui/progresspresenter.h
ui/progresspresenter.cpp
clifp.h
clifp.cpp
import-worker.h
import-worker.cpp
kernel/controller.h
kernel/controller.cpp
kernel/clifp.h
kernel/clifp.cpp
main.cpp
)

if(CMAKE_SYSTEM_NAME STREQUAL Windows)
list(APPEND FIL_SOURCE
frontend/launchbox/lb-data.h
frontend/launchbox/lb-data.cpp
frontend/launchbox/lb-install.h
frontend/launchbox/lb-install.cpp
frontend/launchbox/lb-items.h
frontend/launchbox/lb-items.cpp
launcher/launchbox/lb-data.h
launcher/launchbox/lb-data.cpp
launcher/launchbox/lb-install.h
launcher/launchbox/lb-install.cpp
launcher/launchbox/lb-items.h
launcher/launchbox/lb-items.cpp
)
endif()

Expand Down Expand Up @@ -104,6 +109,11 @@ ob_add_standard_executable(${APP_TARGET_NAME}
WIN32
)

target_sources(fil_fil
PRIVATE

)

# Note that the executable depends on CLIFp being copied into its build dir
add_dependencies(${APP_TARGET_NAME} fil_copy_clifp)

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
6 changes: 3 additions & 3 deletions app/res/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<file>ui/CLIFp.png</file>
<file>ui/Exit.png</file>
<file>ui/GitHub.png</file>
<file>frontend/LaunchBox/icon.svg</file>
<file>frontend/AttractMode/icon.png</file>
<file>frontend/AttractMode/marquee.png</file>
<file>launcher/LaunchBox/icon.svg</file>
<file>launcher/AttractMode/icon.png</file>
<file>launcher/AttractMode/marquee.png</file>
<file>flashpoint/icon.png</file>
<file>ui/About.png</file>
</qresource>
Expand Down
65 changes: 65 additions & 0 deletions app/src/import/properties.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Unit Include
#include "properties.h"

namespace Import
{

//===============================================================================================================
// Properties
//===============================================================================================================

//-Constructor-------------------------------------------------------------
//Public:
Properties::Properties() :
mHasLinkPerms(false)
{}

//-Instance Functions-------------------------------------------------------------
//Public:
void Properties::setHasLinkPermissions(bool perms) { mHasLinkPerms = perms; }
bool Properties::hasLinkPermissions() const { return mHasLinkPerms; }

Qx::Bindable<bool> Properties::bindableIsLauncherPresent() { return &mLauncherPresent; }
bool Properties::isLauncherPresent() const { return mLauncherPresent; }

Qx::Bindable<bool> Properties::bindableIsLauncherReady() { return &mLauncherReady; }
bool Properties::isLauncherReady() const { return mLauncherReady; }

Qx::Bindable<bool> Properties::bindableIsFlashpointPresent() { return &mFlashpointPresent; }
bool Properties::isFlashpointPresent() const { return mFlashpointPresent; }

Qx::Bindable<bool> Properties::bindableIsFlashpointReady() { return &mFlashpointReady; }
bool Properties::isFlashpointReady() const { return mFlashpointReady; }

Qx::Bindable<bool> Properties::bindableIsBothTargetsReady() { return &mBothTargetsReady; }
bool Properties::isBothTargetsReady() const { return mBothTargetsReady; }

Qx::Bindable<bool> Properties::bindableIsFlashpointTargetSeries() { return &mFlashpointTargetSeries; }
bool Properties::isFlashpointTargetSeries() const { return mFlashpointTargetSeries; }

Qx::Bindable<QList<ImageMode>> Properties::bindableImageModeOrder() { return &mImageModeOrder; }
const Qx::Bindable<QList<ImageMode>> Properties::bindableImageModeOrder() const { return &mImageModeOrder; }
QList<ImageMode> Properties::imageModeOrder() const { return mImageModeOrder; }

Qx::Bindable<bool> Properties::bindableIsImageDownloadable() { return &mImageDownloadable; }
bool Properties::isImageDownloadable() const { return mImageDownloadable; }

Qx::Bindable<QString> Properties::bindableLauncherInfo() { return &mLauncherInfo; }
QString Properties::launcherInfo() const { return mLauncherInfo; }

Qx::Bindable<QString> Properties::bindableFlashpointInfo() { return &mFlashpointInfo; }
QString Properties::flashpointInfo() const { return mFlashpointInfo; }

Qx::Bindable<QMap<int, Fp::Db::TagCategory>> Properties::bindableTagMap() { return &mTagMap; }
const Qx::Bindable<QMap<int, Fp::Db::TagCategory>> Properties::bindableTagMap() const { return &mTagMap; }
QMap<int, Fp::Db::TagCategory> Properties::tagMap() const { return mTagMap; }

Qx::Bindable<QList<Importee>> Properties::bindablePlatforms() { return &mPlatforms; }
const Qx::Bindable<QList<Importee>> Properties::bindablePlatforms() const { return &mPlatforms; }
QList<Importee> Properties::platforms() const { return mPlatforms; }

Qx::Bindable<QList<Importee>> Properties::bindablePlaylists() { return &mPlaylists; }
const Qx::Bindable<QList<Importee>> Properties::bindablePlaylists() const { return &mPlaylists; }
QList<Importee> Properties::playlists() const { return mPlaylists; }

}
101 changes: 101 additions & 0 deletions app/src/import/properties.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#ifndef IMPORT_PROPERTIES_H
#define IMPORT_PROPERTIES_H

// Qt Includes
#include <QProperty>

// Qx Includes
#include <qx/core/qx-property.h>

// libfp Includes
#include <fp/fp-db.h>

// Project Includes
#include "import/settings.h"

/* TODO: The number of properties here has gotten somewhat out of hand.
* Mainwindow should probably just be given access to something like
* const QBindable<const std::shared_ptr<Fp::Install>> (and same for
* launcher) so that it can setup its own bindings/properties directly
* off of that. Since it would be read only, that still lets Controller
* have control of the instances.
*/

namespace Import
{

class Properties
{
//-Instance Variables-------------------------------------------------------------
private:
bool mHasLinkPerms;
Qx::Property<bool> mLauncherPresent;
Qx::Property<bool> mLauncherReady;
Qx::Property<bool> mFlashpointPresent;
Qx::Property<bool> mFlashpointReady;
Qx::Property<bool> mBothTargetsReady;
Qx::Property<bool> mFlashpointTargetSeries;
Qx::Property<QList<ImageMode>> mImageModeOrder;
Qx::Property<bool> mImageDownloadable;
Qx::Property<QString> mLauncherInfo;
Qx::Property<QString> mFlashpointInfo;
Qx::Property<QMap<int, Fp::Db::TagCategory>> mTagMap;
Qx::Property<QList<Importee>> mPlatforms;
Qx::Property<QList<Importee>> mPlaylists;

//-Constructor-------------------------------------------------------------
public:
Properties();

//-Instance Functions-------------------------------------------------------------
public:
void setHasLinkPermissions(bool perms);
bool hasLinkPermissions() const;

Qx::Bindable<bool> bindableIsLauncherPresent();
bool isLauncherPresent() const;

Qx::Bindable<bool> bindableIsLauncherReady();
bool isLauncherReady() const;

Qx::Bindable<bool> bindableIsFlashpointPresent();
bool isFlashpointPresent() const;

Qx::Bindable<bool> bindableIsFlashpointReady();
bool isFlashpointReady() const;

Qx::Bindable<bool> bindableIsBothTargetsReady();
bool isBothTargetsReady() const;

Qx::Bindable<bool> bindableIsFlashpointTargetSeries();
bool isFlashpointTargetSeries() const;

Qx::Bindable<QList<ImageMode>> bindableImageModeOrder();
const Qx::Bindable<QList<ImageMode>> bindableImageModeOrder() const;
QList<ImageMode> imageModeOrder() const;

Qx::Bindable<bool> bindableIsImageDownloadable();
bool isImageDownloadable() const;

Qx::Bindable<QString> bindableLauncherInfo();
QString launcherInfo() const;

Qx::Bindable<QString> bindableFlashpointInfo();
QString flashpointInfo() const;

Qx::Bindable<QMap<int, Fp::Db::TagCategory>> bindableTagMap();
const Qx::Bindable<QMap<int, Fp::Db::TagCategory>> bindableTagMap() const;
QMap<int, Fp::Db::TagCategory> tagMap() const;

Qx::Bindable<QList<Importee>> bindablePlatforms();
const Qx::Bindable<QList<Importee>> bindablePlatforms() const;
QList<Importee> platforms() const;

Qx::Bindable<QList<Importee>> bindablePlaylists();
const Qx::Bindable<QList<Importee>> bindablePlaylists() const;
QList<Importee> playlists() const;
};

}

#endif // IMPORT_PROPERTIES_H
50 changes: 50 additions & 0 deletions app/src/import/settings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#ifndef IMPORT_SETTINGS_H
#define IMPORT_SETTINGS_H

// Qt Includes
#include <QString>
#include <QList>

// libfp Includes
#include <fp/fp-db.h>

namespace Import
{

// Enums
enum class Install{ Launcher, Flashpoint };
enum class UpdateMode {OnlyNew, NewAndExisting};
enum class ImageMode {Copy, Reference, Link};
enum class PlaylistGameMode {SelectedPlatform, ForceAll};

// Structs
struct Importee
{
QString name;
bool existing = false;
};

struct Selections
{
QStringList platforms;
QStringList playlists;
};

struct UpdateOptions
{
UpdateMode importMode;
bool removeObsolete;
};

struct OptionSet
{
UpdateOptions updateOptions;
ImageMode imageMode;
bool downloadImages;
PlaylistGameMode playlistMode;
Fp::Db::InclusionOptions inclusionOptions;
};

}

#endif // IMPORT_SETTINGS_H
Loading

0 comments on commit bab05c0

Please sign in to comment.