Пример #1
0
def plugin_prefs(parent, cmdr, is_beta):

    PADX = 10
    BUTTONX = 12	# indent Checkbuttons and Radiobuttons
    PADY = 2		# close spacing

    frame = nb.Frame(parent)
    frame.columnconfigure(1, weight=1)

    HyperlinkLabel(frame, text='Inara', background=nb.Label().cget('background'), url='https://inara.cz/', underline=True).grid(columnspan=2, padx=PADX, sticky=tk.W)	# Don't translate
    this.log = tk.IntVar(value = config.getint('inara_out') and 1)
    this.log_button = nb.Checkbutton(frame, text=_('Send flight log and Cmdr status to Inara'), variable=this.log, command=prefsvarchanged)
    this.log_button.grid(columnspan=2, padx=BUTTONX, pady=(5,0), sticky=tk.W)

    nb.Label(frame).grid(sticky=tk.W)	# big spacer
    this.label = HyperlinkLabel(frame, text=_('Inara credentials'), background=nb.Label().cget('background'), url='https://inara.cz/settings-api', underline=True)	# Section heading in settings
    this.label.grid(columnspan=2, padx=PADX, sticky=tk.W)

    this.apikey_label = nb.Label(frame, text=_('API Key'))	# EDSM setting
    this.apikey_label.grid(row=12, padx=PADX, sticky=tk.W)
    this.apikey = nb.Entry(frame)
    this.apikey.grid(row=12, column=1, padx=PADX, pady=PADY, sticky=tk.EW)

    prefs_cmdr_changed(cmdr, is_beta)

    return frame
Пример #2
0
def plugin_app(parent):

    this.parent = parent
    this.frame = tk.Frame(parent)
    this.inside_frame = tk.Frame(this.frame)
    this.inside_frame.columnconfigure(4, weight=1)
    label_string = MH_VERSION
    this.frame.columnconfigure(2, weight=1)
    this.label = HyperlinkLabel(this.frame,
                                text='Mobius:',
                                url='https://elitepve.com/',
                                underline=False)
    this.status = tk.Label(this.frame,
                           anchor=tk.W,
                           text=label_string,
                           wraplengt=200)
    this.news_label = tk.Label(this.frame, anchor=tk.W, text="News:")
    this.news_headline = HyperlinkLabel(this.frame,
                                        text="",
                                        wraplengt=200,
                                        url="",
                                        underline=True)
    this.spacer = tk.Label(this.frame)
    this.label.grid(row=0, column=0, sticky=tk.W)
    this.status.grid(row=0, column=1, sticky=tk.W)
    this.news_label.grid(row=1, column=0, sticky=tk.W)
    this.news_headline.grid(row=1, column=1, sticky="ew")
    news_update()
    return this.frame
Пример #3
0
def plugin_prefs(parent, cmdr, is_beta):
    frame = nb.Frame(parent)
    frame.columnconfigure(5, weight=1)
    response = requests.get(url=this.github_latest_version)
    this.latest_version = float(response.content.strip().decode('utf-8'))
    this.latest_version_str = str(this.latest_version)
    nb.Label(frame,
             text="ATEL-EDMC {INSTALLED}".format(
                 INSTALLED=installed_version)).grid(columnspan=2,
                                                    padx=PADX,
                                                    sticky=tk.W)
    nb.Label(frame,
             text="Latest ATEL-EDMC version: {latest_version_str}".format(
                 latest_version_str=latest_version_str)).grid(columnspan=2,
                                                              padx=PADX,
                                                              sticky=tk.W)
    HyperlinkLabel(frame,
                   text='GitHub',
                   background=nb.Label().cget('background'),
                   url='https://github.com/Elite-IGAU/ATEL-EDMC\n',
                   underline=True).grid(padx=PADX, sticky=tk.W)
    HyperlinkLabel(frame,
                   text='Discord',
                   background=nb.Label().cget('background'),
                   url='https://discord.gg/2Qq37xt\n',
                   underline=True).grid(padx=PADX, sticky=tk.W)
    HyperlinkLabel(frame,
                   text='Web',
                   background=nb.Label().cget('background'),
                   url='https://elite-igau.github.io/\n',
                   underline=True).grid(padx=PADX, sticky=tk.W)
    return frame
Пример #4
0
def plugin_app(parent):
    # Create and display widgets
    this.frame = tk.Frame(parent)
    this.frame.columnconfigure(6, weight=1)
    this.frame.bind('<<HabZoneData>>', edsm_data)   # callback when EDSM data received
    this.starused_label = tk.Label(this.frame, text = 'Star used: [0]')
    this.starused = HyperlinkLabel(this.frame)
    this.starused_next = HyperlinkLabel(this.frame)
    this.starused_next['text'] = '>'
    this.starused_next['url'] = '>'
    this.starused_next.bind("<Button-1>", next_star)
    this.starused_prev = HyperlinkLabel(this.frame)
    this.starused_prev['text'] = '<'
    this.starused_prev['url'] = '<'
    this.starused_prev.bind("<Button-1>", prev_star)
    for (name, high, low, subType) in WORLDS:
        this.worlds.append((tk.Label(this.frame, text = name + ':'),
                            HyperlinkLabel(this.frame, wraplength=100), # edsm
                            tk.Label(this.frame),   # near
                            tk.Label(this.frame),   # dash
                            tk.Label(this.frame),   # far
                            tk.Label(this.frame),   # ls
                            ))
    this.spacer = tk.Frame(this.frame)  # Main frame can't be empty or it doesn't resize
    update_visibility()
    return this.frame
