1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-17 20:09:50 +01:00

Add open in browser action to Grooveshark

This commit is contained in:
Arnaud Bienner 2011-11-23 23:56:02 +01:00
parent 4b8e9b2d82
commit c234afb776
3 changed files with 38 additions and 32 deletions

View File

@ -21,6 +21,7 @@
#include <QApplication>
#include <QClipboard>
#include <QDesktopServices>
#include <QInputDialog>
#include <QMenu>
#include <QMessageBox>
@ -66,6 +67,7 @@ const char* GroovesharkService::kServiceName = "Grooveshark";
const char* GroovesharkService::kSettingsGroup = "Grooveshark";
const char* GroovesharkService::kUrl = "http://api.grooveshark.com/ws/3.0/";
const char* GroovesharkService::kUrlCover = "http://beta.grooveshark.com/static/amazonart/m";
const char* GroovesharkService::kHomepage = "http://grooveshark.com/";
const int GroovesharkService::kSearchDelayMsec = 400;
const int GroovesharkService::kSongSearchLimit = 50;
@ -488,9 +490,14 @@ void GroovesharkService::EnsureMenuCreated() {
context_menu_->addAction(IconLoader::Load("edit-find"), tr("Search Grooveshark (opens a new tab)") + "...", this, SLOT(OpenSearchTab()));
context_menu_->addSeparator();
context_menu_->addAction(IconLoader::Load("configure"), tr("Configure Grooveshark..."), this, SLOT(ShowConfig()));
context_menu_->addAction(IconLoader::Load("download"), tr("Open %1 in browser").arg("grooveshark.com"), this, SLOT(Homepage()));
}
}
void GroovesharkService::Homepage() {
QDesktopServices::openUrl(QUrl(kHomepage));
}
void GroovesharkService::EnsureItemsCreated() {
if (IsLoggedIn() && !search_) {
search_ = new QStandardItem(IconLoader::Load("edit-find"),

View File

@ -159,6 +159,7 @@ class GroovesharkService : public InternetService {
void StreamMarked();
void SongMarkedAsComplete();
void Homepage();
private:
void EnsureMenuCreated();
@ -239,6 +240,7 @@ class GroovesharkService : public InternetService {
static const char* kUrl;
static const char* kUrlCover;
static const char* kHomepage;
static const int kSongSearchLimit;
static const int kSongSimpleSearchLimit;

View File

@ -419,11 +419,11 @@ msgstr ""
msgid "Add stream..."
msgstr ""
#: internet/groovesharkservice.cpp:833
#: internet/groovesharkservice.cpp:840
msgid "Add to Grooveshark favorites"
msgstr ""
#: internet/groovesharkservice.cpp:839
#: internet/groovesharkservice.cpp:846
msgid "Add to Grooveshark playlists"
msgstr ""
@ -467,7 +467,7 @@ msgstr ""
msgid "Added within three months"
msgstr ""
#: internet/groovesharkservice.cpp:1031
#: internet/groovesharkservice.cpp:1038
msgid "Adding song to favorites"
msgstr ""
@ -622,7 +622,7 @@ msgstr ""
msgid "Are you sure you want to delete the \"%1\" preset?"
msgstr ""
#: internet/groovesharkservice.cpp:1003
#: internet/groovesharkservice.cpp:1010
msgid "Are you sure you want to delete this playlist?"
msgstr ""
@ -976,7 +976,7 @@ msgstr ""
msgid "Composer"
msgstr ""
#: internet/groovesharkservice.cpp:490
#: internet/groovesharkservice.cpp:492
msgid "Configure Grooveshark..."
msgstr ""
@ -1029,7 +1029,7 @@ msgstr ""
msgid "Convert any music that the device can't play"
msgstr ""
#: internet/groovesharkservice.cpp:886
#: internet/groovesharkservice.cpp:893
msgid "Copy to clipboard"
msgstr ""
@ -1108,7 +1108,7 @@ msgstr ""
msgid "Covers from %1"
msgstr ""
#: internet/groovesharkservice.cpp:475 internet/groovesharkservice.cpp:955
#: internet/groovesharkservice.cpp:477 internet/groovesharkservice.cpp:962
msgid "Create a new Grooveshark playlist"
msgstr ""
@ -1248,7 +1248,7 @@ msgstr ""
msgid "Delay between visualizations"
msgstr ""
#: internet/groovesharkservice.cpp:478 internet/groovesharkservice.cpp:1002
#: internet/groovesharkservice.cpp:480 internet/groovesharkservice.cpp:1009
msgid "Delete Grooveshark playlist"
msgstr ""
@ -1675,7 +1675,7 @@ msgstr ""
msgid "Fast"
msgstr ""
#: internet/groovesharkservice.cpp:517
#: internet/groovesharkservice.cpp:524
msgid "Favorites"
msgstr ""
@ -1850,11 +1850,11 @@ msgstr ""
msgid "Genre"
msgstr ""
#: internet/groovesharkservice.cpp:850
#: internet/groovesharkservice.cpp:857
msgid "Get an URL to share this Grooveshark song"
msgstr ""
#: internet/groovesharkservice.cpp:660
#: internet/groovesharkservice.cpp:667
msgid "Getting Grooveshark popular songs"
msgstr ""
@ -1900,11 +1900,11 @@ msgstr ""
msgid "Grooveshark"
msgstr ""
#: internet/groovesharkservice.cpp:402
#: internet/groovesharkservice.cpp:404
msgid "Grooveshark login error"
msgstr ""
#: internet/groovesharkservice.cpp:882
#: internet/groovesharkservice.cpp:889
msgid "Grooveshark song's URL"
msgstr ""
@ -2099,7 +2099,7 @@ msgstr ""
msgid "Invalid session key"
msgstr ""
#: internet/groovesharkservice.cpp:395
#: internet/groovesharkservice.cpp:397
msgid "Invalid username and/or password"
msgstr ""
@ -2567,7 +2567,7 @@ msgstr ""
msgid "My Recommendations"
msgstr ""
#: internet/groovesharkservice.cpp:956 ui/equalizer.cpp:172
#: internet/groovesharkservice.cpp:963 ui/equalizer.cpp:172
#: ui_deviceproperties.h:369 ui_magnatunedownloaddialog.h:135
#: ui_wizardfinishpage.h:84 ui_globalshortcutssettingspage.h:174
msgid "Name"
@ -2733,7 +2733,8 @@ msgid "Only show the first"
msgstr ""
#: internet/digitallyimportedservicebase.cpp:178
#: internet/icecastservice.cpp:300 internet/jamendoservice.cpp:414
#: internet/groovesharkservice.cpp:493 internet/icecastservice.cpp:300
#: internet/jamendoservice.cpp:414 internet/magnatuneservice.cpp:271
#: internet/somafmservice.cpp:84
#, qt-format
msgid "Open %1 in browser"
@ -2757,10 +2758,6 @@ msgstr ""
msgid "Open in new playlist"
msgstr ""
#: internet/magnatuneservice.cpp:271
msgid "Open magnatune.com in browser"
msgstr ""
#: ui_globalshortcutssettingspage.h:169 ui_globalshortcutssettingspage.h:171
msgid "Open..."
msgstr ""
@ -2935,11 +2932,11 @@ msgstr ""
msgid "Pop"
msgstr ""
#: internet/groovesharkservice.cpp:503
#: internet/groovesharkservice.cpp:510
msgid "Popular songs of the Month"
msgstr ""
#: internet/groovesharkservice.cpp:510
#: internet/groovesharkservice.cpp:517
msgid "Popular songs today"
msgstr ""
@ -3151,11 +3148,11 @@ msgstr ""
msgid "Remove folder"
msgstr ""
#: internet/groovesharkservice.cpp:485
#: internet/groovesharkservice.cpp:487
msgid "Remove from favorites"
msgstr ""
#: internet/groovesharkservice.cpp:482 ui_mainwindow.h:674
#: internet/groovesharkservice.cpp:484 ui_mainwindow.h:674
msgid "Remove from playlist"
msgstr ""
@ -3163,7 +3160,7 @@ msgstr ""
msgid "Remove playlist"
msgstr ""
#: internet/groovesharkservice.cpp:1089
#: internet/groovesharkservice.cpp:1096
msgid "Removing song from favorites"
msgstr ""
@ -3241,11 +3238,11 @@ msgstr ""
msgid "Results"
msgstr ""
#: internet/groovesharkservice.cpp:631
#: internet/groovesharkservice.cpp:638
msgid "Retrieving Grooveshark favorites songs"
msgstr ""
#: internet/groovesharkservice.cpp:553
#: internet/groovesharkservice.cpp:560
msgid "Retrieving Grooveshark playlists"
msgstr ""
@ -3322,11 +3319,11 @@ msgid "Search"
msgstr ""
#: internet/groovesharksearchplaylisttype.cpp:32
#: internet/groovesharkservice.cpp:768
#: internet/groovesharkservice.cpp:775
msgid "Search Grooveshark"
msgstr ""
#: internet/groovesharkservice.cpp:488 internet/groovesharkservice.cpp:497
#: internet/groovesharkservice.cpp:490 internet/groovesharkservice.cpp:504
msgid "Search Grooveshark (opens a new tab)"
msgstr ""
@ -3378,7 +3375,7 @@ msgstr ""
msgid "Search terms"
msgstr ""
#: internet/groovesharkservice.cpp:262
#: internet/groovesharkservice.cpp:264
msgid "Searching on Grooveshark"
msgstr ""
@ -4072,7 +4069,7 @@ msgstr ""
msgid "Unset cover"
msgstr ""
#: internet/groovesharkservice.cpp:910
#: internet/groovesharkservice.cpp:917
msgid "Update Grooveshark playlist"
msgstr ""
@ -4150,7 +4147,7 @@ msgstr ""
msgid "Used"
msgstr ""
#: internet/groovesharkservice.cpp:398
#: internet/groovesharkservice.cpp:400
#, qt-format
msgid "User %1 doesn't have a Grooveshark Anywhere account"
msgstr ""