Extracts the control panel tab to its own class, and makes the add server button into a tab button

This commit is contained in:
2021-10-01 00:58:00 +02:00
parent 50b9188229
commit 9f092a73fe
5 changed files with 277 additions and 179 deletions

View File

@ -237,7 +237,7 @@ public class ServerLauncherMenu implements ActionListener {
* Asks the user for a delay if checked, and sets the value to the current profile
*/
private void delay() {
String selectedProfile = serverLauncherGUI.getSelectedProfile();
String selectedProfile = serverLauncherGUI.getControlPanelTab().getSelectedProfile();
if (selectedProfile != null) {
Profile profile = controller.getProfileByName(selectedProfile);
if (delayStartupCheckBoxMenuItem.isSelected()) {
@ -260,7 +260,7 @@ public class ServerLauncherMenu implements ActionListener {
* Saves the runInBackground setting to the current profile
*/
private void background() {
String selectedProfile = serverLauncherGUI.getSelectedProfile();
String selectedProfile = serverLauncherGUI.getControlPanelTab().getSelectedProfile();
if (selectedProfile != null) {
Profile profile = controller.getProfileByName(selectedProfile);
Objects.requireNonNull(profile).setRunInBackground(runInBackgroundCheckBoxMenuItem.isSelected());
@ -273,7 +273,7 @@ public class ServerLauncherMenu implements ActionListener {
* Saves the downloadJars setting to the current profile
*/
private void downloadJars() {
String selectedProfile = serverLauncherGUI.getSelectedProfile();
String selectedProfile = serverLauncherGUI.getControlPanelTab().getSelectedProfile();
if (selectedProfile != null) {
controller.setDownloadAllJars(downloadJarsCheckBoxMenuItem.isSelected());
} else {