Пример #5
0
def plugin_prefs(parent, cmdr, is_beta):
    frame = nb.Frame(parent)
    frame.columnconfigure(5, weight=1)
    response = requests.get(url=this.github_latest_version)
    latest_version = response.content.strip()
    nb.Label(frame,
             text="ATEL-EDMC {INSTALLED}\n".format(
                 INSTALLED=installed_version)).grid(columnspan=2,
                                                    padx=PADX,
                                                    sticky=tk.W)
    HyperlinkLabel(frame,
                   text='GitHub',
                   background=nb.Label().cget('background'),
                   url='https://github.com/Elite-IGAU/ATEL-EDMC\n',
                   underline=True).grid(padx=PADX, sticky=tk.W)
    HyperlinkLabel(frame,
                   text='Discord',
                   background=nb.Label().cget('background'),
                   url='https://discord.gg/2Qq37xt\n',
                   underline=True).grid(padx=PADX, sticky=tk.W)
    HyperlinkLabel(frame,
                   text='Wiki',
                   background=nb.Label().cget('background'),
                   url='https://elite-dangerous-iau.fandom.com\n',
                   underline=True).grid(padx=PADX, sticky=tk.W)
    return frame
Пример #6
0
def plugin_app(parent):
    # Create and display widgets
    this.frame = tk.Frame(parent)
    this.frame.columnconfigure(3, weight=1)
    this.frame.bind('<<EDSMData>>',
                    edsm_data)  # callback when EDSM data received
    this.frame.bind('<<NextData>>',
                    next_data)  # callback when EDSM data received
    this.frame.bind('<<NextNMSData>>',
                    next_NMSdata)  # callback when EDSM data received
    this.frame.bind('<<NextNBCData>>',
                    next_NBCdata)  # callback when EDSM data received
    this.edsm_label = tk.Label(this.frame, text='Body Scanned:')
    this.edsm = tk.Label(this.frame)
    this.edsmnext_label = tk.Label(this.frame, text='Next NoEDSM: [0]')
    this.edsmnext = HyperlinkLabel(this.frame)
    this.edsmnext.bind("<Button-1>", copy_to_clipboard)
    this.edsmNMSnext_label = tk.Label(this.frame, text='Next NoMainStar: [0]')
    this.edsmNMSnext = HyperlinkLabel(this.frame)
    this.edsmNMSnext.bind("<Button-1>", NMScopy_to_clipboard)
    this.edsmNBCnext_label = tk.Label(this.frame, text='Next NoBodyCount: [0]')
    this.edsmNBCnext = HyperlinkLabel(this.frame)
    this.edsmNBCnext.bind("<Button-1>", NBCcopy_to_clipboard)
    this.spacer = tk.Frame(
        this.frame)  # Main frame can't be empty or it doesn't resize
    this.button = ttk.Button(frame,
                             text='Status = Locked',
                             width=28,
                             default=tk.ACTIVE)
    this.button.bind("<Button-1>", Switch_Lock)
    update_visibility()
    return this.frame
Пример #7
0
def plugin_prefs(parent):
    PADX = 5
    global row
    row = 0

    def nextRow():
        global row
        row += 1
        return row

    frame = nb.Frame(parent)
    frame.columnconfigure(0, weight=1)

    row = 0
    nb.Checkbutton(frame,
                   variable=this.clipboard,
                   text="Copy system name to clipboard after jump").grid(
                       row=nextRow(),
                       column=0,
                       columnspan=2,
                       padx=PADX,
                       sticky=tk.W)
    nb.Checkbutton(
        frame,
        variable=this.overwrite,
        text="I use another tool to transmit data to EDSM/EDDN").grid(
            row=nextRow(), column=0, columnspan=2, padx=PADX, sticky=tk.W)

    ttk.Separator(frame, orient=tk.HORIZONTAL).grid(row=nextRow(),
                                                    columnspan=2,
                                                    padx=PADX * 2,
                                                    pady=8,
                                                    sticky=tk.EW)
    nb.Label(frame,
             text="Plugin Version: {}".format(VERSION)).grid(row=nextRow(),
                                                             column=0,
                                                             columnspan=2,
                                                             padx=PADX,
                                                             sticky=tk.W)
    HyperlinkLabel(frame,
                   text="Open the Github page for this plugin",
                   background=nb.Label().cget("background"),
                   url="https://github.com/Thurion/EDSM-RSE-for-EDMC",
                   underline=True).grid(row=nextRow(),
                                        column=0,
                                        columnspan=2,
                                        padx=PADX,
                                        sticky=tk.W)
    HyperlinkLabel(frame,
                   text="A big thanks to EDTS for providing the coordinates.",
                   background=nb.Label().cget("background"),
                   url="http://edts.thargoid.space/",
                   underline=True).grid(row=nextRow(),
                                        column=0,
                                        columnspan=2,
                                        padx=PADX,
                                        sticky=tk.W)
    return frame
