2014-11-10 10:10:37 +01:00
|
|
|
//=============================================================================
|
|
|
|
// MuseScore
|
|
|
|
// Music Composition & Notation
|
|
|
|
//
|
|
|
|
// Copyright (C) 2014 Werner Schweer
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License version 2
|
|
|
|
// as published by the Free Software Foundation and appearing in
|
|
|
|
// the file LICENCE.GPL
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
#ifndef __STARTCENTER_H__
|
|
|
|
#define __STARTCENTER_H__
|
|
|
|
|
2014-11-10 12:30:53 +01:00
|
|
|
#include "ui_startcenter.h"
|
2014-12-19 16:30:18 +01:00
|
|
|
#include "thirdparty/qtwaitingspinner/QtWaitingSpinner.h"
|
2014-11-10 12:30:53 +01:00
|
|
|
|
2014-11-10 10:10:37 +01:00
|
|
|
namespace Ms {
|
|
|
|
|
2014-12-19 16:30:18 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// MyNetworkAccessManager
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
class MyNetworkAccessManager: public QNetworkAccessManager
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
MyNetworkAccessManager(QObject *parent) : QNetworkAccessManager(parent) {}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
QNetworkReply * createRequest(Operation op,
|
|
|
|
const QNetworkRequest & req,
|
|
|
|
QIODevice * outgoingData = 0);
|
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// MyWebView
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
class MyWebView: public QWebView
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
QtWaitingSpinner* _loadingSpinner;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void link(const QUrl& url);
|
|
|
|
void setBusy();
|
|
|
|
void stopBusy(bool val);
|
2014-12-19 20:30:34 +01:00
|
|
|
void addToJavascript();
|
2014-12-19 16:30:18 +01:00
|
|
|
|
|
|
|
#ifndef QT_NO_OPENSSL
|
|
|
|
void ignoreSSLErrors(QNetworkReply *reply, QList<QSslError> sslErrors);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
public:
|
|
|
|
MyWebView(QWidget *parent = 0);
|
|
|
|
~MyWebView();
|
|
|
|
virtual QSize sizeHint () const;
|
|
|
|
};
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
|
|
|
// CookieJar
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
class CookieJar : public QNetworkCookieJar
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
CookieJar(QString path, QObject *parent = 0); //load cookie
|
|
|
|
~CookieJar(); //save cookies
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString file; // where to save cookies
|
|
|
|
};
|
|
|
|
|
2014-11-10 10:10:37 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// Startcenter
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2014-11-10 12:30:53 +01:00
|
|
|
class Startcenter : public QDialog, public Ui::Startcenter
|
2014-11-10 10:10:37 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2014-12-19 16:30:18 +01:00
|
|
|
MyWebView* _webView;
|
2014-11-10 12:30:53 +01:00
|
|
|
virtual void closeEvent(QCloseEvent*);
|
2014-11-10 10:10:37 +01:00
|
|
|
|
2014-11-12 15:01:08 +01:00
|
|
|
private slots:
|
2014-11-19 14:26:20 +01:00
|
|
|
void loadScore(QString);
|
|
|
|
void newScore();
|
2015-02-26 18:11:39 +01:00
|
|
|
void openScoreClicked();
|
2014-11-12 15:01:08 +01:00
|
|
|
|
2014-11-10 10:10:37 +01:00
|
|
|
signals:
|
|
|
|
void closed(bool);
|
|
|
|
|
|
|
|
public:
|
2014-11-10 12:30:53 +01:00
|
|
|
Startcenter();
|
2014-12-19 16:30:18 +01:00
|
|
|
~Startcenter();
|
2014-11-12 16:36:40 +01:00
|
|
|
void updateRecentScores();
|
2014-11-14 11:44:48 +01:00
|
|
|
void writeSettings(QSettings&);
|
|
|
|
void readSettings(QSettings&);
|
2014-11-10 10:10:37 +01:00
|
|
|
};
|
|
|
|
|
2014-12-19 16:30:18 +01:00
|
|
|
}
|
2014-11-10 10:10:37 +01:00
|
|
|
#endif
|
|
|
|
|