Allows choosing and managing each tool

This commit is contained in:
Guillaume Tâche
2024-10-03 21:55:14 +02:00
parent 0a2f9e0c31
commit df58cf4585
117 changed files with 1547 additions and 1515 deletions

View File

@@ -1,69 +1,39 @@
package com.github.gtache.autosubtitle.gui.setup;
import com.github.gtache.autosubtitle.ToolType;
/**
* Controller for the setup view
*/
public interface SetupController {
/**
* Installs the video converter
* Installs the tool given by the tool type
*
* @param type The tool type
*/
void installVideoConverter();
void install(ToolType type);
/**
* Uninstalls the video converter
* Uninstalls the tool given by the tool type
*
* @param type The tool type
*/
void uninstallVideoConverter();
void uninstall(ToolType type);
/**
* Updates the video converter
* Updates the tool given by the tool type
*
* @param type The tool type
*/
void updateVideoConverter();
void update(ToolType type);
/**
* Reinstalls the video converter
* Reinstalls the tool given by the tool type
*
* @param type The tool type
*/
void reinstallVideoConverter();
/**
* Installs the subtitle extractor
*/
void installSubtitleExtractor();
/**
* Uninstalls the subtitle extractor
*/
void uninstallSubtitleExtractor();
/**
* Updates the subtitle extractor
*/
void updateSubtitleExtractor();
/**
* Reinstalls the subtitle extractor
*/
void reinstallSubtitleExtractor();
/**
* Installs the translator
*/
void installTranslator();
/**
* Uninstalls the translator
*/
void uninstallTranslator();
/**
* Updates the translator
*/
void updateTranslator();
/**
* Reinstalls the translator
*/
void reinstallTranslator();
void reinstall(ToolType type);
/**
* @return the model

View File

@@ -1,117 +1,101 @@
package com.github.gtache.autosubtitle.gui.setup;
import com.github.gtache.autosubtitle.ToolType;
import com.github.gtache.autosubtitle.setup.SetupManager;
import com.github.gtache.autosubtitle.setup.SetupStatus;
import java.util.List;
/**
* Model for the setup view
*/
public interface SetupModel {
/**
* @return the status of the subtitle extractor
* Returns the list of available setup managers for the given tool type
*
* @param type The tool type
* @return The list of managers
*/
SetupStatus subtitleExtractorStatus();
List<SetupManager> availableSetupManagers(ToolType type);
/**
* Sets the status of the subtitle extractor
* Returns the selected setup manager for the given tool type
*
* @param type The tool type
* @return The manager
*/
SetupManager selectedSetupManager(ToolType type);
/**
* Sets the selected setup manager for the given tool type
*
* @param type The tool type
* @param manager the new subtitle extractor
*/
void setSelectedSetupManager(ToolType type, SetupManager manager);
/**
* Returns the selected tool for the given tool type
*
* @param type The tool type
* @return the selected tool
*/
String selectedTool(ToolType type);
/**
* Returns the status of the setup manager for the given tool type
*
* @param type The tool type
* @return the status of the setup manager
*/
SetupStatus managerStatus(ToolType type);
/**
* Sets the status of the setup manager for the given tool type
*
* @param type The tool type
* @param status the new status
*/
void setSubtitleExtractorStatus(SetupStatus status);
void setManagerStatus(ToolType type, SetupStatus status);
/**
* @return the progress of the subtitle extractor setup
*/
double subtitleExtractorSetupProgress();
/**
* Sets the progress of the subtitle extractor setup
* Returns the progress of the tool setup for the given tool type
*
* @param type The tool type
* @return the progress of the tool setup
*/
double setupProgress(ToolType type);
/**
* Sets the progress of the tool setup for the given tool type
*
* @param type The tool type
* @param progress the new progress
*/
void setSubtitleExtractorSetupProgress(double progress);
void setSetupProgress(ToolType type, double progress);
/**
* @return the text of the subtitle extractor setup progress
*/
String subtitleExtractorSetupProgressLabel();
/**
* Sets the text of the subtitle extractor setup progress
* Returns the text of the setup progress for the given tool type
*
* @param type The tool type
* @return the text of the setup progress label
*/
String setupProgressLabel(ToolType type);
/**
* Sets the text of the setup progress for the given tool type
*
* @param type The tool type
* @param label the new text
*/
void setSubtitleExtractorSetupProgressLabel(String label);
void setSetupProgressLabel(ToolType type, String label);
/**
* @return the status of the video converter
*/
SetupStatus videoConverterStatus();
/**
* Sets the status of the video converter
* Returns true if the setup is editable
*
* @param status the new status
* @param type The tool type
* @return true if the setup is editable
*/
void setVideoConverterStatus(SetupStatus status);
/**
* @return the progress of the video converter setup
*/
double videoConverterSetupProgress();
/**
* Sets the progress of the video converter setup
*
* @param progress the new progress
*/
void setVideoConverterSetupProgress(double progress);
/**
* @return the text of the video converter setup progress
*/
String videoConverterSetupProgressLabel();
/**
* Sets the text of the video converter setup progress
*
* @param label the new text
*/
void setVideoConverterSetupProgressLabel(String label);
/**
* @return the status of the translator
*/
SetupStatus translatorStatus();
/**
* Sets the status of the translator
*
* @param status the new status
*/
void setTranslatorStatus(SetupStatus status);
/**
* @return the progress of the translator setup
*/
double translatorSetupProgress();
/**
* Sets the progress of the translator setup
*
* @param progress the new progress
*/
void setTranslatorSetupProgress(double progress);
/**
* @return the text of the translator setup progress
*/
String translatorSetupProgressLabel();
/**
* Sets the text of the translator setup progress
*
* @param label the new text
*/
void setTranslatorSetupProgressLabel(String label);
boolean isSetupInProgress(ToolType type);
}