示例#1
0
void Themes::on_lineEditSearch_textChanged(QString text)
{
	if(text=="")
	{
		TimerForSearch->stop();
		hilightTheSearch();
	}
	else
		TimerForSearch->start();
}
示例#2
0
//close the search box
void Themes::closeTheSearchBox()
{
	currentIndexSearch = -1;
	ui->lineEditSearch->clear();
	ui->lineEditSearch->hide();
	ui->pushButtonSearchPrev->hide();
	ui->pushButtonSearchNext->hide();
	ui->pushButtonCloseSearch->hide();
	ui->searchButton->setChecked(false);
	hilightTheSearch();
}
示例#3
0
void Themes::on_lineEditSearch_returnPressed()
{
	hilightTheSearch();
}
示例#4
0
void Themes::on_pushButtonSearchNext_clicked()
{
	hilightTheSearch(true);
}
示例#5
0
Themes::Themes(bool checkBoxShowSpeed,FacilityInterface * facilityEngine,bool moreButtonPushed) :
	ui(new Ui::interfaceCopy())
{
	this->facilityEngine=facilityEngine;
	ui->setupUi(this);
	ui->TransferList->setModel(&transferModel);
	transferModel.setFacilityEngine(facilityEngine);
	ui->tabWidget->setCurrentIndex(0);
	ui->checkBoxShowSpeed->setChecked(checkBoxShowSpeed);
	currentFile	= 0;
	totalFile	= 0;
	currentSize	= 0;
	totalSize	= 0;
	haveError	= false;
	this->show();
	menu=new QMenu(this);
	ui->add->setMenu(menu);
	on_checkBoxShowSpeed_toggled(ui->checkBoxShowSpeed->isChecked());
	currentSpeed	= 0;
	storeIsInPause	= false;
	isInPause(false);
	modeIsForced	= false;
	haveStarted	= false;
	connect(ui->limitSpeed,		SIGNAL(valueChanged(int)),	this,	SLOT(uiUpdateSpeed()));
	connect(ui->checkBox_limitSpeed,SIGNAL(toggled(bool)),		this,	SLOT(uiUpdateSpeed()));

	connect(ui->actionAddFile,SIGNAL(triggered()),this,SLOT(forcedModeAddFile()));
	connect(ui->actionAddFileToCopy,SIGNAL(triggered()),this,SLOT(forcedModeAddFileToCopy()));
	connect(ui->actionAddFileToMove,SIGNAL(triggered()),this,SLOT(forcedModeAddFileToMove()));
	connect(ui->actionAddFolderToCopy,SIGNAL(triggered()),this,SLOT(forcedModeAddFolderToCopy()));
	connect(ui->actionAddFolderToMove,SIGNAL(triggered()),this,SLOT(forcedModeAddFolderToMove()));
	connect(ui->actionAddFolder,SIGNAL(triggered()),this,SLOT(forcedModeAddFolder()));

	//setup the search part
	closeTheSearchBox();
	TimerForSearch  = new QTimer(this);
	TimerForSearch->setInterval(500);
	TimerForSearch->setSingleShot(true);
	searchShortcut  = new QShortcut(QKeySequence("Ctrl+F"),this);
	searchShortcut2 = new QShortcut(QKeySequence("F3"),this);
	searchShortcut3 = new QShortcut(QKeySequence("Escape"),this);//Qt::Key_Escape

	//connect the search part
	connect(TimerForSearch,			SIGNAL(timeout()),	this,	SLOT(hilightTheSearch()));
	connect(searchShortcut,			SIGNAL(activated()),	this,	SLOT(searchBoxShortcut()));
	connect(searchShortcut2,		SIGNAL(activated()),	this,	SLOT(on_pushButtonSearchNext_clicked()));
	connect(ui->pushButtonCloseSearch,	SIGNAL(clicked()),	this,	SLOT(closeTheSearchBox()));
	connect(searchShortcut3,		SIGNAL(activated()),	this,	SLOT(closeTheSearchBox()));

	//reload directly untranslatable text
	newLanguageLoaded();

	//unpush the more button
	ui->moreButton->setChecked(moreButtonPushed);
	on_moreButton_toggled(false);

	/// \note important for drag and drop, \see dropEvent()
	setAcceptDrops(true);

	// try set the OS icon
	QIcon tempIcon;

	tempIcon=QIcon::fromTheme("application-exit");
	if(!tempIcon.isNull())
	{
		ui->cancelButton->setIcon(tempIcon);
		ui->pushButtonCloseSearch->setIcon(tempIcon);
		ui->shutdown->setIcon(tempIcon);
	}

	tempIcon=QIcon::fromTheme("edit-delete");
	if(!tempIcon.isNull())
		ui->del->setIcon(tempIcon);

	tempIcon=QIcon::fromTheme("media-playback-pause");
	if(!tempIcon.isNull())
	{
		player_pause=tempIcon;
		ui->pauseButton->setIcon(tempIcon);
	}
	else
		player_pause=QIcon(":/resources/player_pause.png");

	tempIcon=QIcon::fromTheme("media-playback-play");
	if(!tempIcon.isNull())
		player_play=tempIcon;
	else
		player_play=QIcon(":/resources/player_play.png");

	tempIcon=QIcon::fromTheme("media-skip-forward");
	if(!tempIcon.isNull())
		ui->skipButton->setIcon(tempIcon);

	tempIcon=QIcon::fromTheme("edit-find");
	if(!tempIcon.isNull())
		ui->searchButton->setIcon(tempIcon);

	tempIcon=QIcon::fromTheme("document-open");
	if(!tempIcon.isNull())
		ui->importTransferList->setIcon(tempIcon);

	tempIcon=QIcon::fromTheme("document-save");
	if(!tempIcon.isNull())
		ui->exportTransferList->setIcon(tempIcon);

	tempIcon=QIcon::fromTheme("list-add");
	if(!tempIcon.isNull())
	{
		ui->add->setIcon(tempIcon);
		ui->actionAddFile->setIcon(tempIcon);
		ui->actionAddFileToCopy->setIcon(tempIcon);
		ui->actionAddFileToMove->setIcon(tempIcon);
		ui->actionAddFolder->setIcon(tempIcon);
		ui->actionAddFolderToCopy->setIcon(tempIcon);
		ui->actionAddFolderToMove->setIcon(tempIcon);
	}

	shutdown=facilityEngine->haveFunctionality("shutdown");
	ui->shutdown->setVisible(shutdown);

	selectionModel=ui->TransferList->selectionModel();

	#ifdef ULTRACOPIER_PLUGIN_DEBUG
	connect(&transferModel,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)),this,SIGNAL(debugInformation(DebugLevel,QString,QString,QString,int)));
	#endif

	updateSpeed();
}
void Themes::hilightTheSearchSlot()
{
    hilightTheSearch();
}