Add startup options to Settings

master
skylarmt 9 years ago
parent 74af279f0a
commit a3e1e6960b

@ -13,13 +13,13 @@
<Image iconType="3" name="/net/apocalypselabs/symat/icons/settings.png"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[375, 220]"/>
<Dimension value="[390, 260]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[375, 220]"/>
<Dimension value="[390, 260]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[375, 220]"/>
<Dimension value="[390, 260]"/>
</Property>
</Properties>
<SyntheticProperties>
@ -43,11 +43,11 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanel1" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jPanel3" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="jPanel1" max="32767" attributes="0"/>
<Component id="jPanel3" max="32767" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
@ -58,7 +58,7 @@
</Group>
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="65" max="32767" attributes="0"/>
<EmptySpace pref="62" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -67,19 +67,16 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Group type="102" attributes="0">
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="saveBtn" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="applyBtn" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jPanel2" max="32767" attributes="0"/>
<Component id="jPanel1" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="applyBtn" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="saveBtn" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jPanel3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="36" max="32767" attributes="0"/>
</Group>
@ -106,7 +103,7 @@
<Component id="themeLight" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="themeDark" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="52" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -206,7 +203,7 @@
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="View"/>
<TitledBorder title="Startup"/>
</Border>
</Property>
</Properties>
@ -214,9 +211,12 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="miniRibbon" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="quickStart" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="skipUpdates" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
@ -225,16 +225,23 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="miniRibbon" min="-2" max="-2" attributes="0"/>
<Component id="quickStart" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="skipUpdates" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JCheckBox" name="miniRibbon">
<Component class="javax.swing.JCheckBox" name="quickStart">
<Properties>
<Property name="text" type="java.lang.String" value="Quick Start"/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="skipUpdates">
<Properties>
<Property name="text" type="java.lang.String" value="Minimize ribbon"/>
<Property name="text" type="java.lang.String" value="Skip Update Check"/>
</Properties>
</Component>
</SubComponents>

@ -52,11 +52,10 @@ package net.apocalypselabs.symat;
public class Settings extends javax.swing.JInternalFrame {
/**
* Creates new form Display
* Creates new form Settings
*/
public Settings() {
initComponents();
jPanel3.setVisible(false);
setBackground(Theme.windowColor());
}
@ -78,16 +77,17 @@ public class Settings extends javax.swing.JInternalFrame {
showRecent = new javax.swing.JCheckBox();
clrRecentBtn = new javax.swing.JButton();
jPanel3 = new javax.swing.JPanel();
miniRibbon = new javax.swing.JCheckBox();
quickStart = new javax.swing.JCheckBox();
skipUpdates = new javax.swing.JCheckBox();
applyBtn = new javax.swing.JButton();
setClosable(true);
setIconifiable(true);
setTitle("Settings");
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icons/settings.png"))); // NOI18N
setMaximumSize(new java.awt.Dimension(375, 220));
setMinimumSize(new java.awt.Dimension(375, 220));
setPreferredSize(new java.awt.Dimension(375, 220));
setMaximumSize(new java.awt.Dimension(390, 260));
setMinimumSize(new java.awt.Dimension(390, 260));
setPreferredSize(new java.awt.Dimension(390, 260));
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentShown(java.awt.event.ComponentEvent evt) {
formComponentShown(evt);
@ -113,7 +113,7 @@ public class Settings extends javax.swing.JInternalFrame {
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(themeLight)
.addComponent(themeDark))
.addContainerGap(52, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -166,9 +166,11 @@ public class Settings extends javax.swing.JInternalFrame {
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("View"));
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Startup"));
quickStart.setText("Quick Start");
miniRibbon.setText("Minimize ribbon");
skipUpdates.setText("Skip Update Check");
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
@ -176,14 +178,18 @@ public class Settings extends javax.swing.JInternalFrame {
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(miniRibbon)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(quickStart)
.addComponent(skipUpdates))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(miniRibbon)
.addComponent(quickStart)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(skipUpdates)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
@ -200,9 +206,9 @@ public class Settings extends javax.swing.JInternalFrame {
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(0, 0, 0)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
@ -210,23 +216,21 @@ public class Settings extends javax.swing.JInternalFrame {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(saveBtn))
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(65, Short.MAX_VALUE))
.addContainerGap(62, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(saveBtn)
.addComponent(applyBtn))))
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(applyBtn)
.addComponent(saveBtn))
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(36, Short.MAX_VALUE))
);
@ -246,12 +250,12 @@ public class Settings extends javax.swing.JInternalFrame {
}
}
if (!PrefStorage.getSetting("showrecent", "").equals("")) {
showRecent.setSelected(false);
}
if (PrefStorage.getSetting("miniribbon", "").equals("yes")) {
miniRibbon.setSelected(true);
}
showRecent.setSelected(
PrefStorage.getSetting("showrecent", "").equals(""));
quickStart.setSelected(
PrefStorage.getSetting("quickstart", "").equals("yes"));
skipUpdates.setSelected(
PrefStorage.getSetting("skipupdates", "").equals("yes"));
}//GEN-LAST:event_formComponentShown
private void saveBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveBtnActionPerformed
@ -262,7 +266,8 @@ public class Settings extends javax.swing.JInternalFrame {
private void doSave() {
Theme.setTheme(themeDark.isSelected() ? "dark" : "light");
PrefStorage.saveSetting("showrecent", showRecent.isSelected() ? "" : "no");
PrefStorage.saveSetting("miniribbon", miniRibbon.isSelected() ? "yes" : "");
PrefStorage.saveSetting("quickstart", quickStart.isSelected() ? "yes" : "");
PrefStorage.saveSetting("skipupdates", skipUpdates.isSelected() ? "yes" : "");
PrefStorage.save();
Main.updateDisplay();
}
@ -282,9 +287,10 @@ public class Settings extends javax.swing.JInternalFrame {
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JCheckBox miniRibbon;
private javax.swing.JCheckBox quickStart;
private javax.swing.JButton saveBtn;
private javax.swing.JCheckBox showRecent;
private javax.swing.JCheckBox skipUpdates;
private javax.swing.JRadioButton themeDark;
private javax.swing.ButtonGroup themeGroup;
private javax.swing.JRadioButton themeLight;

@ -159,6 +159,10 @@ public class SplashScreen extends javax.swing.JFrame {
@Override
public void run() {
setProgress("Starting up...");
if (PrefStorage.getSetting("quickstart").equals("yes")) {
Main.skipPython = true;
Main.skipEditor = true;
}
logoOverlay.setSize(100, 140);
if (!Main.skipPython) {
// Python laggggsss when used for first time, this fixes the wait later.
@ -182,8 +186,10 @@ public class SplashScreen extends javax.swing.JFrame {
}
logoOverlay.setSize(235, 140);
setProgress("Checking for updates...");
checkUpdates();
if (!PrefStorage.getSetting("skipupdates").equals("yes")) {
setProgress("Checking for updates...");
checkUpdates();
}
logoOverlay.setSize(300, 140);
logoOverlay.setSize(380, 140);

Loading…
Cancel
Save