class Main(QtGui.QMainWindow, Ui_coreDumpUtilFrame): def __init__(self): QtGui.QMainWindow.__init__(self) self.ui = Ui_coreDumpUtilFrame() self.ui.setupUi(self) self.coreAttrib = CoreDumpAttrib() ## added this line to do event driven -- function to be called when the button is clicked self.ui.bSysRootBrowse.clicked.connect(self.ButtonbrowseSysRoot) self.ui.bApplicationBrowser.clicked.connect(self.browseApplicationExe) self.ui.lCoreFileBrowser.clicked.connect(self.browseCoreFile) self.ui.bgetBackTrace.clicked.connect(self.getbt) ## browse button event installer ######## def ButtonbrowseSysRoot(self): dbgLog('browseSys Root pressed') fileHelper = FileDirHelper() sysRootDir = fileHelper.getDirPath("SysRootPath") self.coreAttrib.setSysRoot(sysRootDir) dbgLog(self.coreAttrib.getSysRoot()) labelHandle = self.ui.lSysRootFilePath labelHelper = LabelHelper() ## This is to check if the string is empty or not if sysRootDir: labelHelper.setLabel(labelHandle, sysRootDir) def browseApplicationExe(self): dbgLog('browse Application Exe') fileHelper = FileDirHelper() appPathName = fileHelper.getFilePath("Select the Executable") self.coreAttrib.setApplicationExe(appPathName) dbgLog(self.coreAttrib.getApplicationExe()) labelHandle = self.ui.lApplicationFilePath labelHelper = LabelHelper() ## This is to check if the string is empty or not if appPathName: labelHelper.setLabel(labelHandle, appPathName) def browseCoreFile(self): dbgLog('browse core file') fileHelper = FileDirHelper() corePathName = fileHelper.getFilePath("Select the CoreFile") self.coreAttrib.setCoreFile(corePathName) dbgLog(self.coreAttrib.getCoreFile()) labelHandle = self.ui.lCorefileBrowser labelHelper = LabelHelper() ## This is to check if the string is empty or not if corePathName: labelHelper.setLabel(labelHandle, corePathName) def getbt(self): dbgLog('get bt') if self.coreAttrib.validateGdbEnviron() is True: coredumpParams = [] coredumpParams.append(self.coreAttrib.getSysRoot()) coredumpParams.append(self.coreAttrib.getApplicationExe()) coredumpParams.append(self.coreAttrib.getCoreFile()) self.win = TabbedTerminal(coredumpParams) self.win.show()
def getbt(self): dbgLog('get bt') if self.coreAttrib.validateGdbEnviron() is True: coredumpParams = [] coredumpParams.append(self.coreAttrib.getSysRoot()) coredumpParams.append(self.coreAttrib.getApplicationExe()) coredumpParams.append(self.coreAttrib.getCoreFile()) self.win = TabbedTerminal(coredumpParams) self.win.show()
class Main(QtGui.QMainWindow, Ui_coreDumpUtilFrame): def __init__(self): QtGui.QMainWindow.__init__(self) self.ui= Ui_coreDumpUtilFrame() self.ui.setupUi(self) self.coreAttrib = CoreDumpAttrib() ## added this line to do event driven -- function to be called when the button is clicked self.ui.bSysRootBrowse.clicked.connect(self.ButtonbrowseSysRoot) self.ui.bApplicationBrowser.clicked.connect(self.browseApplicationExe) self.ui.lCoreFileBrowser.clicked.connect(self.browseCoreFile) self.ui.bgetBackTrace.clicked.connect(self.getbt) ## browse button event installer ######## def ButtonbrowseSysRoot(self): dbgLog('browseSys Root pressed') fileHelper = FileDirHelper() sysRootDir = fileHelper.getDirPath("SysRootPath") self.coreAttrib.setSysRoot(sysRootDir) dbgLog (self.coreAttrib.getSysRoot()) labelHandle = self.ui.lSysRootFilePath labelHelper = LabelHelper() ## This is to check if the string is empty or not if sysRootDir: labelHelper.setLabel(labelHandle,sysRootDir) def browseApplicationExe(self): dbgLog('browse Application Exe') fileHelper = FileDirHelper() appPathName = fileHelper.getFilePath("Select the Executable") self.coreAttrib.setApplicationExe(appPathName) dbgLog (self.coreAttrib.getApplicationExe()) labelHandle = self.ui.lApplicationFilePath labelHelper = LabelHelper() ## This is to check if the string is empty or not if appPathName: labelHelper.setLabel(labelHandle,appPathName) def browseCoreFile(self): dbgLog('browse core file') fileHelper = FileDirHelper() corePathName = fileHelper.getFilePath("Select the CoreFile") self.coreAttrib.setCoreFile(corePathName) dbgLog (self.coreAttrib.getCoreFile()) labelHandle = self.ui.lCorefileBrowser labelHelper = LabelHelper() ## This is to check if the string is empty or not if corePathName: labelHelper.setLabel(labelHandle,corePathName) def getbt(self): dbgLog('get bt') if self.coreAttrib.validateGdbEnviron() is True: coredumpParams = [] coredumpParams.append(self.coreAttrib.getSysRoot()) coredumpParams.append(self.coreAttrib.getApplicationExe()) coredumpParams.append(self.coreAttrib.getCoreFile()) self.win = TabbedTerminal(coredumpParams) self.win.show()