mirror of
https://github.com/developersu/ns-usbloader.git
synced 2025-05-14 15:15:05 -04:00
Update test, rename FrontTab to GamesTab
This commit is contained in:
parent
eb07ab1df8
commit
6e21c514a8
9 changed files with 52 additions and 26 deletions
|
@ -44,7 +44,7 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class FrontController implements Initializable {
|
||||
public class GamesController implements Initializable {
|
||||
@FXML
|
||||
private AnchorPane usbNetPane;
|
||||
|
||||
|
@ -353,6 +353,7 @@ public class FrontController implements Initializable {
|
|||
usbNetPane.setDisable(isActive);
|
||||
return;
|
||||
}
|
||||
|
||||
selectNspBtn.setDisable(isActive);
|
||||
selectSplitNspBtn.setDisable(isActive);
|
||||
btnUpStopImage.getStyleClass().clear();
|
||||
|
@ -362,16 +363,17 @@ public class FrontController implements Initializable {
|
|||
|
||||
uploadStopBtn.setOnAction(e-> stopBtnAction());
|
||||
uploadStopBtn.setText(resourceBundle.getString("btn_Stop"));
|
||||
uploadStopBtn.getStyleClass().clear();
|
||||
uploadStopBtn.getStyleClass().remove("buttonUp");
|
||||
uploadStopBtn.getStyleClass().add("buttonStop");
|
||||
return;
|
||||
}
|
||||
btnUpStopImage.getStyleClass().add("regionUpload");
|
||||
else {
|
||||
btnUpStopImage.getStyleClass().add("regionUpload");
|
||||
|
||||
uploadStopBtn.setOnAction(e-> uploadBtnAction());
|
||||
uploadStopBtn.setText(resourceBundle.getString("btn_Upload"));
|
||||
uploadStopBtn.getStyleClass().clear();
|
||||
uploadStopBtn.getStyleClass().add("buttonUp");
|
||||
uploadStopBtn.setOnAction(e-> uploadBtnAction());
|
||||
uploadStopBtn.setText(resourceBundle.getString("btn_Upload"));
|
||||
uploadStopBtn.getStyleClass().remove("buttonStop");
|
||||
uploadStopBtn.getStyleClass().add("buttonUp");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Crunch. This function called from NSTableViewController
|
|
@ -41,7 +41,7 @@ public class NSLMainController implements Initializable {
|
|||
public ProgressBar progressBar; // Accessible from Mediator
|
||||
|
||||
@FXML
|
||||
public FrontController FrontTabController; // Accessible from Mediator | todo: incapsulate
|
||||
public GamesController GamesTabController; // Accessible from Mediator | todo: incapsulate
|
||||
@FXML
|
||||
private SettingsController SettingsTabController;
|
||||
@FXML
|
||||
|
@ -103,8 +103,8 @@ public class NSLMainController implements Initializable {
|
|||
return SettingsTabController;
|
||||
}
|
||||
|
||||
public FrontController getFrontCtrlr(){
|
||||
return FrontTabController;
|
||||
public GamesController getGamesCtrlr(){
|
||||
return GamesTabController;
|
||||
}
|
||||
|
||||
public SplitMergeController getSmCtrlr(){
|
||||
|
@ -118,7 +118,7 @@ public class NSLMainController implements Initializable {
|
|||
* Save preferences before exit
|
||||
* */
|
||||
public void exit(){
|
||||
FrontTabController.updatePreferencesOnExit();
|
||||
GamesTabController.updatePreferencesOnExit();
|
||||
SettingsTabController.updatePreferencesOnExit();
|
||||
SplitMergeTabController.updatePreferencesOnExit(); // NOTE: This shit above should be re-written to similar pattern
|
||||
RcmTabController.updatePreferencesOnExit();
|
||||
|
|
|
@ -24,12 +24,10 @@ import javafx.collections.FXCollections;
|
|||
import javafx.collections.ObservableList;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.SnapshotParameters;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.control.cell.CheckBoxTableCell;
|
||||
import javafx.scene.control.cell.PropertyValueFactory;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.paint.Paint;
|
||||
import nsusbloader.MediatorControl;
|
||||
import nsusbloader.NSLDataTypes.EFileStatus;
|
||||
|
||||
|
@ -59,7 +57,7 @@ public class NSTableViewController implements Initializable {
|
|||
if (keyEvent.getCode() == KeyCode.DELETE && !MediatorControl.getInstance().getTransferActive()) {
|
||||
rowsObsLst.removeAll(table.getSelectionModel().getSelectedItems());
|
||||
if (rowsObsLst.isEmpty())
|
||||
MediatorControl.getInstance().getContoller().getFrontCtrlr().disableUploadStopBtn(true); // TODO: change to something better
|
||||
MediatorControl.getInstance().getContoller().getGamesCtrlr().disableUploadStopBtn(true); // TODO: change to something better
|
||||
table.refresh();
|
||||
} else if (keyEvent.getCode() == KeyCode.SPACE) {
|
||||
for (NSLRowModel item : table.getSelectionModel().getSelectedItems()) {
|
||||
|
@ -177,13 +175,13 @@ public class NSTableViewController implements Initializable {
|
|||
deleteMenuItem.setOnAction(actionEvent -> {
|
||||
rowsObsLst.remove(row.getItem());
|
||||
if (rowsObsLst.isEmpty())
|
||||
MediatorControl.getInstance().getContoller().getFrontCtrlr().disableUploadStopBtn(true); // TODO: change to something better
|
||||
MediatorControl.getInstance().getContoller().getGamesCtrlr().disableUploadStopBtn(true); // TODO: change to something better
|
||||
table.refresh();
|
||||
});
|
||||
MenuItem deleteAllMenuItem = new MenuItem(resourceBundle.getString("tab1_table_contextMenu_Btn_DeleteAll"));
|
||||
deleteAllMenuItem.setOnAction(actionEvent -> {
|
||||
rowsObsLst.clear();
|
||||
MediatorControl.getInstance().getContoller().getFrontCtrlr().disableUploadStopBtn(true); // TODO: change to something better
|
||||
MediatorControl.getInstance().getContoller().getGamesCtrlr().disableUploadStopBtn(true); // TODO: change to something better
|
||||
table.refresh();
|
||||
});
|
||||
contextMenu.getItems().addAll(deleteMenuItem, deleteAllMenuItem);
|
||||
|
@ -228,7 +226,7 @@ public class NSTableViewController implements Initializable {
|
|||
}
|
||||
else {
|
||||
rowsObsLst.add(new NSLRowModel(file, true));
|
||||
MediatorControl.getInstance().getContoller().getFrontCtrlr().disableUploadStopBtn(false); // TODO: change to something better
|
||||
MediatorControl.getInstance().getContoller().getGamesCtrlr().disableUploadStopBtn(false); // TODO: change to something better
|
||||
}
|
||||
table.refresh();
|
||||
}
|
||||
|
@ -248,7 +246,7 @@ public class NSTableViewController implements Initializable {
|
|||
else {
|
||||
for (File file: newFiles)
|
||||
rowsObsLst.add(new NSLRowModel(file, true));
|
||||
MediatorControl.getInstance().getContoller().getFrontCtrlr().disableUploadStopBtn(false); // TODO: change to something better
|
||||
MediatorControl.getInstance().getContoller().getGamesCtrlr().disableUploadStopBtn(false); // TODO: change to something better
|
||||
}
|
||||
//rowsObsLst.get(0).setMarkForUpload(true);
|
||||
table.refresh();
|
||||
|
|
|
@ -41,7 +41,7 @@ public class MediatorControl {
|
|||
|
||||
public synchronized void setBgThreadActive(boolean isActive, EModule appModuleType) {
|
||||
isTransferActive.set(isActive);
|
||||
mainCtrler.getFrontCtrlr().notifyThreadStarted(isActive, appModuleType);
|
||||
mainCtrler.getGamesCtrlr().notifyThreadStarted(isActive, appModuleType);
|
||||
mainCtrler.getSmCtrlr().notifySmThreadStarted(isActive, appModuleType);
|
||||
mainCtrler.getRcmCtrlr().notifyThreadStarted(isActive, appModuleType);
|
||||
mainCtrler.getNXDTabController().notifyThreadStarted(isActive, appModuleType);
|
||||
|
|
|
@ -26,7 +26,6 @@ import nsusbloader.Controllers.NSTableViewController;
|
|||
import nsusbloader.MediatorControl;
|
||||
import nsusbloader.NSLDataTypes.EFileStatus;
|
||||
import nsusbloader.NSLDataTypes.EModule;
|
||||
import nsusbloader.NSLDataTypes.EMsgType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
@ -62,7 +61,7 @@ public class MessagesConsumer extends AnimationTimer {
|
|||
this.progressBar = MediatorControl.getInstance().getContoller().progressBar;
|
||||
|
||||
this.statusMap = statusMap;
|
||||
this.tableViewController = MediatorControl.getInstance().getContoller().FrontTabController.tableFilesListController;
|
||||
this.tableViewController = MediatorControl.getInstance().getContoller().GamesTabController.tableFilesListController;
|
||||
|
||||
this.oneLinerStatus = oneLinerStatus;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue