示例#1
0
文件: load.py 项目: 0xz00n/ATEL-EDMC
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
示例#2
0
def plugin_prefs(parent):
    global SERVER
    frame = nb.Frame(parent)
    frame.columnconfigure(1, weight=1)

    nb.Label(frame, text="HITS Configuration").grid(padx=10,
                                                    row=8,
                                                    sticky=tk.W)

    nb.Label(frame, text="Server Address").grid(padx=10, row=10, sticky=tk.W)
    nb.Entry(frame, textvariable=SERVER).grid(padx=10,
                                              row=10,
                                              column=1,
                                              sticky=tk.EW)

    nb.Label(frame, text="Overlay Duration (sec)").grid(padx=10,
                                                        row=11,
                                                        sticky=tk.W)
    nb.Entry(frame, textvariable=OVERLAY_MESSAGE_DURATION).grid(padx=10,
                                                                row=11,
                                                                column=1,
                                                                sticky=tk.EW)

    nb.Label(frame, text="Traffic Reports (on/off)").grid(padx=10,
                                                          row=12,
                                                          sticky=tk.W)
    nb.Entry(frame, textvariable=OVERLAY_HITS_MODE).grid(padx=10,
                                                         row=12,
                                                         column=1,
                                                         sticky=tk.EW)

    return 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_prefs(parent, cmdr, is_beta):
    frame = nb.Frame(parent)

    nb.Label(frame, text="Show :").grid(row=0, column=0, sticky=tk.W)
    nb.Label(frame, text="Base :").grid(row=0, column=1, sticky=tk.W)
    global showExplorer
    nb.Checkbutton(frame, text="Explorer",
                   variable=showExplorer).grid(row=1, column=1, sticky=tk.W)
    global showMerchant
    nb.Checkbutton(frame, text="Trader",
                   variable=showMerchant).grid(row=2, column=1, sticky=tk.W)
    global showCombat
    nb.Checkbutton(frame, text="Combat", variable=showCombat).grid(row=3,
                                                                   column=1,
                                                                   sticky=tk.W)

    nb.Label(frame, text="Odyssey :").grid(row=0, column=2, sticky=tk.W)
    global showExo
    nb.Checkbutton(frame, text="Exobiologist",
                   variable=showExo).grid(row=1, column=2, sticky=tk.W)
    global showMerc
    nb.Checkbutton(frame, text="Mercenary",
                   variable=showMerc).grid(row=2, column=2, sticky=tk.W)

    nb.Label(frame, text="Factions :").grid(row=0, column=3, sticky=tk.W)
    global showEmpire
    nb.Checkbutton(frame, text="Empire", variable=showEmpire).grid(row=1,
                                                                   column=3,
                                                                   sticky=tk.W)
    global showFederation
    nb.Checkbutton(frame, text="Federation",
                   variable=showFederation).grid(row=2, column=3, sticky=tk.W)

    return frame
示例#5
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
示例#6
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
示例#7
0
def plugin_prefs(parent):
    """
    Handle plugin tab
    :param parent:
    :return:
    """
    PADX = 10
    PADY = 2

    ROW0 = 8
    ROW1 = 10
    ROW2 = 12
    ROW3 = 14

    BUTTONX = 12

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

    nb.Label(frame, text=APP_LONGNAME).grid(padx=PADX, row=ROW0, sticky=tk.W)

    nb.Label(frame, text=TTL_LABEL) \
        .grid(padx=PADX, pady=PADY, row=ROW1, sticky=tk.W)
    nb.Entry(frame, textvariable=TTL_FIELD) \
        .grid(padx=PADX, pady=PADY, row=ROW1, column=1, sticky=tk.EW)

    nb.Label(frame, text=ED_DATE_LABEL) \
        .grid(padx=PADX, pady=PADY, row=ROW2, sticky=tk.W)
    nb.Checkbutton(frame, text='Use Elite time or normal UTC time', variable=ED_DATE_FIELD) \
        .grid(padx=PADX, pady=PADY, row=ROW2, column=1, sticky=tk.W)

    return frame
