Skip to content

Commit

Permalink
Add ignore to context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Thurion committed Mar 7, 2018
1 parent 4755629 commit c9e226c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion load.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@

this = sys.modules[__name__] # For holding module globals

class RseHyperlinkLabel(HyperlinkLabel):

def __init__(self, master=None, **kw):
super(RseHyperlinkLabel, self).__init__(master, **kw)
self.menu.add_command(label=_("Ignore"), command = self.ignore)

def ignore(self):
this.worker.ignore(self["text"])


class EliteSystem(object):
def __init__(self, id, name, x, y, z, uncertainty = None, action = 0):
self.id = id
Expand Down Expand Up @@ -123,6 +133,15 @@ def __init__(self, queue, radius = DEFAULT_RADIUS):
self.filter = set() # systems that have been completed


def ignore(self, systemName):
for system in self.systemList:
if system.name.lower() == systemName.lower():
system.action = 0
self.removeSystems()
self.showNewClosestSystem()
break;


def adjustRadius(self, numberOfSystems):
if numberOfSystems <= RADIUS_ADJUSTMENT_INCREASE:
self.radius += 1
Expand Down Expand Up @@ -422,7 +441,7 @@ def plugin_app(parent):
this.frame.bind_all("<<EDSM-RSE_BackgroundWorker>>", updateUI)
this.frame.columnconfigure(1, weight=1)
tk.Label(this.frame, text="Unconfirmed:").grid(row=0, column=0, sticky=tk.W)
this.unconfirmedSystem = HyperlinkLabel(frame, compound=tk.RIGHT, popup_copy = True)
this.unconfirmedSystem = RseHyperlinkLabel(frame, compound=tk.RIGHT, popup_copy = True)
this.errorLabel = tk.Label(frame)
tk.Label(this.frame, text="Distance:").grid(row=1, column=0, sticky=tk.W)
this.distanceValue = tk.Label(this.frame)
Expand Down

0 comments on commit c9e226c

Please sign in to comment.