More license system tweaks

master
skylarmt 10 years ago
parent 5b12f44f56
commit c67f3c2221

@ -11,14 +11,15 @@
<Image iconType="3" name="/net/apocalypselabs/symat/icon16.png"/> <Image iconType="3" name="/net/apocalypselabs/symat/icon16.png"/>
</Property> </Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[435, 350]"/> <Dimension value="[435, 367]"/>
</Property> </Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[435, 350]"/> <Dimension value="[435, 367]"/>
</Property> </Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[435, 350]"/> <Dimension value="[435, 367]"/>
</Property> </Property>
<Property name="selected" type="boolean" value="true"/>
</Properties> </Properties>
<SyntheticProperties> <SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/> <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
@ -78,7 +79,7 @@
<Component id="emailBox" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="emailBox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="contBtn" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="contBtn" alignment="3" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/> <EmptySpace min="-2" pref="40" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -86,7 +87,7 @@
<SubComponents> <SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1"> <Component class="javax.swing.JLabel" name="jLabel1">
<Properties> <Properties>
<Property name="text" type="java.lang.String" value="&lt;html&gt;&#xa;&lt;h1&gt;Welcome to SyMAT!&lt;/h1&gt;&#xa;&lt;p&gt;It would be a good idea to get this copy fully activated&#xa;&lt;br /&gt;before you go any further.&lt;/p&gt;&#xa;&lt;br /&gt;&#xa;&lt;p&gt;Do you have a license?&lt;/p&gt;"/> <Property name="text" type="java.lang.String" value="&lt;html&gt;&#xa;&lt;h1&gt;Welcome to SyMAT!&lt;/h1&gt;&#xa;&lt;p&gt;Please activate the software. &#xa;&lt;br /&gt;Until you do, features will be limited.&#xa;&lt;br /&gt;You may be eligible for a free 15-day trial.&lt;/p&gt;&#xa;&lt;br /&gt;&#xa;&lt;p&gt;Do you have a license?&lt;/p&gt;"/>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JRadioButton" name="singLicSel"> <Component class="javax.swing.JRadioButton" name="singLicSel">

@ -74,11 +74,16 @@ public class FirstRun extends javax.swing.JInternalFrame {
setTitle("Welcome"); setTitle("Welcome");
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icon16.png"))); // NOI18N setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/icon16.png"))); // NOI18N
setMaximumSize(new java.awt.Dimension(435, 350)); setMaximumSize(new java.awt.Dimension(435, 367));
setMinimumSize(new java.awt.Dimension(435, 350)); setMinimumSize(new java.awt.Dimension(435, 367));
setPreferredSize(new java.awt.Dimension(435, 350)); setPreferredSize(new java.awt.Dimension(435, 367));
try {
setSelected(true);
} catch (java.beans.PropertyVetoException e1) {
e1.printStackTrace();
}
jLabel1.setText("<html>\n<h1>Welcome to SyMAT!</h1>\n<p>It would be a good idea to get this copy fully activated\n<br />before you go any further.</p>\n<br />\n<p>Do you have a license?</p>"); jLabel1.setText("<html>\n<h1>Welcome to SyMAT!</h1>\n<p>Please activate the software. \n<br />Until you do, features will be limited.\n<br />You may be eligible for a free 15-day trial.</p>\n<br />\n<p>Do you have a license?</p>");
grp1.add(singLicSel); grp1.add(singLicSel);
singLicSel.setText("Yes, I have a single-user license"); singLicSel.setText("Yes, I have a single-user license");
@ -171,7 +176,7 @@ public class FirstRun extends javax.swing.JInternalFrame {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(emailBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(emailBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(contBtn)) .addComponent(contBtn))
.addGap(20, 20, 20)) .addGap(40, 40, 40))
); );
emailBox.setVisible(false); emailBox.setVisible(false);
@ -337,6 +342,7 @@ public class FirstRun extends javax.swing.JInternalFrame {
"Thank you for activating SyMAT!", "Thank you for activating SyMAT!",
"Success", "Success",
JOptionPane.INFORMATION_MESSAGE); JOptionPane.INFORMATION_MESSAGE);
MainGUI.licenseRestrict(false);
exit(); exit();
} }

@ -122,6 +122,7 @@ public class MainGUI extends javax.swing.JFrame {
} }
} }
if (!licValid) { if (!licValid) {
licenseRestrict(true);
loadFrame(new FirstRun()); loadFrame(new FirstRun());
loaded = true; loaded = true;
} }
@ -137,6 +138,12 @@ public class MainGUI extends javax.swing.JFrame {
updateDisplay(); updateDisplay();
} }
public static void licenseRestrict(boolean restricted) {
editorBtn.setEnabled(!restricted);
graphBtn.setEnabled(!restricted);
helpBtn.setEnabled(!restricted);
}
/** /**
* Set keyboard shortcuts for buttons. * Set keyboard shortcuts for buttons.
*/ */
@ -176,6 +183,9 @@ public class MainGUI extends javax.swing.JFrame {
if (PrefStorage.getSetting("licensetype").equals("demo")) { if (PrefStorage.getSetting("licensetype").equals("demo")) {
demo = " Trial"; demo = " Trial";
} }
if (PrefStorage.getSetting("license").equals("")) {
demo = " Unregistered";
}
return "<html>" return "<html>"
+ nbsp + nbsp
+ "<span style=\"color: gray; font-size: 130%;\"><i>" + "<span style=\"color: gray; font-size: 130%;\"><i>"

Loading…
Cancel
Save