Пример #8
0
def plugin_prefs(parent: myNotebook.Notebook, cmdr: str, is_beta: bool) -> Optional[tk.Frame]:
    PADX = 10
    PADY = 10
    INSTRUCTIONS = "Track missions and activity for or against minor faction(s). Multiple selection is allowed. If the desired minor faction does not appear in the list, jump to a system where the minor faction is present and reopen this dialog."
    VERSION = f"Version: {'.'.join(map(str, this.version))}"
    URL = "https://github.com/anthonylangsworth/EDMFAT"
    MISSION_WARNING = "This plug-in may not record some missions correctly due to Elite: Dangerous limitations."
    MISSION_WARNING_URL = "https://github.com/anthonylangsworth/EDMFAT/blob/master/doc/missions.md"
    BACKGROUND = myNotebook.Label().cget("background")
    FOREGROUND = myNotebook.Label().cget("foreground")

    # known_minor_factions = {"EDA Kunti League", "Kunti Dragons", "LTT 2337 Empire Party", "HR 1597 & Co", "The Fuel Rats Mischief", "The Scovereign Justice League", "Hutton Orbital Truckers", "The Dark Wheel", "Edge Fraternity", "Colonia Citizens Network", "Mobius Colonial Republic Navy", "Tenjin Pioneers Colonia", "Knights of Colonial Karma", "Ed's 38"}
    known_minor_factions = set(itertools.chain.from_iterable(star_system.minor_factions for star_system in this.tracker.galaxy_state.systems.values()))
    known_minor_factions.update(this.tracker.minor_factions)
    known_minor_factions = sorted(known_minor_factions)

    frame = myNotebook.Frame(parent)
    frame.columnconfigure(1, weight=1) # Required for listbox scrollbar

    HyperlinkLabel(
        frame, text=this.plugin_name, background=BACKGROUND, url=URL, underline=True
    ).grid(row=0, padx=PADX, pady=PADY, sticky=tk.W)
    myNotebook.Label(frame, text=VERSION).grid(row=0, column=3, padx=PADX, sticky=tk.E)

    myNotebook.Label(frame, text=INSTRUCTIONS, wraplength=500, justify=tk.LEFT, anchor=tk.W).grid(row=2, column=0, columnspan=8, padx=PADX, sticky=tk.W)

    this.minor_faction_list = tk.Listbox(frame, selectmode="extended", foreground=FOREGROUND, background=BACKGROUND)
    this.minor_faction_list.config(height=10, width=50)
    this.minor_faction_list.grid(row=5, column=0, sticky=tk.W, padx=(PADX, 0), pady=PADY)
    this.minor_faction_list.insert(tk.END, *known_minor_factions)

    first_minor_faction_visible = False
    for minor_faction in this.tracker.minor_factions:
        this.minor_faction_list.selection_set(known_minor_factions.index(minor_faction))
        if not first_minor_faction_visible:
            this.minor_faction_list.see(known_minor_factions.index(minor_faction))
            first_minor_faction_visible = True

    scrollbar = tk.Scrollbar(frame, orient=tk.VERTICAL)
    scrollbar.config(command=this.minor_faction_list.yview)
    scrollbar.grid(row=5, column=1, sticky=tk.NS + tk.W, pady=PADY)

    this.minor_faction_list.config(yscrollcommand=scrollbar.set)

    HyperlinkLabel(
        frame, text=MISSION_WARNING, background=BACKGROUND, url=MISSION_WARNING_URL, underline=True
    ).grid(row=7, column=0, columnspan=8, padx=PADX, pady=PADY, sticky=tk.W)

    tk.Button(frame, text="Copy Raw Activity", command=copy_raw_activity).grid(row=8, column=3, sticky=tk.W, padx=10)
    
    return frame
Пример #9
0
def plugin_prefs(parent, cmdr, is_beta):
    PADX = 5

    frame = nb.Frame(parent)
    frame.columnconfigure(0, weight=1)

    nb.Checkbutton(frame, variable=this.edsmBodyCheck,
                   text="Display number of bodies known to EDSM in current system").grid(padx=PADX, sticky=tk.W)

    # enable projects
    ttk.Separator(frame, orient=tk.HORIZONTAL).grid(padx=PADX * 2, pady=8, sticky=tk.EW)
    nb.Label(frame, text="Please choose which projects to enable").grid(padx=PADX, sticky=tk.W)
    for rseProject in this.rseData.projects_dict.values():
        invertedFlag = not (this.rseData.ignored_projects_flags & rseProject.project_id == rseProject.project_id)
        variable = this.ignoredProjectsCheckboxes.setdefault(rseProject.project_id, tk.BooleanVar(value=invertedFlag))
        text = rseProject.name
        if not rseProject.enabled:
            text += " (globally disabled)"
        nb.Checkbutton(frame, variable=variable, text=text).grid(padx=PADX, sticky=tk.W)
        nb.Label(frame, text=rseProject.explanation).grid(padx=PADX * 4, sticky=tk.W)

    # overwrite disabled state when EDDN/EDSM is off in EDMC
    ttk.Separator(frame, orient=tk.HORIZONTAL).grid(padx=PADX * 2, pady=8, sticky=tk.EW)
    nb.Checkbutton(frame, variable=this.clipboard,
                   text="Copy system name to clipboard after jump").grid(padx=PADX, sticky=tk.W)
    nb.Checkbutton(frame, variable=this.overwrite,
                   text="I use another tool to transmit data to EDSM/EDDN").grid(padx=PADX, sticky=tk.W)

    # clear caches
    ttk.Separator(frame, orient=tk.HORIZONTAL).grid(padx=PADX * 2, pady=8, sticky=tk.EW)
    nb.Label(frame, text="Clear caches").grid(padx=PADX, sticky=tk.W)
    clearCachesFrame = nb.Frame(frame)
    clearCachesFrame.grid(padx=PADX * 2, pady=8, sticky=tk.EW)
    frame.columnconfigure(2, weight=1)
    nb.Button(clearCachesFrame, text="Fully scanned systems", command=lambda: clear_scanned_systems_cache_callback(RseData.CACHE_FULLY_SCANNED_BODIES, "fully scanned systems"))\
        .grid(padx=PADX, sticky=tk.W, row=0, column=0)
    nb.Button(clearCachesFrame, text="Ignored systems", command=lambda: clear_scanned_systems_cache_callback(RseData.CACHE_IGNORED_SYSTEMS, "ignored systems")) \
        .grid(padx=PADX, sticky=tk.W, row=0, column=1)

    # links
    ttk.Separator(frame, orient=tk.HORIZONTAL).grid(padx=PADX * 2, pady=8, sticky=tk.EW)
    nb.Label(frame, text="Plugin Version: {}".format(RseData.VERSION)).grid(padx=PADX, sticky=tk.W)
    if not this.edmc_has_logging_support:
        nb.Checkbutton(frame, variable=this.debug,
                       text="Verbose Logging").grid(padx=PADX, sticky=tk.W)
    HyperlinkLabel(frame, text="Open the Github page for this plugin", background=nb.Label().cget("background"),
                   url="https://github.com/Thurion/EDSM-RSE-for-EDMC", underline=True).grid(padx=PADX, sticky=tk.W)
    HyperlinkLabel(frame, text="A big thanks to EDTS for providing the coordinates.", background=nb.Label().cget("background"),
                   url="http://edts.thargoid.space/", underline=True).grid(padx=PADX, sticky=tk.W)
    return frame
