Beispiel #1
0
void MainWindow::newsButtonClicked()
{
	QList<NewsEntryPtr> entries = MMC->newsChecker()->getNewsEntries();
	if (entries.count() > 0)
		openWebPage(QUrl(entries[0]->link));
	else
		openWebPage(QUrl("http://multimc.org/posts.html"));
}
Beispiel #2
0
void MainWindow::on_actionPatreon_triggered()
{
	openWebPage(QUrl("http://www.patreon.com/multimc"));
}
Beispiel #3
0
void MainWindow::on_actionMoreNews_triggered()
{
	openWebPage(QUrl("http://multimc.org/posts.html"));
}
Beispiel #4
0
void MainWindow::on_actionReportBug_triggered()
{
	openWebPage(QUrl("https://github.com/MultiMC/MultiMC5/issues"));
}
Beispiel #5
0
void MainWindow::on_actionReportBug_triggered()
{
	openWebPage(QUrl("http://multimc.myjetbrains.com/youtrack/dashboard#newissue=yes"));
}
Beispiel #6
0
void MainWindow::on_actionNews_triggered()
{
	//QDesktopServices::openUrl(QUrl("http://news.forkk.net/"));
	openWebPage ( QUrl ( "http://news.forkk.net/" ) );
}
Beispiel #7
0
void MainWindow::on_actionReportBug_triggered()
{
	//QDesktopServices::openUrl(QUrl("http://bugs.forkk.net/"));
	openWebPage ( QUrl ( "http://bugs.forkk.net/" ) );
}
Beispiel #8
0
Rekall::Rekall(const QStringList &arguments, QWidget *parent) :
    QDialog(parent) {
    trayIconWorking = false;
    trayIconIndex   = 0;
    trayIconIndexOld = 9999;
    Global::rekall = this;

    qApp->setAttribute(Qt::AA_UseHighDpiPixmaps);

    //Update
    updateManager = 0;
    forceUpdate = false;
    firstTimeOpened = newVersionOfRekall = false;
    if(arguments.contains("-forceupdate"))
        forceUpdate = true;

    //Tray icon
    trayTimer.setInterval(500);
    connect(&trayTimer,    SIGNAL(timeout()), SLOT(trayIconToOnPrivate()));
    connect(&trayTimerOff, SIGNAL(timeout()), SLOT(trayIconToOffPrivate()));
    QString prefix = "mac";
#ifdef Q_OS_WIN
    prefix = "win";
#endif
    for(quint16 i = 0 ; i <= 17 ; i++)
        trayIcons << QIcon(QString(":/icons/rekall-menubar-%1-%2.png").arg(prefix).arg(i, 2, 10, QChar('0')));
    trayIcon = new QSystemTrayIcon(this);
    trayIconToOffPrivate();
    trayTimer.start();
    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), SLOT(trayActivated(QSystemTrayIcon::ActivationReason)));

    //Interfaces
    Global::userInfos = new UserInfos(this);
    Global::http      = new Http(this);
    Analyse *analyse  = new Analyse(this);
    Global::analyse   = analyse;
    connect(analyse, SIGNAL(trayChanged(QString,bool)), SLOT(analyseTrayChanged(QString,bool)));
    connect(analyse, SIGNAL(trayIconToOff()), SLOT(trayIconToOff()));
    connect(analyse, SIGNAL(trayIconToOn(qint16)), SLOT(trayIconToOn(qint16)));
    //Wrapper web
    Global::userInfos->setDockIcon(this, false);
    Global::webWrapper = new WebWrapper();

    /*
    VideoPlayer *player = new VideoPlayer();
    player->open(QUrl::fromLocalFile("/Users/guillaume/Documents/Rekall/Walden/Captations/captation WALDEN_TPV.mov"));
    player->seek(4000);
    */

    trayMenu = new QMenu(this);
    trayMenu->setSeparatorsCollapsible(true);
    trayAnalyse      = trayMenu->addAction(tr("File analysis…"));
    trayAnalysePause = trayMenu->addAction(tr("Pause analysis"));
    trayAnalysePause->setCheckable(true);
    connect(trayAnalysePause, SIGNAL(toggled(bool)), SLOT(trayAnalysePaused()));
    trayMenu->addSeparator();
    trayMenu->addAction(tr("Open welcome page"), this, SLOT(openWebPage()));
    trayMenu->addAction(tr("Open welcome page in webrowser"), this, SLOT(openWebPageInBrowser()));
    //trayMenu->addAction(tr("Create a new project"), this, SLOT(addProject()));
    trayMenu->addSeparator();
    trayMenuProjects = trayMenu->addAction(tr("Quit Rekall"), this, SLOT(closeRekall()));
    trayIcon->setContextMenu(trayMenu);
    trayIcon->show();
    trayIconToOnPrivate();

    QSettings settings;
    quint16 projectCount = settings.beginReadArray("projects");
    /*
    if(projectCount == 0) {
        addProject(new Project("walden",     "Walden", true, QFileInfo("/Users/guillaume/Documents/Rekall/Walden"), this));
        addProject(new Project("joris-test", "Joris", false, QFileInfo("/Users/guillaume/Documents/Rekall/joris-test"), this));
    }
    */
    connect(Global::udp, SIGNAL(outgoingMessage(QString,quint16,QString,QList<QVariant>)), SLOT(incomingMessage(QString,quint16,QString,QList<QVariant>)));

    for(quint16 projectIndex = 0 ; projectIndex < projectCount ; projectIndex++) {
        settings.setArrayIndex(projectIndex);
        Project *project = new Project(settings.value("name").toString(), settings.value("friendlyName").toString(), true, QFileInfo(settings.value("path").toString()), this);
        addProject(project);
    }
    settings.endArray();

    //foreach(ProjectInterface *project, Global::projects)
    //    project->load();


    //Global settings creation if needed
    globalSettings = new QSettings();
    if((globalSettings) && ((!globalSettings->childKeys().contains("id")) || (arguments.contains("-newuser")))) {
        firstTimeOpened = true;
        qsrand(QDateTime::currentDateTime().toTime_t());
        updateAnonymousId = QString::number(qrand());
        globalSettings->setValue("id", updateAnonymousId);
        globalSettings->setValue("version", "");
        globalSettings->setValue("updatePeriod", 1);
        globalSettings->setValue("lastUpdate",   QDateTime(QDate(2000, 01, 01)));
    }

    //Update management
    if((globalSettings) && (globalSettings->childKeys().contains("id"))) {
        QDateTime updateLastDate  = globalSettings->value("lastUpdate")  .toDateTime();
        quint16   updatePeriod    = globalSettings->value("updatePeriod").toUInt();
        updateAnonymousId         = globalSettings->value("id")          .toString();
        QString applicationVersionSettings = globalSettings->value("version").toString();
        if(applicationVersionSettings != QCoreApplication::applicationVersion()) {
            globalSettings->setValue("version", QCoreApplication::applicationVersion());
            firstTimeOpened = true;
        }

        qDebug("Last update : %s (should update each %d day(s))", qPrintable(updateLastDate.toString("dd/MM/yyyy hh:mm:ss")), updatePeriod);
        if((updateLastDate.daysTo(QDateTime::currentDateTime()) >= updatePeriod) || (forceUpdate))
            checkForUpdates();
    }

    askScreenshot = askAddProject = 0;
    startTimer(50);
    if(firstTimeOpened)
        showMessage(tr("Welcome!\nRekall is now running!"));
    else
        showMessage(tr("Rekall is now running!"));

    if(!arguments.contains("-silent"))
        openWebPage();

    /*
    QWebView *webView = new QWebView();
    webView->load(QUrl("http://127.0.0.1:23411"));
    webView->show();
    */
}