22
33import com .lx862 .pwgui .support .packwiz .executable .PackwizExecutable ;
44import com .lx862 .pwgui .util .Strings ;
5- import com .lx862 .pwgui .executable . ProgramExecution ;
5+ import com .lx862 .pwgui .task . RunProgramTask ;
66import com .lx862 .pwgui .gui .prompt .TaskDialog ;
77import com .lx862 .pwgui .gui .prompt .UpdateSummaryDialog ;
88import com .lx862 .pwgui .util .Util ;
@@ -30,9 +30,9 @@ public UpdateAction(Supplier<Window> getParent) {
3030 @ Override
3131 public void actionPerformed (ActionEvent e ) {
3232 Window parent = getParent .get ();
33- ProgramExecution programExecution = getProgramExecution (parent );
33+ RunProgramTask runProgramTask = getProgramExecution (parent );
3434
35- programExecution .onExit (exitResult -> {
35+ runProgramTask .onExit (exitResult -> {
3636 if (exitResult .success ()) {
3737 if (alreadyUpToDate .get ()) {
3838 JOptionPane .showMessageDialog (parent , "All files are already up to date!" , Util .withTitlePrefix ("Up to Date!" ), JOptionPane .INFORMATION_MESSAGE );
@@ -43,19 +43,19 @@ public void actionPerformed(ActionEvent e) {
4343 }
4444 }
4545 });
46- TaskDialog taskDialog = new TaskDialog (parent , "Checking for update..." , programExecution );
47- programExecution .run (Strings .REASON_TRIGGERED_BY_USER );
46+ TaskDialog taskDialog = new TaskDialog (parent , "Checking for update..." , runProgramTask );
47+ runProgramTask .run (Strings .REASON_TRIGGERED_BY_USER );
4848 taskDialog .setVisible (true );
4949 }
5050
51- public ProgramExecution getProgramExecution (Window parent ) {
52- ProgramExecution programExecution = PackwizExecutable .INSTANCE .updateAll ().build ();
51+ public RunProgramTask getProgramExecution (Window parent ) {
52+ RunProgramTask runProgramTask = PackwizExecutable .INSTANCE .updateAll ().build ();
5353 List <String > updateMods = new ArrayList <>();
5454 List <String > skippedMods = new ArrayList <>();
5555 List <String > unsupportedMods = new ArrayList <>();
5656 AtomicBoolean startLogMods = new AtomicBoolean ();
5757
58- programExecution .onOutput (stdout -> {
58+ runProgramTask .onOutput (stdout -> {
5959 String line = stdout .content ();
6060 if (line .startsWith ("Updates found:" )) {
6161 startLogMods .set (true );
@@ -71,8 +71,8 @@ public ProgramExecution getProgramExecution(Window parent) {
7171
7272 if (line .equals ("Do you want to update? [Y/n]: " )) {
7373 new UpdateSummaryDialog (parent , updateMods , skippedMods , unsupportedMods , (update ) -> {
74- if (update ) programExecution .enterInput ("Y" );
75- else programExecution .enterInput ("N" );
74+ if (update ) runProgramTask .enterInput ("Y" );
75+ else runProgramTask .enterInput ("N" );
7676 }).setVisible (true );
7777 }
7878
@@ -88,6 +88,6 @@ public ProgramExecution getProgramExecution(Window parent) {
8888 updateMods .add (line );
8989 }
9090 });
91- return programExecution ;
91+ return runProgramTask ;
9292 }
9393}
0 commit comments