Пример #10
0
def plugin_app(parent):
	
	this.parent = parent
	#create a new frame as a containier for the status
	
	this.frame = tk.Frame(parent)
	#We want three columns, label, text, button
	this.frame.columnconfigure(5, weight=1)
	
	# maybe we want to be able to change the labels?
	this.label = tk.Label(this.frame, text=  "Alien Sites:")
	#this.status = tk.Label(this.frame, anchor=tk.W, text="Getting current location")
	this.status = HyperlinkLabel(this.frame, compound=tk.RIGHT, popup_copy = True)
	this.status["url"] = None
	
	this.system = HyperlinkLabel(parent, compound=tk.RIGHT, popup_copy = True)
	this.clipboard = tk.Label(this.frame, anchor=tk.W, image=this._IMG_CLIPBOARD)
	this.clipboard.bind("<Button-1>", copy_text_to_clipboard)  
	
	this.tick = tk.Label(this.frame, anchor=tk.W, image=this._IMG_VISITED)
	this.tick.bind("<Button-1>", mark_visited)  
	this.cross = tk.Label(this.frame, anchor=tk.W, image=this._IMG_IGNORE)	
	this.cross.bind("<Button-1>", drop_priority)  
	this.spacer = tk.Frame(this.frame)
	this.description = tk.Message(this.frame,width=200)
	this.body_label = tk.Label(this.frame, text=  "Body:")
	this.body = tk.Label(this.frame)

	
	this.label.grid(row = 0, column = 0, sticky=tk.W)
	this.status.grid(row = 0, column = 1, sticky=tk.W)
	this.clipboard.grid(row = 0, column = 2, sticky=tk.W)
	this.tick.grid(row = 0, column = 3, sticky=tk.W)
	this.cross.grid(row = 0, column = 4, sticky=tk.W)
	this.body_label.grid(row = 1, column = 0, sticky=tk.W)
	this.body.grid(row = 1, column = 1, columnspan=3, sticky=tk.W)
	this.description.grid(row = 2, column = 0, columnspan=4, sticky=tk.W)
	
	this.label.grid_remove()
	this.status.grid_remove()
	this.clipboard.grid_remove()
	this.tick.grid_remove()
	this.cross.grid_remove()
	this.description.grid_remove()
	this.body.grid_remove()
	this.body_label.grid_remove()
	#label.grid(row = 1, column = 0, sticky=tk.W)
	#this.status.grid(row = 1, column = 1, sticky=tk.W)
	#this.icon.pack(side=RIGHT)
	return this.frame
Пример #11
0
def plugin_prefs(parent, cmdr, is_beta):

    PADX = 10
    BUTTONX = 12  # indent Checkbuttons and Radiobuttons
    PADY = 2  # close spacing

    frame = nb.Frame(parent)
    frame.columnconfigure(1, weight=1)

    HyperlinkLabel(frame,
                   text='Elite Dangerous Star Map',
                   background=nb.Label().cget('background'),
                   url='https://www.edsm.net/',
                   underline=True).grid(columnspan=2, padx=PADX,
                                        sticky=tk.W)  # Don't translate
    this.log = tk.IntVar(value=config.getint('edsm_out') and 1)
    this.log_button = nb.Checkbutton(
        frame,
        text=_('Send flight log to Elite Dangerous Star Map'),
        variable=this.log,
        command=prefsvarchanged)
    this.log_button.grid(columnspan=2, padx=BUTTONX, pady=(5, 0), sticky=tk.W)

    nb.Label(frame).grid(sticky=tk.W)  # big spacer
    this.label = HyperlinkLabel(frame,
                                text=_('Elite Dangerous Star Map credentials'),
                                background=nb.Label().cget('background'),
                                url='https://www.edsm.net/settings/api',
                                underline=True)  # Section heading in settings
    this.label.grid(columnspan=2, padx=PADX, sticky=tk.W)

    this.cmdr_label = nb.Label(frame, text=_('Cmdr'))  # Main window
    this.cmdr_label.grid(row=10, padx=PADX, sticky=tk.W)
    this.cmdr_text = nb.Label(frame)
    this.cmdr_text.grid(row=10, column=1, padx=PADX, pady=PADY, sticky=tk.W)

    this.user_label = nb.Label(frame, text=_('Commander Name'))  # EDSM setting
    this.user_label.grid(row=11, padx=PADX, sticky=tk.W)
    this.user = nb.Entry(frame)
    this.user.grid(row=11, column=1, padx=PADX, pady=PADY, sticky=tk.EW)

    this.apikey_label = nb.Label(frame, text=_('API Key'))  # EDSM setting
    this.apikey_label.grid(row=12, padx=PADX, sticky=tk.W)
    this.apikey = nb.Entry(frame)
    this.apikey.grid(row=12, column=1, padx=PADX, pady=PADY, sticky=tk.EW)

    prefs_cmdr_changed(cmdr, is_beta)

    return frame
Пример #12
0
def plugin_prefs(parent, cmdr, is_beta):

    PADX = 10

    frame = nb.Frame(parent)
    frame.columnconfigure(1, weight=1)

    HyperlinkLabel(frame,
                   text="Nic Streaming Plugin on Github",
                   background=nb.Label().cget("background"),
                   url=this.plugin_url,
                   underline=True).grid(row=8, padx=PADX, sticky=tk.W)
    nb.Label(frame, text="Version: %s" % this.version).grid(row=8,
                                                            column=1,
                                                            padx=PADX,
                                                            sticky=tk.E)
    nb.Label(
        frame,
        text=
        "Plugin saves game information in various files you can use in your OBS/Streamlabs scenes."
    ).grid(row=9, padx=PADX, sticky=tk.W)
    nb.Label(
        frame,
        text="Files are saved in to output directory selected on the Output tab"
    ).grid(row=10, padx=PADX, sticky=tk.W)

    return frame
Пример #13
0
def plugin_app(parent):
    this.station_label = tk.Label(parent,
                                  text=_('Station') + ':')  # Main window
    this.station = HyperlinkLabel(parent,
                                  url=station_url,
                                  popup_copy=lambda x: x != STATION_UNDOCKED)
    return (this.station_label, this.station)
