Commit a7a821cf authored by Leon Müller's avatar Leon Müller
Browse files

linux compatibility fixes and build template

parent ee850476
......@@ -11,6 +11,7 @@ src/.vscode/
.vscode/
dist/
deploy/darwin/build/
deploy/linux/build/
#mountpoint
mount/
......
#cd NAUTILUS_SCRIPT_CURRENT_URI
npm run updateConfig $1
npm run gui
\ No newline at end of file
[Desktop Entry]
Type=Application
Name=factFUSE
Exec=AppRun %F
Icon=logo
Comment=test comment
Terminal=true
Categories=Utility;
const path = require("path");
// Fix so that linux resources are found correctly
// since webpack will bundle them such that the expected path is /dist from cwd
process.chdir(path.resolve(path.dirname(process.execPath)));
// Now start loading the actual bundle
require("./dist");
{
"distPath": "./index.js"
}
......@@ -34,6 +34,7 @@
"tsc": "tsc",
"webpack": "webpack",
"init": "qode ./dist/index.js",
"gui": "qode ./dist/provView.js",
"build": "npx nodegui-packer --pack ./dist"
},
"repository": {
......
......@@ -759,7 +759,7 @@ class AutoCommitter {
}
else if(numberOfChanges==0) {
(global as any).systemStatus = 1;
if(Info.isDarkMode()) {
if(Info.isDarkMode() || process.platform=="linux") {
(global as any).tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoMountedLight.png"));
}
else {
......@@ -804,7 +804,7 @@ class AutoCommitter {
}
else if(numberOfChanges==0) {
(global as any).systemStatus = 1;
if(Info.isDarkMode()) {
if(Info.isDarkMode() || process.platform=="linux") {
(global as any).tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoMountedLight.png"));
}
else {
......@@ -828,7 +828,7 @@ class AutoCommitter {
const self = this;
try {
(global as any).systemStatus = 0;
if(Info.isDarkMode()) {
if(Info.isDarkMode()|| process.platform=="linux") {
(global as any).tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoWorkingLight.png"));
}
else {
......@@ -840,7 +840,7 @@ class AutoCommitter {
await(new CommitHandler(commit).commitSelectedChanges()).then(function() {
self.start();
(global as any).systemStatus = 1;
if(Info.isDarkMode()) {
if(Info.isDarkMode()|| process.platform=="linux") {
(global as any).tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoMountedLight.png"));
}
else {
......@@ -855,7 +855,7 @@ class AutoCommitter {
catch(e) {
(global as any).systemStatus = -1;
(global as any).tray.showMessage("Error during sync",e+'',new QIcon(pat.dirname(__dirname)+"/assets/error.png"),3000);
if(Info.isDarkMode()) {
if(Info.isDarkMode()|| process.platform=="linux") {
(global as any).tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoErrorLight.png"));
}
else {
......
......@@ -312,7 +312,7 @@ export class CommitGUI {
var self = this;
try {
(global as any).systemStatus = 0;
if(Info.isDarkMode()) {
if(Info.isDarkMode()|| process.platform=="linux") {
(global as any).tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoWorkingLight.png"));
}
else {
......@@ -323,7 +323,7 @@ export class CommitGUI {
(global as any).trayStatus.setText('Syncing...');
await(new CommitHandler(commit).commitSelectedChanges()).then(function(){
(global as any).systemStatus = 1;
if(Info.isDarkMode()) {
if(Info.isDarkMode()|| process.platform=="linux") {
(global as any).tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoMountedLight.png"));
}
else {
......@@ -338,7 +338,7 @@ export class CommitGUI {
catch(e) {
(global as any).systemStatus = -1;
(global as any).tray.showMessage("Error during sync",e+'',new QIcon(pat.dirname(__dirname)+"/assets/error.png"),3000);
if(Info.isDarkMode()) {
if(Info.isDarkMode()|| process.platform=="linux") {
(global as any).tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoErrorLight.png"));
}
else {
......
......@@ -163,7 +163,7 @@ export class InitGUI {
trayMenu.addAction(quitAction);
const trayIcon = logo;
if(Info.isDarkMode()) {
if(Info.isDarkMode() || process.platform=="linux") {
this.tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoSimpleLight.png"));
}
else {
......@@ -181,6 +181,12 @@ export class InitGUI {
process.title = "factFUSE"
this.win.setWindowTitle("factFUSE - Configuration");
if(process.platform=="linux") {
this.win.setWindowIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoSimpleLight.png"))
}
else {
this.win.setWindowIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoSimple.png"))
}
this.win.addEventListener(WidgetEventTypes.Close, () => {
if(this.mounted) {
fuseFS.unmount(function() { //wait for the fs to unmount before quitting
......@@ -211,6 +217,23 @@ export class InitGUI {
this.tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoSimpleLight.png"));
}
}
else if(process.platform=="linux") {
if(this.mounted) {
this.mountButton.setIcon(new QIcon());
if((global as any).systemStatus == 1) {
this.tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoMountedLight.png"));
}
else if((global as any).systemStatus == 0) {
this.tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoWorkingLight.png"));
}
else if((global as any).systemStatus == -1) {
this.tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoErrorLight.png"));
}
}
else {
this.tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoSimpleLight.png"));
}
}
else {
this.mountFolderButton.setIcon(folderIcon)
this.outputFolderButton.setIcon(folderIcon)
......@@ -348,7 +371,7 @@ export class InitGUI {
}
this.statusAction.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/running.png"));
this.statusAction.setText("factFUSE is running")
if(Info.isDarkMode()) {
/*if(Info.isDarkMode()) {
if(this.mounted) {
this.tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoMountedLight.png"));
}
......@@ -363,7 +386,7 @@ export class InitGUI {
else {
this.tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoSimple.png"));
}
}
}*/
}
fs.writeFileSync('./src/config.json', JSON.stringify(config, null, 2));
});
......@@ -416,7 +439,7 @@ export class InitGUI {
fuseFS.mount(); // only works when modifying the path in node-gyp-builder. webpack seems to send '/' to gyp instead of .../fuse-native.
self.tray.showMessage("Success!","LDP mounted on " + config.mountpoint,folderIcon,3000);
if(Info.isDarkMode()) {
if(Info.isDarkMode() || process.platform=="linux") {
self.tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoMountedLight.png"))
}
else {
......@@ -449,7 +472,7 @@ export class InitGUI {
fuseFS.unmount(function(){});
this.tray.showMessage("Unmounted!","LDP unmounted.",folderIcon,3000);
if(Info.isDarkMode()) {
if(Info.isDarkMode() || process.platform=="linux") {
this.tray.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoSimpleLight.png"));
}
else {
......
import {QPixmap,QMainWindow,QWidget,WidgetEventTypes,QBoxLayout, QLabel, QPushButton, QScrollArea, QPicture, QToolButton, QCheckBox} from "@nodegui/nodegui";
import {QPixmap,QIcon,QMainWindow,QWidget,WidgetEventTypes,QBoxLayout, QLabel, QPushButton, QScrollArea, QPicture, QToolButton, QCheckBox} from "@nodegui/nodegui";
const pat = require('path')
const fs = require('fs')
const slidePaths = [pat.dirname(__dirname)+"/assets/tutorial/slides/Slide1.png",
......@@ -15,7 +15,6 @@ export function openTutorial(cb:any) {
const rootLayout = new QBoxLayout(2);
const controlField = new QWidget();
const controlLayout = new QBoxLayout(1);
const scrollArea = new QScrollArea();
const imageLabel = new QLabel();
const closeButton = new QPushButton()
const dontshowCheckBox = new QCheckBox();
......@@ -23,6 +22,12 @@ export function openTutorial(cb:any) {
const backButton = new QPushButton();
var currentSlide = 0;
if(process.platform=="linux") {
win.setWindowIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoSimpleLight.png"))
}
else {
win.setWindowIcon(new QIcon(pat.dirname(__dirname)+"/assets/logoSimple.png"))
}
win.setWindowTitle("Tutorial Slide " + (currentSlide+1) + "/" + slidePaths.length)
imageLabel.setPixmap(new QPixmap(slidePaths[currentSlide]).scaled(1000,800,1,1));
imageLabel.setScaledContents(true)
......
{
"ldpAddress": "http://localhost:8081",
"mountpoint": "/Users/lmueller/GitLab/factfuse/mount",
"output": "/Users/lmueller/Downloads",
"ldpAddress": "http://10.0.2.2:8081",
"mountpoint": "/home/lmueller/GitLab/factfuse/mount",
"output": "/home/lmueller/Downloads",
"userID": "lmueller",
"rdfExtension": ".txt",
"autoCommitEnabled": true,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment