finished new database system... FINALLY
This commit is contained in:
parent
295f5ad96c
commit
03d0a57671
4 changed files with 36 additions and 34 deletions
|
@ -19,7 +19,7 @@ public class LoadMenu {
|
|||
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
|
||||
load.setMinimum(0);
|
||||
load.setMaximum(6);
|
||||
load.setMaximum(7);
|
||||
|
||||
|
||||
load.setBounds(1, 178, 398, 20);
|
||||
|
|
|
@ -21,40 +21,7 @@ public class SettingsGui {
|
|||
settings.setSize(500, 500);
|
||||
settings.setVisible(true);
|
||||
|
||||
Button button = new Button("Daten auf neues System migrieren");
|
||||
button.setBounds(20, 20, 200, 30);
|
||||
|
||||
Button save = new Button("speichern");
|
||||
save.setBounds(430, 230, 100, 30);
|
||||
|
||||
save.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
WriteSettings write = new WriteSettings();
|
||||
try {
|
||||
write.write();
|
||||
} catch (IOException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
button.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
MigrateData migrate = new MigrateData();
|
||||
migrate.migrateData();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
settings.add(button);
|
||||
settings.add(save);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import data.ManageFiles;
|
|||
import database.DatabaseManager;
|
||||
import filestructure.CreateFileStructure;
|
||||
import gui.LoadMenu;
|
||||
import preload.PreChecks;
|
||||
import settingsfunctions.LoadSettings;
|
||||
|
||||
public class Main {
|
||||
|
@ -34,6 +35,11 @@ public class Main {
|
|||
FetchData fetch = new FetchData();
|
||||
fetch.getGithubString();
|
||||
|
||||
load.updateBar("Daten werden überprüft...");
|
||||
|
||||
PreChecks check = new PreChecks();
|
||||
check.check();
|
||||
|
||||
load.updateBar("Einträge werden Indexiert...");
|
||||
|
||||
ManageFiles manager = new ManageFiles();
|
||||
|
|
29
src/preload/PreChecks.java
Normal file
29
src/preload/PreChecks.java
Normal file
|
@ -0,0 +1,29 @@
|
|||
package preload;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import data.FetchData;
|
||||
import data.ManageFiles;
|
||||
import settingsfunctions.MigrateData;
|
||||
|
||||
public class PreChecks {
|
||||
|
||||
public void check() {
|
||||
File file = new File("C:\\ExtremeDemonList\\levels");
|
||||
File[] list = file.listFiles();
|
||||
|
||||
FetchData data = new FetchData();
|
||||
|
||||
System.out.println(data.allLevels().size() - 10);
|
||||
System.out.println(list.length);
|
||||
|
||||
if(list.length >= data.allLevels().size() - 10) {
|
||||
JOptionPane.showMessageDialog(null, "Deine Daten wurden noch nicht migriert. Dies erfolgt nun und kann etwas Zeit in Anspruch nehmen. Die Liste startet sich danach automatisch.", "Migration", JOptionPane.INFORMATION_MESSAGE);
|
||||
MigrateData migration = new MigrateData();
|
||||
migration.migrateData();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue