Skip to content

Commit

Permalink
Finishing touches for 1.2
Browse files Browse the repository at this point in the history
This will be one of the last commits for 1.2. What another journey. I
admit the journey was not as excited as before due to some personal
matters but hey, its a good development after all. 👌 😃
  • Loading branch information
jerobado committed Aug 31, 2018
1 parent 16fab33 commit 6defe1a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/gui/main/main_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _properties(self):
self.gesturesTableView.setSortingEnabled(True)
self.gesturesTableView.sortByColumn(0, Qt.AscendingOrder)
self.gesturesTableView.setShowGrid(False)
self.gesturesTableView.setSelectionModel(self.gesturesItemSelectionModel)
# self.gesturesTableView.setSelectionModel(self.gesturesItemSelectionModel)

self.addPushButton.setText('&Add')
self.updatePushButton.setText('&Update')
Expand Down Expand Up @@ -177,8 +177,8 @@ def _read_settings(self):
def resize_gesturesTableView_cells(self):
""" Resize the rows and columns of the gesturesTableView. """

self.gesturesTableView.resizeRowsToContents()
self.gesturesTableView.resizeColumnsToContents()
# self.gesturesTableView.resizeRowsToContents()
# self.gesturesTableView.resizeColumnsToContents()
self.gesturesTableView.horizontalHeader().setStretchLastSection(True)

def reload_gestures(self, gestures: dict):
Expand All @@ -192,14 +192,17 @@ def reload_gestures(self, gestures: dict):
print(gesture, meaning)

# [] TODO: insert a for loop here, too much for loop outside
# [] TODO: sort not working after adding, updating and removing a gesture
def update_gesture_tableview(self, gesture, meaning):
""" Insert one row at a time in the GestureTableView. """

TEMP_HEADER['gesture'] = gesture
TEMP_HEADER['meaning'] = meaning
RECORD.append(list(TEMP_HEADER.values()))
self.gesturesTableModel.insertRows(len(RECORD), 1)
self.gesturesTableView.setModel(self.gesturesTableModel)

# [] TODO: gesturesTableView not updating properly when new gesture is update
def on_addPushButton_clicked(self):

try:
Expand Down

0 comments on commit 6defe1a

Please sign in to comment.