Example #1
0
 def setDevice(self):
     if(config.device() == 1):
         self.device = " -d "
     else:
         self.device = " -e "
     self.cmd1 = "adb"+self.device+"push "+self.adblist[0]
     self.cmd2 = "adb"+self.device+"shell am start -a android.intent.action.MAIN -n "+self.adblist[1]
     self.cmd3 = "adb"+self.device+"logcat -s "+self.adblist[2]
     self.cmd4 = "adb"+self.device+"shell pm disable com.emo_framework.examples"
     self.cmd5 = "adb"+self.device+"shell pm enable com.emo_framework.examples"
Example #2
0
 def __init__(self, parent):
     QtGui.QDialog.__init__(self, parent)
     self.resize(400, 420)
     self.horizontalLayoutWidget = QtGui.QWidget(self)
     self.horizontalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 401, 361))
     self.horizontalLayout = QtGui.QHBoxLayout(self.horizontalLayoutWidget)
     self.horizontalLayout.setMargin(0)
     self.tabWidget = QtGui.QTabWidget(self.horizontalLayoutWidget)
     self.tab_4 = QtGui.QWidget()
    
     
     self.formLayoutWidget = QtGui.QWidget(self.tab_4)
     self.formLayoutWidget.setGeometry(QtCore.QRect(10, 10, 361, 311))
     
     self.formLayout = QtGui.QFormLayout(self.formLayoutWidget)
     self.formLayout.setMargin(0)
     self.label_2 = QtGui.QLabel(self.formLayoutWidget)
     self.formLayout.setWidget(0, QtGui.QFormLayout.SpanningRole, self.label_2)
     
     #Push
     self.horizontalLayoutWidget_2 = QtGui.QWidget(self.formLayoutWidget)
     self.horizontalLayout_2 = QtGui.QHBoxLayout(self.horizontalLayoutWidget_2)
     self.horizontalLayout_2.setMargin(0)
     self.lineEdit_2 = QtGui.QLineEdit(self.horizontalLayoutWidget_2)
     self.fileButton = QtGui.QPushButton(self.horizontalLayoutWidget_2)
     self.fileButton.setText("Browse")
     self.horizontalLayout_2.addWidget(self.lineEdit_2)
     self.horizontalLayout_2.addWidget(self.fileButton)
     self.formLayout.setWidget(1, QtGui.QFormLayout.SpanningRole, self.horizontalLayoutWidget_2)
     
     self.lineEdit_3 = QtGui.QLineEdit(self.formLayoutWidget)
     self.formLayout.setWidget(3, QtGui.QFormLayout.SpanningRole, self.lineEdit_3)
     self.label_3 = QtGui.QLabel(self.formLayoutWidget)
     self.formLayout.setWidget(2, QtGui.QFormLayout.SpanningRole, self.label_3)
     self.label_4 = QtGui.QLabel(self.formLayoutWidget)
     self.formLayout.setWidget(5, QtGui.QFormLayout.SpanningRole, self.label_4)
     self.lineEdit_4 = QtGui.QLineEdit(self.formLayoutWidget)
     self.formLayout.setWidget(6, QtGui.QFormLayout.SpanningRole, self.lineEdit_4)
     self.label_5 = QtGui.QLabel(self.formLayoutWidget)
     self.formLayout.setWidget(7, QtGui.QFormLayout.SpanningRole, self.label_5)
     self.lineEdit_5 = QtGui.QLineEdit(self.formLayoutWidget)
     self.formLayout.setWidget(8, QtGui.QFormLayout.SpanningRole, self.lineEdit_5)
     self.tabWidget.addTab(self.tab_4, "Android")
     
     #radio buttons
     self.radio1=QtGui.QRadioButton("Device", self.formLayoutWidget)
     self.radio2=QtGui.QRadioButton("Emulator", self.formLayoutWidget)
     self.radio1.clicked.connect(lambda:self.setDevice(1))
     self.radio2.clicked.connect(lambda:self.setDevice(0))
     if(config.device() == 1):
         self.radio1.setChecked(1)
     else:
         self.radio2.setChecked(1)
     self.formLayout.setWidget(9, QtGui.QFormLayout.SpanningRole,self.radio1)
     self.formLayout.setWidget(10, QtGui.QFormLayout.SpanningRole,self.radio2)
     
     self.horizontalLayout.addWidget(self.tabWidget)
     
     self.buttonBox = QtGui.QDialogButtonBox(self)
     self.buttonBox.setGeometry(QtCore.QRect(40, 370, 341, 32))
     self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
     self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
     self.tabWidget.setCurrentIndex(1)
     self.setWindowTitle("Tools")
     self.label_2.setText("Push Main File:")
     self.label_3.setText("Start Activity:")
     self.label_4.setText("Logcat:")
     self.label_5.setText("Exit Activity:")
     self.buttonBox.clicked.connect(self.update)
     self.lineEdit_2.setText(config.adb()[0])
     self.lineEdit_3.setText(config.adb()[1])
     self.lineEdit_4.setText(config.adb()[2])
     self.lineEdit_5.setText(config.adb()[3])
     self.fileButton.clicked.connect(self.showBrowse)
     self.browsedialog = DialogBrowse(self)
     self.browsedialog.tree.itemDoubleClicked.connect(self.getName)