]> git.siccegge.de Git - frida/frida.git/blobdiff - src/gui/dialogs/NewFunctionDialog.cxx
Allow addition of new functions
[frida/frida.git] / src / gui / dialogs / NewFunctionDialog.cxx
diff --git a/src/gui/dialogs/NewFunctionDialog.cxx b/src/gui/dialogs/NewFunctionDialog.cxx
new file mode 100644 (file)
index 0000000..3c605d1
--- /dev/null
@@ -0,0 +1,27 @@
+#include "NewFunctionDialog.hxx"
+
+NewFunctionDialog::NewFunctionDialog() {
+       QGridLayout * layout = new QGridLayout;
+
+       edit = new QLineEdit;
+       layout->addWidget(edit, 0, 0, 1, 2);
+       edit->setInputMask("\\0\\xhhhhhhhhhhhhhhhH");
+       
+       QPushButton * cancelButton = new QPushButton("Cancel");
+       QPushButton * okButton = new QPushButton("OK");
+       layout->addWidget(okButton, 1, 1, 1, 1);
+       connect(okButton, SIGNAL(clicked()),
+               this, SLOT(accept()));
+       layout->addWidget(cancelButton, 1, 0, 1, 1);
+       connect(cancelButton, SIGNAL(clicked()),
+               this, SLOT(reject()));
+       
+       setLayout(layout);
+       setWindowTitle("Add function");
+}
+
+uint64_t NewFunctionDialog::result() {
+       bool ok;
+       uint64_t result = edit->text().toLongLong(&ok, 16);
+       return result;
+}