Skip to content

Commit

Permalink
Merge pull request #120 from Victor-IX/invert-columns-order
Browse files Browse the repository at this point in the history
Invert Columns Order
  • Loading branch information
Victor-IX authored Jun 22, 2024
2 parents 1ccbf26 + f0b8e0b commit 35201df
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions source/widgets/base_page_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def __init__(self, parent, page_name, time_label, info_text, show_reload=False,
super().__init__(parent)
self.name = page_name

self.sort_order_asc = True

self.layout = QVBoxLayout(self)
self.layout.setContentsMargins(0, 0, 0, 0)
self.layout.setSpacing(0)
Expand Down Expand Up @@ -115,21 +117,22 @@ def __init__(self, parent, page_name, time_label, info_text, show_reload=False,
self.layout.addWidget(self.list_widget)

self.sorting_type = SortingType(get_list_sorting_type(self.name))
self.sorting_order = Qt.DescendingOrder
self.set_sorting_type(self.sorting_type)

def set_info_label_text(self, text):
self.InfoLabel.setText(text)

def set_sorting_type(self, sorting_type):
self.sorting_type = sorting_type
self.list_widget.sortItems()
if sorting_type == self.sorting_type:
self.sorting_order = Qt.DescendingOrder if self.sorting_order == Qt.AscendingOrder else Qt.AscendingOrder
else:
self.sorting_order = Qt.AscendingOrder

self.commitTimeLabel.setChecked(False)
self.subversionLabel.setChecked(False)
self.sorting_type = sorting_type
self.list_widget.sortItems(self.sorting_order)

if sorting_type == SortingType.DATETIME:
self.commitTimeLabel.setChecked(True)
elif sorting_type == SortingType.VERSION:
self.subversionLabel.setChecked(True)
self.commitTimeLabel.setChecked(sorting_type == SortingType.DATETIME)
self.subversionLabel.setChecked(sorting_type == SortingType.VERSION)

set_list_sorting_type(self.name, sorting_type)

0 comments on commit 35201df

Please sign in to comment.