Skip to content

Commit

Permalink
fix: bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisTurco committed Nov 7, 2024
1 parent b0a2493 commit 42b632d
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 324 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="TabbedPane" alignment="1" pref="968" max="32767" attributes="0"/>
<Component id="TabbedPane" alignment="1" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="jLabel3" min="-2" pref="66" max="-2" attributes="0"/>
Expand Down Expand Up @@ -376,9 +376,14 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="startPathField" max="32767" attributes="0"/>
<Component id="jLabel2" pref="461" max="32767" attributes="0"/>
<Component id="destinationPathField" alignment="0" max="32767" attributes="0"/>
<Component id="jLabel2" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="destinationPathField" alignment="1" max="-2" attributes="0"/>
<Component id="startPathField" alignment="0" max="-2" attributes="0"/>
</Group>
<EmptySpace min="4" pref="4" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
Expand Down Expand Up @@ -414,7 +419,7 @@
</Group>
</Group>
</Group>
<EmptySpace pref="219" max="32767" attributes="0"/>
<EmptySpace pref="211" max="32767" attributes="0"/>
</Group>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
Expand Down Expand Up @@ -497,7 +502,13 @@
<Property name="alignmentY" type="float" value="0.0"/>
<Property name="autoscrolls" type="boolean" value="false"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[68, 26]"/>
<Dimension value="[465, 26]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[465, 26]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[465, 26]"/>
</Property>
</Properties>
</Component>
Expand All @@ -523,7 +534,13 @@
<Property name="alignmentX" type="float" value="0.0"/>
<Property name="alignmentY" type="float" value="0.0"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[68, 26]"/>
<Dimension value="[465, 26]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[465, 26]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[465, 26]"/>
</Property>
</Properties>
</Component>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import static javax.swing.SwingConstants.CENTER;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
Expand Down Expand Up @@ -143,6 +142,12 @@ private void OpenFolder(String path) {
Logger.logMessage("Event --> opening folder", Logger.LogLevel.INFO);

File folder = new File(path);

// if the object is a file i want to obtain the folder that contains that file
if (folder.exists() && folder.isFile()) {
folder = folder.getParentFile();
}

if (folder.exists() && folder.isDirectory()) {
if (Desktop.isDesktopSupported()) {
Desktop desktop = Desktop.getDesktop();
Expand Down Expand Up @@ -1034,7 +1039,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
startPathField.setAlignmentX(0.0F);
startPathField.setAlignmentY(0.0F);
startPathField.setAutoscrolls(false);
startPathField.setMaximumSize(new java.awt.Dimension(68, 26));
startPathField.setMaximumSize(new java.awt.Dimension(465, 26));
startPathField.setMinimumSize(new java.awt.Dimension(465, 26));
startPathField.setPreferredSize(new java.awt.Dimension(465, 26));

btnPathSearch1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/img/folder.png"))); // NOI18N
btnPathSearch1.setToolTipText("Open file explorer");
Expand All @@ -1050,7 +1057,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
destinationPathField.setActionCommand("<Not Set>");
destinationPathField.setAlignmentX(0.0F);
destinationPathField.setAlignmentY(0.0F);
destinationPathField.setMaximumSize(new java.awt.Dimension(68, 26));
destinationPathField.setMaximumSize(new java.awt.Dimension(465, 26));
destinationPathField.setMinimumSize(new java.awt.Dimension(465, 26));
destinationPathField.setPreferredSize(new java.awt.Dimension(465, 26));

btnPathSearch2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/img/folder.png"))); // NOI18N
btnPathSearch2.setToolTipText("Open file explorer");
Expand Down Expand Up @@ -1116,9 +1125,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(startPathField, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 461, Short.MAX_VALUE)
.addComponent(destinationPathField, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(destinationPathField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(startPathField, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(4, 4, 4)))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
Expand All @@ -1141,7 +1153,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnTimePicker, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(SingleBackup, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(219, Short.MAX_VALUE))
.addContainerGap(211, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
Expand Down Expand Up @@ -1455,7 +1467,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(TabbedPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 968, Short.MAX_VALUE)
.addComponent(TabbedPane, javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;

class JSONAutoBackup implements IJSONAutoBackup {
public class JSONAutoBackup implements IJSONAutoBackup {
@Override
public List<Backup> ReadBackupListFromJSON(String filename, String directoryPath) throws IOException {

Expand Down
Loading

0 comments on commit 42b632d

Please sign in to comment.