Some cleanup, a couple new features added.
This commit is contained in:
@ -166,6 +166,41 @@ class MainWindow(QMainWindow):
|
||||
federated_action.triggered.connect(lambda: self.switch_timeline(3))
|
||||
timeline_menu.addAction(federated_action)
|
||||
|
||||
# Post menu
|
||||
post_menu = menubar.addMenu("&Post")
|
||||
|
||||
# Reply action
|
||||
reply_action = QAction("&Reply", self)
|
||||
reply_action.setShortcut(QKeySequence("Ctrl+R"))
|
||||
reply_action.triggered.connect(self.reply_to_current_post)
|
||||
post_menu.addAction(reply_action)
|
||||
|
||||
# Boost action
|
||||
boost_action = QAction("&Boost", self)
|
||||
boost_action.setShortcut(QKeySequence("Ctrl+B"))
|
||||
boost_action.triggered.connect(self.boost_current_post)
|
||||
post_menu.addAction(boost_action)
|
||||
|
||||
# Favorite action
|
||||
favorite_action = QAction("&Favorite", self)
|
||||
favorite_action.setShortcut(QKeySequence("Ctrl+F"))
|
||||
favorite_action.triggered.connect(self.favorite_current_post)
|
||||
post_menu.addAction(favorite_action)
|
||||
|
||||
post_menu.addSeparator()
|
||||
|
||||
# Copy action
|
||||
copy_action = QAction("&Copy to Clipboard", self)
|
||||
copy_action.setShortcut(QKeySequence("Ctrl+C"))
|
||||
copy_action.triggered.connect(self.copy_current_post)
|
||||
post_menu.addAction(copy_action)
|
||||
|
||||
# Open URLs action
|
||||
urls_action = QAction("Open &URLs in Browser", self)
|
||||
urls_action.setShortcut(QKeySequence("Ctrl+U"))
|
||||
urls_action.triggered.connect(self.open_current_post_urls)
|
||||
post_menu.addAction(urls_action)
|
||||
|
||||
def setup_shortcuts(self):
|
||||
"""Set up keyboard shortcuts"""
|
||||
# Additional shortcuts that don't need menu items
|
||||
@ -292,6 +327,53 @@ class MainWindow(QMainWindow):
|
||||
if hasattr(self.timeline, 'sound_manager'):
|
||||
self.timeline.sound_manager.play_error()
|
||||
self.status_bar.showMessage(f"Failed to load {timeline_name} timeline: {str(e)}", 3000)
|
||||
|
||||
def get_selected_post(self):
|
||||
"""Get the currently selected post from timeline"""
|
||||
current_item = self.timeline.currentItem()
|
||||
if current_item:
|
||||
return current_item.data(0, Qt.UserRole)
|
||||
return None
|
||||
|
||||
def reply_to_current_post(self):
|
||||
"""Reply to the currently selected post"""
|
||||
post = self.get_selected_post()
|
||||
if post:
|
||||
self.reply_to_post(post)
|
||||
else:
|
||||
self.status_bar.showMessage("No post selected", 2000)
|
||||
|
||||
def boost_current_post(self):
|
||||
"""Boost the currently selected post"""
|
||||
post = self.get_selected_post()
|
||||
if post:
|
||||
self.boost_post(post)
|
||||
else:
|
||||
self.status_bar.showMessage("No post selected", 2000)
|
||||
|
||||
def favorite_current_post(self):
|
||||
"""Favorite the currently selected post"""
|
||||
post = self.get_selected_post()
|
||||
if post:
|
||||
self.favorite_post(post)
|
||||
else:
|
||||
self.status_bar.showMessage("No post selected", 2000)
|
||||
|
||||
def copy_current_post(self):
|
||||
"""Copy the currently selected post to clipboard"""
|
||||
post = self.get_selected_post()
|
||||
if post:
|
||||
self.timeline.copy_post_to_clipboard(post)
|
||||
else:
|
||||
self.status_bar.showMessage("No post selected", 2000)
|
||||
|
||||
def open_current_post_urls(self):
|
||||
"""Open URLs from the currently selected post"""
|
||||
post = self.get_selected_post()
|
||||
if post:
|
||||
self.timeline.open_urls_in_browser(post)
|
||||
else:
|
||||
self.status_bar.showMessage("No post selected", 2000)
|
||||
|
||||
def show_first_time_setup(self):
|
||||
"""Show first-time setup dialog"""
|
||||
|
Reference in New Issue
Block a user