#include <QSystemTrayIcon>
#include <QProcess>
#include <QProgressDialog>
+#include <QResizeEvent>
#include <QTime>
#include <MMSystem.h>
} \
while(0)
+#define SET_TEXT_COLOR(WIDGET, COLOR) do \
+{ \
+ QPalette _palette = WIDGET->palette(); \
+ _palette.setColor(QPalette::WindowText, (COLOR)); \
+ _palette.setColor(QPalette::Text, (COLOR)); \
+ WIDGET->setPalette(_palette); \
+} \
+while(0)
+
#define UPDATE_MIN_WIDTH(WIDGET) do \
{ \
if(WIDGET->width() > WIDGET->minimumWidth()) WIDGET->setMinimumWidth(WIDGET->width()); \
if(QAction *act = contextMenuFilterAction[4]) { m_progressViewFilterGroup->addAction(act); act->setCheckable(true); act->setData(-1); act->setChecked(true); }
}
+ //Create info label
+ if(m_filterInfoLabel = new QLabel(view_log))
+ {
+ m_filterInfoLabel->setFrameShape(QFrame::NoFrame);
+ m_filterInfoLabel->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
+ m_filterInfoLabel->setUserData(0, reinterpret_cast<QObjectUserData*>(-1));
+ SET_FONT_BOLD(m_filterInfoLabel, true);
+ SET_TEXT_COLOR(m_filterInfoLabel, Qt::darkGray);
+ m_filterInfoLabel->setContextMenuPolicy(Qt::CustomContextMenu);
+ connect(m_filterInfoLabel, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTriggered(QPoint)));
+ m_filterInfoLabel->hide();
+ }
+
//Connect context menu
view_log->setContextMenuPolicy(Qt::CustomContextMenu);
connect(view_log, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTriggered(QPoint)));
QTimer::singleShot(1000, this, SLOT(initEncoding()));
m_firstShow = false;
}
+
+ //Force update geometry
+ resizeEvent(NULL);
}
void ProcessingDialog::closeEvent(QCloseEvent *event)
}
}
+/*
+ * Window was resized
+ */
+void ProcessingDialog::resizeEvent(QResizeEvent *event)
+{
+ if(event) QDialog::resizeEvent(event);
+
+ if(QWidget *port = view_log->viewport())
+ {
+ QRect geom = port->geometry();
+ m_filterInfoLabel->setGeometry(geom.left() + 16, geom.top() + 16, geom.width() - 32, geom.height() - 32);
+ }
+}
+
bool ProcessingDialog::winEvent(MSG *message, long *result)
{
return WinSevenTaskbar::handleWinEvent(message, result);
}
}
+/*
+ * Filter progress items
+ */
void ProcessingDialog::progressViewFilterChanged(void)
{
unsigned int counter = 0;
if((m_progressViewFilter >= 0) && (counter == 0))
{
- qWarning("Filter does NOT match on any item, reverting to show all!");
- for(int i = 0; i < view_log->model()->rowCount(); i++)
+ if(m_filterInfoLabel->isHidden() || (m_filterInfoLabel->userData(0) != reinterpret_cast<QObjectUserData*>(m_progressViewFilter)))
{
- view_log->setRowHidden(i, false);
+ QString iconPath;
+ switch(m_progressViewFilter)
+ {
+ case ProgressModel::JobRunning: iconPath = ":/icons/media_play.png"; break;
+ case ProgressModel::JobComplete: iconPath = ":/icons/tick.png"; break;
+ case ProgressModel::JobFailed: iconPath = ":/icons/exclamation.png"; break;
+ case ProgressModel::JobSkipped: iconPath = ":/icons/step_over.png"; break;
+ default: iconPath = ":/icons/report.png"; break;
+ }
+ m_filterInfoLabel->show();
+ m_filterInfoLabel->setText(QString("» %1 «<br><br><img src=\"%2\">").arg(tr("None of the items matches the current filtering rules"), iconPath));
+ m_filterInfoLabel->setUserData(0, reinterpret_cast<QObjectUserData*>(m_progressViewFilter));
+ resizeEvent(NULL);
}
}
+ else if(!m_filterInfoLabel->isHidden())
+ {
+ m_filterInfoLabel->hide();
+ }
}
////////////////////////////////////////////////////////////
#define LAMEXP_ZERO_MEMORY(X) SecureZeroMemory(&X, sizeof(X))
+//Helper macros
+#define _LAMEXP_MAKE_STR(STR) #STR
+#define LAMEXP_MAKE_STR(STR) _LAMEXP_MAKE_STR(STR)
+
///////////////////////////////////////////////////////////////////////////////
// TYPES
///////////////////////////////////////////////////////////////////////////////
//Compiler detection
//The following code was borrowed from MPC-HC project: http://mpc-hc.sf.net/
#if defined(__INTEL_COMPILER)
- #if (__INTEL_COMPILER >= 1200)
- static const char *g_lamexp_version_compiler = "ICL 12.x";
+ #if (__INTEL_COMPILER >= 1300)
+ static const char *g_lamexp_version_compiler = "ICL 13." LAMEXP_MAKE_STR(__INTEL_COMPILER_BUILD_DATE);
+ #elif (__INTEL_COMPILER >= 1200)
+ static const char *g_lamexp_version_compiler = "ICL 12." LAMEXP_MAKE_STR(__INTEL_COMPILER_BUILD_DATE);
#elif (__INTEL_COMPILER >= 1100)
static const char *g_lamexp_version_compiler = "ICL 11.x";
#elif (__INTEL_COMPILER >= 1000)