Пример #14
0
    def plugin_app(self, parent):
        "Called once to get the plugin widget. Return a ``tk.Frame``."

        # An additional internal frame that we can grid_forget if disabled:
        frame = self.frame = tk.Frame(parent)
        frame.columnconfigure(1, weight=1)

        self.textvariable = tk.StringVar()
        self.textvariable.set("(Waiting...)")
        ttk.Label(frame,
                  text="HOT-MESS Nearest System:",
                  name='desc',
                  anchor=tk.NW).grid(row=0, column=0, sticky=tk.NW)
        #self.hyperlinkobj = ttk.Label(frame, textvariable=self.textvariable, anchor=tk.NE).grid(row=0, column=1, sticky=tk.NE)
        HyperlinkLabel(frame,
                       textvariable=self.textvariable,
                       url='https://hot.forthemug.com/hot-mess/',
                       name='pwplink',
                       anchor=tk.NE).grid(row=0, column=1, sticky=tk.NE)

        enabled = self.helper.prefs.setdefault(CFG_SHOW_PWPEVENTS, False)
        self.enabled_intvar = tk.IntVar(value=1 if enabled else 0)
        self.__update_hidden()

        return self.frame
Пример #15
0
def plugin_prefs(parent, cmdr, is_beta):
    """Plugin Preferences UI hook."""
    x_padding = 10
    x_button_padding = 12  # indent Checkbuttons and Radiobuttons
    y_padding = 2  # close spacing

    frame = nb.Frame(parent)
    frame.columnconfigure(1, weight=1)

    HyperlinkLabel(frame,
                   text='Route Tracker',
                   background=nb.Label().cget('background'),
                   url="https://github.com/Typhoone/route-tracker",
                   underline=True).grid(row=0,
                                        columnspan=2,
                                        padx=x_padding,
                                        sticky=tk.W)  # Don't translate

    this.includePlanetary_button = nb.Checkbutton(
        frame, text='Include Planetary', variable=this.includePlanetary)
    this.includePlanetary_button.grid(row=1,
                                      columnspan=2,
                                      padx=x_button_padding,
                                      pady=y_padding,
                                      sticky=tk.W)

    this.minSupplyEntry = addEntry(frame, 2, this.minSupplyInt,
                                   "x Your Inventory")
    this.hopDistEntry = addEntry(frame, 3, this.hopDistInt,
                                 "Hop Distance (0 for your ships max hop)")
    this.priceAgeEntry = addEntry(frame, 4, this.priceAgeInt, "Max Price Age")
    this.minDemandEntry = addEntry(frame, 5, this.minDemandInt, "Min Demand")
    this.minProfitEntry = addEntry(frame, 6, this.minProfitInt, "Min Profit")

    return frame
Пример #16
0
    def __init__(self, parent):
        OmniFrame.__init__(self, parent, name="credits")

        self.__label = OmniLabel(self, name="credits_lbl", text="Made by")
        self.__link = HyperlinkLabel(self, text="SeldonLabs", url='https://github.com/seldonlabs/OmniScanner', underline=True)
        theme.register(self.__link)
        self.__link.pack(anchor=tk.NW, side=tk.LEFT)
Пример #17
0
def plugin_prefs(parent, cmdr, is_beta):
    """
    Return a TK Frame for adding to the EDMC settings dialog.
    """
    this.rememberkillcount = tk.IntVar(value=config.getint("RKC"))

    frame = nb.Frame(parent)

    plugin_label = nb.Label(frame, text="IDA-BGS AX plugin v0.31")
    plugin_label.grid(padx=10, row=0, column=0, sticky=tk.W)

    HyperlinkLabel(frame,
                   text='Visit website',
                   background=nb.Label().cget('background'),
                   url='https://github.com/ZTiKnl/IDA-AX',
                   underline=True).grid(padx=10, row=0, column=1, sticky=tk.W)

    empty_label = nb.Label(frame, text="")
    empty_label.grid(padx=10, row=1, column=0, columnspan=2, sticky=tk.W)

    remember_entry = nb.Checkbutton(
        frame,
        text=_('Remember kill count on EDMC restart'),
        variable=this.rememberkillcount)
    remember_entry.grid(padx=10, row=5, column=0, columnspan=2, sticky=tk.EW)

    return frame
Пример #18
0
 def setup_gui(self, parent) -> Tuple[HyperlinkLabel,tk.OptionMenu]:
     self.parent = parent
     self.selectedship = tk.StringVar(parent)
     self.label = HyperlinkLabel(parent, url="http://coriolis.io", name='shipyardlink', text=f'{_("Shipyard")}:')
     self.shiplist = tk.OptionMenu(parent, self.selectedship, self.shipnames[0], *self.shipnames)
     self.tracevar = self.selectedship.trace_add("write",self.updateshipurl)
     self.loadshipdata()
     return (self.label,self.shiplist)
Пример #19
0
def plugin_app(parent):
    "Called once to get the plugin widget. Return a ``tk.Frame``."

    padx, pady = 10, 5  # formatting
    sticky = tk.EW + tk.N  # full width, stuck to the top
    anchor = tk.NW

    frame = this.frame = tk.Frame(parent)
    frame.columnconfigure(0, weight=1)

    table = tk.Frame(frame)
    table.columnconfigure(1, weight=1)
    table.grid(sticky=sticky)

    HyperlinkLabel(
        table,
        text='Helper:',
        url='https://hot.forthemug.com/',
        anchor=anchor,
    ).grid(row=0, column=0, sticky=sticky)
    this.status = ttk.Label(table, anchor=anchor, text="For the Mug!")
    this.status.grid(row=0, column=1, sticky=sticky)

    widgets.StyleCaptureLabel(table, anchor=anchor, text="News:").grid(row=1, column=0, sticky=sticky)
    news.HuttonNews(table).grid(row=1, column=1, sticky=sticky)

    this.plugin_rows = {}
    this.plugin_frames = {}
    row = 1 # because the table is first

    # Add the plugins' widgets
    for plugin in this.plugins:
        try:
            plugin_frame = plugin.plugin_app(frame)
        except:
            PANIC("{}.plugin_app".format(plugin))
            continue

        if plugin_frame:
            this.plugin_rows[plugin] = row
            this.plugin_frames[plugin] = plugin_frame
            row = row + 1

    # Add the front cover
    this.front_cover_row = row
    this.front_cover = widgets.FrontCover(frame)
    _show_front_cover(True)

    # Arrange for the front cover to be shown for at least a few seconds
    this.front_cover_until = time.time() + FRONT_COVER_DELAY
    frame.after(1000 * FRONT_COVER_DELAY, _refresh)
    frame.after_idle(_refresh)

    # Add the toolbar
    toolbar.HuttonToolbar(frame).grid(row=row + 1, pady=pady, sticky=sticky)

    return frame
