|
15 | 15 | from xml.etree import ElementTree |
16 | 16 | from albert import * |
17 | 17 |
|
18 | | -md_iid = '1.0' |
19 | | -md_version = "1.4" |
| 18 | +md_iid = '2.0' |
| 19 | +md_version = "1.5" |
20 | 20 | md_name = "Jetbrains projects" |
21 | 21 | md_description = "Open your JetBrains projects" |
22 | 22 | md_license = "GPL-3" |
@@ -82,22 +82,19 @@ def _parse_recent_projects(self, recent_projects_file: Path) -> list[Project]: |
82 | 82 | return [] |
83 | 83 |
|
84 | 84 |
|
85 | | -class Plugin(TriggerQueryHandler): |
86 | | - executables = [] |
87 | | - |
88 | | - def id(self): |
89 | | - return md_id |
| 85 | +class Plugin(PluginInstance, TriggerQueryHandler): |
90 | 86 |
|
91 | | - def name(self): |
92 | | - return md_name |
93 | | - |
94 | | - def description(self): |
95 | | - return md_description |
| 87 | + executables = [] |
96 | 88 |
|
97 | | - def defaultTrigger(self): |
98 | | - return "jb " |
| 89 | + def __init__(self): |
| 90 | + TriggerQueryHandler.__init__(self, |
| 91 | + id=md_id, |
| 92 | + name=md_name, |
| 93 | + description=md_description, |
| 94 | + synopsis='project name', |
| 95 | + defaultTrigger='jb ') |
| 96 | + PluginInstance.__init__(self, extensions=[self]) |
99 | 97 |
|
100 | | - def initialize(self): |
101 | 98 | plugin_dir = Path(__file__).parent |
102 | 99 | editors = [ |
103 | 100 | Editor( |
@@ -175,12 +172,12 @@ def handleTriggerQuery(self, query: TriggerQuery): |
175 | 172 | query.add([self._make_item(editor, project, query) for editor, project in editor_project_pairs]) |
176 | 173 |
|
177 | 174 | def _make_item(self, editor: Editor, project: Project, query: TriggerQuery) -> Item: |
178 | | - return Item( |
| 175 | + return StandardItem( |
179 | 176 | id="%s-%s-%s" % (editor.binary, project.path, project.last_opened), |
180 | 177 | text=project.name, |
181 | 178 | subtext=project.path, |
182 | | - completion=query.trigger + project.name, |
183 | | - icon=[str(editor.icon)], |
| 179 | + inputActionText=query.trigger + project.name, |
| 180 | + iconUrls=["file:" + str(editor.icon)], |
184 | 181 | actions=[ |
185 | 182 | Action( |
186 | 183 | "Open", |
|
0 commit comments