Skip to content

Commit 7cb0324

Browse files
committed
Update v2.3.2 new feature, error dialog, loading dialog, minor bug
- cleaning code - add description to method
1 parent 749848b commit 7cb0324

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

src/com/opelooo/scrcpyGUI/GUI_functions.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public static String adb_get_device_ip(PopupHandler errorHandler, String device_
177177
// Wait for the process to complete
178178
process.waitFor();
179179
} catch (IOException | InterruptedException | NullPointerException e) {
180-
errorHandler.showError("Exception occurred: " + e.getMessage());
180+
181181
}
182182
return device_ip_addr;
183183
}
@@ -218,7 +218,6 @@ public static void adb_connect_tcpip(PopupHandler errorHandler, String device_co
218218
dialog.dispose(); // Close the dialog
219219
});
220220
}
221-
222221
}).start();
223222
}
224223

src/com/opelooo/scrcpyGUI/PopupHandler.java

+18-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,25 @@
77
* @author Administrator
88
*/
99
public interface PopupHandler {
10-
10+
11+
/**
12+
* Method to show popup message containing error happening
13+
*
14+
* @param errorMessage String containing error message
15+
*/
1116
void showError(String errorMessage);
17+
18+
/**
19+
* Method to show popup message containing device info
20+
*
21+
* @param message String containing device info message
22+
*/
1223
void showDeviceInfo(String message);
24+
25+
/**
26+
* Method to create new JDialog for progress bar
27+
*
28+
* @return JDialog creating new JDialog
29+
*/
1330
JDialog progressBarDialog();
1431
}

src/com/opelooo/scrcpyGUI/scrcpy_main_panel.java

+12-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class scrcpy_main_panel extends javax.swing.JFrame implements PopupHandle
2626
public scrcpy_main_panel() {
2727
initComponents();
2828
setIcon("/resources/icon.png");
29-
29+
3030
listModel_JD = new DefaultListModel<>(); // Initialize the list model
3131
list_devices.setModel(listModel_JD); // Set the list model to JList
3232

@@ -339,7 +339,9 @@ public static void main(String args[]) {
339339
// End of variables declaration//GEN-END:variables
340340
//</editor-fold>
341341

342-
// Method to update the JList with the adb devices
342+
/**
343+
* Method to update the JList with the adb devices
344+
*/
343345
private void updateDeviceList() {
344346
// Clear the current list
345347
listModel_JD.clear();
@@ -352,7 +354,10 @@ private void updateDeviceList() {
352354
listModel_JD.addElement(device); // Add each device to the list model
353355
}
354356
}
355-
357+
358+
/**
359+
* Method to show popup menu and right click menu
360+
*/
356361
private void poupMenuDeviceInfo() {
357362
// Create a JPopupMenu and add a menu item
358363
popupMenu = new JPopupMenu();
@@ -406,7 +411,10 @@ private void showPopupMenu(MouseEvent e) {
406411
infoMenuItem.addActionListener(menuActionListener);
407412
ipInfo.addActionListener(menuActionListener);
408413
}
409-
414+
415+
/**
416+
* Method to set icon for GUI .jar and the main frame
417+
*/
410418
private void setIcon(String iconURL) {
411419
try {
412420
URL resource = this.getClass().getResource(iconURL);

0 commit comments

Comments
 (0)