示例#8
0
def plugin_prefs(parent: nb.Notebook, cmdr: str,
                 is_beta: bool) -> Optional[tk.Frame]:
    global setting_show_sum
    global setting_show_delta_column
    global setting_show_ratio_and_cr_per_kill
    setting_show_sum = tk.BooleanVar(
        value=config.get_bool(f"{plugin_name}.show_sum"))
    setting_show_delta_column = tk.BooleanVar(
        value=config.get_bool(f"{plugin_name}.show_delta"))
    setting_show_ratio_and_cr_per_kill = tk.BooleanVar(
        value=config.get_bool(f"{plugin_name}.show_ratio"))
    frame = nb.Frame(parent)
    nb.Label(frame, text="Massacre Plugin Display Settings").grid()
    nb.Checkbutton(frame, text="Display Sum Row",
                   variable=setting_show_sum).grid()
    nb.Checkbutton(frame, text="Display Kill Ratio (*1) and CR per Kill", variable=setting_show_ratio_and_cr_per_kill)\
        .grid()
    nb.Checkbutton(frame,
                   text="Display Delta Column (*2)",
                   variable=setting_show_delta_column).grid()
    nb.Label(
        frame,
        text=
        "*1: Calculated as follows: Total Mission Kills / Total required actual kills"
    ).grid()
    nb.Label(frame, text="*2: Show the difference to the maximum stack. If it is the maximum stack, the value will"
                         "show the difference to the second highest stack. This value will then prefixed with a '-'")\
        .grid()
    return frame
示例#9
0
def plugin_prefs(parent, cmdr, is_beta):
    """
    Return a TK Frame for adding to the EDMC settings dialog.
    """
    PADX = 5
    PADY = 2

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

    def select_route_file_handler():
        """
        Handle Select Route File button click event
        """
        file_selection = tkFileDialog.askopenfilename(filetypes=[("Supported files","*.csv *.txt"),("CSV files","*.csv"),("Text files","*.txt"),("All files","*.*")])
        if file_selection:
            this.route_file_location_setting.set(file_selection)
            load_systems()


    def clear_route_file_handler():
        """
        Handle Clear Route File button click event
        """
        this.route_file_location_setting.set("")
        load_systems()

    nb.Label(frame, text="Route File Location: ").grid(row=0, padx=PADX, pady=PADY, sticky=tk.E)
    nb.Entry(frame, textvariable=this.route_file_location_setting).grid(row=0, column=1, sticky=tk.EW)
    nb.Button(frame, text="Select Route File", command=select_route_file_handler).grid(row=0, column=2, columnspan=2, padx=PADX, pady=PADY, sticky=tk.EW)
    nb.Button(frame, text="Clear Route File", command=clear_route_file_handler).grid(row=1, column=2, columnspan=2, padx=PADX, pady=PADY, sticky=tk.EW)
    nb.Label(frame, text="Route: ").grid(row=2, padx=PADX, pady=PADY, sticky=tk.NE)
    nb.Label(frame, textvariable=this.systems_label_text).grid(row=2, column=1, columnspan=2, sticky=tk.EW)

    return frame
示例#10
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
示例#11
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
示例#12
0
def plugin_prefs(parent):
    global SERVER
    frame = nb.Frame(parent)
    frame.columnconfigure(1, weight=1)

    nb.Label(frame, text="HITS Configuration").grid(padx=10, row=8, sticky=tk.W)

    nb.Label(frame, text="Server Address").grid(padx=10, row=10, sticky=tk.W)
    nb.Entry(frame, textvariable=SERVER).grid(padx=10, row=10, column=1, sticky=tk.EW)

    return frame
示例#13
0
def plugin_prefs(parent, cmdr, is_beta):
    """
   Return a TK Frame for adding to the EDMC settings dialog.
   """
    this.mysetting = tk.IntVar(value=config.getint(
        "MyPluginSetting"))  # Retrieve saved value from config
    frame = nb.Frame(parent)
    nb.Label(frame, text="Hello").grid()
    nb.Label(frame, text="Commander").grid()
    nb.Checkbutton(frame, text="My Setting", variable=this.mysetting).grid()

    return frame
