]> git.siccegge.de Git - frida/frida.git/blobdiff - src/gui/Mainwindow.cxx
Change window title to FRIDA
[frida/frida.git] / src / gui / Mainwindow.cxx
index 061734a5bc946dde58082641543aed5ec24d6c0c..91a933bdb390567cc1af9013f9c70898d09847a0 100644 (file)
@@ -8,7 +8,7 @@
 
 #include <QtGui>
 
-Mainwindow::Mainwindow()
+Mainwindow::Mainwindow(const std::string& filename)
 {
     openAction = new QAction(tr("&Open"), this);
     // saveAction = new QAction(tr("&Save"), this);
@@ -36,7 +36,9 @@ Mainwindow::Mainwindow()
     connect(listWidget, SIGNAL(currentRowChanged(int)),
             stackedWidget, SLOT(setCurrentIndex(int)));
 
-    setWindowTitle(tr("Notepad"));
+    setWindowTitle(tr("FRIDA"));
+
+       openBinary(filename);
 }
 
 void Mainwindow::quit()
@@ -54,8 +56,12 @@ void Mainwindow::open() {
     QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "",
                                                     tr("Binaries (*)"));
 
-    if (fileName != "") {
-        disassembler.reset(new LLVMDisassembler(fileName.toStdString()));
+       openBinary(fileName.toStdString());
+}
+
+void Mainwindow::openBinary(const std::string& filename) {
+    if (filename != "") {
+        disassembler.reset(new LLVMDisassembler(filename));
         // curBin = new Binary(fileName.toStdString());
 
         // std::vector<std::string> symbols = curBin->getSymbols();