From 74d26ccffab0c702d7f90645bf6104e120747594 Mon Sep 17 00:00:00 2001 From: Nemo Date: Mon, 15 Jun 2020 01:29:57 +0530 Subject: [PATCH] Change comments to a radio button --- hackertray/__init__.py | 5 ++++- hackertray/firefox.py | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hackertray/__init__.py b/hackertray/__init__.py index 2b70fc9..d4a9d73 100644 --- a/hackertray/__init__.py +++ b/hackertray/__init__.py @@ -63,6 +63,7 @@ class HackerNewsApp: btnComments = Gtk.CheckMenuItem("Show Comments") btnComments.show() btnComments.set_active(args.comments) + btnComments.set_draw_as_radio(True) btnComments.connect("activate", self.toggleComments) self.menu.append(btnComments) @@ -125,7 +126,7 @@ class HackerNewsApp: Gtk.main() return 0 - def open(self, widget, event=None, data=None): + def open(self, widget, **args): """Opens the link in the web browser""" # We disconnect and reconnect the event in case we have # to set it to active and we don't want the signal to be processed @@ -137,6 +138,8 @@ class HackerNewsApp: self.db.add(widget.item_id) webbrowser.open(widget.url) + # TODO: Add support for Shift+Click or Right Click + # to do the opposite of the current commentState setting if self.commentState: webbrowser.open(self.HN_URL_PREFIX + str(widget.hn_id)) diff --git a/hackertray/firefox.py b/hackertray/firefox.py index 08ea44d..7398635 100644 --- a/hackertray/firefox.py +++ b/hackertray/firefox.py @@ -1,4 +1,3 @@ - import sqlite3 import shutil import os