示例#14
0
def plugin_prefs(parent, cmdr, is_beta):
    frame = nb.Frame(parent)
    nb.Label(frame, text="Select types of location you want to visit").grid(
        sticky=tk.W, row=0, column=0, columnspan=2)
    this.settings = {}
    this.types = {}
    selected = config.get("matgrindr.selected") or []
    types = config.get("matgrindr.types") or []

    c = 0
    debug("Types: " + str(this.mats.types()))
    for type in this.mats.types():
        this.types[type] = tk.IntVar()
        this.types[type].set(1 if type in types else 0)
        chk = nb.Checkbutton(frame, text=type,
                             variable=this.types[type]).grid(sticky=tk.W,
                                                             row=1 + c // 2,
                                                             column=c % 2,
                                                             columnspan=2)
        c = c + 1

    c = c + 2 - (c % 2)
    ttk.Separator(frame, orient=tk.HORIZONTAL).grid(row=1 + c // 2,
                                                    columnspan=2,
                                                    padx=10,
                                                    pady=2,
                                                    sticky=tk.EW)
    c = c + 2 - (c % 2)

    nb.Label(frame, text="Select materials you want").grid(sticky=tk.W,
                                                           row=1 + c // 2,
                                                           column=c % 2)
    c = c + 2 - (c % 2)
    debug("Mats: " + str(this.mats.names()))
    for mat in this.mats.names():
        this.settings[mat] = tk.IntVar()
        this.settings[mat].set(1 if mat in selected else 0)
        chk = nb.Checkbutton(frame, text=mat,
                             variable=this.settings[mat]).grid(sticky=tk.W,
                                                               row=1 + c // 2,
                                                               column=c % 2)
        c = c + 1

    c = c + 2
    nb.Button(frame, text="Select All", command=select_all).grid(sticky=tk.W,
                                                                 row=c // 2,
                                                                 column=0)
    nb.Button(frame, text="Select None", command=select_none).grid(sticky=tk.W,
                                                                   row=c // 2,
                                                                   column=1)
    return frame
示例#15
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
示例#16
0
def plugin_prefs(parent):
    frame = nb.Frame(parent)
    frame.columnconfigure(1, weight=1)

    site_label = nb.Label(frame, text="EDStats Configuration")
    site_label.grid(padx=10, row=8, sticky=tk.W)

    email_label = nb.Label(frame, text="EDStats Email")
    email_label.grid(padx=10, row=10, sticky=tk.W)

    email_entry = nb.Entry(frame, textvariable=this.email)
    email_entry.grid(padx=10, row=10, column=1, sticky=tk.EW)

    return frame
示例#17
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
示例#18
0
文件: load.py 项目: fiinnnn/EliteHIS
def plugin_prefs(parent, cmdr, is_beta):
    """
    Create settings dialog
    """
    frame = nb.Frame(parent)

    nb.Label(frame, text="Latitude").grid(row=0)
    nb.Entry(frame, textvariable=this.targetLat).grid(row=0, column=1)

    nb.Label(frame, text="Longitude").grid(row=1)
    nb.Entry(frame, textvariable=this.targetLong).grid(row=1, column=1)

    nb.Label(frame, text="Planet radius (in metres)").grid(row=2)
    nb.Entry(frame, textvariable=this.planetRadius).grid(row=2, column=1)
    return frame
示例#19
0
文件: load.py 项目: Dxnxsh/BGS-Tally
def plugin_prefs(parent, cmdr, is_beta):
    """
   Return a TK Frame for adding to the EDMC settings dialog.
   """

    frame = nb.Frame(parent)
    nb.Label(frame, text="Faction to monitor").grid(column=0, sticky=tk.W)
    factionname = nb.Entry(frame, textvariable=this.FactionName,
                           width=40).grid(column=0, sticky=tk.W)
    systemlabel = nb.Label(frame, text="System to monitor").grid(column=0,
                                                                 sticky=tk.W)
    systemname = nb.Entry(frame, textvariable=this.SystemName,
                          width=40).grid(column=0, sticky=tk.W)
    Reset = nb.Button(frame, text="Reset Counter").place(x=0, y=290)
    return frame
