AddonManager: Use workbenches icons
This commit is contained in:
@@ -258,10 +258,16 @@ class CommandAddonManager:
|
||||
|
||||
from PySide import QtGui
|
||||
self.repos.append(addon_repo)
|
||||
if addon_repo[2] == 1 :
|
||||
self.dialog.listWorkbenches.addItem(QtGui.QListWidgetItem(QtGui.QIcon(":/icons/button_valid.svg"),str(addon_repo[0]) + str(" ("+translate("AddonsInstaller","Installed")+")")))
|
||||
import AddonManager_rc
|
||||
addonicon = QtGui.QIcon(":/icons/" + addon_repo[0] + "_workbench_icon.svg")
|
||||
if addonicon.isNull():
|
||||
addonicon = QtGui.QIcon(":/icons/Group.svg")
|
||||
if addon_repo[2] == 1:
|
||||
item = QtGui.QListWidgetItem(addonicon,str(addon_repo[0]) + str(" ("+translate("AddonsInstaller","Installed")+")"))
|
||||
item.setBackground(QtGui.QBrush(QtGui.QColor(0,182,41)))
|
||||
self.dialog.listWorkbenches.addItem(item)
|
||||
else:
|
||||
self.dialog.listWorkbenches.addItem(QtGui.QListWidgetItem(QtGui.QIcon(":/icons/Group.svg"),str(addon_repo[0])))
|
||||
self.dialog.listWorkbenches.addItem(QtGui.QListWidgetItem(addonicon,str(addon_repo[0])))
|
||||
|
||||
def show_information(self, label):
|
||||
|
||||
@@ -358,7 +364,9 @@ class CommandAddonManager:
|
||||
from PySide import QtGui
|
||||
self.macros.append(macro)
|
||||
if macro.is_installed():
|
||||
self.dialog.listMacros.addItem(QtGui.QListWidgetItem(QtGui.QIcon(":/icons/button_valid.svg"), macro.name + str(' (Installed)')))
|
||||
item = QtGui.QListWidgetItem(QtGui.QIcon(":/icons/applications-python.svg"), macro.name + str(' (Installed)'))
|
||||
item.setBackground(QtGui.QBrush(QtGui.QColor(0,182,41)))
|
||||
self.dialog.listMacros.addItem(item)
|
||||
else:
|
||||
self.dialog.listMacros.addItem(QtGui.QListWidgetItem(QtGui.QIcon(":/icons/applications-python.svg"),macro.name))
|
||||
|
||||
@@ -533,7 +541,7 @@ class CommandAddonManager:
|
||||
wb[2] = 0
|
||||
for macro in self.macros:
|
||||
if macro.is_installed():
|
||||
self.dialog.listMacros.addItem(QtGui.QListWidgetItem(QtGui.QIcon(":/icons/button_valid.svg"), macro.name + " ("+translate("AddonsInstaller","Installed")+")"))
|
||||
self.dialog.listMacros.addItem(item)
|
||||
else:
|
||||
self.dialog.listMacros.addItem(QtGui.QListWidgetItem(QtGui.QIcon(":/icons/applications-python.svg"),+macro.name))
|
||||
|
||||
@@ -546,7 +554,7 @@ class CommandAddonManager:
|
||||
w = self.dialog.listWorkbenches.item(i)
|
||||
if w.text().startswith(str(repo)):
|
||||
w.setText(str(repo) + str(" ("+translate("AddonsInstaller","Update available")+")"))
|
||||
w.setIcon(QtGui.QIcon(":/icons/debug-marker.svg"))
|
||||
w.setBackground(QtGui.QBrush(QtGui.QColor(182,90,0)))
|
||||
if not repo in self.doUpdate:
|
||||
self.doUpdate.append(repo)
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
IF (BUILD_GUI)
|
||||
PYSIDE_WRAP_RC(AddonManager_QRC_SRCS Resources/AddonManager.qrc)
|
||||
ENDIF (BUILD_GUI)
|
||||
|
||||
SET(AddonManager_SRCS
|
||||
Init.py
|
||||
InitGui.py
|
||||
@@ -12,14 +16,24 @@ SET(AddonManager_SRCS
|
||||
SOURCE_GROUP("" FILES ${AddonManager_SRCS})
|
||||
|
||||
ADD_CUSTOM_TARGET(AddonManager ALL
|
||||
SOURCES ${AddonManager_SRCS}
|
||||
SOURCES ${AddonManager_SRCS} ${AddonManager_QRC_SRCS}
|
||||
)
|
||||
|
||||
fc_copy_sources(AddonManager "${CMAKE_BINARY_DIR}/Mod/AddonManager" ${AddonManager_SRCS})
|
||||
|
||||
IF (BUILD_GUI)
|
||||
fc_target_copy_resource(AddonManager
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_BINARY_DIR}/Mod/AddonManager
|
||||
AddonManager_rc.py)
|
||||
ENDIF (BUILD_GUI)
|
||||
|
||||
INSTALL(
|
||||
FILES
|
||||
${AddonManager_SRCS}
|
||||
${AddonManager_QRC_SRCS}
|
||||
DESTINATION
|
||||
Mod/AddonManager
|
||||
)
|
||||
|
||||
|
||||
|
||||
31
src/Mod/AddonManager/Resources/AddonManager.qrc
Normal file
31
src/Mod/AddonManager/Resources/AddonManager.qrc
Normal file
@@ -0,0 +1,31 @@
|
||||
<RCC>
|
||||
<qresource>
|
||||
<file>icons/A2plus_workbench-icon.svg</file>
|
||||
<file>icons/Airplane_workbench-icon.svg</file>
|
||||
<file>icons/Arch_Textures_workbench_icon.svg</file>
|
||||
<file>icons/BIM_workbench_icon.svg</file>
|
||||
<file>icons/BOLTS_workbench_icon.svg</file>
|
||||
<file>icons/cfd_workbench_icon.svg</file>
|
||||
<file>icons/Curves_workbench_icon.svg</file>
|
||||
<file>icons/Defeaturing_workbench_icon.svg</file>
|
||||
<file>icons/Dodo_workbench_icon.svg</file>
|
||||
<file>icons/EM_workbench_icon.svg</file>
|
||||
<file>icons/ExplodedAssembly_workbench_icon.svg</file>
|
||||
<file>icons/Fasteners_workbench_icon.svg</file>
|
||||
<file>icons/Flamingo_workbench_icon.svg</file>
|
||||
<file>icons/GDT_workbench_icon.svg</file>
|
||||
<file>icons/Gears_workbench_icon.svg</file>
|
||||
<file>icons/Glider_workbench_icon.svg</file>
|
||||
<file>icons/Kicad-StepUp-tools-workbench_icon.svg</file>
|
||||
<file>icons/Lattice2_workbench_icon.svg</file>
|
||||
<file>icons/Lithophane_workbench_icon.svg</file>
|
||||
<file>icons/Manipulator_workbench_icon.svg</file>
|
||||
<file>icons/PartOMagic_workbench_icon.svg</file>
|
||||
<file>icons/Plot_workbench_icon.svg</file>
|
||||
<file>icons/Pyrate_workbench_icon.svg</file>
|
||||
<file>icons/Reporting_workbench_icon.svg</file>
|
||||
<file>icons/SheetMetal_workbench_icon.svg</file>
|
||||
<file>icons/Ship_workbench_icon.svg</file>
|
||||
<file>icons/Timber_workbench_icon.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -553,7 +553,7 @@ class InstallWorker(QtCore.QThread):
|
||||
try:
|
||||
answer = repo.pull()
|
||||
except:
|
||||
print("Error updating module",repos[idx][1]," - Please fix manually")
|
||||
print("Error updating module",self.repos[idx][1]," - Please fix manually")
|
||||
answer = repo.status()
|
||||
print(answer)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user