Skip to content

Commit

Permalink
cleanup all files
Browse files Browse the repository at this point in the history
  • Loading branch information
pasotee committed Apr 22, 2024
1 parent 56d74b4 commit 6cb4db0
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Source/TolgeeEditor/Private/STolgeeSyncDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ FReply STolgeeSyncDialog::OnCancelClicked()

FText STolgeeSyncDialog::GetOperationsSummary() const
{
return FText::Format(INVTEXT("{0} operations will be performed"), GetNumberOfOperationToPerform());
return FText::Format(INVTEXT("{0} operations will be performed"), GetNumberOfKeysAffectedByOperations());
}

int STolgeeSyncDialog::GetNumberOfOperationToPerform() const
int STolgeeSyncDialog::GetNumberOfKeysAffectedByOperations() const
{
int Total = 0;
if (UploadNew.bPerform)
Expand Down
68 changes: 61 additions & 7 deletions Source/TolgeeEditor/Private/STolgeeSyncDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,92 @@

#pragma once

/**
* @brief Represents details about a possible operation (Upload, Update, Delete)
*/
struct FTolgeeOperation
{
/**
* Name of the operation displayed to the developer
*/
FText Title;
/**
* Number of keys this operation will be affected by running this operation
*/
int NumberOfKeys = 0;
/**
* Should we perform this operation after the dialog closes?
*/
bool bPerform = false;
};

/**
* Window used to display the Sync dialog to chose what operations should be performed
*/
class STolgeeSyncDialog : public SWindow
{
public:
SLATE_BEGIN_ARGS(STolgeeSyncDialog) {}
SLATE_END_ARGS()

/**
* @brief Constructs the sync operations widget
*/
void Construct(const FArguments& InArgs, int NumToUpload, int NumToUpdate, int NumToDelete);

/**
* Refreshes the Run button style based on the operation that will be executed
*/
void RefreshRunButton();

/**
* Callback executed when the Run button is clicked
*/
FReply OnRunClicked();
/**
* Callback executed when the Cancel button is clicked
*/
FReply OnCancelClicked();

/**
* Constructs a text explaining all the operations that will be performed if the currently selected operations will be run
*/
FText GetOperationsSummary() const;
int GetNumberOfOperationToPerform() const;

/**
* Calculates the total number of keys that will be affected if the currently selected operations will be run
*/
int GetNumberOfKeysAffectedByOperations() const;
/**
* Constructs a user-facing checkbox to enable/disable an operation
*/
TSharedRef<SCheckBox> MakeOperationCheckBox(FTolgeeOperation& Operation);
/**
* Callback executed when a new checkbox state is set for an operation
*/
void OnOperationStateChanged(ECheckBoxState NewCheckedState, FTolgeeOperation* Operation);
/**
* Callback executed to determine the state of a checkbox for an operation
*/
ECheckBoxState IsOperationChecked(FTolgeeOperation* Operation) const;
/**
* Callback executed to determine if a checkbox is enabled for an operation
*/
bool IsOperationEnabled(FTolgeeOperation* Operation) const;
/**
* Callback executed to determine a checkbox title for an operation
*/
FText GetOperationName(FTolgeeOperation* Operation) const;

/**
* Reference to the used to Run the selected operations
*/
TSharedPtr<SButton> RunButton;

/**
* State of the UploadNew operation
*/
FTolgeeOperation UploadNew;
/**
* State of the UpdateOutdated operation
*/
FTolgeeOperation UpdateOutdated;
/**
* State of the DeleteUnused operation
*/
FTolgeeOperation DeleteUnused;
};
1 change: 0 additions & 1 deletion Source/TolgeeEditor/Private/STolgeeTranslationTab.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#pragma once

#include <CoreMinimal.h>
#include <Widgets/SCompoundWidget.h>

class SWebBrowser;
Expand Down

0 comments on commit 6cb4db0

Please sign in to comment.