Пример #20
0
    def plugin_prefs(cls, parent, client, gridrow):
        "Called to get a tk Frame for the settings dialog."

        frame = nb.Frame(parent)
        frame.columnconfigure(1, weight=1)
        frame.grid(row=gridrow, column=0, sticky="NSEW")
        HyperlinkLabel(frame, text=f"Release: {client}",
                       url="https://github.com/canonn-science/EDMC-Canonn/blob/master/README.md").grid(row=1, column=0, sticky="NW")

        return frame
Пример #21
0
def plugin_app(parent) -> tk.Frame:
    global system_label, system_status, body_label, body_status

    frame = tk.Frame(parent)

    system_label = tk.Label(frame, text=f'{_("System")}:')
    system_label.grid(row=0, column=0, sticky=tk.W)
    system_status = HyperlinkLabel(frame, text='', url=None)
    system_status.grid(row=0, column=2, sticky=tk.E)

    body_label = tk.Label(frame, text=f'{_("Body")}:')
    body_label.grid(row=1, column=0, sticky=tk.W)
    body_status = HyperlinkLabel(frame, text='', url=None)
    body_status.grid(row=1, column=2, sticky=tk.E)

    frame.columnconfigure(2, weight=1)

    update_status()

    return frame
Пример #22
0
    def __populate_plugin_prefs_frame(self, frame):
        "Populate the frame for ``plugin_prefs``."

        for widget in frame.winfo_children():  # In case we're called again
            widget.destroy()

        frame.columnconfigure(0, weight=1)

        topline = nb.Frame(frame)
        topline.grid(row=0, sticky=tk.W)

        HyperlinkLabel(topline,
                       text="Hutton Helper",
                       background=nb.Label().cget('background'),
                       url='https://hot.forthemug.com/',
                       underline=True).grid(row=0, column=0)
        nb.Label(topline,
                 text="Lite version {}".format(HH_VERSION)).grid(row=0,
                                                                 column=1)
        self.automatic_intvar = tk.IntVar(value=self.cfg_auto)
        nb.Checkbutton(frame,
                       text="Update automatically",
                       variable=self.automatic_intvar).grid(row=1, sticky=tk.W)

        if self.updated:
            nb.Label(frame, text=HH_TEXT_UPDATED).grid(
                row=2, sticky=tk.W)  # str(self) == self.__str__()

        elif self.remote_version is None:
            nb.Label(frame, text=HH_TEXT_VERSION_CHECK_FAILED,
                     fg='dark red').grid(row=2, sticky=tk.W)
            button = nb.Button(
                frame,
                text="Check Again",
                command=lambda: self.__again_callback(frame, button))
            button.grid(row=3, sticky=tk.W)

        elif self.remote_version > HH_VERSION:
            text = HH_TEXT_UPDATE_AVAILABLE.format(
                remote_version=self.remote_version)
            nb.Label(frame, text=text, fg='dark green').grid(row=2,
                                                             sticky=tk.W)
            button = nb.Button(
                frame,
                text="UPDATE",
                command=lambda: self.__upgrade_callback(frame, button))
            button.grid(row=3, sticky=tk.W)

        else:
            nb.Label(frame,
                     text="You're up to date. Fly safe!").grid(row=2,
                                                               sticky=tk.W)

        return frame
Пример #23
0
def plugin_app(parent):
    this.frame = tk.Frame(parent)
    this.frame.bind_all(RseData.EVENT_RSE_BACKGROUNDWORKER,
                        updateUiUnconfirmedSystem)
    this.frame.bind_all(RseData.EVENT_RSE_UPDATE_AVAILABLE,
                        showUpdateNotification)
    this.frame.bind_all(RseData.EVENT_RSE_EDSM_BODY_COUNT,
                        updateUiEdsmBodyCount)

    this.rseData.setFrame(this.frame)

    this.frame.columnconfigure(1, weight=1)
    tk.Label(this.frame, text="Unconfirmed:").grid(row=0,
                                                   column=0,
                                                   sticky=tk.W)
    this.unconfirmedSystem = RseHyperlinkLabel(this.frame,
                                               compound=tk.RIGHT,
                                               popup_copy=True)
    this.errorLabel = tk.Label(this.frame)
    tk.Label(this.frame, text="Distance:").grid(row=1, column=0, sticky=tk.W)
    this.distanceValue = tk.Label(this.frame)
    this.distanceValue.grid(row=1, column=1, sticky=tk.W)
    tk.Label(this.frame, text="Action:").grid(row=2, column=0, sticky=tk.W)
    this.actionText = tk.Label(this.frame)
    this.actionText.grid(row=2, column=1, sticky=tk.W)

    this.edsmBodyFrame = tk.Frame(this.rseData.frame)
    this.edsmBodyFrame.columnconfigure(1, weight=1)
    tk.Frame(this.edsmBodyFrame,
             highlightthickness=1).grid(row=0,
                                        pady=3,
                                        columnspan=2,
                                        sticky=tk.EW)  # separator
    tk.Label(this.edsmBodyFrame, text="EDSM Bodies:").grid(row=1,
                                                           column=0,
                                                           sticky=tk.W)
    this.edsmBodyCountText = tk.Label(this.edsmBodyFrame)
    this.edsmBodyCountText["text"] = "?"
    this.edsmBodyCountText.grid(row=1, column=1, sticky=tk.W)

    this.updateNotificationLabel = HyperlinkLabel(
        this.frame,
        text="Plugin update available",
        background=nb.Label().cget("background"),
        url="https://github.com/Thurion/EDSM-RSE-for-EDMC/releases",
        underline=True)
    updateUiUnconfirmedSystem()
    updateUiEdsmBodyCount()

    # start update check after frame is initialized to avoid any possible race conditions when generating the event
    this.queue.put(BackgroundTask.VersionCheckTask(this.rseData))

    return this.frame
