Example #1
0
void NodeGraphDisplay::onControlClick(NodeControl *nc)
{
	if(stickySelect())
		selectNode(nc, true);
	else if(toggleStickySelect())
		selectNodeToggle(nc);
	else
	{
		clearSelected();
		selectNode(nc, true);
	}
}
Example #2
0
void NodeGraphDisplay::onMouseDown(APoint m_pos, MouseButton b)
{
	if(valid(b & NODEGRAPH_SELECT_NODES_BTN))
	{
		if(!stickySelect() && !toggleStickySelect())
			clearSelected();

		selectionPivot = m_pos;
		selectionRect.pos = selectionPivot;
		selectionRect.size = AVec(0, 0);
		//selectionRect.space = TSpace::O_VIRTUAL;
	}
}
Example #3
0
State::State()
 : m_xStart(0), m_xEnd(0), m_xCtrl(0), m_edges(0)
{
    m_uistate = UI_NEWSPLINE;
    m_showControlPoints = true;
    m_showFinalPoints = true;
    clearAllSelected();
    clearSelected();
    m_paintQ = false;
    m_paintP = true;

    setMinimumSeparation(0.01);
}
Example #4
0
void NodeGraphDisplay::onDrag(APoint m_pos, AVec d_pos)
{
	if(valid(Mouse::getButtonStates() & NODEGRAPH_MOVE_OFFSET_BTN))
	{
		moveViewOffset(-absoluteToVirtualVec(d_pos));
	}
	else if(selectionRect.space != TSpace::INVALID)
	{
		//Adjust selectionRect
		if(selectionPivot.x > m_pos.x)
		{
			selectionRect.pos.x = m_pos.x;
			selectionRect.size.x = selectionPivot.x - m_pos.x;
		}
		else
		{
			selectionRect.pos.x = selectionPivot.x;
			selectionRect.size.x = m_pos.x - selectionPivot.x;
		}

		if(selectionPivot.y > m_pos.y)
		{
			selectionRect.pos.y = m_pos.y;
			selectionRect.size.y = selectionPivot.y - m_pos.y;
		}
		else
		{
			selectionRect.pos.y = selectionPivot.y;
			selectionRect.size.y = m_pos.y - selectionPivot.y;
		}

		//Clamp selection rect within absolute bounds
		Rect bounds = Rect(APoint(0, 0), size);
		selectionRect = Rect::findIntersection(selectionRect, absoluteToVirtualRect(bounds));
		
		if(!stickySelect())
			clearSelected();

		for(auto c : nodeControls)
		{
			if((c->selected && stickySelect()) || Rect::intersects(c->getRect(), selectionRect))
				selectNode(c, false);
		}
	}
}
Example #5
0
// редактирование информации о КХР
bool TController::editKHR()
{
	// происходит проверка на заполненность полей
	if(Trim(formKHR->edtOrderNum->Text) == "" || Trim(formKHR->edtKHRNum->Text) == "" ||
	   Trim(formKHR->edtName->Text) == "" || Trim(formKHR->edtShort->Text) == "")
	{
		// какие-то данные не заполнены
		//ShowMessage("Не все данные заполнены!");
		return false;
	}
	string nfile;

	selectedKHR->szOrder  	 = STR(formKHR->edtOrderNum->Text);
	selectedKHR->szNumber 	 = STR(formKHR->edtKHRNum->Text);
	selectedKHR->szTitle	 = STR(formKHR->edtName->Text);
	selectedKHR->dtStartDate = formKHR->dtStartDate->Date;
	selectedKHR->szFileName  = STR(formKHR->edtShort->Text);
	selectedKHR->selected    = true;

	for (unsigned int i=0; i < selectedKHR->Executors.size(); i++)
		delete selectedKHR->Executors[i];
	selectedKHR->Executors.clear();

	for (unsigned int i=0; i < selectedKHR->Signatures.size(); i++)
		delete selectedKHR->Signatures[i];
	selectedKHR->Signatures.clear();

	int execid = 1;
	for(int i=0; i < formKHR->sgExecutors->RowCount; i++)
	{
		if (Trim(formKHR->sgExecutors->Cells[0][i])!="")
		{
			TExecutor *exec = new TExecutor;
			exec->id 		=  execid++;
			AnsiString tt = formKHR->sgExecutors->Cells[0][i];
		   //	exec->szName 	= formKHR->sgExecutors->Cells[0][i].c_str();
			exec->szName = tt.c_str();
			selectedKHR->Executors.push_back(exec);
		}
	}

	for(int i=0; i < formKHR->sgSigns->RowCount; i++)
	{
		if (Trim(formKHR->sgSigns->Cells[0][i])!=""&&Trim(formKHR->sgSigns->Cells[1][i])!="")
		{
			TSignature *sig = new TSignature;
			sig->szChair = STR(formKHR->sgSigns->Cells[0][i]);
			sig->szName	 = STR(formKHR->sgSigns->Cells[1][i]);
			selectedKHR->Signatures.push_back(sig);
		}
	}

	formKHR->edtOrderNum	-> Text = "";
	formKHR->edtKHRNum		-> Text = "";
	formKHR->edtName		-> Text = "";
	for(int i=0; i < formKHR->sgSigns->RowCount; i++)
	{
		formKHR->sgSigns->Cells[0][i]="";
		formKHR->sgSigns->Cells[1][i]="";
	}
	for(int i=0; i < formKHR->sgExecutors->RowCount; i++)
		formKHR->sgExecutors->Cells[0][i]="";

	clearSelected();

	formKHR->Close();
	showAll();

	return true;
}
Example #6
0
//------------------------------------------------------------------------------
// Блок действий с файлом КХР
//------------------------------------------------------------------------------
// добавление информации о КХР
bool TController::addNewKHR()
{
	// происходит проверка на заполненность полей
	if(Trim(formKHR->edtOrderNum->Text) == "" || Trim(formKHR->edtKHRNum->Text) == "" ||
	   Trim(formKHR->edtName->Text) == "" || Trim(formKHR->edtShort->Text) == "")
	{
		// какие-то данные не заполнены
		ShowMessage("Не все данные заполнены!");
		return false;
	}

	TKHR *khr;
	string nfile;
	string pathName;
	// сохранение КХР
	formKHR->SaveDialog->InitialDir = ExtractFilePath(Application->ExeName);
	if (!formKHR->SaveDialog->Execute())
		return false;
	else
	{
		nfile = STR(formKHR->SaveDialog->FileName);
		AnsiString temp;
		khr = new TKHR; // создание новой КХР
		temp = nfile.substr(nfile.size()-4, 4).string::c_str();
		if(temp != ".xml")
		{
			formKHR->SaveDialog->FileName = formKHR->SaveDialog->FileName + ".xml";
		}
		formKHR->SaveDialog->Options >> ofExtensionDifferent;
		pathName = STR(formKHR->SaveDialog->FileName);
		khr->path = pathName;
	}

	khr->szOrder  	 = STR(formKHR->edtOrderNum->Text);
	khr->szNumber 	 = STR(formKHR->edtKHRNum->Text);
	khr->szTitle	 = STR(formKHR->edtName->Text);
	khr->dtStartDate = formKHR->dtStartDate->Date;
	khr->szFileName  = STR(formKHR->edtShort->Text);
	khr->selected    = true;

	int execid = 1;
	for(int i=0; i < formKHR->sgExecutors->RowCount; i++)
	{
		if (Trim(formKHR->sgExecutors->Cells[0][i])!="")
		{
			TExecutor *exec = new TExecutor;
			exec->id 		=  execid++;
			exec->szName 	= STR(formKHR->sgExecutors->Cells[0][i]);
			khr->Executors.push_back(exec);
		}
	}

	for(int i=0; i < formKHR->sgSigns->RowCount; i++)
	{
		if (Trim(formKHR->sgSigns->Cells[0][i])!=""&&Trim(formKHR->sgSigns->Cells[1][i])!="")
		{
			TSignature *sig = new TSignature;
			sig->szChair = STR(formKHR->sgSigns->Cells[0][i]);
			sig->szName	 = STR(formKHR->sgSigns->Cells[1][i]);
			khr->Signatures.push_back(sig);
		}
	}

	addKHR(khr);
	DataManager->SaveData(khr, pathName);

	formKHR->edtOrderNum	-> Text = "";
	formKHR->edtKHRNum		-> Text = "";
	formKHR->edtName		-> Text = "";
	for(int i=0; i < formKHR->sgSigns->RowCount; i++)
	{
		formKHR->sgSigns->Cells[0][i]="";
		formKHR->sgSigns->Cells[1][i]="";
	}
	for(int i=0; i < formKHR->sgExecutors->RowCount; i++)
		formKHR->sgExecutors->Cells[0][i]="";

	clearSelected();

	formKHR->Close();
	saveSettings();
	showAll();
	return true;
}
Example #7
0
RadWidget::RadWidget(Rad *_rad, QWidget *parent, const char *name) : QWidget(parent, name)
{
	hotlistNum = 3;

	rad = _rad;
	QHBoxLayout *hlayout = new QHBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
	QVBoxLayout *vlayout = new QVBoxLayout(hlayout, KDialog::spacingHint());

	hotlistGroup = new QButtonGroup(1, Horizontal, i18n("Hotlist"), this);
	//hotlistGroup->setRadioButtonExclusive(true);
	vlayout->addWidget(hotlistGroup);

	Config* config = Config::self();

	hotlist = config->hotlist();

	while (hotlist.size() > hotlistNum)
		hotlist.pop_front();

	for (unsigned int i = 0; i < hotlistNum; ++i)
	{
		if (i >= hotlistNum)
			break;

		hotlistGroup->insert(new KPushButton(*hotlist.at(i), hotlistGroup), i);
	}
	connect(hotlistGroup, SIGNAL(clicked(int)), SLOT(hotlistClicked(int)));

	QVBoxLayout *layout = new QVBoxLayout(vlayout, KDialog::spacingHint());

	totalStrokes = new QCheckBox(i18n("Search by total strokes"), this);
	connect(totalStrokes, SIGNAL(clicked()), this, SLOT(totalClicked()));
	layout->addWidget(totalStrokes);

	QHBoxLayout *strokesLayout = new QHBoxLayout(layout, KDialog::spacingHint());
	totalSpin = new QSpinBox(1, 30, 1, this);
	strokesLayout->addWidget(totalSpin);
	strokesLayout->addStretch();
	totalErrLabel = new QLabel(i18n("+/-"), this);
	strokesLayout->addWidget(totalErrLabel);
	totalErrSpin = new QSpinBox(0, 15, 1, this);
	strokesLayout->addWidget(totalErrSpin);

	ok = new KPushButton(i18n("&Look Up"), this);
	ok->setEnabled(false);
	connect(ok, SIGNAL(clicked()), SLOT(apply()));
	layout->addWidget(ok);
	cancel = new KPushButton( KStdGuiItem::cancel(), this );

	connect(cancel, SIGNAL(clicked()), SLOT(close()));
	layout->addWidget(cancel);

	QVBoxLayout *middlevLayout = new QVBoxLayout(hlayout, KDialog::spacingHint());

	strokesSpin = new QSpinBox(1, 17, 1, this);
	QToolTip::add(strokesSpin, i18n("Show radicals having this number of strokes"));
	middlevLayout->addWidget(strokesSpin);

	List = new KListBox(this);
	middlevLayout->addWidget(List);
	connect(List, SIGNAL(executed(QListBoxItem *)), this, SLOT(executed(QListBoxItem *)));
	connect(strokesSpin, SIGNAL(valueChanged(int)), this, SLOT(updateList(int)));

	QVBoxLayout *rightvlayout = new QVBoxLayout(hlayout, KDialog::spacingHint());
	selectedList = new KListBox(this);
	rightvlayout->addWidget(selectedList);
	connect(selectedList, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));

	remove = new KPushButton(i18n("&Remove"), this);
	rightvlayout->addWidget(remove);
	connect(remove, SIGNAL(clicked()), this, SLOT(removeSelected()));
	remove->setEnabled(false);

	clear = new KPushButton(KStdGuiItem::clear(), this);
	rightvlayout->addWidget(clear);
	connect(clear, SIGNAL(clicked()), this, SLOT(clearSelected()));
	clear->setEnabled(false);

	setCaption(kapp->makeStdCaption(i18n("Radical Selector")));

	strokesSpin->setValue(config->strokes());
	strokesSpin->setFocus();

	totalSpin->setValue(config->totalStrokes());
	totalErrSpin->setValue(config->totalStrokesErrorMargin());
	totalStrokes->setChecked(config->searchByTotal());

	// make sure the right parts of the total stroke
	// selection system are enabled
	totalClicked();

 	// initially show the list of radicals to choose from
	updateList(strokesSpin->value());
}
Example #8
0
    void Pathgrid::applyRemoveNodes(CSMWorld::CommandMacro& commands)
    {
        const CSMWorld::Pathgrid* source = getPathgridSource();
        if (source)
        {
            CSMWorld::IdTree* model = dynamic_cast<CSMWorld::IdTree*>(mData.getTableModel(
                CSMWorld::UniversalId::Type_Pathgrids));

            // Want to remove nodes from end of list first
            std::sort(mSelected.begin(), mSelected.end(), std::greater<int>());

            int recordIndex = mPathgridCollection.getIndex(mId);
            int parentColumn = mPathgridCollection.findColumnIndex(CSMWorld::Columns::ColumnId_PathgridPoints);

            for (std::vector<unsigned short>::iterator row = mSelected.begin(); row != mSelected.end(); ++row)
            {
                commands.push(new CSMWorld::DeleteNestedCommand(*model, mId, static_cast<int>(*row), parentColumn));
            }

            // Fix/remove edges
            std::set<int, std::greater<int> > edgeRowsToRemove;

            parentColumn = mPathgridCollection.findColumnIndex(CSMWorld::Columns::ColumnId_PathgridEdges);

            int edge0Column = mPathgridCollection.searchNestedColumnIndex(parentColumn,
                CSMWorld::Columns::ColumnId_PathgridEdge0);

            int edge1Column = mPathgridCollection.searchNestedColumnIndex(parentColumn,
                CSMWorld::Columns::ColumnId_PathgridEdge1);

            QModelIndex parent = model->index(recordIndex, parentColumn);

            for (size_t edge = 0; edge < source->mEdges.size(); ++edge)
            {
                int adjustment0 = 0;
                int adjustment1 = 0;

                // Determine necessary adjustment
                for (std::vector<unsigned short>::iterator point = mSelected.begin(); point != mSelected.end(); ++point)
                {
                    if (source->mEdges[edge].mV0 == *point || source->mEdges[edge].mV1 == *point)
                    {
                        edgeRowsToRemove.insert(static_cast<int>(edge));

                        adjustment0 = 0; // No need to adjust, its getting removed
                        adjustment1 = 0;
                        break;
                    }

                    if (source->mEdges[edge].mV0 > *point)
                        --adjustment0;

                    if (source->mEdges[edge].mV1 > *point)
                        --adjustment1;
                }

                if (adjustment0 != 0)
                {
                    int adjustedEdge = source->mEdges[edge].mV0 + adjustment0;
                    commands.push(new CSMWorld::ModifyCommand(*model, model->index(edge, edge0Column, parent),
                        adjustedEdge));
                }

                if (adjustment1 != 0)
                {
                    int adjustedEdge = source->mEdges[edge].mV1 + adjustment1;
                    commands.push(new CSMWorld::ModifyCommand(*model, model->index(edge, edge1Column, parent),
                        adjustedEdge));
                }
            }

            std::set<int, std::greater<int> >::iterator row;
            for (row = edgeRowsToRemove.begin(); row != edgeRowsToRemove.end(); ++row)
            {
                commands.push(new CSMWorld::DeleteNestedCommand(*model, mId, *row, parentColumn));
            }
        }

        clearSelected();
    }
