[Esbox-commits] r1633 - branches/work_Ed/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/scratchbox/core/sbrsh
eswartz at garage.maemo.org
eswartz at garage.maemo.org
Thu May 21 23:36:59 EEST 2009
Author: eswartz
Date: 2009-05-21 23:36:58 +0300 (Thu, 21 May 2009)
New Revision: 1633
Modified:
branches/work_Ed/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/scratchbox/core/sbrsh/SBRSHPreferencePage.java
Log:
Merge revs 1627:1632 from trunk
Modified: branches/work_Ed/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/scratchbox/core/sbrsh/SBRSHPreferencePage.java
===================================================================
--- branches/work_Ed/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/scratchbox/core/sbrsh/SBRSHPreferencePage.java 2009-05-21 20:06:36 UTC (rev 1632)
+++ branches/work_Ed/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/scratchbox/core/sbrsh/SBRSHPreferencePage.java 2009-05-21 20:36:58 UTC (rev 1633)
@@ -14,12 +14,24 @@
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.maemo.esbox.internal.scratchbox.core.IHelpID;
import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
+import org.maemo.mica.common.ui.dialogs.DialogUtils;
+import org.maemo.mica.protocol.ssh.ui.ExchangeKeysDialog;
+import org.maemo.esbox.internal.scratchbox.core.Activator;
+import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
+
/**
* @author Fabrício S Epaminondas (UFCG)
*
@@ -34,6 +46,41 @@
setDescription("SBRSH preference configuration.");
}
+
+ @Override
+ protected Control createContents(Composite parent) {
+ Composite composite= (Composite) super.createContents(parent);
+
+ Button fExchangeKeys = new Button(composite, SWT.PUSH);
+ fExchangeKeys.setText("Exchange Keys");
+ fExchangeKeys.setToolTipText("Export host identity to client and" +
+ " authorize paswordless ssh connection from client to host.");
+ fExchangeKeys.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Shell shell = WorkbenchUtils.getActiveShell();
+ final ExchangeKeysDialog dialog;
+ try {
+ dialog = new ExchangeKeysDialog(shell, "Exchanging Keys");
+ // default values
+ dialog.getExchanger().setGenerateKeys(true);
+ DialogUtils.getShell().getDisplay().syncExec(
+ new Runnable() {
+ public void run() {
+ dialog.open();
+ }
+ });
+ } catch (Exception ex) {
+ Activator.getErrorLogger().logAndShowError(
+ "Could not connect to device", ex);
+ }
+ }
+ });
+
+
+
+ return composite;
+ }
public void createFieldEditors() {
WorkbenchUtils.setHelpContextId(getControl(), IHelpID.HID_GLOBAL_PREF_ESBOX_SBRSH);
More information about the Esbox-commits
mailing list