|
|
|
|
#include "zxLogInstance.h"
|
|
|
|
|
#include "iRibbonXmlCmd.h"
|
|
|
|
|
|
|
|
|
|
#ifdef MY_OWN_GRID
|
|
|
|
|
#include "iSubWndGrid.h"
|
|
|
|
|
#else
|
|
|
|
|
#include "nmSubWndDemo.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "nmSubWndUtils.h"
|
|
|
|
|
|
|
|
|
|
iSubWnd* nmSubWndUtils::createSubWnd(iRibbonXmlCmd* pCmdInfo)
|
|
|
|
|
{
|
|
|
|
|
if (NULL == pCmdInfo)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
return createSubWnd(pCmdInfo->m_sID, pCmdInfo->m_sExtInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
iSubWnd* nmSubWndUtils::createSubWnd(QString sID, QString sExt)
|
|
|
|
|
{
|
|
|
|
|
iSubWnd* pSubWnd = NULL;
|
|
|
|
|
|
|
|
|
|
// Here is your own codes
|
|
|
|
|
int nID = sID.toInt();
|
|
|
|
|
if (nID == 5101)
|
|
|
|
|
{
|
|
|
|
|
// TODO,先弹窗做新建分析,再创建subWnd
|
|
|
|
|
pSubWnd = new nmSubWndDemo(NULL, sExt);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (NULL != pSubWnd)
|
|
|
|
|
{
|
|
|
|
|
// TODO 此处根据需要设置 改变 标识
|
|
|
|
|
pSubWnd->setModified(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return pSubWnd;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool nmSubWndUtils::runCmdBySpecial(iRibbonXmlCmd* pCmdInfo)
|
|
|
|
|
{
|
|
|
|
|
if (NULL == pCmdInfo)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return runCmdBySpecial(pCmdInfo->m_sID, pCmdInfo->m_sExtInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool nmSubWndUtils::runCmdBySpecial(QString sID, QString sExt)
|
|
|
|
|
{
|
|
|
|
|
// Here is your own codes
|
|
|
|
|
if (_isSame(sID, "12345"))
|
|
|
|
|
{
|
|
|
|
|
QMessageBox::information(NULL, zxAppID, QObject::tr("I am abc"));
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool nmSubWndUtils::isEnableOfID_Common(QString sID, QString sName, const bool bLicensed)
|
|
|
|
|
{
|
|
|
|
|
// 如果是5101,即 新建PVT
|
|
|
|
|
if (sID.toInt() == 5101) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
// Here is your own codes
|
|
|
|
|
if (_isSame(sName, "NmDemo"))
|
|
|
|
|
{
|
|
|
|
|
return (bLicensed);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|