Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Commit

Permalink
Mejorada la sincronización de manera significativa. Bugfix al error d…
Browse files Browse the repository at this point in the history
…el commit anterior solucionado. Fixes a varios errores críticos dentro del sistema en varios elementos distintos.
  • Loading branch information
xman40100 committed Jun 5, 2019
1 parent c4d0bef commit 6ca97f2
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 162 deletions.
31 changes: 7 additions & 24 deletions src/techdomotica/java/forms/devices/DeviceManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public void run() {
while(continueOnThread) {
try {
Thread.sleep(2000);
System.out.println("bruh");
checkComponentUse();
/*System.out.println("bruh");
for(int i = 0 ; i < allButtons.length ; i++) {
switch(i) {
case 0:
Expand Down Expand Up @@ -131,7 +132,7 @@ public void run() {
}
break;
}
}
}*/
}
catch(InterruptedException e) {
System.out.println(e);
Expand Down Expand Up @@ -1893,31 +1894,13 @@ private void btndeleteprojectorActionPerformed(java.awt.event.ActionEvent evt) {
}//GEN-LAST:event_btndeleteprojectorActionPerformed

private void rdbtnprojectoronActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdbtnprojectoronActionPerformed
progressDialog dialogo = new progressDialog(this, true, 25) {
@Override
public void progressBarFilled() {
ambiente.getTelevisor().toggleComponenteEncendido(true);
rdbtnprojectoron.setSelected(true);
checkComponentUse();
}
};
dialogo.setTitle("Encendiendo dispositivo");
dialogo.textVar.setText("<html>Modificando valores del dispositivo " + ambiente.getTelevisor().getComponenteFullName() + ", puede tardar unos segundos...</html>");
dialogo.setVisible(true);
toggleDevice(ambiente.getTelevisor(), 15, true);
rdbtnprojectoron.setSelected(true);
}//GEN-LAST:event_rdbtnprojectoronActionPerformed

private void rdbtnprojectoroffActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdbtnprojectoroffActionPerformed
progressDialog dialogo = new progressDialog(this, true, 25) {
@Override
public void progressBarFilled() {
ambiente.getTelevisor().toggleComponenteEncendido(false);
rdbtnprojectoroff.setSelected(true);
checkComponentUse();
}
};
dialogo.setTitle("Apagando dispositivo");
dialogo.textVar.setText("<html>Modificando valores del dispositivo " + ambiente.getTelevisor().getComponenteFullName() + ", puede tardar unos segundos...</html>");
dialogo.setVisible(true);
toggleDevice(ambiente.getTelevisor(), 15, false);
rdbtnprojectoroff.setSelected(true);
}//GEN-LAST:event_rdbtnprojectoroffActionPerformed

public void saveChangesToMain() {}
Expand Down
3 changes: 2 additions & 1 deletion src/techdomotica/java/forms/gestorusuarios/Usuarios.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,9 @@ else if(evt.getClickCount() == 1) {
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
int conf = JOptionPane.showConfirmDialog(null, "¿Estás seguro de eliminar al usuario " + users.get(selectedRow).getFullName() + "?\nEsta acción es irreversible.", "Confirmación de eliminación", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
if(conf == JOptionPane.YES_OPTION) {
if(conx.execute("DELETE FROM usuario WHERE id_usuario = " + Integer.parseInt(users.get(selectedRow).getID()) +";") == 1) {
if(conx.execute("UPDATE usuario SET habilitado = 0 WHERE id_usuario = " + Integer.parseInt(users.get(selectedRow).getID()) +";") == 1) {
loadTable();
JOptionPane.showMessageDialog(null, "El usuario se ha deshabilitado exitosamente.", "Operación completada", JOptionPane.INFORMATION_MESSAGE);
}
}
}//GEN-LAST:event_jButton1ActionPerformed
Expand Down
1 change: 1 addition & 0 deletions src/techdomotica/java/forms/security/SecurityAddRep.form
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
</Properties>
<Events>
<EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="areaReportKeyPressed"/>
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="areaReportKeyTyped"/>
</Events>
</Component>
</SubComponents>
Expand Down
14 changes: 11 additions & 3 deletions src/techdomotica/java/forms/security/SecurityAddRep.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ private void initComponents() {
public void keyPressed(java.awt.event.KeyEvent evt) {
areaReportKeyPressed(evt);
}
public void keyTyped(java.awt.event.KeyEvent evt) {
areaReportKeyTyped(evt);
}
});
jScrollPane1.setViewportView(areaReport);

Expand Down Expand Up @@ -111,12 +114,17 @@ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS
}//GEN-LAST:event_jButton1ActionPerformed

private void areaReportKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_areaReportKeyPressed

}//GEN-LAST:event_areaReportKeyPressed

private void areaReportKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_areaReportKeyTyped
String currentText = areaReport.getText();
if(currentText.length() > 1001) {
areaReport.setText(currentText);
if(currentText.length() >= 1000) {
String realText = currentText.substring(0, 999);
areaReport.setText(realText);
}
charLim.setText(String.format("Límite de caracteres: %d/1000", currentText.length()));
}//GEN-LAST:event_areaReportKeyPressed
}//GEN-LAST:event_areaReportKeyTyped

/**
* @param args the command line arguments
Expand Down
1 change: 1 addition & 0 deletions src/techdomotica/java/forms/security/SecurityHistory.form
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
</Properties>
<Events>
<EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtReportKeyPressed"/>
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtReportKeyTyped"/>
</Events>
</Component>
</SubComponents>
Expand Down
18 changes: 13 additions & 5 deletions src/techdomotica/java/forms/security/SecurityHistory.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
public void keyPressed(java.awt.event.KeyEvent evt) {
txtReportKeyPressed(evt);
}
public void keyTyped(java.awt.event.KeyEvent evt) {
txtReportKeyTyped(evt);
}
});
jScrollPane2.setViewportView(txtReport);

Expand Down Expand Up @@ -261,17 +264,22 @@ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS
}//GEN-LAST:event_jButton1ActionPerformed

private void txtReportKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtReportKeyPressed
String currentText = txtReport.getText();
if(currentText.length() > 1001) {
txtReport.setText(currentText);
}
charRemaining.setText(String.format("Caracteres restantes: %d", (1000 - currentText.length())));

}//GEN-LAST:event_txtReportKeyPressed

private void jCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox1ActionPerformed
loadTable(jCheckBox1.isSelected());
}//GEN-LAST:event_jCheckBox1ActionPerformed

private void txtReportKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtReportKeyTyped
String currentText = txtReport.getText();
if(currentText.length() >= 1000) {
String realText = currentText.substring(0, 999);
txtReport.setText(realText);
}
charRemaining.setText(String.format("Caracteres restantes: %d", (1000 - currentText.length())));
}//GEN-LAST:event_txtReportKeyTyped

/**
* @param args the command line arguments
*/
Expand Down
Loading

0 comments on commit 6ca97f2

Please sign in to comment.