Skip to content

Commit 711b248

Browse files
committed
added the last refresh datetime in the GUI, at the top
1 parent cc4b872 commit 711b248

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

main.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,21 @@ def __init__(self):
118118
self.setCentralWidget(self.central_widget)
119119
self.main_layout = QVBoxLayout(self.central_widget)
120120

121-
# Add labels for total and unread entries at the top (outside scroll area)
121+
# Add labels for total/ unread entries and last refresh datetime at the top (outside scroll area)
122+
self.last_refresh_label = QLabel("Last refresh done at: TBA")
122123
self.total_label = QLabel("Total Entries: 0")
123124
self.unread_label = QLabel("Unread Entries: 0")
124-
125-
# Set label alignment and add them in a horizontal layout
125+
self.last_refresh_label.setAlignment(Qt.AlignCenter)
126126
self.total_label.setAlignment(Qt.AlignCenter)
127127
self.unread_label.setAlignment(Qt.AlignCenter)
128+
129+
# Prepare the horizontal are for total_label and unread_label
128130
label_layout = QHBoxLayout()
129131
label_layout.addWidget(self.total_label)
130132
label_layout.addWidget(self.unread_label)
131133

132-
# Add label layout to the main layout
134+
# Add last_refresh_label and label_layout to the main layout
135+
self.main_layout.addWidget(self.last_refresh_label)
133136
self.main_layout.addLayout(label_layout)
134137

135138
# Button layout for Refresh and Mark All as Read buttons
@@ -221,6 +224,7 @@ def update_feed_entries(self, entries):
221224
total_entries = len(entries)
222225
self.unread_entries = sum(1 for _, entry in entries if entry.get("title") not in self.viewed_entries)
223226

227+
self.last_refresh_label.setText(f"Last refresh done at: {datetime.now().strftime("%d-%b-%Y %H:%M:%S")}")
224228
self.total_label.setText(f"Total Entries: {total_entries}")
225229
self.unread_label.setText(f"Unread Entries: {self.unread_entries}")
226230

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.1
1+
1.0.2

0 commit comments

Comments
 (0)