From 1a1b30b1e14747669733b4a4e88cc744d8c8f100 Mon Sep 17 00:00:00 2001 From: zhuohy <1445643474@qq.com> Date: Mon, 25 Sep 2023 17:03:10 +0800 Subject: [PATCH] update run button and kill button when process status changed --- ui/zenoedit/dock/docktabcontent.cpp | 13 ++- ui/zenoedit/dock/docktabcontent.h | 1 + ui/zenoedit/dock/ztabdockwidget.cpp | 4 + ui/zenoedit/res/languages/zh.qm | Bin 32127 -> 34635 bytes ui/zenoedit/res/languages/zh.ts | 174 ++++++++++++++++++++++------ ui/zenoedit/zenomainwindow.cpp | 26 ++++- ui/zenoedit/zenomainwindow.h | 1 + ui/zenoui/comctrl/ztoolbutton.cpp | 34 +++--- ui/zenoui/comctrl/ztoolbutton.h | 3 +- 9 files changed, 201 insertions(+), 55 deletions(-) diff --git a/ui/zenoedit/dock/docktabcontent.cpp b/ui/zenoedit/dock/docktabcontent.cpp index dbac0cd391..ff62ef3846 100644 --- a/ui/zenoedit/dock/docktabcontent.cpp +++ b/ui/zenoedit/dock/docktabcontent.cpp @@ -335,7 +335,7 @@ void DockContent_Editor::initToolbar(QHBoxLayout* pToolLayout) m_btnRun->setText(tr("Run")); m_btnRun->setCursor(QCursor(Qt::PointingHandCursor)); m_btnRun->setMargins(ZenoStyle::dpiScaledMargins(QMargins(11, 5, 14, 5))); - m_btnRun->setBackgroundClr(QColor("#4578AC"), QColor("#4578AC"), QColor("#4578AC"), QColor("#4578AC")); + m_btnRun->setBackgroundClr(QColor("#4578AC"), QColor("#4578AC"), QColor("#4578AC"), QColor("#4578AC"), QColor("#4D5561")); m_btnRun->setTextClr(QColor("#FFFFFF"), QColor("#FFFFFF"), QColor("#FFFFFF"), QColor("#FFFFFF")); ZenoSettingsManager &settings = ZenoSettingsManager::GetInstance(); m_btnRun->setShortcut(settings.getShortCut(ShortCut_Run)); @@ -350,10 +350,11 @@ void DockContent_Editor::initToolbar(QHBoxLayout* pToolLayout) m_btnKill->setText(tr("Kill")); m_btnKill->setCursor(QCursor(Qt::PointingHandCursor)); m_btnKill->setMargins(ZenoStyle::dpiScaledMargins(QMargins(11, 5, 14, 5))); - m_btnKill->setBackgroundClr(QColor("#4D5561"), QColor("#4D5561"), QColor("#4D5561"), QColor("#4D5561")); + m_btnKill->setBackgroundClr(QColor("#4578AC"), QColor("#4578AC"), QColor("#4578AC"), QColor("#4578AC"), QColor("#4D5561")); m_btnKill->setTextClr(QColor("#FFFFFF"), QColor("#FFFFFF"), QColor("#FFFFFF"), QColor("#FFFFFF")); m_btnKill->setShortcut(settings.getShortCut(ShortCut_Kill)); m_btnKill->setCursor(QCursor(Qt::PointingHandCursor)); + m_btnKill->setEnabled(false); QStringList runList{tr("disable"), tr("alwaysAll"), tr("alwaysLightCamera"), tr("alwaysMaterial")}; m_btnAlways = new ZComboBox(this); @@ -552,6 +553,8 @@ void DockContent_Editor::initConnections() }); connect(m_btnRun, &ZToolMenuButton::clicked, this, [=]() { + m_btnRun->setEnabled(false); + m_btnKill->setEnabled(true); std::shared_ptr mgr = zenoApp->cacheMgr(); ZASSERT_EXIT(mgr); ZenoMainWindow *pMainWin = zenoApp->getMainWindow(); @@ -626,6 +629,12 @@ ZenoGraphsEditor* DockContent_Editor::getEditor() const return m_pEditor; } +void DockContent_Editor::runFinished() +{ + m_btnRun->setEnabled(true); + m_btnKill->setEnabled(false); +} + void DockContent_Editor::onCommandDispatched(QAction* pAction, bool bTriggered) { if (m_pEditor) diff --git a/ui/zenoedit/dock/docktabcontent.h b/ui/zenoedit/dock/docktabcontent.h index b37d82665d..60b8bcc801 100644 --- a/ui/zenoedit/dock/docktabcontent.h +++ b/ui/zenoedit/dock/docktabcontent.h @@ -92,6 +92,7 @@ class DockContent_Editor : public DockToolbarWidget explicit DockContent_Editor(QWidget* parent = nullptr); void onCommandDispatched(QAction* pAction, bool bTriggered); ZenoGraphsEditor* getEditor() const; + void runFinished(); protected: void initToolbar(QHBoxLayout* pToolLayout) override; diff --git a/ui/zenoedit/dock/ztabdockwidget.cpp b/ui/zenoedit/dock/ztabdockwidget.cpp index d3fd200447..5a4cc4c7cb 100644 --- a/ui/zenoedit/dock/ztabdockwidget.cpp +++ b/ui/zenoedit/dock/ztabdockwidget.cpp @@ -416,6 +416,10 @@ void ZTabDockWidget::onRunFinished() ZASSERT_EXIT(pWid); pWid->onRunFinished(); } + else if (DockContent_Editor* pView = qobject_cast(m_tabWidget->widget(i))) + { + pView->runFinished(); + } } } diff --git a/ui/zenoedit/res/languages/zh.qm b/ui/zenoedit/res/languages/zh.qm index f94549fb11786a20fe7734f018f66f2032669b2f..a56bed9bc8faaf38a7795d93fb9b773d3809df19 100644 GIT binary patch delta 5418 zcma)=cU)9g+Q*-nxp(TF86YAmA_EABR8cfy0|6B&(gZ{lDZ|VN&Hw`{x;l#*1$%-D zYScFxYlsbvS$o0Q60BLv+G5?TG0|8zYxMmMC$FoT&_qYyHld-Kv12M@&?UyqRm9gH#`kTE9VajbzhKP!nE2g)BPzN;e3N~i>x@1}7`yCZ z9A+W@Bx3J~es=o0lC9+-v=?hgYe!OH2vJfi#u3v=`XCK4Ur4eI`w{ablI_=nHd5?D zq8jg$OPv$muaI{!aw6s?_4a#0)NUrlWZoqjJBkL4>xm={qu5TDiTu8&!QJ60cR6FP zEjEf@j7*OVWi&=pLe?R~@Gzr)Bqf;kAmJuaLUkBXn`iY@OIcNgAckL@dR@j9!Pp zokSmIQ~GRJ++D#q=o8AEUQX1j9c9`VaLA)!W*F@3Oj&t&_gTT%Wf5c1W=5+kWl!A> z&uFRO**N4>GnF(%5!qTd(WKBA)O0Jx+{cWga~VsQ(xm^aBXT-Vn_3;f!co*XJD8}a z2Yt7%nP|Xpdeo~gk))EII?X2P93>Ls5!;ZNBJ~F{cwoB7=`uVM6)g(R{g|jcUlcn9 zAsl#Fl%Dr3*+^X}%5Yc_Idr~ywqrpUag(%OmnJ7A6G;7l~4 z=aaDTdC`|ck?ncGqBA8sh`OmoKU|oAy3Y~azkdrla98vn0rMm^ip5bdEc%vMXhQw> zy(I1#jgY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4<7!^Av z2Kpe7#7HqX6EYpJM~tjKgiMc#Q{!;xn4AJt;3ILt%U|KFhs4!uys*y?;@%s0E~-r2 z_p2TmNg6Cb^ZShHLE`>IIMRTK%2K7IAN3n7wn%Bc zDi$8!th76R0z>1h9C|zm8Cfg+T9>1A&dPvUIL$1^GRBNnMjY=VN;Xz5NVP{V_bT&$ z$8)M8W#JB#JTizep+kL$0Z5aaxT%vqF78{H|qI`ZDl~G<*c7=su2BI0GZz|t+qvWQ2K$P6n zU&TL-z(sGT%692=lsZ)va1Vi|<*UZj;&(#u8v>60*+~~ zPIDQKN?v444P;F3rB3_70<)lBsm=|5hf~c*owuLEXK*d(0@i5?PGHELK4{8sV2C}OG&RP%pntE0n%ax)I1C&$ zCktUT{Wogr`TIm!wVL|7a=f5c(~@`u!)2^_(|r#XoTzzg>yAujNi?|?$8sc^6NPFw@RfK(;&}UMwbM}!Mml+kq>Yvt&qwt z;P2CZk#;p>mVA#%pl1bArEcH%|Oo3&YO zjhOy=ZSJZQn6a-Ir?+VfWVN{VPt_Ladlt5Tu`fLKGiFC?S8XuGovj~Z+7ayrD@?1Z zOMA-G9=}&J#-(c8JQa{tp!Q=RUg-A3z^h<6T2g3`;))B6XO_V{+gDIahCx{_&V~sq z4bHR=gF`+rIM=TUm3wHQ|Fm$aGH7>1j}tl!ZU=Cf@`bwIory4}F*>UO7^ZL&ox{bK zxOTVd9Nyi6Dq3`&gZDyaRnnr_B16&R!| z?)ZqAA;y{ab^ozhf=U~QvxS+K(SDHbYj3>Bd6;g$@jp0hw&@NoKtMrNy7Onyim_L8 zE%UIku3LAv=Rc|zFLd|1ZE??EmW6}DtGdKcCad0Il-jqtz(b?n系统信息 + + ColorWidget + + More Color + + + DesignerMainWin Open - 打开 + 打开 File - 文件 + 文件 New - 新建 + 新建 Save - 保存 + 保存 Edit - 编辑 + 编辑 Undo - 撤销 + 撤销 Redo - 重做 + 重做 Cut - 剪切 + 剪切 Copy - 复制 + 复制 Paste - 粘贴 + 粘贴 Help - 帮助 + 帮助 Play - 播放 + 播放 + + + node + + + + mdiWin2 + + + + Quit + + + + Layout + + + + View + @@ -634,14 +661,21 @@ ImageGroupBox Select an image - 选择一张图片 + 选择一张图片 LayerTreeitemDelegate Select an image - 选择一张图片 + 选择一张图片 + + + + LayerWidget + + Layer + @@ -962,12 +996,20 @@ Please input the title of blackboard 请输入黑板的标题 + + content + + + + title + + NodesWidget Save As - 另存为 + 另存为 @@ -996,6 +1038,13 @@ 参数名字已存在 + + PropertyPane + + Inspector + + + QObject @@ -2576,6 +2625,14 @@ the save action will lose them, we recommand you choose "Save As" to save it + + Kill Process + 结束进程 + + + Background process is running, you need kill the process. + 后台进程正在运行,您需要终止该进程。 + ZenoNode @@ -2651,95 +2708,136 @@ the save action will lose them, we recommand you choose "Save As" to s ZenoPlayer File - 文件 + 文件 Open - 打开 + 打开 Display - 显示 + 显示 Show Grid - 显示网格 + 显示网格 Background Color - 背景颜色 + 背景颜色 Smooth Shading - 平滑渲染 + 平滑渲染 Normal Check - 法线检查 + 法线检查 Wireframe - 线框 + 线框 Solid - 实体 + 实体 Shading - 上色 + 上色 VXGI - 全局光照 + 全局光照 Optix - 光线追踪 + 光线追踪 Camera Keyframe - 摄像机关键帧 + 摄像机关键帧 English / Chinese - 中英文切换 + 中英文切换 Record - 导出 + 导出 Screenshot - 截屏 + 截屏 Path to Save - 文件保存路径 + 文件保存路径 PNG images(*.png);;JPEG images(*.jpg);;BMP images(*.bmp);;EXR images(*.exr);;HDR images(*.hdr);; - PNG图像(*.png);;JPEG图像(*.jpg);;BMP图像(*.bmp);;EXR图像(*.exr);;HDR图像(*.hdr);; + PNG图像(*.png);;JPEG图像(*.jpg);;BMP图像(*.bmp);;EXR图像(*.exr);;HDR图像(*.hdr);; Record Video - 录制视频 + 录制视频 EnvTex - 环境贴图 + 环境贴图 Error - 错误 + 错误 Open %1 error! - 打开%1错误! + 打开%1错误! Default - 默认 + 默认 + + + Ctrl+O + + + + Shift+F12 + + + + BlackWhite + + + + Creek + + + + Daylight + + + + Footballfield + + + + Forest + + + + Lake + + + + Sea + + + + Zensim Graph File (*.zsg) +All Files (*) + diff --git a/ui/zenoedit/zenomainwindow.cpp b/ui/zenoedit/zenomainwindow.cpp index 8ff31b3abf..09c40bbf46 100644 --- a/ui/zenoedit/zenomainwindow.cpp +++ b/ui/zenoedit/zenomainwindow.cpp @@ -839,6 +839,25 @@ DisplayWidget* ZenoMainWindow::getOnlyViewport() const return pView; } +bool ZenoMainWindow::resetProc() +{ + //should kill the runner proc. + const bool bWorking = zeno::getSession().globalState->working; + if (bWorking) + { + int flag = QMessageBox::question(this, tr("Kill Process"), tr("Background process is running, you need kill the process."), QMessageBox::Yes | QMessageBox::No); + if (flag & QMessageBox::Yes) + { + killProgram(); + } + else + { + return false; + } + } + return true; +} + void ZenoMainWindow::optixRunRender(const ZENO_RECORD_RUN_INITPARAM& param, LAUNCH_PARAM launchparam) { VideoRecInfo recInfo; @@ -1264,7 +1283,8 @@ void ZenoMainWindow::openFileDialog() QString filePath = getOpenFileByDialog(); if (filePath.isEmpty()) return; - + if (!resetProc()) + return; //todo: path validation if (saveQuit()) { @@ -1276,6 +1296,8 @@ void ZenoMainWindow::onNewFile() { std::shared_ptr mgr = zenoApp->cacheMgr(); ZASSERT_EXIT(mgr); mgr->setNewCacheDir(true); + if (!resetProc()) + return; if (saveQuit()) { zenoApp->graphsManagment()->newFile(); @@ -1623,6 +1645,8 @@ void ZenoMainWindow::loadRecentFiles() QAction *action = new QAction(path); m_ui->menuRecent_Files->addAction(action); connect(action, &QAction::triggered, this, [=]() { + if (!resetProc()) + return; if (saveQuit()) { if (!QFileInfo::exists(path)) { int flag = QMessageBox::question(nullptr, "", tr("the file does not exies, do you want to remove it?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No); diff --git a/ui/zenoedit/zenomainwindow.h b/ui/zenoedit/zenomainwindow.h index f33d43f40b..66dec58e5e 100644 --- a/ui/zenoedit/zenomainwindow.h +++ b/ui/zenoedit/zenomainwindow.h @@ -209,6 +209,7 @@ public slots: void shortCutDlg(); void killOptix(); DisplayWidget* getOnlyViewport() const; + bool resetProc(); ZTimeline* m_pTimeline; PtrLayoutNode m_layoutRoot; diff --git a/ui/zenoui/comctrl/ztoolbutton.cpp b/ui/zenoui/comctrl/ztoolbutton.cpp index 3598385ed0..fa546c55a0 100644 --- a/ui/zenoui/comctrl/ztoolbutton.cpp +++ b/ui/zenoui/comctrl/ztoolbutton.cpp @@ -215,27 +215,34 @@ void ZToolButton::initStyleOption(ZStyleOptionToolButton* option) const QBrush ZToolButton::backgrondColor(QStyle::State state) const { - if (state & QStyle::State_MouseOver) + if (state & QStyle::State_Enabled) { - if (state & QStyle::State_On) + if (state & QStyle::State_MouseOver) { - return m_clrBgOnHovered; + if (state & QStyle::State_On) + { + return m_clrBgOnHovered; + } + else + { + return m_clrBgNormalHover; + } } else { - return m_clrBgNormalHover; + if (state & QStyle::State_On) + { + return m_clrBgOn; + } + else + { + return m_clrBgNormal; + } } } else { - if (state & QStyle::State_On) - { - return m_clrBgOn; - } - else - { - return m_clrBgNormal; - } + return m_clrBgDisabled; } } @@ -259,12 +266,13 @@ QBrush ZToolButton::textColor(QStyle::State state) const } } -void ZToolButton::setBackgroundClr(const QColor& normalClr, const QColor& hoverClr, const QColor& downClr, const QColor& checkedClr) +void ZToolButton::setBackgroundClr(const QColor& normalClr, const QColor& hoverClr, const QColor& downClr, const QColor& checkedClr, const QColor& disabledClr) { m_clrBgNormal = normalClr; m_clrBgNormalHover = hoverClr; m_clrBgOn = downClr; m_clrBgOnHovered = checkedClr; + m_clrBgDisabled = disabledClr; } void ZToolButton::setTextClr(const QColor& normal, const QColor& hover, const QColor& normalOn, const QColor& hoverOn) diff --git a/ui/zenoui/comctrl/ztoolbutton.h b/ui/zenoui/comctrl/ztoolbutton.h index 4a21841239..007793a297 100644 --- a/ui/zenoui/comctrl/ztoolbutton.h +++ b/ui/zenoui/comctrl/ztoolbutton.h @@ -64,7 +64,7 @@ class ZToolButton : public QWidget bool isHovered() const; int buttonOption() const; virtual QSize sizeHint() const override; - void setBackgroundClr(const QColor& normalClr, const QColor& hoverClr, const QColor& downClr, const QColor& checkedClr); + void setBackgroundClr(const QColor& normalClr, const QColor& hoverClr, const QColor& downClr, const QColor& checkedClr, const QColor& disabledClr = QColor()); void setTextClr(const QColor &normal, const QColor &hover, const QColor &normalOn, const QColor &hoverOn); void setMargins(const QMargins& margins); void setRadius(int radius); @@ -121,6 +121,7 @@ public slots: QColor m_clrBgOn; QColor m_clrBgOnHovered; QColor m_clrBgNormal; + QColor m_clrBgDisabled; QColor m_clrText, m_clrTextHover, m_clrTextOn, m_clrTextOnHover;