Example #9
0
void NodeGraphDisplay::finishConnectingNodes(NodeControl *to_node, NCID *connector)
{
	if(!draggedNode) return;

	std::cout << "TRYING TO COMPLETE CONNECTION...\n";

	Node *n_from, *n_to;
	NCID id_from, id_to;

	if(draggedConnector)
	{
		switch(NodeConnector::getNodeConnector(draggedConnector)->ioType)
		{
		case NCType::DATA_OUTPUT:
		case NCType::INFO_OUTPUT:
			n_from = draggedNode->getNode();
			n_to = to_node->getNode();

			id_from = draggedConnector;
			id_to = (connector ? *connector : 0);
			break;
		case NCType::DATA_INPUT:
		case NCType::INFO_INPUT:
				n_from = to_node->getNode();
				n_to = draggedNode->getNode();
			
				id_from = (connector ? *connector : 0);
				id_to = draggedConnector;
				break;
		default:
			return;
		}
	}
	else
	{
		n_from = draggedNode->getNode();
		n_to = to_node->getNode();
		
		id_from = draggedConnector;
		id_to = (connector ? *connector : 0);
	}
	
	std::vector<NodeConnector*> c_from = n_from->getConnectors(),
								c_to = n_to->getConnectors();
	
	NodeConnector	*nc_from = nullptr,
					*nc_to = nullptr;

	if(id_from)
	{
		nc_from = NodeConnector::getNodeConnector(id_from);

		if(id_to)
		{
			NodeConnector *nc = NodeConnector::getNodeConnector(id_to);
			if(statusGood(nc_from->connect(nc)))
				nc_to = nc;
		}
		else
		{
			for(unsigned int i = 0; i < c_to.size(); i++)
			{
				if(statusGood(nc_from->connect(c_to[i])))
				{
					nc_to = c_to[i];
					break;
				}
			}
		}
	}
	else
	{
		if(id_to)
		{
			nc_to = NodeConnector::getNodeConnector(id_to);
			for(unsigned int i = 0; i < c_from.size(); i++)
			{
				if(statusGood(c_from[i]->connect(nc_to)))
				{
					nc_from = c_from[i];
					break;
				}
			}
		}
		else
		{
			//Find best fit for connection between these connectors
			for(unsigned int i1 = 0; !nc_from && i1 < c_from.size(); i1++)
			{
				for(unsigned int i2 = 0; i2 < c_to.size(); i2++)
				{
					if(statusGood(c_from[i1]->connect(c_to[i2])))
					{
						nc_from = c_from[i1];
						nc_to = c_to[i2];
						break;
					}
				}
			}
		}
	}

	if(nc_from && nc_to)
	{
		std::cout << "Connected Node \"" << n_from->getName() << "\" to Node \"" << n_to->getName() << "\".\n";
		std::cout << "\t(Data type = " << nc_from->dataType << ")\n";
		
		clearSelected();
		
		if(!connections[connectionIndex]->hasFrom())
		{
			NodeControl *from_node = getNodeControl(n_from);
			connections[connectionIndex]->setOtherNode(from_node, nc_from);
			selectNode(from_node, true);
		}
		else
		{
			connections[connectionIndex]->setOtherNode(to_node, nc_to);
			selectNode(to_node, true);
		}
	}
	else
	{
		std::cout << "ERROR --> Could not connect Node \"" << n_from->getName() << "\" to Node \"" << n_to->getName() << "\".\n";
		removeConnection(connectionIndex);
		//clearSelected();
	}

	draggedNode = nullptr;
	draggedConnector = 0;
	connectionIndex = -1;
}
Example #10
0
Transfers::Transfers(QWidget* _p, const char* _n)
          : QWidget(_p) {


	QVBoxLayout *MainBox = new QVBoxLayout(this);
	MainBox->setMargin(0);
	MainBox->setSpacing(0);
	transferSplitter = new QSplitter(this);
	MainBox->addWidget(transferSplitter);
	downloadsWidget = new QWidget(transferSplitter);
	uploadsWidget = new QWidget(transferSplitter);
	transferSplitter->setOrientation(Qt::Vertical);

    if (museeq->settings()->value("saveTransfersLayout", false).toBool()) {
        QString optionName = "transferSplitter_Layout";
        transferSplitter->restoreState(museeq->settings()->value(optionName).toByteArray());
    }

	// Downloads
	QVBoxLayout *downloadVbox = new QVBoxLayout(downloadsWidget);
	downloadVbox->setMargin(0);
	downloadVbox->setSpacing(3);
	QHBoxLayout *downloadHbox = new QHBoxLayout;
	downloadVbox->addLayout(downloadHbox);
	QLabel * downloadsLabel = new QLabel(tr("Downloads:"), downloadsWidget);
	downloadsLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
	downloadHbox->addWidget(downloadsLabel);

	mDownrate = new QSpinBox(downloadsWidget);
	mDownrate->setMaximum(9999);
	downloadHbox->addWidget(mDownrate);
	QLabel * downrateLabel = new QLabel(tr("KiB/s"), downloadsWidget);
	downloadHbox->addWidget(downrateLabel);
	connect(mDownrate, SIGNAL(valueChanged(const QString&)), SLOT(setDownrate(const QString&)));
	connect(museeq, SIGNAL(configChanged(const QString&, const QString&, const QString&)), SLOT(slotConfigChanged(const QString&, const QString&, const QString&)));

	QFrame* sep = new QFrame(downloadsWidget);
	downloadHbox->addWidget(sep);
	sep->setFrameShape(QFrame::VLine);
	sep->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);

	mDownslots = new QSpinBox(downloadsWidget);
	downloadHbox->addWidget(mDownslots);
	QLabel * downslotsLabel = new QLabel(tr("slots"), downloadsWidget);
	downloadHbox->addWidget(downslotsLabel);
	connect(mDownslots, SIGNAL(valueChanged(const QString&)), SLOT(setDownslots(const QString&)));
	connect(museeq, SIGNAL(configChanged(const QString&, const QString&, const QString&)), SLOT(slotConfigChanged(const QString&, const QString&, const QString&)));

	QFrame* sep2 = new QFrame(downloadsWidget);
	downloadHbox->addWidget(sep2);
	sep2->setFrameShape(QFrame::VLine);
	sep2->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);

	mGroupDownloads = new QCheckBox(tr("Group by user"), downloadsWidget);
	downloadHbox->addWidget(mGroupDownloads);
	connect(mGroupDownloads, SIGNAL(toggled(bool)), SLOT(groupDownloadsSet(bool)));

	mDownloads = new TransferListView(true, downloadsWidget, "downloads");
 	downloadVbox->addWidget(mDownloads);
	mDownloads->setAcceptDrops(true);
	connect(museeq, SIGNAL(downloadUpdated(const NTransfer&)), mDownloads, SLOT(update(const NTransfer&)));
	connect(museeq, SIGNAL(downloadRemoved(const QString&, const QString&)), mDownloads, SLOT(remove(const QString&, const QString&)));
	connect(mDownloads, SIGNAL(dropSlsk(const QList<QUrl>&)), SLOT(dropSlsk(const QList<QUrl>&)));
	// Uploads
	QVBoxLayout *uploadVbox = new QVBoxLayout(uploadsWidget);
	uploadVbox->setMargin(0);
	uploadVbox->setSpacing(3);
	QHBoxLayout *uploadHbox = new QHBoxLayout;
	uploadVbox->addLayout(uploadHbox);

	uploadHbox->setSpacing(5);
	QLabel * uploadsLabel = new QLabel(tr("Uploads:"));
	uploadsLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
	uploadHbox->addWidget(uploadsLabel);

	mUprate = new QSpinBox(uploadsWidget);
	mUprate->setMaximum(9999);
	uploadHbox->addWidget(mUprate);
	QLabel * uprateLabel = new QLabel(tr("KiB/s"), uploadsWidget);
	uploadHbox->addWidget(uprateLabel);
	connect(mUprate, SIGNAL(valueChanged(const QString&)), SLOT(setUprate(const QString&)));
	connect(museeq, SIGNAL(configChanged(const QString&, const QString&, const QString&)), SLOT(slotConfigChanged(const QString&, const QString&, const QString&)));

	QFrame* sep3 = new QFrame(uploadsWidget);
	uploadHbox->addWidget(sep3);
	sep3->setFrameShape(QFrame::VLine);
	sep3->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);

	mUpslots = new QSpinBox(uploadsWidget);
	uploadHbox->addWidget(mUpslots);
	QLabel * upslotsLabel = new QLabel(tr("slots"), uploadsWidget);
	uploadHbox->addWidget(upslotsLabel);
	connect(mUpslots, SIGNAL(valueChanged(const QString&)), SLOT(setUpslots(const QString&)));
	connect(museeq, SIGNAL(configChanged(const QString&, const QString&, const QString&)), SLOT(slotConfigChanged(const QString&, const QString&, const QString&)));

	QFrame* sep4 = new QFrame(uploadsWidget);
	uploadHbox->addWidget(sep4);
	sep4->setFrameShape(QFrame::VLine);
	sep4->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);

	mGroupUploads = new QCheckBox(tr("Group by user"), uploadsWidget);
	uploadHbox->addWidget(mGroupUploads);
	connect(mGroupUploads, SIGNAL(toggled(bool)), SLOT(groupUploadsSet(bool)));

	mUploads = new TransferListView(false, uploadsWidget, "uploads");
	uploadVbox->addWidget(mUploads);
	connect(museeq, SIGNAL(uploadUpdated(const NTransfer&)), mUploads, SLOT(update(const NTransfer&)));
	connect(museeq, SIGNAL(uploadRemoved(const QString&, const QString&)), mUploads, SLOT(remove(const QString&, const QString&)));

	mTransferMenu = new QMenu(this);

	ActionRetry = new QAction(tr("Retry"), this);
	connect(ActionRetry, SIGNAL(triggered()), this, SLOT(retrySelected()));
	mTransferMenu->addAction(ActionRetry);

	ActionCheckPosition = new QAction(tr("Check place"), this);
	connect(ActionCheckPosition, SIGNAL(triggered()), this, SLOT(updateSelected()));
	mTransferMenu->addAction(ActionCheckPosition);

	ActionAbort = new QAction(tr("Abort"), this);
	connect(ActionAbort, SIGNAL(triggered()), this, SLOT(abortSelected()));
	mTransferMenu->addAction(ActionAbort);

	ActionMessageDownloading = new QAction(tr("Message downloading users"), this);
	connect(ActionMessageDownloading, SIGNAL(triggered()), this, SLOT(messageDownloadingUsers()));
	mTransferMenu->addAction(ActionMessageDownloading);

	mClearMenu = mTransferMenu->addMenu(tr("Clear"));

	ActionClearSelected = new QAction(tr("Selected"), this);
	connect(ActionClearSelected, SIGNAL(triggered()), this, SLOT(clearSelected()));
	mClearMenu->addAction(ActionClearSelected);

	mClearMenu->addSeparator();

	ActionClearFinished = new QAction(tr("Finished"), this);
	connect(ActionClearFinished, SIGNAL(triggered()), this, SLOT(clearFinished()));
	mClearMenu->addAction(ActionClearFinished);

	ActionClearAborted = new QAction(tr("Aborted"), this);
	connect(ActionClearAborted, SIGNAL(triggered()), this, SLOT(clearAborted()));
	mClearMenu->addAction(ActionClearAborted);

	ActionClearAwaiting = new QAction(tr("Offline"), this);
	connect(ActionClearAwaiting, SIGNAL(triggered()), this, SLOT(clearAwaiting()));
	mClearMenu->addAction(ActionClearAwaiting);

	ActionClearCruft = new QAction(tr("Cruft"), this);
	connect(ActionClearCruft, SIGNAL(triggered()), this, SLOT(clearCruft()));
	mClearMenu->addAction(ActionClearCruft);

	ActionClearFinishedAborted = new QAction(tr("Finished / aborted"), this);
	connect(ActionClearFinishedAborted, SIGNAL(triggered()), this, SLOT(clearFinishedAborted()));
	mClearMenu->addAction(ActionClearFinishedAborted);

	ActionClearQueued = new QAction(tr("Queued"), this);
	connect(ActionClearQueued, SIGNAL(triggered()), this, SLOT(clearQueued()));
	mClearMenu->addAction(ActionClearQueued);


	mTransferMenu->addSeparator();
	mUsersMenu = mTransferMenu->addMenu(tr("Users"));

	connect(mDownloads, SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(popupDownloads(const QPoint&)));
	connect(mUploads, SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(popupUploads(const QPoint&)));
	connect(museeq, SIGNAL(transfersSorting(bool)), SLOT(setSorting(bool)));

	mUpGroupingChanging = mDownGroupingChanging = true;
    groupDownloads(museeq->settings()->value("groupDownloads", false).toBool());
    groupUploads(museeq->settings()->value("groupUploads", false).toBool());
	mUpGroupingChanging = mDownGroupingChanging = false;

	connect(museeq, SIGNAL(closingMuseeq()), this, SLOT(onClosingMuseeq()));
}