package app.lsgui.gui;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import app.lsgui.gui.streamInfoPanel.StreamInfoPanel;
import app.lsgui.gui.streamList.StreamList;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.layout.BorderPane;

public class MainController {

    private static Logger LOGGER = LoggerFactory.getLogger(MainController.class);

    private static StreamList streamList;
    private static StreamInfoPanel streamInfoPanel;

    @FXML
    private Button addButton;

    @FXML
    private Button removeButton;

    @FXML
    private Button settingsButton;

    @FXML
    private ComboBox qualityComboBox;

    @FXML
    private ComboBox serviceComboBox;

    @FXML
    private BorderPane contentBorderPane;

    @FXML
    public void initialize() {
        LOGGER.debug("INIT MainController");

        streamList = new StreamList();
        streamInfoPanel = new StreamInfoPanel(null);

        contentBorderPane.setLeft(streamList);
        contentBorderPane.setCenter(streamInfoPanel);
    }

    @FXML
    private void addAction() {

    }

    @FXML
    private void removeAction() {

    }

    @FXML
    private void onSettingsClicked() {

    }

}

@@ -17,16 +17,117 @@
 i.gui;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.Optional;%0Aimport java.util.Set;%0A%0A
 import o
@@ -270,24 +270,153 @@
 StreamList;%0A
+import app.lsgui.serviceapi.twitch.TwitchProcessor;%0Aimport javafx.application.Platform;%0Aimport javafx.collections.FXCollections;%0A
 import javaf
@@ -502,16 +502,61 @@
 mboBox;%0A
+import javafx.scene.control.TextInputDialog;%0A
 import j
@@ -957,16 +957,22 @@
 ComboBox
+%3CVoid%3E
  quality
@@ -1012,16 +1012,22 @@
 ComboBox
+%3CVoid%3E
  service
@@ -1536,10 +1536,917 @@
 %0A    %7D%0A%0A
+    @FXML%0A    private void importStreams() %7B%0A        TextInputDialog dialog = new TextInputDialog();%0A        dialog.setTitle(%22Import Twitch.tv followed Streams%22);%0A        dialog.setContentText(%22Please enter your Twitch.tv Username:%22);%0A%0A        // Traditional way to get the response value.%0A        Optional%3CString%3E result = dialog.showAndWait();%0A        if (result.isPresent()) %7B%0A%0A            Platform.runLater(new Runnable() %7B%0A                @Override%0A                public void run() %7B%0A                    Set%3CString%3E list = TwitchProcessor.instance().getListOfFollowedStreams(result.get());%0A                    List%3CString%3E list2 = new ArrayList%3CString%3E();%0A                    list2.addAll(list);%0A                    streamList.getStreams()%0A                            .setValue(FXCollections.observableArrayList(FXCollections.observableList(list2)));%0A                %7D%0A            %7D);%0A        %7D%0A    %7D%0A
 %7D%0A

enable import of followed streams