Пример #24
0
    def create_gui(parent, update_func, globals):
        """
        Create plugin's preference GUI
        :param parent: parent frame
        :param gui:
        :return: plugin's preference GUI
        """

        # Settings frame
        frame = nb.Frame(parent)
        frame.columnconfigure(1, weight=1)

        # Headline label
        globals.logger.debug("Creating settings hyperling label..")
        HyperlinkLabel(frame,
                       text='EDMC: Autopath',
                       background=nb.Label().cget('background'),
                       url='https://github.com/Sognus/EDMC-Autopath',
                       underline=True).grid(columnspan=2,
                                            padx=PrefGUI.PADX,
                                            sticky=tk.W)

        globals.logger.debug("Settings hyperlink label created.")

        # Checkbox for Road To Riches
        globals.logger.debug("Creating settings neutron plotter checkbox...")
        neutron_button = nb.Checkbutton(
            frame,
            text=_('Enable neutron plotter feature'),
            variable=PrefGUI.neutron,
            command=lambda update_func=update_func: PrefGUI.prefs_changed(
                update_func))
        neutron_button.grid(columnspan=2,
                            padx=PrefGUI.BUTTONX,
                            pady=(5, 0),
                            sticky=tk.W)
        globals.logger.debug("Settings neutron plotter created.")

        # Checkbox for Road To Riches
        globals.logger.debug("Creating settings road to riches checkbox")
        riches_button = nb.Checkbutton(
            frame,
            text=_('Enable road to riches feature'),
            variable=PrefGUI.riches,
            command=lambda update_func=update_func: PrefGUI.prefs_changed(
                update_func, globals))
        riches_button.grid(columnspan=2,
                           padx=PrefGUI.BUTTONX,
                           pady=(5, 0),
                           sticky=tk.W)
        globals.logger.debug("Settings neutron plotter created")

        return frame
Пример #25
0
def showSingleLoop(indx):
    if indx == None:
        addLabel("Loop data Missing!", 0, 0, this.frame)
    else:
        this.currentLoopIndx = indx
        loop = this.loops[indx]

        this.currentLoopID = loop['tradeLoopId']

        oneSystemName = str(loop['oneSystem']['name'])
        twoSystemName = str(loop['twoSystem']['name'])
        oneStationName = str(loop['oneStation']['name'])
        twoStationName = str(loop['twoStation']['name'])

        oneCommodityName = str(loop['oneCommodity']['name'])
        twoCommodityName = str(loop['twoCommodity']['name'])
        oneCommodityId = loop['oneCommodity']['id']
        twoCommodityId = loop['twoCommodity']['id']
        oneCommodityCategory = getCategoryNameFromCommodityId(oneCommodityId)
        twoCommodityCategory = getCategoryNameFromCommodityId(twoCommodityId)

        sup1 = str(loop['oneBuyListing']['supply'])
        sup2 = str(loop['twoBuyListing']['supply'])

        station1Type = loop['oneStation']['type_id']
        station2Type = loop['twoStation']['type_id']

        b1 = str(loop['twoSellListing']['sell_price'] -
                 loop['oneBuyListing']['buy_price'])
        b2 = str(loop['oneSellListing']['sell_price'] -
                 loop['twoBuyListing']['buy_price'])
        printRoute(oneSystemName, oneStationName, b1, station1Type, 1,
                   oneCommodityCategory, oneCommodityName, sup1)

        logger.debug(twoStationName)
        logger.debug(this.currentStation)

        if this.currentStation == twoStationName:
            addLabel("ᐃ", 3, 2, this.frame)
        else:
            addLabel("ᐁ", 3, 2, this.frame)

        # addLabel("ᐃ", 3, 3, this.frame)
        printRoute(twoSystemName, twoStationName, b2, station2Type, 4,
                   twoCommodityCategory, twoCommodityName, sup2)

        HyperlinkLabel(this.frame,
                       text=f'https://eddb.io/trade/loop/{this.currentLoopID}',
                       url=f'https://eddb.io/trade/loop/{this.currentLoopID}',
                       underline=True).grid(row=6, columnspan=10, sticky=tk.W)

    addFooter(7, "showLoops")
Пример #26
0
def plugin_app(parent):
    debug("plugin_app")
    this.parent = parent
    this.pcont = tk.Frame(parent)
    this.container = tk.Frame(pcont)
    this.container.columnconfigure(3, weight=1)
    this.label = tk.Label(this.container, text="Screenshot:")
    this.status = HyperlinkLabel(this.container,
                                 anchor=tk.W,
                                 text=this.status_text)
    this.status["url"] = this.status_url
    this.timex = tk.Button(this.container,
                           command=lambda: this.timex.config(
                               text="False", image=this.io_LEDRedOff)
                           if this.timex.config('text')[-1] == 'True' else this
                           .timex.config(text="True", image=this.io_LEDRedOn),
                           anchor=tk.W)
    this.io_LEDRedOn = tk.PhotoImage(
        file=os.path.realpath(os.path.dirname(os.path.realpath(__file__))) +
        "\\icons\\timer_enabled.gif")
    this.io_LEDRedOff = tk.PhotoImage(
        file=os.path.realpath(os.path.dirname(os.path.realpath(__file__))) +
        "\\icons\\timer_disabled.gif")
    this.timex.config(text="False", image=io_LEDRedOff)
    this.timex.grid(padx=10, row=0, column=2, sticky=tk.E)
    this.thargoid = False
    this.thargscan = False

    this.images = tk.Frame(this.container)
    this.images.grid(row=1, column=0, columnspan=3, sticky=tk.W)
    this.images.columnconfigure(2, weight=1)

    this.screenshot = tk.Label(this.images, anchor=tk.W)
    this.screenshot.grid(padx=10, row=0, column=0, columnspan=1, sticky=tk.W)
    this.screenshot.grid_remove()
    this.screenshot.bind("<Button-1>", save_screenshot)
    this.cropped = tk.Label(this.images, anchor=tk.W)
    this.cropped.grid(padx=10, row=0, column=1, columnspan=1, sticky=tk.W)
    this.cropped.bind("<Button-1>", save_crop)
    this.cropped.grid_remove()
    this.label.grid(row=0, column=0, sticky=tk.W)
    this.status.grid(padx=10, row=0, column=1, sticky=tk.W)
    debug_settings()
    display()
    this.processing = False
    this.parent.after(1000, sendKeyPress)

    return (this.pcont)