示例#20
0
def plugin_prefs(parent):
    frame = nb.Frame(parent)
    frame.columnconfigure(1, weight=1)

    user_label = nb.Label(
            frame
            , text="User Name"
            )
    user_label.grid(
            padx=10
            , row=10
            , sticky=tk.W
            )

    user_entry = nb.Entry(
            frame
            , textvariable=this.user
            )
    user_entry.grid(
            padx=10
            , row=10
            , column=1
            , sticky=tk.EW
            )

    password_label = nb.Label(
            frame
            , text="Password"
            )
    password_label.grid(
            padx=10
            , row=12
            , sticky=tk.W
            )

    password_entry = nb.Entry(
            frame
            , textvariable=this.password
            , show=u'•'
            )
    password_entry.grid(
            padx=10
            , row=12
            , column=1
            , sticky=tk.EW
            )

    return frame
示例#21
0
def journal_entry(cmdr, is_beta, system, station, entry, state):

    #############################
    #
    # FSDJump happens often enough in the journal to use for debugging purposes.
    if entry['event'] == 'FSDJump':
        # We arrived at a new system!
        sys.stderr.write("(Debug) Arrived at: {}\n".format(
            entry['StarSystem']))
        status.set("(Debug) Arrived at: {}\n".format(entry['StarSystem']))


##############################
#
# What we're really after are unique discoveries.
    if entry['event'] == 'CodexDiscovery':
        # We discovered something!
        # Lines 111, and 112 might not work the way I think they should. I don't know "tuple" well.
        sys.stderr.write("{} Discovered on {},{}\n".format(
            entry['Discovered'], ['System'], ['Body']))
        status.set("{} Discovered on {},{}\n".format(entry['Discovered'],
                                                     ['System'], ['Body']))
        nb.Label(frame).grid()  # spacer
        nb.Button(frame,
                  text="Submit Discovery Report",
                  command=bulletin_callback).grid(row=10,
                                                  column=0,
                                                  columnspan=2,
                                                  padx=PADX,
                                                  sticky=tk.W)
示例#22
0
def plugin_prefs(parent):
    """
    Return a TK Frame for adding to the EDMC settings dialog.
    """
    frame = nb.Frame(parent)

    nb.Label(frame, text="{NAME} {VER}".format(NAME=applongname, VER=appversion)).grid(sticky=tk.W)
    nb.Label(frame).grid()	# spacer
    nb.Label(frame, text="Fly Safe!").grid(sticky=tk.W)
    nb.Label(frame).grid()	# spacer

    if cmdr_data.last is not None:
        datalen = len(str(cmdr_data.last))
        nb.Label(frame, text="FD sent {} chars".format(datalen)).grid(sticky=tk.W)

    return frame
示例#23
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
示例#24
0
def plugin_prefs(parent, cmdr, is_beta):
    '''
    Return a TK Frame for adding to the EDMC settings dialog.
    '''
    this.AllowEasternEggsButton = tk.IntVar(
        value=config.getint("AllowEasterEggs"))
    this.AllowEasternEggs = this.AllowEasternEggsButton.get()
    frame = nb.Frame(parent)
    frame.columnconfigure(1, weight=1)

    this.news.plugin_prefs(frame, cmdr, is_beta, 1)
    this.release.plugin_prefs(frame, cmdr, is_beta, 2)
    this.patrol.plugin_prefs(frame, cmdr, is_beta, 3)
    Debug.plugin_prefs(frame, this.client_version, 4)
    this.codexcontrol.plugin_prefs(frame, cmdr, is_beta, 5)
    nb.Checkbutton(frame,
                   text="Включить пасхалки",
                   variable=this.AllowEasternEggsButton).grid(row=6,
                                                              column=0,
                                                              sticky="NW")
    hdreport.HDInspector(frame, cmdr, is_beta, this.client_version, 7)
    # release.versionInSettings(frame,
    # cmdr, is_beta,8)
    # entry=nb.Entry(frame,None)
    nb.Label(
        frame,
        text=
        "В случае возникновения проблем с плагином \nили в случае, если Вы поставили неправильное сообщество в гугл-форме, \nпишите в личку Дискорда Казаков#4700"
    ).grid(row=9, column=0, sticky="NW")

    return frame
