예제 #1
0
void SearchVideosItemImpl::linkActivated(const QString &link)
{
	if (!VideoListController::instance()->isAlreadyAdded(link))
	{
		// check if this video can be downloaded
		if (canBeDownloaded)
			VideoListController::instance()->addVideo(link);
		else // ops, its not possible add this video
			native_alert(this, QMessageBox::Information, tr("Missing plugin"),
						 tr("<p>Is not possible to download this video.</p><p>The xVST didn't find any plugin capable to get the video information.</p>"),
						 tr("Ok"));
	}
	else // already added
		native_alert(this, QMessageBox::Information, tr("Already added"),
					 tr("You already added this video. Check your downloads list."), tr("Ok"));
}
void BugReportImpl::trackerReportSent(QString result)
{
	line_2->hide();
	lblSending->hide();
	prbSending->hide();
	
	if (result == "OK")
	{
		native_alert(this, QMessageBox::Information, "xVideoServiceThief Tracker", tr("Thank you for your report."), tr("Ok"));
	}
	else // error
	{
		native_alert(this, QMessageBox::Warning, "xVideoServiceThief Tracker", result, tr("Ok"));
	}

	done(QDialog::Accepted);
}
void UpdateCenterImpl::failedToInstallUpdates()
{
	native_alert(this, QMessageBox::Critical, tr("Updates center error"),
				 tr("Some errors has ocurred on try download the new update(s)."), tr("Ok"));
	// enable clancel button
	btnCancel->setEnabled(true);
	btnCancel->setDefault(true);
	btnCancel->setText(tr("Close"));
}
void CheckUpdatesWorker::updateMessage(QString version, QString url)
{
	// wait thread end
	waitThread();
	// display special updates message
	native_alert(parentForm, QMessageBox::Information, tr("Update Center"),
				 tr("Please, download the new version of <b>xVideoServiceThief (%1)</b> from <a href='%2'>here.</a>").arg(version).arg(url), tr("Ok"));
	// set as closed by button
	closedByButton = true;
	// close
	emit finished(false, closedByButton);
}
void CheckUpdatesWorker::updatesChecked(bool hasUpdates)
{
	// if has updates, then display the update center
	if (hasUpdates)
	{
		//this->setVisible(false);
		// result checker
		int result = QDialog::Accepted;
		// check if we are running windwos vista
		if (isWindowsVista() && !programOptions->getVistaUpdatesMessage())
		{
			WindowsVistaDetectedImpl windowsVistaDetectedForm(parentForm);
			result = windowsVistaDetectedForm.exec();
			// update the option "don't display this message"
			programOptions->setVistaUpdatesMessage(windowsVistaDetectedForm.chbDontDisplay->isChecked());
		}
		// open update center (this condition works only on windows vista)
		if (result == QDialog::Accepted)
		{
			emit beforeDisplayUpdateCenter();
			// dispaly
			UpdateCenterImpl updateCenterForm(updates, programOptions->getInstallAutomaticallyUpdates(), parentForm);
			result = updateCenterForm.exec();
		}
		// wait until "thread end"
		waitThread();
		// updates downloaded??? yes? then install them
		if (result == QDialog::Accepted)
		{
			updates->installUpdates();
			QApplication::closeAllWindows();
		}
		else // update center has been cancelled
		{
			closedByButton = true;
			//done(QDialog::Rejected);
			emit finished(false, closedByButton);
		}
	}
	else
	{
		// wait thread end
		waitThread();
		// display no updates message (only if is an user request)
		if (isUser)
			native_alert(parentForm, QMessageBox::Information, tr("Updates"), tr("You are using the most recent version of this program."),	tr("Ok"));
		// set as closed by button
		closedByButton = true;
		// close
		emit finished(false, closedByButton);
	}
}