@jupytergis/jupytergis-qgis 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/plugins.js +10 -9
- package/package.json +4 -4
package/lib/plugins.js
CHANGED
|
@@ -6,8 +6,8 @@ import { ConsolePanel, IConsoleTracker } from '@jupyterlab/console';
|
|
|
6
6
|
import { PathExt } from '@jupyterlab/coreutils';
|
|
7
7
|
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
|
|
8
8
|
import { Widget } from '@lumino/widgets';
|
|
9
|
-
import { logoMiniIcon, requestAPI } from '@jupytergis/base';
|
|
10
|
-
import {
|
|
9
|
+
import { logoMiniIcon, logoMiniIconQGZ, requestAPI } from '@jupytergis/base';
|
|
10
|
+
import { JupyterGISDocumentWidgetFactory } from '@jupytergis/jupytergis-core';
|
|
11
11
|
import { IJupyterGISDocTracker } from '@jupytergis/schema';
|
|
12
12
|
import { QGSModelFactory, QGZModelFactory } from './modelfactory';
|
|
13
13
|
/**
|
|
@@ -29,7 +29,7 @@ const activate = async (app, tracker, themeManager, drive, externalCommandRegist
|
|
|
29
29
|
}
|
|
30
30
|
return installed;
|
|
31
31
|
};
|
|
32
|
-
const QGSWidgetFactory = new
|
|
32
|
+
const QGSWidgetFactory = new JupyterGISDocumentWidgetFactory({
|
|
33
33
|
name: 'JupyterGIS QGS Factory',
|
|
34
34
|
modelName: 'jupytergis-qgsmodel',
|
|
35
35
|
fileTypes: ['QGS'],
|
|
@@ -44,7 +44,7 @@ const activate = async (app, tracker, themeManager, drive, externalCommandRegist
|
|
|
44
44
|
mimeTypeService: editorServices.mimeTypeService,
|
|
45
45
|
consoleTracker
|
|
46
46
|
});
|
|
47
|
-
const QGZWidgetFactory = new
|
|
47
|
+
const QGZWidgetFactory = new JupyterGISDocumentWidgetFactory({
|
|
48
48
|
name: 'JupyterGIS QGZ Factory',
|
|
49
49
|
modelName: 'jupytergis-qgzmodel',
|
|
50
50
|
fileTypes: ['QGZ'],
|
|
@@ -82,7 +82,7 @@ const activate = async (app, tracker, themeManager, drive, externalCommandRegist
|
|
|
82
82
|
extensions: ['.qgz', '.QGZ'],
|
|
83
83
|
fileFormat: 'base64',
|
|
84
84
|
contentType: 'QGZ',
|
|
85
|
-
icon:
|
|
85
|
+
icon: logoMiniIconQGZ
|
|
86
86
|
});
|
|
87
87
|
const QGISSharedModelFactory = () => {
|
|
88
88
|
return new JupyterGISDoc();
|
|
@@ -90,11 +90,12 @@ const activate = async (app, tracker, themeManager, drive, externalCommandRegist
|
|
|
90
90
|
drive.sharedModelFactory.registerDocumentFactory('QGS', QGISSharedModelFactory);
|
|
91
91
|
drive.sharedModelFactory.registerDocumentFactory('QGZ', QGISSharedModelFactory);
|
|
92
92
|
const widgetCreatedCallback = (sender, widget) => {
|
|
93
|
+
widget.title.icon = logoMiniIconQGZ;
|
|
93
94
|
// Notify the instance tracker if restore data needs to update.
|
|
94
95
|
widget.context.pathChanged.connect(() => {
|
|
95
96
|
tracker.save(widget);
|
|
96
97
|
});
|
|
97
|
-
themeManager.themeChanged.connect((_, changes) => widget.
|
|
98
|
+
themeManager.themeChanged.connect((_, changes) => widget.model.themeChanged.emit(changes));
|
|
98
99
|
tracker.add(widget);
|
|
99
100
|
app.shell.activateById('jupytergis::leftControlPanel');
|
|
100
101
|
app.shell.activateById('jupytergis::rightControlPanel');
|
|
@@ -111,17 +112,17 @@ const activate = async (app, tracker, themeManager, drive, externalCommandRegist
|
|
|
111
112
|
app.commands.addCommand(CommandIDs.exportQgis, {
|
|
112
113
|
label: 'Export To QGZ',
|
|
113
114
|
isEnabled: () => tracker.currentWidget
|
|
114
|
-
? tracker.currentWidget.
|
|
115
|
+
? tracker.currentWidget.model.sharedModel.editable
|
|
115
116
|
: false,
|
|
116
117
|
execute: async (args) => {
|
|
117
118
|
var _a, _b;
|
|
118
119
|
const sourceExtension = '.jGIS';
|
|
119
120
|
const extension = '.qgz';
|
|
120
|
-
const model = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.
|
|
121
|
+
const model = (_a = tracker.currentWidget) === null || _a === void 0 ? void 0 : _a.model.sharedModel;
|
|
121
122
|
if (!model) {
|
|
122
123
|
return;
|
|
123
124
|
}
|
|
124
|
-
const sourcePath = tracker.currentWidget.
|
|
125
|
+
const sourcePath = tracker.currentWidget.model.filePath;
|
|
125
126
|
let filepath = (_b = args.filepath) !== null && _b !== void 0 ? _b : null;
|
|
126
127
|
if (!filepath) {
|
|
127
128
|
filepath = (await InputDialog.getText({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupytergis/jupytergis-qgis",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "JupyterGIS QGIS extension.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@jupyter/collaborative-drive": "^3.0.0",
|
|
57
|
-
"@jupytergis/base": "^0.
|
|
58
|
-
"@jupytergis/jupytergis-core": "^0.
|
|
59
|
-
"@jupytergis/schema": "^0.
|
|
57
|
+
"@jupytergis/base": "^0.4.0",
|
|
58
|
+
"@jupytergis/jupytergis-core": "^0.4.0",
|
|
59
|
+
"@jupytergis/schema": "^0.4.0",
|
|
60
60
|
"@jupyterlab/application": "^4.3.0",
|
|
61
61
|
"@jupyterlab/apputils": "^4.3.0",
|
|
62
62
|
"@jupyterlab/coreutils": "^6.3.0",
|