Skip to content

Commit

Permalink
add button to copy revision number in aboutbox. Revision number is re…
Browse files Browse the repository at this point in the history
…ady to be pasted on musescore.org and will turn into a Github link
  • Loading branch information
lasconic committed May 30, 2012
1 parent e4e1334 commit 4b4c75d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 6 deletions.
37 changes: 32 additions & 5 deletions mscore/aboutbox.ui
Expand Up @@ -585,11 +585,38 @@
</widget>
</item>
<item>
<widget class="QLabel" name="revisionLabel">
<property name="text">
<string notr="true" comment="do not translate">Revision: 628</string>
</property>
</widget>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="revisionLabel">
<property name="text">
<string notr="true" comment="do not translate">Revision: 628</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="copyRevisionButton">
<property name="toolTip">
<string>Copy revision number</string>
</property>
<property name="text">
<string></string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="copyrightLabel">
Expand Down
17 changes: 16 additions & 1 deletion mscore/musescore.cpp
Expand Up @@ -2848,7 +2848,7 @@ void MuseScore::reportBug()
{
QString url("http://musescore.org/en/node/add/project-issue/musescore?sha=");
url += revision();
QDesktopServices::openUrl(QUrl(url.trimmed());
QDesktopServices::openUrl(QUrl(url.trimmed()));
}

//---------------------------------------------------------
Expand Down Expand Up @@ -2876,6 +2876,21 @@ AboutBoxDialog::AboutBoxDialog()
#endif
revisionLabel->setText(tr("Revision: %1").arg(revision));
setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
#ifdef MSCORE_UNSTABLE
copyRevisionButton->setIcon(*icons[copy_ICON]);
connect(copyRevisionButton, SIGNAL(clicked()), this, SLOT(copyRevisionToClipboard()));
#else
copyRevisionButton->hide();
#endif
}

//---------------------------------------------------------
// copyRevisionToClipboard
//---------------------------------------------------------
void AboutBoxDialog::copyRevisionToClipboard()
{
QClipboard* cb = QApplication::clipboard();
cb->setText(QString("github-musescore-musescore-") + revision);
}

//---------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions mscore/musescore.h
Expand Up @@ -125,6 +125,8 @@ class AboutBoxDialog : public QDialog, Ui::AboutBox {

public:
AboutBoxDialog();
private slots:
void copyRevisionToClipboard();
};

//---------------------------------------------------------
Expand Down

0 comments on commit 4b4c75d

Please sign in to comment.