Пример #27
0
def plugin_prefs(parent, cmdr: str, is_beta: bool) -> Frame:
    PADX = 10  # noqa: N806
    BUTTONX = 12  # noqa: N806 # indent Checkbuttons and Radiobuttons

    if prefsVersion.shouldSetDefaults('0.0.0.0',
                                      not bool(config.getint('output'))):
        output: int = (config.OUT_MKT_EDDN | config.OUT_SYS_EDDN
                       )  # default settings

    else:
        output: int = config.getint('output')

    eddnframe = nb.Frame(parent)

    HyperlinkLabel(eddnframe,
                   text='Elite Dangerous Data Network',
                   background=nb.Label().cget('background'),
                   url='https://github.com/EDSM-NET/EDDN/wiki',
                   underline=True).grid(padx=PADX,
                                        sticky=tk.W)  # Don't translate

    this.eddn_station = tk.IntVar(value=(output & config.OUT_MKT_EDDN) and 1)
    this.eddn_station_button = nb.Checkbutton(
        eddnframe,
        text=_('Send station data to the Elite Dangerous Data Network'),
        variable=this.eddn_station,
        command=prefsvarchanged)  # Output setting

    this.eddn_station_button.grid(padx=BUTTONX, pady=(5, 0), sticky=tk.W)
    this.eddn_system = tk.IntVar(value=(output & config.OUT_SYS_EDDN) and 1)
    # Output setting new in E:D 2.2
    this.eddn_system_button = nb.Checkbutton(
        eddnframe,
        text=_(
            'Send system and scan data to the Elite Dangerous Data Network'),
        variable=this.eddn_system,
        command=prefsvarchanged)

    this.eddn_system_button.grid(padx=BUTTONX, pady=(5, 0), sticky=tk.W)
    this.eddn_delay = tk.IntVar(value=(output & config.OUT_SYS_DELAY) and 1)
    # Output setting under 'Send system and scan data to the Elite Dangerous Data Network' new in E:D 2.2
    this.eddn_delay_button = nb.Checkbutton(
        eddnframe,
        text=_('Delay sending until docked'),
        variable=this.eddn_delay)
    this.eddn_delay_button.grid(padx=BUTTONX, sticky=tk.W)

    return eddnframe
Пример #28
0
def plugin_app(parent):
    # Create and display widgets
    this.frame = tk.Frame(parent)
    this.frame.columnconfigure(3, weight=1)
    this.frame.bind('<<HabZoneData>>', edsm_data)	# callback when EDSM data received
    for (name, high, low, subType) in WORLDS:
        this.worlds.append((tk.Label(this.frame, text = name + ':'),
                            HyperlinkLabel(this.frame, wraplength=100),	# edsm
                            tk.Label(this.frame),	# near
                            tk.Label(this.frame),	# dash
                            tk.Label(this.frame),	# far
                            tk.Label(this.frame),	# ls
                            ))
    this.spacer = tk.Frame(this.frame)	# Main frame can't be empty or it doesn't resize
    update_visibility()
    return this.frame
Пример #29
0
 def __init__(self, frame):
     debug("Initiating News")
     self.feed_url = "https://docs.google.com/spreadsheets/d/e/2PACX-1vSy9ij93j2qbwD-1_bXlI5IfO4EUD4ozNX2GJ2Do5tZNl-udWIqBHxYbtmcMRwvF6favzay3zY2LpH5/pub?gid=1876886084&single=true&output=tsv"
     self.version_url = "https://docs.google.com/spreadsheets/d/e/2PACX-1vSy9ij93j2qbwD-1_bXlI5IfO4EUD4ozNX2GJ2Do5tZNl-udWIqBHxYbtmcMRwvF6favzay3zY2LpH5/pub?gid=0&single=true&output=tsv"
     self.nag_count = 0
     this.description = tk.Message(frame, width=200)
     this.news_label = tk.Label(frame, text="Report:")
     this.newsitem = HyperlinkLabel(frame,
                                    compound=tk.LEFT,
                                    popup_copy=True)
     this.news_label.grid(row=3, column=0, sticky=tk.W)
     this.newsitem.grid(row=3, column=1, columnspan=3, sticky=tk.W)
     this.newsitem["text"] = "News"
     this.news_label["text"] = "News"
     this.newsitem.grid_remove()
     this.news_label.grid_remove()
     self.getPost()
Пример #30
0
def plugin_prefs(parent):
    PADX = 10  # formatting
    frame = nb.Frame(parent)
    frame.columnconfigure(1, weight=1)
    HyperlinkLabel(frame,
                   text='Mobius PVE website',
                   background=nb.Label().cget('background'),
                   url='https://elitepve.com/',
                   underline=True).grid(columnspan=2, padx=PADX,
                                        sticky=tk.W)  # Don't translate
    nb.Label(frame,
             text="Mobius Plug-in - pre-alpha release Version {VER}".format(
                 VER=MH_VERSION)).grid(columnspan=2, padx=PADX, sticky=tk.W)
    nb.Label(frame).grid()  # spacer
    nb.Button(frame, text="UPGRADE",
              command=upgrade_callback).grid(columnspan=2,
                                             padx=PADX,
                                             sticky=tk.W)
    return frame