diff --git a/src/Config.h b/src/Config.h index 8a1e0fc8..40273a69 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,7 +30,7 @@ #define VER_LAMEXP_MINOR_LO 7 #define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_PATCH 2 -#define VER_LAMEXP_BUILD 1183 +#define VER_LAMEXP_BUILD 1185 /////////////////////////////////////////////////////////////////////////////// // Tool versions (minimum expected versions!) diff --git a/src/Dialog_Processing.cpp b/src/Dialog_Processing.cpp index fc897489..b8d7c473 100644 --- a/src/Dialog_Processing.cpp +++ b/src/Dialog_Processing.cpp @@ -63,6 +63,7 @@ #include #include #include +#include #include #include @@ -101,6 +102,15 @@ while(0) } \ 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()); \ @@ -192,6 +202,19 @@ ProcessingDialog::ProcessingDialog(FileListModel *fileListModel, AudioFileModel 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(-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))); @@ -322,6 +345,9 @@ void ProcessingDialog::showEvent(QShowEvent *event) QTimer::singleShot(1000, this, SLOT(initEncoding())); m_firstShow = false; } + + //Force update geometry + resizeEvent(NULL); } void ProcessingDialog::closeEvent(QCloseEvent *event) @@ -390,6 +416,20 @@ bool ProcessingDialog::event(QEvent *e) } } +/* + * 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); @@ -758,6 +798,9 @@ void ProcessingDialog::contextMenuFilterActionTriggered(void) } } +/* + * Filter progress items + */ void ProcessingDialog::progressViewFilterChanged(void) { unsigned int counter = 0; @@ -772,12 +815,27 @@ void ProcessingDialog::progressViewFilterChanged(void) 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(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 «

").arg(tr("None of the items matches the current filtering rules"), iconPath)); + m_filterInfoLabel->setUserData(0, reinterpret_cast(m_progressViewFilter)); + resizeEvent(NULL); } } + else if(!m_filterInfoLabel->isHidden()) + { + m_filterInfoLabel->hide(); + } } //////////////////////////////////////////////////////////// diff --git a/src/Dialog_Processing.h b/src/Dialog_Processing.h index e8f4b1b1..9b423260 100644 --- a/src/Dialog_Processing.h +++ b/src/Dialog_Processing.h @@ -79,6 +79,7 @@ protected: bool eventFilter(QObject *obj, QEvent *event); virtual bool event(QEvent *e); virtual bool winEvent(MSG *message, long *result); + virtual void resizeEvent(QResizeEvent *event); private: void setCloseButtonEnabled(bool enabled); @@ -98,6 +99,7 @@ private: QMap m_playList; QMenu *m_contextMenu; QActionGroup *m_progressViewFilterGroup; + QLabel *m_filterInfoLabel; unsigned int m_runningThreads; unsigned int m_currentFile; QList m_allJobs; diff --git a/src/Global.cpp b/src/Global.cpp index 13b08f47..87df4525 100644 --- a/src/Global.cpp +++ b/src/Global.cpp @@ -88,6 +88,10 @@ Q_IMPORT_PLUGIN(QICOPlugin) #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 /////////////////////////////////////////////////////////////////////////////// @@ -143,8 +147,10 @@ static bool g_lamexp_console_attached = false; //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)