diff --git a/journey_fm_app.py b/journey_fm_app.py
index 78189e6..aeb354b 100644
--- a/journey_fm_app.py
+++ b/journey_fm_app.py
@@ -289,6 +289,11 @@ class MainWindow(QMainWindow):
self.last_update_label = QLabel("Last update: Never")
status_layout.addWidget(self.last_update_label)
+ # Buy list button
+ self.buy_list_button = QPushButton("Show Buy List")
+ self.buy_list_button.clicked.connect(self.show_buy_list)
+ status_layout.addWidget(self.buy_list_button)
+
status_group.setLayout(status_layout)
splitter.addWidget(status_group)
@@ -432,6 +437,40 @@ class MainWindow(QMainWindow):
self.load_settings()
QMessageBox.information(self, "Settings Saved", "Configuration updated successfully!")
+ def show_buy_list(self):
+ """Show the Amazon buy list dialog"""
+ try:
+ with open('amazon_buy_list.txt', 'r') as f:
+ content = f.read()
+ except FileNotFoundError:
+ content = "No buy list available. Run an update to generate the list."
+
+ # Convert plain text to HTML with clickable links
+ html_content = content.replace('\n', '
')
+ # Make URLs clickable
+ import re
+ html_content = re.sub(r'(https?://[^\s]+)', r'\1', html_content)
+
+ dialog = QDialog(self)
+ dialog.setWindowTitle("Amazon Buy List")
+ dialog.setModal(False)
+ dialog.resize(600, 400)
+
+ layout = QVBoxLayout()
+
+ text_edit = QTextEdit()
+ text_edit.setHtml(html_content)
+ text_edit.setReadOnly(True)
+ text_edit.setOpenExternalLinks(True) # Allow clicking links
+ layout.addWidget(text_edit)
+
+ buttons = QDialogButtonBox(QDialogButtonBox.StandardButton.Close)
+ buttons.rejected.connect(dialog.close)
+ layout.addWidget(buttons)
+
+ dialog.setLayout(layout)
+ dialog.show()
+
def closeEvent(self, event):
"""Handle window close - minimize to tray instead of closing"""
if self.tray_icon and self.tray_icon.isVisible():