Commit 947cc38d authored by Adrian Hunter's avatar Adrian Hunter Committed by Arnaldo Carvalho de Melo

perf scripts python: exported-sql-viewer.py: Move report name into ReportVars

The report name is a report variable so move it into into ReportVars.
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 0bf0947a
...@@ -1402,7 +1402,8 @@ class BranchModel(TreeModel): ...@@ -1402,7 +1402,8 @@ class BranchModel(TreeModel):
class ReportVars(): class ReportVars():
def __init__(self, where_clause = ""): def __init__(self, name = "", where_clause = ""):
self.name = name
self.where_clause = where_clause self.where_clause = where_clause
def UniqueId(self): def UniqueId(self):
...@@ -1412,7 +1413,7 @@ class ReportVars(): ...@@ -1412,7 +1413,7 @@ class ReportVars():
class BranchWindow(QMdiSubWindow): class BranchWindow(QMdiSubWindow):
def __init__(self, glb, event_id, name, report_vars, parent=None): def __init__(self, glb, event_id, report_vars, parent=None):
super(BranchWindow, self).__init__(parent) super(BranchWindow, self).__init__(parent)
model_name = "Branch Events " + str(event_id) + " " + report_vars.UniqueId() model_name = "Branch Events " + str(event_id) + " " + report_vars.UniqueId()
...@@ -1435,7 +1436,7 @@ class BranchWindow(QMdiSubWindow): ...@@ -1435,7 +1436,7 @@ class BranchWindow(QMdiSubWindow):
self.setWidget(self.vbox.Widget()) self.setWidget(self.vbox.Widget())
AddSubWindow(glb.mainwindow.mdi_area, self, name + " Branch Events") AddSubWindow(glb.mainwindow.mdi_area, self, report_vars.name + " Branch Events")
def ResizeColumnToContents(self, column, n): def ResizeColumnToContents(self, column, n):
# Using the view's resizeColumnToContents() here is extrememly slow # Using the view's resizeColumnToContents() here is extrememly slow
...@@ -1710,7 +1711,6 @@ class ReportDialogBase(QDialog): ...@@ -1710,7 +1711,6 @@ class ReportDialogBase(QDialog):
self.glb = glb self.glb = glb
self.name = ""
self.report_vars = ReportVars() self.report_vars = ReportVars()
self.setWindowTitle(title) self.setWindowTitle(title)
...@@ -1751,8 +1751,8 @@ class ReportDialogBase(QDialog): ...@@ -1751,8 +1751,8 @@ class ReportDialogBase(QDialog):
def Ok(self): def Ok(self):
vars = self.report_vars vars = self.report_vars
self.name = self.data_items[0].value vars.name = self.data_items[0].value
if not self.name: if not vars.name:
self.ShowMessage("Report name is required") self.ShowMessage("Report name is required")
return return
for d in self.data_items: for d in self.data_items:
...@@ -2392,13 +2392,13 @@ class MainWindow(QMainWindow): ...@@ -2392,13 +2392,13 @@ class MainWindow(QMainWindow):
CallGraphWindow(self.glb, self) CallGraphWindow(self.glb, self)
def NewBranchView(self, event_id): def NewBranchView(self, event_id):
BranchWindow(self.glb, event_id, "", ReportVars(), self) BranchWindow(self.glb, event_id, ReportVars(), self)
def NewSelectedBranchView(self, event_id): def NewSelectedBranchView(self, event_id):
dialog = SelectedBranchDialog(self.glb, self) dialog = SelectedBranchDialog(self.glb, self)
ret = dialog.exec_() ret = dialog.exec_()
if ret: if ret:
BranchWindow(self.glb, event_id, dialog.name, dialog.report_vars, self) BranchWindow(self.glb, event_id, dialog.report_vars, self)
def NewTableView(self, table_name): def NewTableView(self, table_name):
TableWindow(self.glb, table_name, self) TableWindow(self.glb, table_name, self)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment