Skip to content

Commit

Permalink
fix bug in automatic dB reading
Browse files Browse the repository at this point in the history
  • Loading branch information
flaime authored and Linus Ahlin-Hamberg committed Jul 14, 2019
1 parent 805dd7d commit 9275217
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/main/java/hjälpprogram/ReloadDatabasAutomatic.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,14 @@ private void dataExtraction() {

lock.lock();
try {
if (replace == true)
if (replace == true){
mainUi.addKlubbarErsätt(t);
mainUi.addLoppErsätt(t);
else
}
else{
mainUi.addKlubbarHoppaÖver(t);
mainUi.addLoppHoppaÖver(t);
}
} finally {
lock.unlock();
}
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/uiProgram/DatabasLoderController.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public class DatabasLoderController implements LoadDatabasInformation {

@FXML
Button readDatabas;

@FXML
Button selectdatabas;

@FXML
TextField databasURL;

Expand Down Expand Up @@ -145,6 +149,10 @@ private void loadDatabas(){
public void autoLoadPdfOn(){
System.out.println("load");
readDatabas.setDisable(true);
selectdatabas.setDisable(true);
reloadIntervall.setDisable(true);
replace.setDisable(true);
skipp.setDisable(true);
int seconds = Integer.parseInt(reloadIntervall.getText());
if(seconds == 0){
seconds = 10;
Expand All @@ -165,6 +173,10 @@ public void autoLoadPdfOf(){
System.out.println("load3");

readDatabas.setDisable(false);
selectdatabas.setDisable(false);
reloadIntervall.setDisable(false);
replace.setDisable(false);
skipp.setDisable(false);
rdb.setRuning(false);
System.out.println("load4");

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/LoadDatabasUi.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<Insets left="10.0" />
</HBox.margin>
</TextField>
<Button mnemonicParsing="false" onAction="#handleShoseDatabas" text="Select databas">
<Button fx:id="selectdatabas" mnemonicParsing="false" onAction="#handleShoseDatabas" text="Select databas">
<HBox.margin>
<Insets left="10.0" />
</HBox.margin>
Expand Down

0 comments on commit 9275217

Please sign in to comment.