summaryrefslogtreecommitdiffstats
path: root/src/app/actions.cpp
blob: 1612a575c224464b7282525a34dfa2f07e3b79b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright 2005 Max Howell ([email protected])
// See COPYING file for licensing information

#include "actions.h"
#include "debug.h"
#include "mxcl.library.h"
#include <ntqtoolbutton.h>
#include "xineEngine.h"

namespace Codeine
{
   PlayAction::PlayAction( TQObject *receiver, const char *slot, TDEActionCollection *ac )
         : TDEToggleAction( i18n("Play"), "player_play", TQt::Key_Space, receiver, slot, ac, "play" )
   {}

   void
   PlayAction::setChecked( bool b )
   {
      if( videoWindow()->state() == Engine::Empty && sender() && TQCString(sender()->className()) == "TDEToolBarButton" ) {
         // clicking play when empty means open PlayMediaDialog, but we have to uncheck the toolbar button
         // as KDElibs sets that checked automatically..
         ((TQToolButton*)sender())->setOn( false );
      }
      else
         TDEToggleAction::setChecked( b );
   }
}