Skip to content

Commit

Permalink
Merge pull request #17 from XperiaOverlay/master
Browse files Browse the repository at this point in the history
Improve Device plug wait screen into fastboot and flashmode
  • Loading branch information
Androxyde committed Jun 3, 2015
2 parents 3abd5d0 + 9995f5c commit f68ef74
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/gui/BLUWizard.java
Expand Up @@ -89,7 +89,7 @@ public void handleEvent(Event event) {
event.doit = true;
}
});
shlBootloaderUnlockWizard.setSize(286, 183);
shlBootloaderUnlockWizard.setSize(350, 220);
if (_action.equals("R"))
shlBootloaderUnlockWizard.setText("BootLoader Relock Wizard");
else
Expand Down
48 changes: 48 additions & 0 deletions src/gui/FastbootToolbox.java
@@ -1,5 +1,6 @@
package gui;

import gui.tools.WidgetTask;
import gui.tools.FastBootToolBoxJob;
import gui.tools.WidgetsTool;
import org.eclipse.swt.widgets.Dialog;
Expand Down Expand Up @@ -91,8 +92,15 @@ public void widgetSelected(SelectionEvent e) {
btnRebootFBFB.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
logger.info("Now plug your device in Fastboot Mode");
String result = (String)WidgetTask.openWaitDeviceForFastboot(shlFastbootToolbox);
if (result.equals("OK")) {
doRebootBackIntoFastbootMode();
}
else {
logger.info("Failed");
}
}
});
btnRebootFBFB.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1));
btnRebootFBFB.setText("Reboot into fastboot mode (via Fastboot)");
Expand All @@ -101,13 +109,19 @@ public void widgetSelected(SelectionEvent e) {
btnHotboot.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
logger.info("Now plug your device in Fastboot Mode");
String result = (String)WidgetTask.openWaitDeviceForFastboot(shlFastbootToolbox);
if (result.equals("OK")) {
FileDialog dlg = new FileDialog(shlFastbootToolbox);
dlg.setFilterExtensions(new String[]{"*.sin","*.elf","*.img"});
dlg.setText("Kernel Chooser");
String dir = dlg.open();
if (dir!=null)
doHotBoot(dir);
} else {
logger.info("Failed"):
}
}
});
btnHotboot.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
btnHotboot.setText("Select kernel to HotBoot");
Expand All @@ -116,28 +130,43 @@ public void widgetSelected(SelectionEvent e) {
btnFlashSystem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
logger.info("Now plug your device in Fastboot Mode");
String result = (String)WidgetTask.openWaitDeviceForFastboot(shlFastbootToolbox);
if (result.equals("OK")) {
FileDialog dlg = new FileDialog(shlFastbootToolbox);
dlg.setFilterExtensions(new String[]{"*.sin","*.img","*.ext4","*.yaffs2"});
dlg.setText("System Chooser");
String dir = dlg.open();
if (dir!=null)
doFlashSystem(dir);
}
else {
logger.info("Failed");
}
}
});

btnFlashSystem.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
btnFlashSystem.setText("Select system to Flash");

Button btnFlashKernel = new Button(shlFastbootToolbox, SWT.NONE);
btnFlashKernel.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
logger.info("Now plug your device in Fastboot Mode");
String result = (String)WidgetTask.openWaitDeviceForFastboot(shlFastbootToolbox);
if (result.equals("OK")) {
FileDialog dlg = new FileDialog(shlFastbootToolbox);
dlg.setFilterExtensions(new String[]{"*.sin","*.elf","*.img"});
dlg.setText("Kernel Chooser");
String dir = dlg.open();
if (dir!=null)
doFlashKernel(dir);
}
else {
logger.info("Failed");
}
}
});
btnFlashKernel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1));
btnFlashKernel.setText("Select kernel to Flash");
Expand All @@ -146,8 +175,14 @@ public void widgetSelected(SelectionEvent e) {
btnGetVerInfo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
logger.info("Now plug your device in Fastboot Mode");
String result = (String)WidgetTask.openWaitDeviceForFastboot(shlFastbootToolbox);
if (result.equals("OK")) {
doGetFastbootVerInfo();
} else {
logger.info("Filed");
}
}
});
btnGetVerInfo.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
btnGetVerInfo.setText("Get Ver Info");
Expand All @@ -157,8 +192,14 @@ public void widgetSelected(SelectionEvent e) {
btnGetDeviceInfo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
logger.info("Now plug your device in Fastboot Mode");
String result = (String)WidgetTask.openWaitDeviceForFastboot(shlFastbootToolbox);
if (result.equals("OK")) {
doGetConnectedDeviceInfo();
} else {
logger.info("Failed");
}
}
});
btnGetDeviceInfo.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1));
btnGetDeviceInfo.setText("Get Device Info");
Expand All @@ -168,8 +209,15 @@ public void widgetSelected(SelectionEvent e) {
btnReboot.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
logger.info("Now plug your device in Fastboot Mode");
String result = (String)WidgetTask.openWaitDeviceForFastboot(shlFastbootToolbox);
if (result.equals("OK")) {
doFastbootReboot();
}
else {
loggger.info("failed");
}
}
});
btnReboot.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
btnReboot.setText("Reboot device into system");
Expand Down
70 changes: 58 additions & 12 deletions src/gui/WaitDeviceForFastboot.java
Expand Up @@ -12,6 +12,7 @@
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import gui.tools.SearchFastbootJob;
import gui.tools.WidgetTask;
import gui.tools.WidgetsTool;
import org.eclipse.swt.widgets.Label;

