mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-16 13:32:44 +00:00
Merge branch 'main' into plugin-ui-1
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M1.5,8 14.5,1.5 7.5,14.5 6.3,9.7 Z" style="fill:none;stroke:gray;stroke-linecap:round;stroke-linejoin:round"/></svg>
|
||||
|
After Width: | Height: | Size: 209 B |
@@ -415,7 +415,9 @@ img.ModelThumbnail {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-radius: 4px;
|
||||
background-color: inherit;
|
||||
border-color: var(--border-color);
|
||||
background-color: var(--bg-color);
|
||||
color: var(--fg-color-text);
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 200px;
|
||||
@@ -423,13 +425,17 @@ img.ModelThumbnail {
|
||||
}
|
||||
|
||||
#NoticeBar {
|
||||
background-color:#00f0d8;
|
||||
background-color: var(--main-color);
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#NoticeBar.notice-error {
|
||||
background-color: var(--button-bg-alert);
|
||||
}
|
||||
|
||||
#NoticeContent {
|
||||
padding: 4mm 10mm;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,34 @@ function HandleStudio( pVal )
|
||||
{
|
||||
HandleModelList(pVal['response']);
|
||||
}
|
||||
else if(strCmd=='check_new_printers_result')
|
||||
{
|
||||
let button = document.getElementById("CheckNewPrintersBtn");
|
||||
if (button) {
|
||||
button.style.pointerEvents = "auto";
|
||||
button.style.opacity = "1";
|
||||
}
|
||||
|
||||
let noticeBar = document.getElementById("NoticeBar");
|
||||
let noticeText = document.getElementById("NoticeText");
|
||||
let hasError = pVal.hasOwnProperty("error");
|
||||
noticeBar.classList.toggle("notice-error", hasError);
|
||||
if (hasError) {
|
||||
noticeBar.textContent = "Error";
|
||||
noticeText.textContent = pVal["error"];
|
||||
} else if (pVal["vendors"] && pVal["vendors"].length > 0) {
|
||||
noticeBar.textContent = "New printers found";
|
||||
noticeText.textContent = "New printer vendors installed: " + pVal["vendors"].join(", ");
|
||||
} else if (pVal["declined"]) {
|
||||
noticeBar.textContent = "Information";
|
||||
noticeText.textContent = "New printer vendors were found, but installation was cancelled.";
|
||||
} else {
|
||||
noticeBar.textContent = "Information";
|
||||
noticeText.textContent = "No new printers found.";
|
||||
}
|
||||
|
||||
ShowNotice(1);
|
||||
}
|
||||
}
|
||||
|
||||
function HandleModelList( pVal )
|
||||
@@ -78,9 +106,13 @@ function HandleModelList( pVal )
|
||||
}
|
||||
|
||||
//Update Nozzel Html Append
|
||||
// ORCA: HandleModelList can now be called more than once per dialog (e.g. after a new vendor
|
||||
// is installed via "check for new printers"). pModel always holds the full, current list, so
|
||||
// clear each vendor's printer area before repopulating instead of appending on top of a
|
||||
// previous render.
|
||||
for( let key in ModelHtml )
|
||||
{
|
||||
$(".OneVendorBlock[vendor='"+key+"'] .PrinterArea").append( ModelHtml[key] );
|
||||
$(".OneVendorBlock[vendor='"+key+"'] .PrinterArea").empty().append( ModelHtml[key] );
|
||||
}
|
||||
|
||||
//Update Checkbox
|
||||
@@ -343,6 +375,9 @@ function OnExit()
|
||||
let nTotal=ModelSelect.length;
|
||||
|
||||
if( nTotal==0 ) {
|
||||
let noticeBar = document.getElementById("NoticeBar");
|
||||
noticeBar.classList.add("notice-error");
|
||||
noticeBar.textContent = "Error";
|
||||
ShowNotice(1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,22 @@ function ConfirmSelect()
|
||||
}
|
||||
}
|
||||
|
||||
function CheckForNewPrinters()
|
||||
{
|
||||
var tSend={};
|
||||
tSend['sequence_id']=Math.round(new Date() / 1000);
|
||||
tSend['command']="check_for_new_printers";
|
||||
tSend['data']={};
|
||||
|
||||
var button = document.getElementById("CheckNewPrintersBtn");
|
||||
if (button) {
|
||||
button.style.pointerEvents = "none";
|
||||
button.style.opacity = "0.6";
|
||||
}
|
||||
|
||||
SendWXMessage( JSON.stringify(tSend) );
|
||||
}
|
||||
|
||||
function CreateNewPrinter()
|
||||
{
|
||||
var tSend={};
|
||||
|
||||
@@ -82,7 +82,8 @@
|
||||
</div>
|
||||
<div id="AcceptArea">
|
||||
<div class="ButtonStyleRegular ButtonTypeChoice trans" id="CreateBtn" onclick="CreateNewPrinter()">Create</div>
|
||||
<div class="ButtonStyleConfirm ButtonTypeChoice trans" tid="t39" id="AcceptBtn" onclick="ConfirmSelect()">Confirm</div>
|
||||
<div class="ButtonStyleRegular ButtonTypeChoice" id="CheckNewPrintersBtn" onclick="CheckForNewPrinters()">Check for new printers</div>
|
||||
<div class="ButtonStyleConfirm ButtonTypeChoice trans" tid="t39" id="AcceptBtn" onclick="ConfirmSelect()">Confirm</div>
|
||||
<div class="ButtonStyleRegular ButtonTypeChoice trans" tid="t38" id="PreBtn" onclick="CancelSelect()">Cancel</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -716,7 +716,8 @@ body
|
||||
background-color: #E4E4E4;
|
||||
border-radius: 8px;
|
||||
width: 184px;
|
||||
height: 184px;
|
||||
height: 184px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.FileItem img
|
||||
@@ -728,6 +729,19 @@ body
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.FileImg .FileLogoBadge
|
||||
{
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
left: 8px;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
padding: 2px;
|
||||
box-sizing: border-box;
|
||||
background-color: rgba(255,255,255,0.85);
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.FileName
|
||||
{
|
||||
white-space: nowrap;
|
||||
@@ -736,6 +750,35 @@ body
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.FileNamePack
|
||||
{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.FileNamePack .FileName
|
||||
{
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.FilePublishedBadge
|
||||
{
|
||||
flex: 0 0 auto;
|
||||
margin-right: 4px;
|
||||
padding: 0 4px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
color: #FFFFFF;
|
||||
background-color: #009688;
|
||||
border-radius: 2px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.FileDate
|
||||
{
|
||||
color: #A8A8A8;
|
||||
|
||||
@@ -305,15 +305,19 @@ function ShowRecentFileList( pList )
|
||||
let sImg=OneFile["image"] || sImages[sPath];
|
||||
let sTime=OneFile['time'];
|
||||
let sName=OneFile['project_name'];
|
||||
let sPublished=OneFile['published'] == '1';
|
||||
sImages[sPath] = sImg;
|
||||
|
||||
//let index=sPath.lastIndexOf('\\')>0?sPath.lastIndexOf('\\'):sPath.lastIndexOf('\/');
|
||||
//let sShortName=sPath.substring(index+1,sPath.length);
|
||||
|
||||
let sBadge=sPublished? '<span class="FilePublishedBadge">PUB</span>':'';
|
||||
let sLogoBadge=sPublished? '<img class="FileLogoBadge" src="../../images/OrcaSlicer_gradient_circle.svg" alt="" />':'';
|
||||
|
||||
let TmpHtml='<div class="FileItem" fpath="'+sPath+'" >'+
|
||||
'<a class="FileTip" title="'+sPath+'"></a>'+
|
||||
'<div class="FileImg" ><img src="'+sImg+'" onerror="this.onerror=null;this.src=\'img/d.png\';" alt="No Image" /></div>'+
|
||||
'<div class="FileName TextS1">'+sName+'</div>'+
|
||||
'<div class="FileImg" ><img src="'+sImg+'" onerror="this.onerror=null;this.src=\'img/d.png\';" alt="No Image" />'+sLogoBadge+'</div>'+
|
||||
'<div class="FileNamePack">'+sBadge+'<div class="FileName TextS1">'+sName+'</div></div>'+
|
||||
'<div class="FileDate">'+sTime+'</div>'+
|
||||
'</div>';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user