Commit 02c9b71d authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Revert changes that accidentally ended up in ba5750d4

Thanks to dt for noticing this messup!
parent 563c542a
......@@ -509,11 +509,26 @@ public:
QMenu *m_contextMenu;
QModelIndex m_contextMenuIndex;
ITaskHandler *m_defaultHandler;
QToolButton *m_filterButton;
QMenu *m_filterMenu;
QToolButton *m_filterWarningsButton;
QToolButton *m_categoriesButton;
QMenu *m_categoriesMenu;
TaskHub *m_taskHub;
};
static QToolButton *createFilterButton(QIcon icon, const QString &toolTip,
QObject *receiver, const char *slot)
{
QToolButton *button = new QToolButton;
button->setIcon(icon);
button->setToolTip(toolTip);
button->setCheckable(true);
button->setChecked(true);
button->setAutoRaise(true);
button->setEnabled(true);
QObject::connect(button, SIGNAL(toggled(bool)), receiver, slot);
return button;
}
TaskWindow::TaskWindow(TaskHub *taskhub) : d(new TaskWindowPrivate)
{
d->m_defaultHandler = 0;
......@@ -554,16 +569,20 @@ TaskWindow::TaskWindow(TaskHub *taskhub) : d(new TaskWindowPrivate)
connect(d->m_listview, SIGNAL(customContextMenuRequested(QPoint)),
this, SLOT(showContextMenu(QPoint)));
d->m_filterMenu = new QMenu;
connect(d->m_filterMenu, SIGNAL(aboutToShow()), this, SLOT(updateCategoriesMenu()));
connect(d->m_filterMenu, SIGNAL(triggered(QAction*)), this, SLOT(filterMenuTriggered(QAction*)));
d->m_filterWarningsButton = createFilterButton(d->m_model->taskTypeIcon(Task::Warning),
tr("Show Warnings"),
this, SLOT(setShowWarnings(bool)));
d->m_categoriesMenu = new QMenu;
connect(d->m_categoriesMenu, SIGNAL(aboutToShow()), this, SLOT(updateCategoriesMenu()));
connect(d->m_categoriesMenu, SIGNAL(triggered(QAction*)), this, SLOT(filterCategoryTriggered(QAction*)));
d->m_filterButton = new QToolButton;
d->m_filterButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_FILTER)));
d->m_filterButton->setToolTip(tr("Filter by categories"));
d->m_filterButton->setAutoRaise(true);
d->m_filterButton->setPopupMode(QToolButton::InstantPopup);
d->m_filterButton->setMenu(d->m_filterMenu);
d->m_categoriesButton = new QToolButton;
d->m_categoriesButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_FILTER)));
d->m_categoriesButton->setToolTip(tr("Filter by categories"));
d->m_categoriesButton->setAutoRaise(true);
d->m_categoriesButton->setPopupMode(QToolButton::InstantPopup);
d->m_categoriesButton->setMenu(d->m_categoriesMenu);
connect(d->m_taskHub, SIGNAL(categoryAdded(QString, QString)),
this, SLOT(addCategory(QString, QString)));
......@@ -579,6 +598,7 @@ TaskWindow::~TaskWindow()
{
Core::ICore::instance()->removeContextObject(d->m_taskWindowContext);
cleanContextMenu();
delete d->m_filterWarningsButton;
delete d->m_listview;
delete d->m_filter;
delete d->m_model;
......@@ -587,7 +607,7 @@ TaskWindow::~TaskWindow()
QList<QWidget*> TaskWindow::toolBarWidgets() const
{
return QList<QWidget*>() << d->m_filterButton;
return QList<QWidget*>() << d->m_filterWarningsButton << d->m_categoriesButton;
}
QWidget *TaskWindow::outputWidget(QWidget *)
......@@ -711,80 +731,38 @@ void TaskWindow::setShowWarnings(bool show)
void TaskWindow::updateCategoriesMenu()
{
d->m_filterMenu->clear();
d->m_categoriesMenu->clear();
const QStringList filteredCategories = d->m_filter->filteredCategories();
foreach (const QString &categoryId, d->m_model->categoryIds()) {
const QString categoryName = d->m_model->categoryDisplayName(categoryId);
QAction *action = new QAction(d->m_filterMenu);
QAction *action = new QAction(d->m_categoriesMenu);
action->setCheckable(true);
action->setText(categoryName);
action->setData(categoryId);
action->setChecked(!filteredCategories.contains(categoryId));
d->m_filterMenu->addAction(action);
d->m_categoriesMenu->addAction(action);
}
d->m_filterMenu->addSeparator();
QAction *unknownType = new QAction(d->m_model->taskTypeIcon(Task::Unknown),
tr("Informational"), d->m_filterMenu);
unknownType->setCheckable(true);
unknownType->setData(Task::Unknown);
unknownType->setChecked(d->m_filter->filterIncludesUnknowns());
d->m_filterMenu->addAction(unknownType);
QAction *warningType = new QAction(d->m_model->taskTypeIcon(Task::Warning),
tr("Warnings"), d->m_filterMenu);
warningType->setCheckable(true);
warningType->setData(Task::Warning);
warningType->setChecked(d->m_filter->filterIncludesUnknowns());
d->m_filterMenu->addAction(warningType);
QAction *errorType = new QAction(d->m_model->taskTypeIcon(Task::Error),
tr("Errors"), d->m_filterMenu);
errorType->setCheckable(true);
errorType->setData(Task::Error);
errorType->setChecked(d->m_filter->filterIncludesUnknowns());
d->m_filterMenu->addAction(errorType);
}
void TaskWindow::filterMenuTriggered(QAction *action)
void TaskWindow::filterCategoryTriggered(QAction *action)
{
if (action->data().type() == QVariant::String) {
QString categoryId = action->data().toString();
Q_ASSERT(!categoryId.isEmpty());
QStringList categories = d->m_filter->filteredCategories();
Q_ASSERT(d->m_filter->filteredCategories().contains(categoryId) == action->isChecked());
QString categoryId = action->data().toString();
Q_ASSERT(!categoryId.isEmpty());
if (action->isChecked()) {
categories.removeOne(categoryId);
} else {
categories.append(categoryId);
}
QStringList categories = d->m_filter->filteredCategories();
Q_ASSERT(d->m_filter->filteredCategories().contains(categoryId) == action->isChecked());
d->m_filter->setFilteredCategories(categories);
if (action->isChecked()) {
categories.removeOne(categoryId);
} else {
bool ok;
Task::TaskType type = static_cast<Task::TaskType>(action->data().toInt(&ok));
Q_ASSERT(ok);
switch (type) {
case ProjectExplorer::Task::Unknown:
d->m_filter->setFilterIncludesUnknowns(action->isChecked());
break;
case ProjectExplorer::Task::Error:
d->m_filter->setFilterIncludesErrors(action->isChecked());
break;
case ProjectExplorer::Task::Warning:
d->m_filter->setFilterIncludesWarnings(action->isChecked());
break;
}
categories.append(categoryId);
}
d->m_filter->setFilteredCategories(categories);
}
int TaskWindow::taskCount() const
......
......@@ -91,7 +91,7 @@ private slots:
void contextMenuEntryTriggered(QAction *);
void setShowWarnings(bool);
void updateCategoriesMenu();
void filterMenuTriggered(QAction *action);
void filterCategoryTriggered(QAction *action);
private:
void cleanContextMenu();
......
......@@ -400,7 +400,7 @@ AutoDetectS60QtDevices::AutoDetectS60QtDevices(QObject *parent) :
// Detect a Qt version that is installed into a Symbian SDK
static QString detect_SDK_installedQt(const QString &epocRoot)
{
const QString coreLibDllFileName = epocRoot + QLatin1String("/epoc32/release/armv5/udeb/QtCore.dll");
const QString coreLibDllFileName = epocRoot + QLatin1String("/epoc32/release/winscw/udeb/QtCore.dll");
QFile coreLibDllFile(coreLibDllFileName);
if (!coreLibDllFile.exists() || !coreLibDllFile.open(QIODevice::ReadOnly))
return QString();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment