|
|
@ -24,12 +24,12 @@
|
|
|
|
#include "playDialog.h" //::play()
|
|
|
|
#include "playDialog.h" //::play()
|
|
|
|
#include "playlistFile.h"
|
|
|
|
#include "playlistFile.h"
|
|
|
|
#include "mxcl.library.h"
|
|
|
|
#include "mxcl.library.h"
|
|
|
|
#include <qcstring.h>
|
|
|
|
#include <ntqcstring.h>
|
|
|
|
#include <qdesktopwidget.h>
|
|
|
|
#include <ntqdesktopwidget.h>
|
|
|
|
#include <qevent.h> //::stateChanged()
|
|
|
|
#include <ntqevent.h> //::stateChanged()
|
|
|
|
#include <qlayout.h> //ctor
|
|
|
|
#include <ntqlayout.h> //ctor
|
|
|
|
#include <qpopupmenu.h> //because XMLGUI is poorly designed
|
|
|
|
#include <ntqpopupmenu.h> //because XMLGUI is poorly designed
|
|
|
|
#include <qobjectlist.h>
|
|
|
|
#include <ntqobjectlist.h>
|
|
|
|
#include "slider.h"
|
|
|
|
#include "slider.h"
|
|
|
|
#include "theStream.h"
|
|
|
|
#include "theStream.h"
|
|
|
|
#include "volumeAction.h"
|
|
|
|
#include "volumeAction.h"
|
|
|
@ -48,13 +48,13 @@ namespace Codeine {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// @see codeine.h
|
|
|
|
/// @see codeine.h
|
|
|
|
QWidget *mainWindow() { return kapp->mainWidget(); }
|
|
|
|
TQWidget *mainWindow() { return kapp->mainWidget(); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MainWindow::MainWindow()
|
|
|
|
MainWindow::MainWindow()
|
|
|
|
: KMainWindow()
|
|
|
|
: KMainWindow()
|
|
|
|
, m_positionSlider( new Slider( this, 65535 ) )
|
|
|
|
, m_positionSlider( new Slider( this, 65535 ) )
|
|
|
|
, m_timeLabel( new QLabel( " 0:00:00 ", this ) )
|
|
|
|
, m_timeLabel( new TQLabel( " 0:00:00 ", this ) )
|
|
|
|
, m_titleLabel( new KSqueezedTextLabel( this ) )
|
|
|
|
, m_titleLabel( new KSqueezedTextLabel( this ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DEBUG_BLOCK
|
|
|
|
DEBUG_BLOCK
|
|
|
@ -65,11 +65,11 @@ MainWindow::MainWindow()
|
|
|
|
|
|
|
|
|
|
|
|
new VideoWindow( this );
|
|
|
|
new VideoWindow( this );
|
|
|
|
setCentralWidget( videoWindow() );
|
|
|
|
setCentralWidget( videoWindow() );
|
|
|
|
setFocusProxy( videoWindow() ); // essential! See VideoWindow::event(), QEvent::FocusOut
|
|
|
|
setFocusProxy( videoWindow() ); // essential! See VideoWindow::event(), TQEvent::FocusOut
|
|
|
|
|
|
|
|
|
|
|
|
// these have no affect beccause "KDE Knows Best" FFS
|
|
|
|
// these have no affect beccause "KDE Knows Best" FFS
|
|
|
|
setDockEnabled( toolBar(), Qt::DockRight, false ); //doesn't make sense due to our large horizontal slider
|
|
|
|
setDockEnabled( toolBar(), TQt::DockRight, false ); //doesn't make sense due to our large horizontal slider
|
|
|
|
setDockEnabled( toolBar(), Qt::DockLeft, false ); //as above
|
|
|
|
setDockEnabled( toolBar(), TQt::DockLeft, false ); //as above
|
|
|
|
|
|
|
|
|
|
|
|
m_titleLabel->setMargin( 2 );
|
|
|
|
m_titleLabel->setMargin( 2 );
|
|
|
|
m_timeLabel->setFont( KGlobalSettings::fixedFont() );
|
|
|
|
m_timeLabel->setFont( KGlobalSettings::fixedFont() );
|
|
|
@ -78,7 +78,7 @@ MainWindow::MainWindow()
|
|
|
|
|
|
|
|
|
|
|
|
// work around a bug in KStatusBar
|
|
|
|
// work around a bug in KStatusBar
|
|
|
|
// sizeHint width of statusbar seems to get stupidly large quickly
|
|
|
|
// sizeHint width of statusbar seems to get stupidly large quickly
|
|
|
|
statusBar()->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Maximum );
|
|
|
|
statusBar()->setSizePolicy( TQSizePolicy::Ignored, TQSizePolicy::Maximum );
|
|
|
|
|
|
|
|
|
|
|
|
statusBar()->addWidget( m_titleLabel, 1, false );
|
|
|
|
statusBar()->addWidget( m_titleLabel, 1, false );
|
|
|
|
statusBar()->addWidget( m_analyzer = new Analyzer::Block( this ), 0, true );
|
|
|
|
statusBar()->addWidget( m_analyzer = new Analyzer::Block( this ), 0, true );
|
|
|
@ -90,16 +90,16 @@ MainWindow::MainWindow()
|
|
|
|
|
|
|
|
|
|
|
|
// only show dvd button when playing a dvd
|
|
|
|
// only show dvd button when playing a dvd
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct KdeIsTehSuck : public QObject
|
|
|
|
struct KdeIsTehSuck : public TQObject
|
|
|
|
{
|
|
|
|
{
|
|
|
|
virtual bool eventFilter( QObject*, QEvent *e )
|
|
|
|
virtual bool eventFilter( TQObject*, TQEvent *e )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (e->type() != QEvent::LayoutHint)
|
|
|
|
if (e->type() != TQEvent::LayoutHint)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
// basically, KDE shows all tool-buttons, even if they are
|
|
|
|
// basically, KDE shows all tool-buttons, even if they are
|
|
|
|
// hidden after it does any layout operation. Yay for KDE. Yay.
|
|
|
|
// hidden after it does any layout operation. Yay for KDE. Yay.
|
|
|
|
QWidget *button = (QWidget*)((KMainWindow*)mainWindow())->toolBar()->child( "toolbutton_toggle_dvd_menu" );
|
|
|
|
TQWidget *button = (TQWidget*)((KMainWindow*)mainWindow())->toolBar()->child( "toolbutton_toggle_dvd_menu" );
|
|
|
|
if (button)
|
|
|
|
if (button)
|
|
|
|
button->setShown( TheStream::url().protocol() == "dvd" );
|
|
|
|
button->setShown( TheStream::url().protocol() == "dvd" );
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -111,11 +111,11 @@ MainWindow::MainWindow()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QPopupMenu *menu = 0, *settings = static_cast<QPopupMenu*>(factory()->container( "settings", this ));
|
|
|
|
TQPopupMenu *menu = 0, *settings = static_cast<TQPopupMenu*>(factory()->container( "settings", this ));
|
|
|
|
int id = SubtitleChannelsMenuItemId, index = 0;
|
|
|
|
int id = SubtitleChannelsMenuItemId, index = 0;
|
|
|
|
|
|
|
|
|
|
|
|
#define make_menu( name, text ) \
|
|
|
|
#define make_menu( name, text ) \
|
|
|
|
menu = new QPopupMenu( this, name ); \
|
|
|
|
menu = new TQPopupMenu( this, name ); \
|
|
|
|
menu->setCheckable( true ); \
|
|
|
|
menu->setCheckable( true ); \
|
|
|
|
connect( menu, SIGNAL(activated( int )), engine(), SLOT(setStreamParameter( int )) ); \
|
|
|
|
connect( menu, SIGNAL(activated( int )), engine(), SLOT(setStreamParameter( int )) ); \
|
|
|
|
connect( menu, SIGNAL(aboutToShow()), SLOT(aboutToShowMenu()) ); \
|
|
|
|
connect( menu, SIGNAL(aboutToShow()), SLOT(aboutToShowMenu()) ); \
|
|
|
@ -133,7 +133,7 @@ MainWindow::MainWindow()
|
|
|
|
settings->insertSeparator( index );
|
|
|
|
settings->insertSeparator( index );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QObjectList *list = toolBar()->queryList( "KToolBarButton" );
|
|
|
|
TQObjectList *list = toolBar()->queryList( "KToolBarButton" );
|
|
|
|
if (list->isEmpty()) {
|
|
|
|
if (list->isEmpty()) {
|
|
|
|
MessageBox::error( i18n(
|
|
|
|
MessageBox::error( i18n(
|
|
|
|
"<qt>" PRETTY_NAME " could not load its interface, this probably means that " PRETTY_NAME " is not "
|
|
|
|
"<qt>" PRETTY_NAME " could not load its interface, this probably means that " PRETTY_NAME " is not "
|
|
|
@ -154,8 +154,8 @@ MainWindow::MainWindow()
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
//"faster" startup
|
|
|
|
//"faster" startup
|
|
|
|
//TODO if we have a size stored for this video, do the "faster" route
|
|
|
|
//TODO if we have a size stored for this video, do the "faster" route
|
|
|
|
QTimer::singleShot( 0, this, SLOT(init()) );
|
|
|
|
TQTimer::singleShot( 0, this, SLOT(init()) );
|
|
|
|
QApplication::setOverrideCursor( KCursor::waitCursor() ); }
|
|
|
|
TQApplication::setOverrideCursor( KCursor::waitCursor() ); }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
@ -163,10 +163,10 @@ MainWindow::init()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DEBUG_BLOCK
|
|
|
|
DEBUG_BLOCK
|
|
|
|
|
|
|
|
|
|
|
|
connect( engine(), SIGNAL(statusMessage( const QString& )), this, SLOT(engineMessage( const QString& )) );
|
|
|
|
connect( engine(), SIGNAL(statusMessage( const TQString& )), this, SLOT(engineMessage( const TQString& )) );
|
|
|
|
connect( engine(), SIGNAL(stateChanged( Engine::State )), this, SLOT(engineStateChanged( Engine::State )) );
|
|
|
|
connect( engine(), SIGNAL(stateChanged( Engine::State )), this, SLOT(engineStateChanged( Engine::State )) );
|
|
|
|
connect( engine(), SIGNAL(channelsChanged( const QStringList& )), this, SLOT(setChannels( const QStringList& )) );
|
|
|
|
connect( engine(), SIGNAL(channelsChanged( const TQStringList& )), this, SLOT(setChannels( const TQStringList& )) );
|
|
|
|
connect( engine(), SIGNAL(titleChanged( const QString& )), m_titleLabel, SLOT(setText( const QString& )) );
|
|
|
|
connect( engine(), SIGNAL(titleChanged( const TQString& )), m_titleLabel, SLOT(setText( const TQString& )) );
|
|
|
|
connect( m_positionSlider, SIGNAL(valueChanged( int )), this, SLOT(showTime( int )) );
|
|
|
|
connect( m_positionSlider, SIGNAL(valueChanged( int )), this, SLOT(showTime( int )) );
|
|
|
|
|
|
|
|
|
|
|
|
if( !engine()->init() ) {
|
|
|
|
if( !engine()->init() ) {
|
|
|
@ -179,9 +179,9 @@ MainWindow::init()
|
|
|
|
//would be dangerous for these to65535 happen before the videoWindow() is initialised
|
|
|
|
//would be dangerous for these to65535 happen before the videoWindow() is initialised
|
|
|
|
setAcceptDrops( true );
|
|
|
|
setAcceptDrops( true );
|
|
|
|
connect( m_positionSlider, SIGNAL(sliderReleased( uint )), engine(), SLOT(seek( uint )) );
|
|
|
|
connect( m_positionSlider, SIGNAL(sliderReleased( uint )), engine(), SLOT(seek( uint )) );
|
|
|
|
connect( statusBar(), SIGNAL(messageChanged( const QString& )), engine(), SLOT(showOSD( const QString& )) );
|
|
|
|
connect( statusBar(), SIGNAL(messageChanged( const TQString& )), engine(), SLOT(showOSD( const TQString& )) );
|
|
|
|
|
|
|
|
|
|
|
|
QApplication::restoreOverrideCursor();
|
|
|
|
TQApplication::restoreOverrideCursor();
|
|
|
|
|
|
|
|
|
|
|
|
if( !kapp->isRestored() ) {
|
|
|
|
if( !kapp->isRestored() ) {
|
|
|
|
KCmdLineArgs &args = *KCmdLineArgs::parsedArgs();
|
|
|
|
KCmdLineArgs &args = *KCmdLineArgs::parsedArgs();
|
|
|
@ -221,10 +221,10 @@ MainWindow::queryExit()
|
|
|
|
// saving the window state without any controls
|
|
|
|
// saving the window state without any controls
|
|
|
|
fullScreenToggled( false );
|
|
|
|
fullScreenToggled( false );
|
|
|
|
showNormal();
|
|
|
|
showNormal();
|
|
|
|
QApplication::sendPostedEvents( this, 0 );
|
|
|
|
TQApplication::sendPostedEvents( this, 0 );
|
|
|
|
// otherwise KMainWindow saves the screensize as maximised
|
|
|
|
// otherwise KMainWindow saves the screensize as maximised
|
|
|
|
Codeine::MessageBox::sorry(
|
|
|
|
Codeine::MessageBox::sorry(
|
|
|
|
"This annoying messagebox is to get round a bug in either KDE or Qt. "
|
|
|
|
"This annoying messagebox is to get round a bug in either KDE or TQt. "
|
|
|
|
"Just press OK and Codeine will quit." );
|
|
|
|
"Just press OK and Codeine will quit." );
|
|
|
|
//NOTE not actually needed
|
|
|
|
//NOTE not actually needed
|
|
|
|
saveAutoSaveSettings();
|
|
|
|
saveAutoSaveSettings();
|
|
|
@ -278,7 +278,7 @@ MainWindow::readProperties( KConfig *config )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
MainWindow::timerEvent( QTimerEvent* )
|
|
|
|
MainWindow::timerEvent( TQTimerEvent* )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
static int counter = 0;
|
|
|
|
static int counter = 0;
|
|
|
|
|
|
|
|
|
|
|
@ -310,24 +310,24 @@ MainWindow::timerEvent( QTimerEvent* )
|
|
|
|
void
|
|
|
|
void
|
|
|
|
MainWindow::showTime( int pos )
|
|
|
|
MainWindow::showTime( int pos )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#define zeroPad( n ) n < 10 ? QString("0%1").arg( n ) : QString::number( n )
|
|
|
|
#define zeroPad( n ) n < 10 ? TQString("0%1").arg( n ) : TQString::number( n )
|
|
|
|
|
|
|
|
|
|
|
|
const int ms = (pos == -1) ? engine()->time() : int(engine()->length() * (pos / 65535.0));
|
|
|
|
const int ms = (pos == -1) ? engine()->time() : int(engine()->length() * (pos / 65535.0));
|
|
|
|
const int s = ms / 1000;
|
|
|
|
const int s = ms / 1000;
|
|
|
|
const int m = s / 60;
|
|
|
|
const int m = s / 60;
|
|
|
|
const int h = m / 60;
|
|
|
|
const int h = m / 60;
|
|
|
|
|
|
|
|
|
|
|
|
QString time = zeroPad( s % 60 ); //seconds
|
|
|
|
TQString time = zeroPad( s % 60 ); //seconds
|
|
|
|
time.prepend( ':' );
|
|
|
|
time.prepend( ':' );
|
|
|
|
time.prepend( zeroPad( m % 60 ) ); //minutes
|
|
|
|
time.prepend( zeroPad( m % 60 ) ); //minutes
|
|
|
|
time.prepend( ':' );
|
|
|
|
time.prepend( ':' );
|
|
|
|
time.prepend( QString::number( h ) ); //hours
|
|
|
|
time.prepend( TQString::number( h ) ); //hours
|
|
|
|
|
|
|
|
|
|
|
|
m_timeLabel->setText( time );
|
|
|
|
m_timeLabel->setText( time );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
MainWindow::engineMessage( const QString &message )
|
|
|
|
MainWindow::engineMessage( const TQString &message )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
statusBar()->message( message, 3500 );
|
|
|
|
statusBar()->message( message, 3500 );
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -418,7 +418,7 @@ MainWindow::playMedia( bool show_welcome_dialog )
|
|
|
|
|
|
|
|
|
|
|
|
switch( dialog.exec() ) {
|
|
|
|
switch( dialog.exec() ) {
|
|
|
|
case PlayDialog::FILE: {
|
|
|
|
case PlayDialog::FILE: {
|
|
|
|
const QString filter = engine()->fileFilter() + '|' + i18n("Supported Media Formats") + "\n*|" + i18n("All Files");
|
|
|
|
const TQString filter = engine()->fileFilter() + '|' + i18n("Supported Media Formats") + "\n*|" + i18n("All Files");
|
|
|
|
const KURL url = KFileDialog::getOpenURL( ":default", filter, this, i18n("Select A File To Play") );
|
|
|
|
const KURL url = KFileDialog::getOpenURL( ":default", filter, this, i18n("Select A File To Play") );
|
|
|
|
open( url );
|
|
|
|
open( url );
|
|
|
|
} break;
|
|
|
|
} break;
|
|
|
@ -437,16 +437,16 @@ MainWindow::playMedia( bool show_welcome_dialog )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class FullScreenToolBarHandler : QObject
|
|
|
|
class FullScreenToolBarHandler : TQObject
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KToolBar *m_toolbar;
|
|
|
|
KToolBar *m_toolbar;
|
|
|
|
int m_timer_id;
|
|
|
|
int m_timer_id;
|
|
|
|
bool m_stay_hidden_for_a_bit;
|
|
|
|
bool m_stay_hidden_for_a_bit;
|
|
|
|
QPoint m_home;
|
|
|
|
TQPoint m_home;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
FullScreenToolBarHandler( KMainWindow *parent )
|
|
|
|
FullScreenToolBarHandler( KMainWindow *parent )
|
|
|
|
: QObject( parent )
|
|
|
|
: TQObject( parent )
|
|
|
|
, m_toolbar( parent->toolBar() )
|
|
|
|
, m_toolbar( parent->toolBar() )
|
|
|
|
, m_timer_id( 0 )
|
|
|
|
, m_timer_id( 0 )
|
|
|
|
, m_stay_hidden_for_a_bit( false )
|
|
|
|
, m_stay_hidden_for_a_bit( false )
|
|
|
@ -457,12 +457,12 @@ public:
|
|
|
|
m_toolbar->installEventFilter( this );
|
|
|
|
m_toolbar->installEventFilter( this );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool eventFilter( QObject *o, QEvent *e )
|
|
|
|
bool eventFilter( TQObject *o, TQEvent *e )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (o == parent() && e->type() == QEvent::MouseMove) {
|
|
|
|
if (o == parent() && e->type() == TQEvent::MouseMove) {
|
|
|
|
killTimer( m_timer_id );
|
|
|
|
killTimer( m_timer_id );
|
|
|
|
|
|
|
|
|
|
|
|
QMouseEvent const * const me = (QMouseEvent*)e;
|
|
|
|
TQMouseEvent const * const me = (TQMouseEvent*)e;
|
|
|
|
if (m_stay_hidden_for_a_bit) {
|
|
|
|
if (m_stay_hidden_for_a_bit) {
|
|
|
|
// wait for a small pause before showing the toolbar again
|
|
|
|
// wait for a small pause before showing the toolbar again
|
|
|
|
// usage = user removes mouse from toolbar after using it
|
|
|
|
// usage = user removes mouse from toolbar after using it
|
|
|
@ -485,7 +485,7 @@ public:
|
|
|
|
// then cursor has moved far enough to trigger show toolbar
|
|
|
|
// then cursor has moved far enough to trigger show toolbar
|
|
|
|
show_toolbar:
|
|
|
|
show_toolbar:
|
|
|
|
m_toolbar->show(),
|
|
|
|
m_toolbar->show(),
|
|
|
|
m_home = QPoint();
|
|
|
|
m_home = TQPoint();
|
|
|
|
else
|
|
|
|
else
|
|
|
|
// cursor hasn't moved far enough yet
|
|
|
|
// cursor hasn't moved far enough yet
|
|
|
|
// don't reset timer below, return instead
|
|
|
|
// don't reset timer below, return instead
|
|
|
@ -497,22 +497,22 @@ show_toolbar:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (o == parent() && e->type() == QEvent::Resize)
|
|
|
|
if (o == parent() && e->type() == TQEvent::Resize)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//we aren't managed by mainWindow when at FullScreen
|
|
|
|
//we aren't managed by mainWindow when at FullScreen
|
|
|
|
videoWindow()->move( 0, 0 );
|
|
|
|
videoWindow()->move( 0, 0 );
|
|
|
|
videoWindow()->resize( ((QWidget*)o)->size() );
|
|
|
|
videoWindow()->resize( ((TQWidget*)o)->size() );
|
|
|
|
videoWindow()->lower();
|
|
|
|
videoWindow()->lower();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (o == m_toolbar)
|
|
|
|
if (o == m_toolbar)
|
|
|
|
switch (e->type()) {
|
|
|
|
switch (e->type()) {
|
|
|
|
case QEvent::Enter:
|
|
|
|
case TQEvent::Enter:
|
|
|
|
m_stay_hidden_for_a_bit = false;
|
|
|
|
m_stay_hidden_for_a_bit = false;
|
|
|
|
killTimer( m_timer_id );
|
|
|
|
killTimer( m_timer_id );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case QEvent::Leave:
|
|
|
|
case TQEvent::Leave:
|
|
|
|
m_toolbar->hide();
|
|
|
|
m_toolbar->hide();
|
|
|
|
m_stay_hidden_for_a_bit = true;
|
|
|
|
m_stay_hidden_for_a_bit = true;
|
|
|
|
killTimer( m_timer_id );
|
|
|
|
killTimer( m_timer_id );
|
|
|
@ -525,7 +525,7 @@ show_toolbar:
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void timerEvent( QTimerEvent* )
|
|
|
|
void timerEvent( TQTimerEvent* )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (m_stay_hidden_for_a_bit)
|
|
|
|
if (m_stay_hidden_for_a_bit)
|
|
|
|
;
|
|
|
|
;
|
|
|
@ -546,8 +546,8 @@ MainWindow::fullScreenToggled( bool isFullScreen )
|
|
|
|
DEBUG_FUNC_INFO
|
|
|
|
DEBUG_FUNC_INFO
|
|
|
|
|
|
|
|
|
|
|
|
if( isFullScreen )
|
|
|
|
if( isFullScreen )
|
|
|
|
toolBar()->setPalette( palette() ), // due to 2px spacing in QMainWindow :(
|
|
|
|
toolBar()->setPalette( palette() ), // due to 2px spacing in TQMainWindow :(
|
|
|
|
setPaletteBackgroundColor( Qt::black ); // due to 2px spacing
|
|
|
|
setPaletteBackgroundColor( TQt::black ); // due to 2px spacing
|
|
|
|
else
|
|
|
|
else
|
|
|
|
toolBar()->unsetPalette(),
|
|
|
|
toolBar()->unsetPalette(),
|
|
|
|
unsetPalette();
|
|
|
|
unsetPalette();
|
|
|
@ -555,7 +555,7 @@ MainWindow::fullScreenToggled( bool isFullScreen )
|
|
|
|
toolBar()->setMovingEnabled( !isFullScreen );
|
|
|
|
toolBar()->setMovingEnabled( !isFullScreen );
|
|
|
|
toolBar()->setHidden( isFullScreen && engine()->state() == Engine::Playing );
|
|
|
|
toolBar()->setHidden( isFullScreen && engine()->state() == Engine::Playing );
|
|
|
|
|
|
|
|
|
|
|
|
reinterpret_cast<QWidget*>(menuBar())->setHidden( isFullScreen );
|
|
|
|
reinterpret_cast<TQWidget*>(menuBar())->setHidden( isFullScreen );
|
|
|
|
statusBar()->setHidden( isFullScreen );
|
|
|
|
statusBar()->setHidden( isFullScreen );
|
|
|
|
|
|
|
|
|
|
|
|
setMouseTracking( isFullScreen ); /// @see mouseMoveEvent()
|
|
|
|
setMouseTracking( isFullScreen ); /// @see mouseMoveEvent()
|
|
|
@ -572,7 +572,7 @@ MainWindow::fullScreenToggled( bool isFullScreen )
|
|
|
|
void
|
|
|
|
void
|
|
|
|
MainWindow::configure()
|
|
|
|
MainWindow::configure()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const QCString sender = this->sender()->name();
|
|
|
|
const TQCString sender = this->sender()->name();
|
|
|
|
|
|
|
|
|
|
|
|
if( sender == "video_settings" )
|
|
|
|
if( sender == "video_settings" )
|
|
|
|
Codeine::showVideoSettingsDialog( this );
|
|
|
|
Codeine::showVideoSettingsDialog( this );
|
|
|
@ -588,15 +588,15 @@ MainWindow::streamInformation()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
MainWindow::setChannels( const QStringList &channels )
|
|
|
|
MainWindow::setChannels( const TQStringList &channels )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DEBUG_FUNC_INFO
|
|
|
|
DEBUG_FUNC_INFO
|
|
|
|
|
|
|
|
|
|
|
|
//TODO -1 = auto
|
|
|
|
//TODO -1 = auto
|
|
|
|
|
|
|
|
|
|
|
|
QStringList::ConstIterator it = channels.begin();
|
|
|
|
TQStringList::ConstIterator it = channels.begin();
|
|
|
|
|
|
|
|
|
|
|
|
QPopupMenu *menu = (QPopupMenu*)child( (*it).latin1() );
|
|
|
|
TQPopupMenu *menu = (TQPopupMenu*)child( (*it).latin1() );
|
|
|
|
menu->clear();
|
|
|
|
menu->clear();
|
|
|
|
|
|
|
|
|
|
|
|
menu->insertItem( i18n("&Determine Automatically"), 1 );
|
|
|
|
menu->insertItem( i18n("&Determine Automatically"), 1 );
|
|
|
@ -604,10 +604,10 @@ MainWindow::setChannels( const QStringList &channels )
|
|
|
|
|
|
|
|
|
|
|
|
//the id is crucial, since the slot this menu is connected to requires
|
|
|
|
//the id is crucial, since the slot this menu is connected to requires
|
|
|
|
//that information to set the correct channel
|
|
|
|
//that information to set the correct channel
|
|
|
|
//NOTE we subtract 2 in xineEngine because QMenuData doesn't allow negative id
|
|
|
|
//NOTE we subtract 2 in xineEngine because TQMenuData doesn't allow negative id
|
|
|
|
int id = 2;
|
|
|
|
int id = 2;
|
|
|
|
++it;
|
|
|
|
++it;
|
|
|
|
for( QStringList::ConstIterator const end = channels.end(); it != end; ++it, ++id )
|
|
|
|
for( TQStringList::ConstIterator const end = channels.end(); it != end; ++it, ++id )
|
|
|
|
menu->insertItem( *it, id );
|
|
|
|
menu->insertItem( *it, id );
|
|
|
|
|
|
|
|
|
|
|
|
menu->insertSeparator();
|
|
|
|
menu->insertSeparator();
|
|
|
@ -620,8 +620,8 @@ MainWindow::setChannels( const QStringList &channels )
|
|
|
|
void
|
|
|
|
void
|
|
|
|
MainWindow::aboutToShowMenu()
|
|
|
|
MainWindow::aboutToShowMenu()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QPopupMenu *menu = (QPopupMenu*)sender();
|
|
|
|
TQPopupMenu *menu = (TQPopupMenu*)sender();
|
|
|
|
QCString name( sender() ? sender()->name() : 0 );
|
|
|
|
TQCString name( sender() ? sender()->name() : 0 );
|
|
|
|
|
|
|
|
|
|
|
|
// uncheck all items first
|
|
|
|
// uncheck all items first
|
|
|
|
for( uint x = 0; x < menu->count(); ++x )
|
|
|
|
for( uint x = 0; x < menu->count(); ++x )
|
|
|
@ -639,13 +639,13 @@ MainWindow::aboutToShowMenu()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
MainWindow::dragEnterEvent( QDragEnterEvent *e )
|
|
|
|
MainWindow::dragEnterEvent( TQDragEnterEvent *e )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
e->accept( KURLDrag::canDecode( e ) );
|
|
|
|
e->accept( KURLDrag::canDecode( e ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
MainWindow::dropEvent( QDropEvent *e )
|
|
|
|
MainWindow::dropEvent( TQDropEvent *e )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KURL::List list;
|
|
|
|
KURL::List list;
|
|
|
|
KURLDrag::decode( e, list );
|
|
|
|
KURLDrag::decode( e, list );
|
|
|
@ -657,7 +657,7 @@ MainWindow::dropEvent( QDropEvent *e )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
MainWindow::keyPressEvent( QKeyEvent *e )
|
|
|
|
MainWindow::keyPressEvent( TQKeyEvent *e )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#define seek( step ) { \
|
|
|
|
#define seek( step ) { \
|
|
|
|
const int new_pos = m_positionSlider->value() step; \
|
|
|
|
const int new_pos = m_positionSlider->value() step; \
|
|
|
@ -666,8 +666,8 @@ MainWindow::keyPressEvent( QKeyEvent *e )
|
|
|
|
|
|
|
|
|
|
|
|
switch( e->key() )
|
|
|
|
switch( e->key() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case Qt::Key_Left: seek( -500 ); break;
|
|
|
|
case TQt::Key_Left: seek( -500 ); break;
|
|
|
|
case Qt::Key_Right: seek( +500 ); break;
|
|
|
|
case TQt::Key_Right: seek( +500 ); break;
|
|
|
|
case Key_Escape: KWin::clearState( winId(), NET::FullScreen );
|
|
|
|
case Key_Escape: KWin::clearState( winId(), NET::FullScreen );
|
|
|
|
default: ;
|
|
|
|
default: ;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -675,11 +675,11 @@ MainWindow::keyPressEvent( QKeyEvent *e )
|
|
|
|
#undef seek
|
|
|
|
#undef seek
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QPopupMenu*
|
|
|
|
TQPopupMenu*
|
|
|
|
MainWindow::menu( const char *name )
|
|
|
|
MainWindow::menu( const char *name )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// KXMLGUI is "really good".
|
|
|
|
// KXMLGUI is "really good".
|
|
|
|
return static_cast<QPopupMenu*>(factory()->container( name, this ));
|
|
|
|
return static_cast<TQPopupMenu*>(factory()->container( name, this ));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|