\r
package cx.fbn.nevernote.dialog;\r
\r
+import com.trolltech.qt.gui.QComboBox;\r
import com.trolltech.qt.gui.QDialog;\r
import com.trolltech.qt.gui.QGridLayout;\r
import com.trolltech.qt.gui.QLabel;\r
private final QLineEdit password1;\r
private final QLineEdit password2;\r
private final QPushButton ok;\r
+ private final QComboBox encryptionType;\r
+ private final QLabel encryptionLabel;\r
\r
\r
// Constructor\r
password1.textChanged.connect(this, "validateInput()");\r
password2.textChanged.connect(this, "validateInput()");\r
\r
+ encryptionLabel = new QLabel(tr("Encryption Method"));\r
+ encryptionType = new QComboBox();\r
+ encryptionType.addItem(tr("AES"), "AES");\r
+ encryptionType.addItem(tr("XTEA"), "XTEA");\r
+ \r
passwordGrid.addWidget(new QLabel(tr("Password")), 1,1);\r
passwordGrid.addWidget(password1, 1, 2);\r
passwordGrid.addWidget(new QLabel(tr("Verify Password")), 2,1);\r
passwordGrid.addWidget(password2, 2, 2);\r
+ passwordGrid.addWidget(encryptionLabel, 3,1);\r
+ passwordGrid.addWidget(encryptionType, 3,2);\r
passwordGrid.setContentsMargins(10, 10, -10, -10);\r
grid.addLayout(passwordGrid,1,1);\r
\r
+ \r
+ \r
ok = new QPushButton(tr("OK"));\r
ok.setEnabled(false);\r
ok.clicked.connect(this, "okButtonPressed()");\r
grid.addLayout(buttonGrid,2,1);\r
}\r
\r
+ public void hideEncryption() {\r
+ encryptionType.setVisible(false);\r
+ encryptionLabel.setVisible(false);\r
+ }\r
+ \r
+ public String getEncryptionMethod() {\r
+ int i = encryptionType.currentIndex();\r
+ return encryptionType.itemData(i).toString();\r
+ }\r
+ \r
// The OK button was pressed\r
@SuppressWarnings("unused")\r
private void okButtonPressed() {\r