2020-09-16 00:35:12 +01:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2009-2010 Volker Lanz <vl@fidra.de>
|
|
|
|
SPDX-FileCopyrightText: 2014-2020 Andrius Štikonas <andrius@stikonas.eu>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*/
|
2009-04-21 17:36:43 +01:00
|
|
|
|
|
|
|
#include "gui/listoperations.h"
|
|
|
|
|
2016-01-12 00:12:49 +00:00
|
|
|
#include <ops/operation.h>
|
2009-04-21 17:36:43 +01:00
|
|
|
|
2016-01-12 00:12:49 +00:00
|
|
|
#include <util/globallog.h>
|
|
|
|
#include <util/capacity.h>
|
2009-04-21 17:36:43 +01:00
|
|
|
|
|
|
|
/** Creates a new ListOperations instance.
|
2015-07-13 15:17:41 +01:00
|
|
|
@param parent the parent widget
|
2009-04-21 17:36:43 +01:00
|
|
|
*/
|
|
|
|
ListOperations::ListOperations(QWidget* parent) :
|
2015-07-13 15:17:41 +01:00
|
|
|
QWidget(parent),
|
|
|
|
Ui::ListOperationsBase(),
|
2016-04-14 19:18:36 +01:00
|
|
|
m_ActionCollection(nullptr)
|
2009-04-21 17:36:43 +01:00
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
setupUi(this);
|
2009-04-21 17:36:43 +01:00
|
|
|
}
|
|
|
|
|
2010-02-12 11:49:35 +00:00
|
|
|
void ListOperations::updateOperations(const OperationStack::Operations& ops)
|
2009-04-21 17:36:43 +01:00
|
|
|
{
|
2015-07-13 15:17:41 +01:00
|
|
|
listOperations().clear();
|
2009-04-21 17:36:43 +01:00
|
|
|
|
2016-08-09 14:57:33 +01:00
|
|
|
for (const auto &op : ops) {
|
2020-09-29 17:54:53 +01:00
|
|
|
QListWidgetItem* item = new QListWidgetItem(QIcon::fromTheme(op->iconName()), op->description());
|
2015-07-13 15:17:41 +01:00
|
|
|
item->setToolTip(op->description());
|
|
|
|
listOperations().addItem(item);
|
|
|
|
}
|
2009-04-21 17:36:43 +01:00
|
|
|
|
2015-07-13 15:17:41 +01:00
|
|
|
listOperations().scrollToBottom();
|
2009-04-21 17:36:43 +01:00
|
|
|
}
|