Skip to content

Commit

Permalink
3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
tonikelope committed Mar 14, 2018
1 parent 793bced commit 4bb4509
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tonikelope</groupId>
<artifactId>MegaBasterd</artifactId>
<version>3.5</version>
<version>3.6</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
Expand Down
30 changes: 10 additions & 20 deletions src/main/java/com/tonikelope/megabasterd/MainPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
*/
public final class MainPanel {

public static final String VERSION = "3.5";
public static final String VERSION = "3.6";
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024;
public static final int STREAMER_PORT = 1337;
Expand Down Expand Up @@ -727,7 +727,7 @@ public boolean checkByeBye() {
return exit;
}

public void byebyenow() {
public void byebyenow(boolean restart) {

synchronized (DBTools.class) {

Expand All @@ -737,7 +737,12 @@ public void byebyenow() {
Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex);
}

exit(0);
if (restart) {
restartApplication(1);
} else {
exit(0);
}

}
}

Expand Down Expand Up @@ -852,26 +857,11 @@ public void run() {

} while (wait);

synchronized (DBTools.class) {

try {
DBTools.vaccum();
} catch (SQLException ex) {
Logger.getLogger(MainPanel.class.getName()).log(Level.SEVERE, null, ex);
}

if (restart) {
restartApplication(1);
} else {
exit(0);
}

}

byebyenow(restart);
}
});

WarningExitMessage exit_message = new WarningExitMessage(getView(), true, this);
WarningExitMessage exit_message = new WarningExitMessage(getView(), true, this, restart);

exit_message.setLocationRelativeTo(getView());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,21 @@
public class WarningExitMessage extends javax.swing.JDialog {

MainPanel _main_panel;
boolean _restart;

/**
* Creates new form WarningExitMessage
*/
public WarningExitMessage(java.awt.Frame parent, boolean modal, MainPanel main_panel) {
public WarningExitMessage(java.awt.Frame parent, boolean modal, MainPanel main_panel, boolean restart) {
super(parent, modal);
initComponents();

updateFonts(this.getRootPane(), DEFAULT_FONT, main_panel.getZoom_factor());

_main_panel = main_panel;

_restart = restart;

pack();
}

Expand Down Expand Up @@ -119,7 +122,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {

private void exit_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exit_buttonActionPerformed

_main_panel.byebyenow();
_main_panel.byebyenow(_restart);
}//GEN-LAST:event_exit_buttonActionPerformed

// Variables declaration - do not modify//GEN-BEGIN:variables
Expand Down

0 comments on commit 4bb4509

Please sign in to comment.