diff --git a/resources/web/data/text.js b/resources/web/data/text.js
index aeb67a253..b4589dc74 100644
--- a/resources/web/data/text.js
+++ b/resources/web/data/text.js
@@ -78,7 +78,10 @@ var LangText={
"t83":"2, Close all open Bambu Studio",
"t84":"3, Delete all files under the plug-in directory",
"t85":"4, Reopen Bambu studio and install the plug-in again",
- "t86":"Close"
+ "t86":"Close",
+ "t87":"User manual",
+ "t88":"clear",
+ "t89":"show in explorer"
},
"zh_CN":{
"t1":"欢迎使用Bambu Studio",
@@ -159,7 +162,10 @@ var LangText={
"t83":"2, 关闭所有Bambu Studio",
"t84":"3, 删除插件所在目录下的所有文件",
"t85":"4, 重新启动Bambu Studio并尝试安装插件",
- "t86":"关闭"
+ "t86":"关闭",
+ "t87":"使用引导",
+ "t88":"清除",
+ "t89":"打开文件所在路径"
}
};
diff --git a/resources/web/homepage/css/home.css b/resources/web/homepage/css/home.css
index 6e2c322dd..e25c9570f 100644
--- a/resources/web/homepage/css/home.css
+++ b/resources/web/homepage/css/home.css
@@ -33,6 +33,12 @@ html, body {
text-decoration:underline;
}
+/*------------------*/
+#DebugText
+{
+ height:30px;
+}
+
/*------------------*/
body
{
@@ -208,6 +214,7 @@ body
padding: 0px 40px;
display: flex;
flex-direction: column;
+ position: relative;
}
#MenuArea
@@ -274,9 +281,31 @@ body
flex-direction: column;
}
+#RecentTitleBlock
+{
+ display:flex;
+ align-items: center;
+ padding: 6px;
+ border-bottom: 1px solid #D9D9D9;
+}
+
+#RecentClearAllBtn
+{
+ border: 1px solid #C4C4C4;
+ padding: 0px 10px;
+ border-radius: 6px;
+ line-height: 26px;
+ height: 26px;
+ margin-left: 20px;
+ cursor: pointer;
+ background-color: #00AE42;
+ color: #fff;
+ display: inline;
+}
+
#RecentTitle
{
- border-bottom: 1px solid #D9D9D9;
+
}
#FileList
@@ -331,6 +360,68 @@ body
color: #A8A8A8;
}
+#recnet_context_menu
+{
+ position: absolute;
+ margin: 0px;
+ padding: 0px;
+ border: 0px;
+ min-width: 100px;
+ top: 800px;
+ border: 1px solid #C5C5C5;
+ border-radius: 6px;
+ background-color: #fff;
+}
+
+.CT_Item
+{
+ line-height:30px;
+ padding: 0px 10px;
+ display: flex;
+ flex-direction: row;
+ align-content: center;
+ align-items: center;
+}
+
+.CT_Item:hover
+{
+ background-color: #E9E9E9;
+ cursor: pointer;
+}
+
+
+.CT_Icon
+{
+ margin-right: 6px;
+ width: 16px;
+ height: 16px;
+}
+
+.CT_Delete
+{
+ background: url("../img/delete.png");
+ background-repeat: no-repeat;
+ background-size: contain;
+}
+
+.CT_Explore
+{
+ background: url("../img/folder.png");
+ background-repeat: no-repeat;
+ background-size: contain;
+}
+
+
+.CT_Seperate
+{
+ border-bottom:1px solid #C5C5C5;
+}
+
+.CT_Text
+{
+
+}
+
/*--------Mall------*/
#MallBoard
{
@@ -363,4 +454,59 @@ body
width: 100%;
height: 95%;
border: 1px solid #D9D9D9;
-}
\ No newline at end of file
+}
+
+
+/*---------Wiki----------*/
+#WikiGuideBigBoard
+{
+ display:none;
+}
+
+
+#WikiGuideBoard
+{
+ display: flex;
+ flex-wrap: wrap;
+ align-content: flex-start;
+ overflow-y: auto;
+ padding: 50px;
+}
+
+.GuideBlock
+{
+ width: 320px;
+ margin: 0px;
+ margin: 0px 12px 30px 12px;
+ cursor: pointer;
+}
+
+.UG_IMG
+{
+ width: 320px;
+ height: 200px;
+}
+
+.UG_IMG img
+{
+ width: 320px;
+ height: 200px;
+}
+
+.UG_TITLE
+{
+ font-size: 16px;
+ line-height: 20px;
+ width: 320px;
+ margin-top: 6px;
+}
+
+.UG_DESC
+{
+ width: 320px;
+ line-height: 18px;
+ color: #C4C4C4;
+ font-size: 14px;
+}
+
+
diff --git a/resources/web/homepage/img/delete.png b/resources/web/homepage/img/delete.png
new file mode 100644
index 000000000..3f857a1a2
Binary files /dev/null and b/resources/web/homepage/img/delete.png differ
diff --git a/resources/web/homepage/img/folder.png b/resources/web/homepage/img/folder.png
new file mode 100644
index 000000000..cc5b34532
Binary files /dev/null and b/resources/web/homepage/img/folder.png differ
diff --git a/resources/web/homepage/img/wiki.png b/resources/web/homepage/img/wiki.png
new file mode 100644
index 000000000..c6a19f469
Binary files /dev/null and b/resources/web/homepage/img/wiki.png differ
diff --git a/resources/web/homepage/img/wiki2.png b/resources/web/homepage/img/wiki2.png
new file mode 100644
index 000000000..7a867d41a
Binary files /dev/null and b/resources/web/homepage/img/wiki2.png differ
diff --git a/resources/web/homepage/img/wiki3.png b/resources/web/homepage/img/wiki3.png
new file mode 100644
index 000000000..f5a52c2e3
Binary files /dev/null and b/resources/web/homepage/img/wiki3.png differ
diff --git a/resources/web/homepage/index.html b/resources/web/homepage/index.html
index d05753b88..944c9411b 100644
--- a/resources/web/homepage/index.html
+++ b/resources/web/homepage/index.html
@@ -10,7 +10,7 @@
-
+
@@ -39,8 +39,11 @@
recent
+
-
@@ -63,16 +66,21 @@
+
+
-
recent open
+
+
recent open
+
Clear all
+
-
+
-->
+
+
+
+
+
+
+
+
+
+
+
Wiki Title XXXXXXX XXXXXX XXXXX XXXXX XXXXXX
+
This is a long long long long long longlong long long long long longlong long long long long longlong long long long long longlong long long long long long text
+
+
+
+
Wiki Title XXXXXXX XXXXXX XXXXX XXXXX XXXXXX
+
This is a long long long long long longlong long long long long longlong long long long long longlong long long long long longlong long long long long long text
+
+
+
+
Wiki Title XXXXXXX XXXXXX XXXXX XXXXX XXXXXX
+
This is a long long long long long longlong long long long long longlong long long long long longlong long long long long longlong long long long long long text
+
+
+
+
Wiki Title XXXXXXX XXXXXX XXXXX XXXXX XXXXXX
+
This is a long long long long long longlong long long long long longlong long long long long longlong long long long long longlong long long long long long text
+
+
+
+
Wiki Title XXXXXXX XXXXXX XXXXX XXXXX XXXXXX
+
This is a long long long long long longlong long long long long longlong long long long long longlong long long long long longlong long long long long long text
+
+
+
+
Wiki Title XXXXXXX XXXXXX XXXXX XXXXX XXXXXX
+
This is a long long long long long longlong long long long long longlong long long long long longlong long long long long longlong long long long long long text
+
+
+
+
Wiki Title XXXXXXX XXXXXX XXXXX XXXXX XXXXXX
+
This is a long long long long long longlong long long long long longlong long long long long longlong long long long long longlong long long long long long text
+
+
+
+
Wiki Title XXXXXXX XXXXXX XXXXX XXXXX XXXXXX
+
This is a long long long long long longlong long long long long longlong long long long long longlong long long long long longlong long long long long long text
+
+
+
+
Wiki Title XXXXXXX XXXXXX XXXXX XXXXX XXXXXX
+
This is a long long long long long longlong long long long long longlong long long long long longlong long long long long longlong long long long long long text
+
+
+
+
Wiki Title XXXXXXX XXXXXX XXXXX XXXXX XXXXXX
+
This is a long long long long long longlong long long long long longlong long long long long longlong long long long long longlong long long long long long text
+
+
+
+
Wiki Title XXXXXXX XXXXXX XXXXX XXXXX XXXXXX
+
This is a long long long long long longlong long long long long longlong long long long long longlong long long long long longlong long long long long long text
+
+
+
+
Wiki Title XXXXXXX XXXXXX XXXXX XXXXX XXXXXX
+
This is a long long long long long longlong long long long long longlong long long long long longlong long long long long longlong long long long long long text
+
+
diff --git a/resources/web/homepage/js/home.js b/resources/web/homepage/js/home.js
index e1bcdd8e8..a37539bef 100644
--- a/resources/web/homepage/js/home.js
+++ b/resources/web/homepage/js/home.js
@@ -14,6 +14,68 @@ function OnInit()
SendMsg_GetRecentFile();
}
+//------最佳打开文件的右键菜单功能----------
+var RightBtnFilePath='';
+
+var MousePosX=0;
+var MousePosY=0;
+
+function Set_RecentFile_MouseRightBtn_Event()
+{
+ $(".FileItem").mousedown(
+ function(e)
+ {
+ //FilePath
+ RightBtnFilePath=$(this).attr('fpath');
+
+ if(e.which == 3){
+ //鼠标点击了右键+$(this).attr('ff') );
+ ShowRecnetFileContextMenu();
+ }else if(e.which == 2){
+ //鼠标点击了中键
+ }else if(e.which == 1){
+ //鼠标点击了左键
+ OnOpenRecentFile( encodeURI(RightBtnFilePath) );
+ }
+ });
+
+ $(document).bind("contextmenu",function(e){
+ //在这里书写代码,构建个性右键化菜单
+ return false;
+ });
+
+ $(document).mousemove( function(e){
+ MousePosX=e.pageX;
+ MousePosY=e.pageY;
+
+ let ContextMenuWidth=$('#recnet_context_menu').width();
+ let ContextMenuHeight=$('#recnet_context_menu').height();
+
+ let DocumentWidth=$(document).width();
+ let DocumentHeight=$(document).height();
+
+ //$("#DebugText").text( ContextMenuWidth+' - '+ContextMenuHeight+'
'+
+ // DocumentWidth+' - '+DocumentHeight+'
'+
+ // MousePosX+' - '+MousePosY +'
' );
+ } );
+
+
+ $(document).click( function(){
+ var e = e || window.event;
+ var elem = e.target || e.srcElement;
+ while (elem) {
+ if (elem.id && elem.id == 'recnet_context_menu') {
+ return;
+ }
+ elem = elem.parentNode;
+ }
+
+ $("#recnet_context_menu").hide();
+ } );
+
+
+}
+
function HandleStudio( pVal )
{
@@ -123,7 +185,7 @@ function ShowRecentFileList( pList )
//let index=sPath.lastIndexOf('\\')>0?sPath.lastIndexOf('\\'):sPath.lastIndexOf('\/');
//let sShortName=sPath.substring(index+1,sPath.length);
- let TmpHtml=''+
+ let TmpHtml='
'+
'
'+
'
'+
'
'+sName+''+
@@ -134,10 +196,33 @@ function ShowRecentFileList( pList )
}
$("#FileList").html(strHtml);
+
+ Set_RecentFile_MouseRightBtn_Event();
+ UpdateRecentClearBtnDisplay();
}
+function ShowRecnetFileContextMenu()
+{
+ $('#recnet_context_menu').show();
+
+ let ContextMenuWidth=$('#recnet_context_menu').width();
+ let ContextMenuHeight=$('#recnet_context_menu').height();
+
+ let DocumentWidth=$(document).width();
+ let DocumentHeight=$(document).height();
-/*-------MX Message------*/
+ let RealX=MousePosX;
+ let RealY=MousePosY;
+
+ if( MousePosX + ContextMenuWidth >DocumentWidth )
+ RealX=MousePosX-ContextMenuWidth;
+ if( MousePosY+ContextMenuHeight>DocumentHeight )
+ RealY=MousePosY-ContextMenuHeight;
+
+ $("#recnet_context_menu").offset({top: RealY, left:RealX});
+}
+
+/*-------RecentFile MX Message------*/
function SendMsg_GetLoginInfo()
{
var tSend={};
@@ -197,6 +282,69 @@ function OnOpenRecentFile( strPath )
SendWXMessage( JSON.stringify(tSend) );
}
+function OnDeleteRecentFile( )
+{
+ var tSend={};
+ tSend['sequence_id']=Math.round(new Date() / 1000);
+ tSend['command']="homepage_delete_recentfile";
+ tSend['data']={};
+ tSend['data']['path']=decodeURI(RightBtnFilePath);
+
+ SendWXMessage( JSON.stringify(tSend) );
+
+ $("#recnet_context_menu").hide();
+
+ let AllFile=$(".FileItem");
+ let nFile=AllFile.length;
+ for(let p=0;p
0 )
+ $("#RecentClearAllBtn").show();
+ else
+ $("#RecentClearAllBtn").hide();
+}
+
+
+
+
+function OnExploreRecentFile( )
+{
+ var tSend={};
+ tSend['sequence_id']=Math.round(new Date() / 1000);
+ tSend['command']="homepage_explore_recentfile";
+ tSend['data']={};
+ tSend['data']['path']=decodeURI(RightBtnFilePath);
+
+ SendWXMessage( JSON.stringify(tSend) );
+
+ $("#recnet_context_menu").hide();
+}
+
function OnLogOut()
{
var tSend={};
@@ -227,4 +375,20 @@ function OutputKey(keyCode, isCtrlDown, isShiftDown, isCmdDown) {
SendWXMessage(JSON.stringify(tSend));
}
+
+//-------------User Manual------------
+
+function OpenWikiUrl( strUrl )
+{
+ var tSend={};
+ tSend['sequence_id']=Math.round(new Date() / 1000);
+ tSend['command']="userguide_wiki_open";
+ tSend['data']={};
+ tSend['data']['url']=strUrl;
+
+ SendWXMessage( JSON.stringify(tSend) );
+}
+
+
+//---------------Global-----------------
window.postMessage = HandleStudio;
diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp
index 041ce1fba..bcd8af225 100644
--- a/src/slic3r/GUI/GUI_App.cpp
+++ b/src/slic3r/GUI/GUI_App.cpp
@@ -3002,6 +3002,31 @@ std::string GUI_App::handle_web_request(std::string cmd)
this->request_open_project(path.value());
}
}
+ }
+ else if (command_str.compare("homepage_delete_recentfile") == 0) {
+ if (root.get_child_optional("data") != boost::none) {
+ pt::ptree data_node = root.get_child("data");
+ boost::optional path = data_node.get_optional("path");
+ if (path.has_value()) {
+ this->request_remove_project(path.value());
+ }
+ }
+ }
+ else if (command_str.compare("homepage_delete_all_recentfile") == 0) {
+ this->request_remove_project("");
+ }
+ else if (command_str.compare("homepage_explore_recentfile") == 0) {
+ if (root.get_child_optional("data") != boost::none) {
+ pt::ptree data_node = root.get_child("data");
+ boost::optional path = data_node.get_optional("path");
+ if (path.has_value())
+ {
+ boost::filesystem::path NowFile(path.value());
+
+ std::string FolderPath = NowFile.parent_path().make_preferred().string();
+ desktop_open_any_folder(FolderPath);
+ }
+ }
}
else if (command_str.compare("homepage_open_hotspot") == 0) {
if (root.get_child_optional("data") != boost::none) {
@@ -3036,7 +3061,17 @@ std::string GUI_App::handle_web_request(std::string cmd)
e.SetEventObject(mainframe);
wxPostEvent(mainframe, e);
}
+ }
+ else if (command_str.compare("userguide_wiki_open") == 0) {
+ if (root.get_child_optional("data") != boost::none) {
+ pt::ptree data_node = root.get_child("data");
+ boost::optional path = data_node.get_optional("url");
+ if (path.has_value()) {
+ wxLaunchDefaultBrowser(path.value());
+ }
+ }
}
+
}
}
catch (...) {
@@ -3111,6 +3146,11 @@ void GUI_App::request_open_project(std::string project_id)
CallAfter([this, project_id] { mainframe->open_recent_project(-1, wxString::FromUTF8(project_id)); });
}
+void GUI_App::request_remove_project(std::string project_id)
+{
+ mainframe->remove_recent_project(-1, wxString::FromUTF8(project_id));
+}
+
void GUI_App::handle_http_error(unsigned int status, std::string body)
{
// tips body size must less than 1024
diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp
index aa2f31f67..17329a9eb 100644
--- a/src/slic3r/GUI/GUI_App.hpp
+++ b/src/slic3r/GUI/GUI_App.hpp
@@ -372,6 +372,7 @@ public:
void download_project(std::string project_id);
void request_project_download(std::string project_id);
void request_open_project(std::string project_id);
+ void request_remove_project(std::string project_id);
void handle_http_error(unsigned int status, std::string body);
void on_http_error(wxCommandEvent &evt);
diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp
index acbd9d197..dfb4986ec 100644
--- a/src/slic3r/GUI/MainFrame.cpp
+++ b/src/slic3r/GUI/MainFrame.cpp
@@ -2611,6 +2611,28 @@ void MainFrame::open_recent_project(size_t file_id, wxString const & filename)
}
}
+void MainFrame::remove_recent_project(size_t file_id, wxString const &filename)
+{
+ if (file_id == size_t(-1)) {
+ if (filename.IsEmpty())
+ while (m_recent_projects.GetCount() > 0)
+ m_recent_projects.RemoveFileFromHistory(0);
+ else
+ file_id = m_recent_projects.FindFileInHistory(filename);
+ }
+ if (file_id != size_t(-1))
+ m_recent_projects.RemoveFileFromHistory(file_id);
+ std::vector recent_projects;
+ size_t count = m_recent_projects.GetCount();
+ for (size_t i = 0; i < count; ++i)
+ {
+ recent_projects.push_back(into_u8(m_recent_projects.GetHistoryFile(i)));
+ }
+ wxGetApp().app_config->set_recent_projects(recent_projects);
+ wxGetApp().app_config->save();
+ m_webview->SendRecentList("");
+}
+
void MainFrame::load_url(wxString url)
{
BOOST_LOG_TRIVIAL(trace) << "load_url:" << url;
diff --git a/src/slic3r/GUI/MainFrame.hpp b/src/slic3r/GUI/MainFrame.hpp
index 2eca15278..0342c71d5 100644
--- a/src/slic3r/GUI/MainFrame.hpp
+++ b/src/slic3r/GUI/MainFrame.hpp
@@ -296,6 +296,7 @@ public:
void add_to_recent_projects(const wxString& filename);
void get_recent_projects(boost::property_tree::wptree & tree);
void open_recent_project(size_t file_id, wxString const & filename);
+ void remove_recent_project(size_t file_id, wxString const &filename);
void technology_changed();