示例#25
0
def plugin_prefs(parent, cmdr, is_beta):
    """
    Return a TK Frame for adding to the EDMC settings dialog.
    """
    if isinstance(appversion, str):
        core_version = semantic_version.Version(appversion)

    elif callable(appversion):
        core_version = appversion()

    logger.info(f'Core EDMC version: {core_version}')
    if core_version < semantic_version.Version('5.0.0-beta1'):
        logger.info('EDMC core version is before 5.0.0-beta1')
        this.disablePresence = tk.IntVar(
            value=config.getint("disable_presence"))
    else:
        logger.info('EDMC core version is at least 5.0.0-beta1')
        this.disablePresence = tk.IntVar(
            value=config.get_int("disable_presence"))

    frame = nb.Frame(parent)
    nb.Checkbutton(frame,
                   text="Disable Presence",
                   variable=this.disablePresence).grid()
    nb.Label(frame, text='Version %s' % VERSION).grid(padx=10,
                                                      pady=10,
                                                      sticky=tk.W)

    return frame
示例#26
0
    def plugin_prefs(self, parent, cmdr, is_beta,gridrow):
        "Called to get a tk Frame for the settings dialog."

        self.canonnbtn=tk.IntVar(value=config.getint("HideCanonn"))
        self.factionbtn=tk.IntVar(value=config.getint("HideFaction"))
        self.hideshipsbtn=tk.IntVar(value=config.getint("HideShips"))
        self.copypatrolbtn=tk.IntVar(value=config.getint("CopyPatrol"))

        self.canonn=self.canonnbtn.get()
        self.faction=self.factionbtn.get()
        self.hideships=self.hideshipsbtn.get()
        self.copypatrol=self.copypatrolbtn.get()



        frame = nb.Frame(parent)
        frame.columnconfigure(1, weight=1)
        frame.grid(row = gridrow, column = 0,sticky="NSEW")

        nb.Label(frame,text="Patrol Settings").grid(row=0,column=0,sticky="NW")
        nb.Checkbutton(frame, text="Hide Canonn Patrols", variable=self.canonnbtn).grid(row = 1, column = 0,sticky="NW")
        nb.Checkbutton(frame, text="Hide Canonn Faction Systems", variable=self.factionbtn).grid(row = 1, column = 2,sticky="NW")
        nb.Checkbutton(frame, text="Hide Your Ships", variable=self.hideshipsbtn).grid(row = 1, column = 3,sticky="NW")
        nb.Checkbutton(frame, text="Automatically copy the patrol to the clipboard", variable=self.copypatrolbtn).grid(row = 2, column = 0,sticky="NW",)


        debug("canonn: {}, faction: {} hideships {}".format(self.canonn,self.faction,self.hideships))

        return frame
示例#27
0
def plugin_prefs(parent, cmdr, is_beta):
    """
   Return a TK Frame for adding to the EDMC settings dialog.
   """
    this.port = tk.IntVar(
        value=config.getint("edmqPORT"))  # Retrieve saved value from config
    frame = nb.Frame(parent)
    nb.Label(frame,
             text="Welcome to EDMQ v" + this.version + " settings").grid()

    port_label = nb.Label(frame, text="API Key :").grid()
    # port_label.grid(row=11, padx=PADX, sticky=tk.W)
    port_entry = nb.Entry(frame, textvariable=this.port).grid()
    # port_entry.grid(row=11, column=1, padx=PADX, pady=PADY, sticky=tk.EW)
    this.server.send_sys(u'plugin_perfs')

    return frame
示例#28
0
def plugin_prefs(parent):
	frame = nb.Frame(parent)
	frame.columnconfigure(1, weight=1)
	
	plugin_label = nb.Label(frame, text="EOProgression Configuration")
	plugin_label.grid(padx=10, row=8, sticky=tk.W)
	
	return frame
示例#29
0
def plugin_prefs(parent, cmdr, is_beta):
    frame = nb.Frame(parent)

    nb.Label(frame, text='Version %s' % VERSION).grid(padx=10,
                                                      pady=10,
                                                      sticky=tk.W)

    return frame
示例#30
0
def plugin_app(parent):
    # Create and display widgets
    this.frame = tk.Frame(parent)
    #this.frame.columnconfigure(3, weight=1)
    nb.Label(frame, text='Approx. Value Banked:').grid(row=0,
                                                       column=0,
                                                       sticky=tk.W)
    this.value = nb.Label(frame)
    this.value.grid(row=0, column=1)
    this.events = nb.Label(frame)
    settings = get_settings()
    update_visibility(settings[1])

    this.bank = eb.ExploreBank()
    this.bank.honkValue = settings[0]
    display_value()
    display_event()
    return this.frame