Esempio n. 1
0
void TelegramCache::setUpdating(bool updating)
{
    if(p->updating == updating)
        return;

    p->updating = updating;
    Q_EMIT updatingChanged();
}
Esempio n. 2
0
void GM_Script::updateScript()
{
    if (!m_downloadUrl.isValid() || m_updating)
        return;

    m_updating = true;
    emit updatingChanged(m_updating);

    GM_Downloader *downloader = new GM_Downloader(m_downloadUrl, m_manager);
    downloader->updateScript(m_fileName);
    connect(downloader, &GM_Downloader::finished, this, [this]() {
        m_updating = false;
        emit updatingChanged(m_updating);
    });
    connect(downloader, &GM_Downloader::error, this, [this]() {
        m_updating = false;
        emit updatingChanged(m_updating);
    });
}
Esempio n. 3
0
toAbout::toAbout(QWidget* parent, const char* name, bool modal)
    : QDialog(parent)
{
    if (name)
        setObjectName(name);
    if (modal)
        setWindowModality(Qt::WindowModal);

    setupUi(this);

#if !defined(TOBUILDTYPE_RELEASE)
    setWindowTitle(QString(TOAPPNAME) + " " BUILD_TAG);
#endif

    // About Tab
    {
    	QFile f(":/widgets/toabout.html");
    	f.open(QFile::ReadOnly);
    	QString AboutText = QString::fromUtf8(f.readAll());
    	QString buffer = AboutText.arg(QString::fromLatin1(TORAVERSION));
    	textBrowserAbout->setHtml(buffer);
    }

    // License Tab
    {
    	QFile f(":/widgets/gpl-2.0-standalone.html");
    	f.open(QFile::ReadOnly);
    	QString LicenseText = QString::fromUtf8(f.readAll());
    	textBrowserLicense->setHtml(LicenseText);
    }

	// Copyright Tab
	{

	}

	// Version Tab
	{
		QString version;
#if defined(HAVE_GITREVISION_H)
		version.append("<center><table>");
		QString format = QString("<tr><td align=\"right\">%1:<td align=\"left\">%2");
		version.append(format.arg("GITVERSION").arg(GITVERSION));
		version.append(format.arg("GITVERSION_MAJOR").arg(GITVERSION_MAJOR));
		version.append(format.arg("GITVERSION_MINOR").arg(GITVERSION_MINOR));
		version.append(format.arg("GIT_BUILD_TYPE").arg(GIT_BUILD_TYPE));
		version.append(format.arg("GITVERSION_COUNT").arg(GITVERSION_COUNT));
		version.append(format.arg("GITVERSION_SHA1").arg(GITVERSION_SHA1));
		version.append(format.arg("GITVERSION_SHORT").arg(GITVERSION_SHORT));
		version.append(format.arg("GIT_BRANCH").arg(GIT_BRANCH));
		version.append(format.arg("BUILD_TAG").arg(BUILD_TAG));
		version.append(format.arg("BUILD_DATE").arg(BUILD_DATE));
		version.append("</table>");
#else
		version = TORAVERSION;
#endif
		QFont fixed(Utils::toStringToFont(toConfigurationNewSingle::Instance().option(ToConfiguration::Editor::ConfCodeFont).toString()));
		textBrowserVersion->setFont(fixed);
		textBrowserUpdate->setFont(fixed);
		textBrowserVersion->setHtml(version);

#if defined(Q_OS_WIN32)
		toUpdater &tu = toUpdaterSingle::Instance();
		connect(&tu, SIGNAL(updatingChanged(QString)), this, SLOT(updateVersionTab(QString)));
		connect(&tu, SIGNAL(updatingFinished(QString)), this, SLOT(updateVersionTab(QString)));
		connect(updateButton, SIGNAL(clicked()), &tu, SLOT(check()));
#endif
	}


	// Memory tab
#ifdef TORA_EXPERIMENTAL
	{
		QString usage("Memory usage: %1 M");
		textBrowserMemory->setPlainText(usage.arg(QString::number((qulonglong)getCurrentRSS())));
	}
#else
#endif

}