Expand Down Expand Up @@ -66,30 +67,75 @@ public void handleEvent(Event event) {
*/
private void createContents() {
shlWaitForFastbootmode = new Shell(getParent(), getStyle());
shlWaitForFastbootmode.setSize(616, 429);
shlWaitForFastbootmode.setSize(656, 520);
shlWaitForFastbootmode.setText("Wait for Fastboot Mode");

Composite composite = new Composite(shlWaitForFastbootmode, SWT.NONE);
composite.setBounds(10, 10, 200, 348);
composite.setBounds(10, 5, 200, 388);

// 2012 Line Of Xperias Text
Label lblNewLabel00 = new Label(composite, SWT.NONE);
lblNewLabel00.setBounds(20, 39, 180, 15);
lblNewLabel00.setText("2012");

Label lblNewLabel01 = new Label(composite, SWT.NONE);
lblNewLabel01.setBounds(20, 61, 180, 15);
lblNewLabel01.setText("1. Unplug the device");

Label lblNewLabel02 = new Label(composite, SWT.NONE);
lblNewLabel02.setBounds(20, 82, 180, 15);
lblNewLabel02.setText("2. Power off the device");

Label lblNewLabel03 = new Label(composite, SWT.NONE);
lblNewLabel03.setBounds(20, 104, 200, 15);
lblNewLabel03.setText("3. Press the volume UP button");

Label lblNewLabel05 = new Label(composite, SWT.NONE);
lblNewLabel05.setBounds(20, 126, 180, 15);
lblNewLabel05.setText("4. Plug the USB cable");


// Xperia 2011 Lines of Xperia Text
Label lblNewLabel = new Label(composite, SWT.NONE);
lblNewLabel.setBounds(10, 120, 180, 15);
lblNewLabel.setText("1 - Unplug the device");
lblNewLabel.setBounds(20, 260, 180, 15);
lblNewLabel.setText("2011");

Label lblNewLabel_1 = new Label(composite, SWT.NONE);
lblNewLabel_1.setBounds(10, 141, 180, 15);
lblNewLabel_1.setText("2 - Power off the device");
lblNewLabel_1.setBounds(20, 282, 180, 15);
lblNewLabel_1.setText("1. Unplug the device");

Label lblNewLabel_2 = new Label(composite, SWT.NONE);
lblNewLabel_2.setBounds(10, 162, 180, 15);
lblNewLabel_2.setText("3 - Press the menu button");
lblNewLabel_2.setBounds(20, 304, 180, 15);
lblNewLabel_2.setText("2. Power off the device");

Label lblNewLabel_3 = new Label(composite, SWT.NONE);
lblNewLabel_3.setBounds(10, 183, 180, 15);
lblNewLabel_3.setText("4 - Plug the USB cable");
lblNewLabel_3.setBounds(20, 326, 180, 15);
lblNewLabel_3.setText("3. Press the menu button-");

Label lblNewLabel_4 = new Label(composite, SWT.NONE);
lblNewLabel_4.setBounds(20, 348, 190, 15);
lblNewLabel_4.setText("-Volume UP for Xperia Ray");

Label lblNewLabel_5 = new Label(composite, SWT.NONE);
lblNewLabel_5.setBounds(20, 370, 180, 15);
lblNewLabel_5.setText("4. Plug the USB cable");

Composite composite_1 = new Composite(shlWaitForFastbootmode, SWT.NONE);
composite_1.setBounds(216, 10, 384, 348);
composite_1.setBounds(320, 0, 364, 221);

final GifCLabel lbl = new GifCLabel(composite_1, SWT.CENTER);
lbl.setText("");
lbl.setGifImage(this.getClass().getResourceAsStream("/gui/ressources/fastbootmode2012.gif"));
lbl.setBounds(10, -44, 350, 339);

Composite composite_2 = new Composite(shlWaitForFastbootmode, SWT.NONE);
composite_2.setBounds(320, 167, 364, 271);

final GifCLabel lbl2 = new GifCLabel(composite_2, SWT.CENTER);
lbl2.setText("");
lbl2.setGifImage(this.getClass().getResourceAsStream("/gui/ressources/fastbootmode2011.gif"));
lbl2.setBounds(8, 5, 350, 339);


Button btnCancel = new Button(shlWaitForFastbootmode, SWT.NONE);
btnCancel.addSelectionListener(new SelectionAdapter() {
Expand All @@ -100,7 +146,7 @@ public void widgetSelected(SelectionEvent e) {
shlWaitForFastbootmode.dispose();
}
});
btnCancel.setBounds(532, 364, 68, 23);
btnCancel.setBounds(568, 450, 68, 26);
btnCancel.setText("Cancel");
}

Expand Down
74 changes: 57 additions & 17 deletions src/gui/WaitDeviceForFlashmode.java
Expand Up @@ -67,35 +67,75 @@ public void handleEvent(Event event) {
*/
private void createContents() {
shlWaitForFlashmode = new Shell(getParent(), getStyle());
shlWaitForFlashmode.setSize(616, 425);
shlWaitForFlashmode.setSize(656, 520);
shlWaitForFlashmode.setText("Wait for Flashmode");

Composite composite = new Composite(shlWaitForFlashmode, SWT.NONE);
composite.setBounds(10, 10, 200, 348);
composite.setBounds(10, 5, 304, 433);

Label lblNewLabel = new Label(composite, SWT.NONE);
lblNewLabel.setBounds(10, 122, 180, 15);
lblNewLabel.setText("1 - Unplug the device");
// 2012 Line Of Xperias Text
Label lblNewLabel00 = new Label(composite, SWT.NONE);
lblNewLabel00.setBounds(20, 39, 248, 15);
lblNewLabel00.setText("2012");

Label lblNewLabel01 = new Label(composite, SWT.NONE);
lblNewLabel01.setBounds(20, 61, 274, 15);
lblNewLabel01.setText("1. Unplug the device");

Label lblPower = new Label(composite, SWT.NONE);
lblPower.setBounds(10, 143, 180, 15);
lblPower.setText("2 - Power off the device");
Label lblNewLabel02 = new Label(composite, SWT.NONE);
lblNewLabel02.setBounds(20, 82, 274, 15);
lblNewLabel02.setText("2. Power off the device");

Label lblNewLabel03 = new Label(composite, SWT.NONE);
lblNewLabel03.setBounds(20, 104, 274, 15);
lblNewLabel03.setText("3. Press the volume DOWN button");

Label lblNewLabel05 = new Label(composite, SWT.NONE);
lblNewLabel05.setBounds(20, 126, 274, 15);
lblNewLabel05.setText("4. Plug the USB cable");


// Xperia 2011 Lines of Xperia Text
Label lblNewLabel = new Label(composite, SWT.NONE);
lblNewLabel.setBounds(20, 260, 274, 15);
lblNewLabel.setText("2011");

Label lblNewLabel_1 = new Label(composite, SWT.NONE);
lblNewLabel_1.setBounds(10, 164, 180, 15);
lblNewLabel_1.setText("3 - Press the back button");
lblNewLabel_1.setBounds(20, 282, 274, 15);
lblNewLabel_1.setText("1. Unplug the device");

Label lblPlug = new Label(composite, SWT.NONE);
lblPlug.setBounds(10, 185, 180, 15);
lblPlug.setText("4 - Plug the USB cable");
Label lblNewLabel_2 = new Label(composite, SWT.NONE);
lblNewLabel_2.setBounds(20, 304, 274, 15);
lblNewLabel_2.setText("2. Power off the device");

Label lblNewLabel_3 = new Label(composite, SWT.NONE);
lblNewLabel_3.setBounds(20, 326, 274, 15);
lblNewLabel_3.setText("3. Press the BACK button-");

Label lblNewLabel_4 = new Label(composite, SWT.NONE);
lblNewLabel_4.setBounds(20, 348, 274, 23);
lblNewLabel_4.setText("-Volume down for Xperia Ray");

Label lblNewLabel_5 = new Label(composite, SWT.NONE);
lblNewLabel_5.setBounds(20, 369, 274, 23);
lblNewLabel_5.setText("4. Plug the USB cable");

Composite composite_1 = new Composite(shlWaitForFlashmode, SWT.NONE);
composite_1.setBounds(216, 10, 384, 348);
composite_1.setBounds(320, 0, 364, 221);

final GifCLabel lbl = new GifCLabel(composite_1, SWT.CENTER);
lbl.setText("");
lbl.setGifImage(this.getClass().getResourceAsStream("/gui/ressources/flashmode.gif"));
lbl.setBounds(10, 35, 350, 339);
lbl.setGifImage(this.getClass().getResourceAsStream("/gui/ressources/flashmode2012.gif"));
lbl.setBounds(10, -44, 350, 339);

Composite composite_2 = new Composite(shlWaitForFlashmode, SWT.NONE);
composite_2.setBounds(320, 167, 364, 271);

final GifCLabel lbl2 = new GifCLabel(composite_2, SWT.CENTER);
lbl2.setText("");
lbl2.setGifImage(this.getClass().getResourceAsStream("/gui/ressources/flashmode2011.gif"));
lbl2.setBounds(8, 5, 350, 339);


Button btnCancel = new Button(shlWaitForFlashmode, SWT.NONE);
btnCancel.addSelectionListener(new SelectionAdapter() {
Expand All @@ -106,7 +146,7 @@ public void widgetSelected(SelectionEvent e) {
shlWaitForFlashmode.dispose();
}
});
btnCancel.setBounds(538, 364, 68, 28);
btnCancel.setBounds(568, 450, 68, 26);
btnCancel.setText("Cancel");
}
}
Binary file added src/gui/ressources/fastbootmode2011.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/gui/ressources/fastbootmode2012.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/gui/ressources/flashmode.gif
Binary file not shown.
Binary file added src/gui/ressources/flashmode2011.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/gui/ressources/flashmode2012.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f68ef74

Please sign in to comment.