Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/MAPPER_MODULES.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,30 @@ evescout = EveScout(
)
```

### Wanderer

**Status**: Fully supported with multiple instances

**Configuration**:
- URL: Wanderer instance URL (self-hosted or community instance)
- Map slug: The map identifier from the map's URL
- API token: Bearer token generated in Wanderer under Map Settings → API
- Name: Instance identifier (e.g., "Alliance Wanderer")

In the persisted `MapperConfig`, the map slug is stored in the `user` slot
and the API token in the `password` slot (the token is the secret, so it
belongs in the slot the UI masks).

**Example**:
```python
wanderer = Wanderer(
url="https://wanderer.example.com",
map_slug="my-map",
token="generated-api-token",
name="Alliance Wanderer"
)
```

### eve-whmapper

**Status**: Not currently supported - no public API available
Expand Down
174 changes: 174 additions & 0 deletions resources/ui/gui_wanderer.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WandererDialog</class>
<widget class="QDialog" name="WandererDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>480</width>
<height>260</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>480</width>
<height>260</height>
</size>
</property>
<property name="font">
<font>
<family>Segoe UI</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="windowTitle">
<string>Wanderer Configuration</string>
</property>
<property name="windowIcon">
<iconset resource="../resources.qrc">
<normaloff>:/images/app_icon.png</normaloff>:/images/app_icon.png</iconset>
</property>
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_name">
<property name="text">
<string>Name:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_name"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_url">
<property name="text">
<string>URL:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_url">
<property name="placeholderText">
<string>https://your-wanderer-instance</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_map">
<property name="text">
<string>Map slug:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_map">
<property name="placeholderText">
<string>Map identifier from the map URL</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_token">
<property name="text">
<string>API token:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_token">
<property name="inputMethodHints">
<set>Qt::ImhHiddenText|Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText|Qt::ImhSensitiveData</set>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_help">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Generate the token in Wanderer under Map Settings → API. &lt;a href=&quot;https://github.com/wanderer-industries/wanderer&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;About Wanderer&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../resources.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>WandererDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>WandererDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
55 changes: 55 additions & 0 deletions src/shortcircuit/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
MapperConfig,
TYPE_EVESCOUT,
TYPE_TRIPWIRE,
TYPE_WANDERER,
default_configs,
load_configs,
migrate_legacy,
Expand All @@ -28,6 +29,7 @@
from .view.gui_main import Ui_MainWindow
from .view.gui_mappers import Ui_MappersDialog
from .view.gui_tripwire import Ui_TripwireDialog
from .view.gui_wanderer import Ui_WandererDialog


class StateEVEConnection(TypedDict):
Expand All @@ -44,6 +46,7 @@ class StateMapper(TypedDict):
MAPPER_TYPE_LABELS = {
TYPE_TRIPWIRE: "Tripwire",
TYPE_EVESCOUT: "Eve Scout",
TYPE_WANDERER: "Wanderer",
}


Expand Down Expand Up @@ -74,6 +77,30 @@ def __init__(
self.lineEdit_proxy.setText(proxy or "")


class WandererDialog(QtWidgets.QDialog, Ui_WandererDialog):
"""
Per-instance Wanderer edit dialog, opened from MappersDialog.

Edits one Wanderer MapperConfig: name, instance URL, map slug and API
bearer token (generated in Wanderer under Map Settings -> API).
"""

def __init__(
self,
name: str,
url: str,
map_slug: str,
token: str,
parent=None,
):
super().__init__(parent)
self.setupUi(self)
self.lineEdit_name.setText(name or "")
self.lineEdit_url.setText(url or "")
self.lineEdit_map.setText(map_slug or "")
self.lineEdit_token.setText(token or "")


class MappersDialog(QtWidgets.QDialog, Ui_MappersDialog):
"""
Multi-mapper management dialog.
Expand Down Expand Up @@ -180,6 +207,13 @@ def _on_add(self):
url="https://tripwire.eve-apps.com",
)
edited = self._edit_tripwire(cfg)
elif type_key == TYPE_WANDERER:
cfg = MapperConfig(
type=TYPE_WANDERER,
name=self._unique_name("Wanderer"),
enabled=True,
)
edited = self._edit_wanderer(cfg)
else:
cfg = MapperConfig(
type=TYPE_EVESCOUT,
Expand All @@ -203,6 +237,8 @@ def _on_edit(self):
edited = self._edit_tripwire(cfg)
elif cfg.type == TYPE_EVESCOUT:
edited = self._edit_evescout(cfg)
elif cfg.type == TYPE_WANDERER:
edited = self._edit_wanderer(cfg)
else:
edited = None
if edited is not None:
Expand Down Expand Up @@ -238,6 +274,25 @@ def _edit_tripwire(self, cfg: MapperConfig) -> Optional[MapperConfig]:
password=dlg.lineEdit_pass.text(),
)

def _edit_wanderer(self, cfg: MapperConfig) -> Optional[MapperConfig]:
dlg = WandererDialog(
name=cfg.name,
url=cfg.url,
map_slug=cfg.user,
token=cfg.password,
parent=self,
)
if not dlg.exec():
return None
return MapperConfig(
type=TYPE_WANDERER,
name=dlg.lineEdit_name.text().strip() or cfg.name,
enabled=cfg.enabled,
url=dlg.lineEdit_url.text().strip(),
user=dlg.lineEdit_map.text().strip(),
password=dlg.lineEdit_token.text().strip(),
)

def _edit_evescout(self, cfg: MapperConfig) -> Optional[MapperConfig]:
name, ok = QtWidgets.QInputDialog.getText(
self,
Expand Down
5 changes: 4 additions & 1 deletion src/shortcircuit/model/mapper_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

TYPE_TRIPWIRE = "tripwire"
TYPE_EVESCOUT = "evescout"
TYPE_WANDERER = "wanderer"


@dataclass
Expand All @@ -23,7 +24,9 @@ class MapperConfig:
which MapperSource subclass to instantiate; `name` is the user-facing
label that also serves as the key in the `results` dict emitted by
NavProcessor. `url`/`user`/`password` are mapper-agnostic config slots —
Eve Scout ignores user/password.
Eve Scout ignores user/password, and Wanderer stores its map slug in
`user` and its API bearer token in `password` (the token is a secret, so
it belongs in the slot the UI masks).
"""
type: str
name: str
Expand Down
15 changes: 14 additions & 1 deletion src/shortcircuit/model/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
from .evedb import EveDb, SystemDescription, WormholeMassspan, WormholeSize, WormholeTimespan
from .evescout import EveScout
from .mapper_base import MapperSource
from .mapper_config import TYPE_EVESCOUT, TYPE_TRIPWIRE, MapperConfig
from .mapper_config import TYPE_EVESCOUT, TYPE_TRIPWIRE, TYPE_WANDERER, MapperConfig
from .mapper_registry import MapperRegistry
from .solarmap import ConnectionType, SolarMap
from .tripwire import Tripwire
from .wanderer import Wanderer

if TYPE_CHECKING:
from shortcircuit.app import MainWindow
Expand All @@ -30,9 +31,21 @@ def _build_evescout(cfg: MapperConfig) -> MapperSource:
return EveScout(name=cfg.name)


def _build_wanderer(cfg: MapperConfig) -> MapperSource:
# Wanderer keeps its map slug in the `user` slot and the API bearer token
# in the `password` slot; see the MapperConfig docstring.
return Wanderer(
url=cfg.url,
map_slug=cfg.user,
token=cfg.password,
name=cfg.name,
)


MAPPER_BUILDERS: Dict[str, Callable[[MapperConfig], MapperSource]] = {
TYPE_TRIPWIRE: _build_tripwire,
TYPE_EVESCOUT: _build_evescout,
TYPE_WANDERER: _build_wanderer,
}


Expand Down
Loading