Changeset View
Changeset View
Standalone View
Standalone View
src/ActionClasses.cpp
Show All 14 Lines | |||||
15 | * You should have received a copy of the GNU General Public License along with * | 15 | * You should have received a copy of the GNU General Public License along with * | ||
16 | * this program. If not, see <http://www.gnu.org/licenses/>. * | 16 | * this program. If not, see <http://www.gnu.org/licenses/>. * | ||
17 | ****************************************************************************************/ | 17 | ****************************************************************************************/ | ||
18 | 18 | | |||
19 | #define DEBUG_PREFIX "ActionClasses" | 19 | #define DEBUG_PREFIX "ActionClasses" | ||
20 | 20 | | |||
21 | #include "ActionClasses.h" | 21 | #include "ActionClasses.h" | ||
22 | 22 | | |||
23 | | ||||
24 | #include "App.h" | 23 | #include "App.h" | ||
25 | #include "EngineController.h" | 24 | #include "EngineController.h" | ||
25 | #include "KNotificationBackend.h" | ||||
26 | #include "MainWindow.h" | 26 | #include "MainWindow.h" | ||
27 | #include "aboutdialog/OcsData.h" | ||||
27 | #include "amarokconfig.h" | 28 | #include "amarokconfig.h" | ||
28 | #include <config.h> | 29 | #include <config.h> | ||
29 | #include "core/support/Amarok.h" | 30 | #include "core/support/Amarok.h" | ||
30 | #include "core/support/Debug.h" | 31 | #include "core/support/Debug.h" | ||
31 | #include "playlist/PlaylistActions.h" | 32 | #include "playlist/PlaylistActions.h" | ||
32 | #include "playlist/PlaylistModelStack.h" | 33 | #include "playlist/PlaylistModelStack.h" | ||
33 | #include "widgets/Osd.h" | 34 | #include "widgets/Osd.h" | ||
34 | #include "KNotificationBackend.h" | 35 | | ||
36 | #include <QKeySequence> | ||||
35 | 37 | | |||
36 | #include <KAuthorized> | 38 | #include <KAuthorized> | ||
37 | #include <KHelpMenu> | 39 | #include <KHelpMenu> | ||
38 | #include <KLocale> | 40 | #include <KLocalizedString> | ||
39 | #include <KToolBar> | 41 | #include <KToolBar> | ||
40 | #include <KGlobalAccel> | 42 | #include <KGlobalAccel> | ||
41 | #include <QKeySequence> | | |||
42 | 43 | | |||
43 | extern OcsData ocsData; | 44 | extern OcsData ocsData; | ||
44 | 45 | | |||
45 | namespace Amarok | 46 | namespace Amarok | ||
46 | { | 47 | { | ||
47 | bool favorNone() { return AmarokConfig::favorTracks() == AmarokConfig::EnumFavorTracks::Off; } | 48 | bool favorNone() { return AmarokConfig::favorTracks() == AmarokConfig::EnumFavorTracks::Off; } | ||
48 | bool favorScores() { return AmarokConfig::favorTracks() == AmarokConfig::EnumFavorTracks::HigherScores; } | 49 | bool favorScores() { return AmarokConfig::favorTracks() == AmarokConfig::EnumFavorTracks::HigherScores; } | ||
49 | bool favorRatings() { return AmarokConfig::favorTracks() == AmarokConfig::EnumFavorTracks::HigherRatings; } | 50 | bool favorRatings() { return AmarokConfig::favorTracks() == AmarokConfig::EnumFavorTracks::HigherRatings; } | ||
▲ Show 20 Lines • Show All 384 Lines • ▼ Show 20 Line(s) | 434 | if( engine->isStopped() ) | |||
434 | stopped(); | 435 | stopped(); | ||
435 | else | 436 | else | ||
436 | playing(); | 437 | playing(); | ||
437 | 438 | | |||
438 | connect( engine, &EngineController::stopped, | 439 | connect( engine, &EngineController::stopped, | ||
439 | this, &StopAction::stopped ); | 440 | this, &StopAction::stopped ); | ||
440 | connect( engine, &EngineController::trackPlaying, | 441 | connect( engine, &EngineController::trackPlaying, | ||
441 | this, &StopAction::playing ); | 442 | this, &StopAction::playing ); | ||
442 | | ||||
443 | } | 443 | } | ||
444 | 444 | | |||
445 | void | 445 | void | ||
446 | StopAction::stopped() | 446 | StopAction::stopped() | ||
447 | { | 447 | { | ||
448 | setEnabled( false ); | 448 | setEnabled( false ); | ||
449 | } | 449 | } | ||
450 | 450 | | |||
451 | void | 451 | void | ||
452 | StopAction::playing() | 452 | StopAction::playing() | ||
453 | { | 453 | { | ||
454 | setEnabled( true ); | 454 | setEnabled( true ); | ||
455 | } | 455 | } | ||
456 | 456 | | |||
457 | void | 457 | void | ||
458 | StopAction::stop() | 458 | StopAction::stop() | ||
459 | { | 459 | { | ||
460 | The::engineController()->stop(); | 460 | The::engineController()->stop(); | ||
461 | } | 461 | } | ||
462 | 462 | | |||
463 | | ||||
464 | ////////////////////////////////////////////////////////////////////////////////////////// | 463 | ////////////////////////////////////////////////////////////////////////////////////////// | ||
465 | // StopPlayingAfterCurrentTrackAction | 464 | // StopPlayingAfterCurrentTrackAction | ||
466 | ////////////////////////////////////////////////////////////////////////////////////////// | 465 | ////////////////////////////////////////////////////////////////////////////////////////// | ||
467 | 466 | | |||
468 | StopPlayingAfterCurrentTrackAction::StopPlayingAfterCurrentTrackAction( KActionCollection *ac, QObject *parent ) | 467 | StopPlayingAfterCurrentTrackAction::StopPlayingAfterCurrentTrackAction( KActionCollection *ac, QObject *parent ) | ||
469 | : QAction( parent ) | 468 | : QAction( parent ) | ||
470 | { | 469 | { | ||
471 | ac->addAction( "stop_after_current", this ); | 470 | ac->addAction( "stop_after_current", this ); | ||
Show All 32 Lines |