Skip to content

Commit

Permalink
cosmetic changes, start center, login, upload, score browser
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Feb 26, 2015
1 parent 5ca436a commit 96c7028
Show file tree
Hide file tree
Showing 11 changed files with 362 additions and 237 deletions.
4 changes: 4 additions & 0 deletions mscore/logindialog.cpp
Expand Up @@ -37,6 +37,10 @@ LoginDialog::LoginDialog(LoginManager* loginManager)
: QDialog(0)
{
setupUi(this);
setStyleSheet("QLineEdit { "
"padding: 8px 8px;"
"}");

setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), SLOT(buttonBoxClicked(QAbstractButton*)));
_loginManager = loginManager;
Expand Down
171 changes: 123 additions & 48 deletions mscore/logindialog.ui
Expand Up @@ -9,14 +9,26 @@
<rect>
<x>0</x>
<y>0</y>
<width>258</width>
<height>292</height>
<width>615</width>
<height>501</height>
</rect>
</property>
<property name="windowTitle">
<string>Log in to MuseScore</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
Expand All @@ -35,59 +47,109 @@
</layout>
</item>
<item>
<widget class="QLabel" name="createAccountLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,2,1">
<item>
<widget class="QLabel" name="label_username">
<property name="text">
<string>Username or email</string>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="usernameEdit">
<property name="placeholderText">
<string>Username or email</string>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</widget>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_password">
<property name="text">
<string>Password</string>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>16</number>
</property>
</widget>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>8</number>
</property>
<item>
<widget class="QLabel" name="label_username">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Username or email</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="usernameEdit">
<property name="placeholderText">
<string>Username or email</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>8</number>
</property>
<item>
<widget class="QLabel" name="label_password">
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Password</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="passwordEdit">
<property name="inputMethodHints">
<set>Qt::ImhHiddenText|Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText|Qt::ImhSensitiveData</set>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<property name="placeholderText">
<string>Password</string>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
<property name="centerButtons">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QLineEdit" name="passwordEdit">
<property name="inputMethodHints">
<set>Qt::ImhHiddenText|Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText|Qt::ImhSensitiveData</set>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="placeholderText">
<string>Password</string>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</widget>
</spacer>
</item>
</layout>
</item>
Expand All @@ -108,9 +170,22 @@
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<widget class="QLabel" name="createAccountLabel">
<property name="font">
<font>
<pointsize>26</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
Expand Down
3 changes: 2 additions & 1 deletion mscore/loginmanager.cpp
Expand Up @@ -313,10 +313,11 @@ void LoginManager::onGetScoreRequestReady(QByteArray ba)
QString sharing = score.value("sharing").toString();
QString license = score.value("license").toString();
QString tags = score.value("tags").toString();
QString url = score.value("custom_url").toString();
if (user.value("uid") != QJsonValue::Undefined) {
int uid = user.value("uid").toString().toInt();
if (uid == _uid)
emit getScoreSuccess(title, description, (sharing == "private"), license, tags);
emit getScoreSuccess(title, description, (sharing == "private"), license, tags, url);
else
emit getScoreError("");
}
Expand Down
2 changes: 1 addition & 1 deletion mscore/loginmanager.h
Expand Up @@ -39,7 +39,7 @@ class LoginManager : public QObject
void getUserError(const QString& error);
void getUserSuccess();
void getScoreError(const QString& error);
void getScoreSuccess(const QString &title, const QString &description, bool priv, const QString& license, const QString& tags);
void getScoreSuccess(const QString &title, const QString &description, bool priv, const QString& license, const QString& tags, const QString& url);
void uploadError(const QString& error);
void uploadSuccess(const QString& url);
void tryLoginSuccess();
Expand Down
4 changes: 2 additions & 2 deletions mscore/scoreBrowser.ui
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
<string notr="true">Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
Expand Down Expand Up @@ -58,7 +58,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>77</width>
<width>209</width>
<height>302</height>
</rect>
</property>
Expand Down
12 changes: 7 additions & 5 deletions mscore/startcenter.cpp
Expand Up @@ -43,16 +43,18 @@ Startcenter::Startcenter()
: QDialog(0)
{
setupUi(this);
setBackgroundRole(QPalette::Window);
setBackgroundRole(QPalette::Base);
setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowModality(Qt::ApplicationModal);
connect(recentPage, &ScoreBrowser::scoreActivated, this, &Startcenter::loadScore);
connect(openScore, SIGNAL(linkActivated(QString)), this, SLOT(openScoreClicked(QString)));
connect(openScore, SIGNAL(clicked()), this, SLOT(openScoreClicked()));
connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));

//init webview
MyWebView* _webView = new MyWebView(this);
_webView->setUrl(QUrl("http://connect2.musescore.com/"));
horizontalLayout->addWidget(_webView);

if (enableExperimental)
QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, false);
Expand Down Expand Up @@ -119,7 +121,7 @@ void Startcenter::updateRecentScores()
// openScoreClicked
//---------------------------------------------------------

void Startcenter::openScoreClicked(const QString & /*link*/)
void Startcenter::openScoreClicked()
{
close();
getAction("file-open")->trigger();
Expand All @@ -144,7 +146,7 @@ void Startcenter::writeSettings(QSettings& settings)
void Startcenter::readSettings(QSettings& settings)
{
settings.beginGroup("Startcenter");
resize(settings.value("size", QSize(740, 500)).toSize());
resize(settings.value("size", QSize(690, 500)).toSize());
move(settings.value("pos", QPoint(200, 100)).toPoint());
settings.endGroup();
}
Expand Down Expand Up @@ -293,7 +295,7 @@ void MyWebView::addToJavascript()

QSize MyWebView::sizeHint() const
{
return QSize(300 * guiScaling, 600 * guiScaling);
return QSize(200 * guiScaling, 600 * guiScaling);
}

//---------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion mscore/startcenter.h
Expand Up @@ -89,7 +89,7 @@ class Startcenter : public QDialog, public Ui::Startcenter
private slots:
void loadScore(QString);
void newScore();
void openScoreClicked(const QString &);
void openScoreClicked();

signals:
void closed(bool);
Expand Down

0 comments on commit 96c7028

Please sign in to comment.