diff --git a/GIMPCommand.py b/AppCommand.py
similarity index 71%
rename from GIMPCommand.py
rename to AppCommand.py
index 0be18e3..a7ed421 100644
--- a/GIMPCommand.py
+++ b/AppCommand.py
@@ -1,18 +1,20 @@
+import os
import FreeCAD
import FreeCADGui as Gui
import PySide
from PySide import QtGui
from PySide import QtCore
+import ExternalAppsList
import Embed
-class GIMPCommand():
+class AppCommand():
def __init__(self, appName):
self.appName = appName
def GetResources(self):
return {
- 'Pixmap': ':/icons/GIMP.svg',
+ 'Pixmap': ExternalAppsList.apps[self.appName].Icon,
'Accel': "Shit+E", # E for Embed
'MenuText': "Start " + self.appName,
'ToolTip': "Start " + self.appName,
@@ -26,6 +28,5 @@ class GIMPCommand():
# return false to grey out the command in the menus, toolbars etc.
return True
-Gui.addCommand('MousepadCommand', GIMPCommand('Mousepad'))
-Gui.addCommand('InkscapeCommand', GIMPCommand('Inkscape'))
-Gui.addCommand('GIMPCommand', GIMPCommand('GIMP'))
+for appName in ExternalAppsList.apps:
+ Gui.addCommand('ExternalAppsOpen' + appName + 'Command', AppCommand(appName))
diff --git a/ExternalAppsList.py b/ExternalAppsList.py
index 3eb35d5..bd05c73 100644
--- a/ExternalAppsList.py
+++ b/ExternalAppsList.py
@@ -1,3 +1,4 @@
+import os
import FreeCAD
import FreeCADGui as Gui
import subprocess
@@ -11,6 +12,7 @@ from MyX11Utils import *
class App():
def __init__(self, name, *, start_command_and_args, xwininfo_filter_re, extra_xprop_filter):
self.name = name
+ self.Icon = os.path.dirname(__file__) + '/icons/' + self.name + '.svg'
self.start_command_and_args = start_command_and_args
self.xwininfo_filter_re = re.compile(xwininfo_filter_re)
self.extra_xprop_filter = extra_xprop_filter
diff --git a/InitGui.py b/InitGui.py
index d2e36e0..303bab3 100644
--- a/InitGui.py
+++ b/InitGui.py
@@ -43,23 +43,19 @@ class XternalAppsWorkbench(Workbench):
"""Subclasses must implement the appName attribute"""
global myIcon
global XternalAppsWorkbench
-
- Icon = myIcon
+ global ExternalAppsList
def __init__(self):
self.MenuText = "XternalApps: " + self.appName
self.ToolTip = "Embeds " + self.appName + " in FreeCAD"
+ self.Icon = ExternalAppsList.apps[self.appName].Icon
super(XternalAppsWorkbench, self).__init__()
def Initialize(self):
- if sys.version_info[0] == 2:
- import Resources2
- else:
- import Resources3
- import GIMPCommand
+ import AppCommand
import Embed
Embed.ExternalApps()
- self.list = [self.appName + 'Command']
+ self.list = ['ExternalAppsOpen' + self.appName + 'Command']
self.appendMenu("ExternalApplications", self.list)
self.appendToolbar("ExternalApplications", self.list)
@@ -81,5 +77,5 @@ def addAppWorkbench(appName):
(XternalAppsWorkbench,), { 'appName': appName })
Gui.addWorkbench(workbenchClass())
-for app in ExternalAppsList.apps:
- addAppWorkbench(app)
+for appName in ExternalAppsList.apps:
+ addAppWorkbench(appName)
diff --git a/LICENSE b/LICENSE
index a6f206a..5029a7f 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1 +1,5 @@
-The contents of this repository are released under the CC0, with the exception of the GIMP logo which comes from the GIMP project and is therefore under the GPL license.
+The contents of this repository are released under the CC0,
+with the exception of:
+* the GIMP logo which comes from the GIMP project and is therefore under the GPL v3 license.
+* the Inkscape logo which comes from the Inkscape project and is therefore under the GPL v2 license.
+* the Mousepad logo which comes from the Mousepad project and is therefore under the GPL v2 license.
diff --git a/Resources2.py b/Resources2.py
deleted file mode 100644
index 8af6c01..0000000
--- a/Resources2.py
+++ /dev/null
@@ -1,1406 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Resource object code
-#
-# Created: Thu Jan 21 01:44:33 2021
-# by: The Resource Compiler for PySide2 (Qt v5.11.3)
-#
-# WARNING! All changes made in this file will be lost!
-
-from PySide2 import QtCore
-
-qt_resource_data = b"\
-\x00\x00U\x5c\
-<\
-?xml version=\x221.\
-0\x22 encoding=\x22UTF\
--8\x22 standalone=\x22\
-no\x22?>\x0a\x0a\
-\x0a\
-"
-
-qt_resource_name = b"\
-\x00\x05\
-\x00o\xa6S\
-\x00i\
-\x00c\x00o\x00n\x00s\
-\x00\x08\
-\x0e#S\xa7\
-\x00G\
-\x00I\x00M\x00P\x00.\x00s\x00v\x00g\
-"
-
-qt_resource_struct = b"\
-\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
-\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
-\x00\x00\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
-"
-
-def qInitResources():
- QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
-
-def qCleanupResources():
- QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
-
-qInitResources()
diff --git a/Resources3.py b/Resources3.py
deleted file mode 100644
index 8af6c01..0000000
--- a/Resources3.py
+++ /dev/null
@@ -1,1406 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Resource object code
-#
-# Created: Thu Jan 21 01:44:33 2021
-# by: The Resource Compiler for PySide2 (Qt v5.11.3)
-#
-# WARNING! All changes made in this file will be lost!
-
-from PySide2 import QtCore
-
-qt_resource_data = b"\
-\x00\x00U\x5c\
-<\
-?xml version=\x221.\
-0\x22 encoding=\x22UTF\
--8\x22 standalone=\x22\
-no\x22?>\x0a\x0a\
-\x0a\
-"
-
-qt_resource_name = b"\
-\x00\x05\
-\x00o\xa6S\
-\x00i\
-\x00c\x00o\x00n\x00s\
-\x00\x08\
-\x0e#S\xa7\
-\x00G\
-\x00I\x00M\x00P\x00.\x00s\x00v\x00g\
-"
-
-qt_resource_struct = b"\
-\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
-\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
-\x00\x00\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
-"
-
-def qInitResources():
- QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
-
-def qCleanupResources():
- QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
-
-qInitResources()
diff --git a/icons/Inkscape.svg b/icons/Inkscape.svg
new file mode 100644
index 0000000..56e21aa
--- /dev/null
+++ b/icons/Inkscape.svg
@@ -0,0 +1,727 @@
+
+
+
+
diff --git a/icons/Mousepad.svg b/icons/Mousepad.svg
new file mode 100644
index 0000000..492a76f
--- /dev/null
+++ b/icons/Mousepad.svg
@@ -0,0 +1,119 @@
+
+
+