|
|
|
@ -11,7 +11,6 @@
|
|
|
|
|
#include <kcursor.h>
|
|
|
|
|
#include <tdefiledialog.h> //::open()
|
|
|
|
|
#include <tdeglobalsettings.h> //::timerEvent()
|
|
|
|
|
#include <tdepopupmenu.h>
|
|
|
|
|
#include <tdeio/netaccess.h>
|
|
|
|
|
#include <ksqueezedtextlabel.h>
|
|
|
|
|
#include <kstatusbar.h>
|
|
|
|
@ -19,17 +18,16 @@
|
|
|
|
|
#include <kurldrag.h>
|
|
|
|
|
#include <twin.h>
|
|
|
|
|
#include <tqcstring.h>
|
|
|
|
|
#include <tqdesktopwidget.h>
|
|
|
|
|
#include <tqevent.h> //::stateChanged()
|
|
|
|
|
#include <tqlayout.h> //ctor
|
|
|
|
|
#include <tqpopupmenu.h> //because XMLGUI is poorly designed
|
|
|
|
|
#include <tqobjectlist.h>
|
|
|
|
|
#include <tqwidgetstack.h>
|
|
|
|
|
|
|
|
|
|
#include "../debug.h"
|
|
|
|
|
#include "../mxcl.library.h"
|
|
|
|
|
#include "actions.h"
|
|
|
|
|
#include "analyzer.h"
|
|
|
|
|
#include "audioView.h"
|
|
|
|
|
#include "codeineConfig.h"
|
|
|
|
|
#include "extern.h" //dialog creation function definitions
|
|
|
|
|
#include "fullScreenAction.h"
|
|
|
|
@ -50,15 +48,12 @@ extern "C"
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
constexpr auto kAspectSelectActionName = "aspect_ratio_select";
|
|
|
|
|
constexpr auto kAudioSelectActionName = "audio_channels_select";
|
|
|
|
|
constexpr auto kSubtitleSelectActionName = "subtitle_channels_select";
|
|
|
|
|
|
|
|
|
|
namespace Codeine {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// @see codeine.h
|
|
|
|
|
TQWidget *mainWindow() { return tdeApp->mainWidget(); }
|
|
|
|
|
TQWidget *mainWindow() { return kapp->mainWidget(); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MainWindow::MainWindow()
|
|
|
|
@ -71,21 +66,10 @@ MainWindow::MainWindow()
|
|
|
|
|
|
|
|
|
|
clearWFlags( WDestructiveClose ); //we are allocated on the stack
|
|
|
|
|
|
|
|
|
|
tdeApp->setMainWidget( this );
|
|
|
|
|
|
|
|
|
|
m_widgetStack = new TQWidgetStack(this, "m_widgetStack");
|
|
|
|
|
kapp->setMainWidget( this );
|
|
|
|
|
|
|
|
|
|
new VideoWindow( this );
|
|
|
|
|
|
|
|
|
|
m_audioView = new AudioView(this, "m_audioView");
|
|
|
|
|
|
|
|
|
|
// videoWindow() will be the initial widget.
|
|
|
|
|
// m_audioView is raised when no video track is present.
|
|
|
|
|
m_widgetStack->addWidget(videoWindow());
|
|
|
|
|
m_widgetStack->addWidget(m_audioView);
|
|
|
|
|
|
|
|
|
|
setCentralWidget(m_widgetStack);
|
|
|
|
|
|
|
|
|
|
setCentralWidget( videoWindow() );
|
|
|
|
|
setFocusProxy( videoWindow() ); // essential! See VideoWindow::event(), TQEvent::FocusOut
|
|
|
|
|
|
|
|
|
|
// these have no affect beccause "KDE Knows Best" FFS
|
|
|
|
@ -109,9 +93,6 @@ MainWindow::MainWindow()
|
|
|
|
|
setStandardToolBarMenuEnabled( false ); //bah to setupGUI()!
|
|
|
|
|
toolBar()->show(); //it's possible it would be hidden, but we don't want that as no UI way to show it!
|
|
|
|
|
|
|
|
|
|
m_showAnalyzer = config("MainWindow")->readBoolEntry("showAnalyzer", true);
|
|
|
|
|
m_analyzer->setShown(m_showAnalyzer);
|
|
|
|
|
|
|
|
|
|
// only show dvd button when playing a dvd
|
|
|
|
|
{
|
|
|
|
|
struct KdeIsTehSuck : public TQObject
|
|
|
|
@ -135,27 +116,26 @@ MainWindow::MainWindow()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
/* Disable aspect/channel menus until the stream has loaded;
|
|
|
|
|
* Make sure they have the same default item selected. */
|
|
|
|
|
TQStringList defaultItems("&Determine Automatically");
|
|
|
|
|
if (const auto aspectAction = dynamic_cast<TDESelectAction *>(action(kAspectSelectActionName)))
|
|
|
|
|
{
|
|
|
|
|
aspectAction->setToolTip(i18n("Aspect Ratio"));
|
|
|
|
|
insertAspectRatioMenuItems(aspectAction);
|
|
|
|
|
aspectAction->setEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
if (const auto audioChannelAction = dynamic_cast<TDESelectAction *>(action(kAudioSelectActionName)))
|
|
|
|
|
{
|
|
|
|
|
audioChannelAction->setToolTip(i18n("Audio Channels"));
|
|
|
|
|
audioChannelAction->setItems(defaultItems);
|
|
|
|
|
audioChannelAction->setEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
if (const auto subChannelAction = dynamic_cast<TDESelectAction *>(action(kSubtitleSelectActionName)))
|
|
|
|
|
{
|
|
|
|
|
subChannelAction->setToolTip(i18n("Subtitles"));
|
|
|
|
|
subChannelAction->setItems(defaultItems);
|
|
|
|
|
subChannelAction->setEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
TQPopupMenu *menu = 0, *settings = static_cast<TQPopupMenu*>(factory()->container( "settings", this ));
|
|
|
|
|
int id = SubtitleChannelsMenuItemId, index = 0;
|
|
|
|
|
|
|
|
|
|
#define make_menu( name, text ) \
|
|
|
|
|
menu = new TQPopupMenu( this, name ); \
|
|
|
|
|
menu->setCheckable( true ); \
|
|
|
|
|
connect( menu, TQ_SIGNAL(activated( int )), engine(), TQ_SLOT(setStreamParameter( int )) ); \
|
|
|
|
|
connect( menu, TQ_SIGNAL(aboutToShow()), TQ_SLOT(aboutToShowMenu()) ); \
|
|
|
|
|
settings->insertItem( text, menu, id, index ); \
|
|
|
|
|
settings->setItemEnabled( id, false ); \
|
|
|
|
|
id++, index++;
|
|
|
|
|
|
|
|
|
|
make_menu( "subtitle_channels_menu", i18n( "&Subtitles" ) );
|
|
|
|
|
make_menu( "audio_channels_menu", i18n( "A&udio Channels" ) );
|
|
|
|
|
make_menu( "aspect_ratio_menu", i18n( "Aspect &Ratio" ) );
|
|
|
|
|
#undef make_menu
|
|
|
|
|
|
|
|
|
|
Codeine::insertAspectRatioMenuItems( menu ); //so we don't have to include xine.h here
|
|
|
|
|
|
|
|
|
|
settings->insertSeparator( index );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQObjectList *list = toolBar()->queryList( "TDEToolBarButton" );
|
|
|
|
@ -173,7 +153,7 @@ MainWindow::MainWindow()
|
|
|
|
|
KXMLGUIClient::stateChanged( "empty" );
|
|
|
|
|
|
|
|
|
|
TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
|
|
|
|
|
if( args->count() || args->isSet( "play-dvd" ) || tdeApp->isRestored() )
|
|
|
|
|
if( args->count() || args->isSet( "play-dvd" ) || kapp->isRestored() )
|
|
|
|
|
//we need to resize the window, so we can't show the window yet
|
|
|
|
|
init();
|
|
|
|
|
else {
|
|
|
|
@ -190,14 +170,10 @@ MainWindow::init()
|
|
|
|
|
|
|
|
|
|
connect( engine(), TQ_SIGNAL(statusMessage( const TQString& )), this, TQ_SLOT(engineMessage( const TQString& )) );
|
|
|
|
|
connect( engine(), TQ_SIGNAL(stateChanged( Engine::State )), this, TQ_SLOT(engineStateChanged( Engine::State )) );
|
|
|
|
|
connect( engine(), TQ_SIGNAL(channelsChanged( const TQStringList& )), this, TQ_SLOT(setChannels( const TQStringList& )) );
|
|
|
|
|
connect( engine(), TQ_SIGNAL(titleChanged( const TQString& )), m_titleLabel, TQ_SLOT(setText( const TQString& )) );
|
|
|
|
|
connect( m_positionSlider, TQ_SIGNAL(valueChanged( int )), this, TQ_SLOT(showTime( int )) );
|
|
|
|
|
|
|
|
|
|
connect(engine(), TQ_SIGNAL(audioChannelsChanged(const TQStringList &)),
|
|
|
|
|
this, TQ_SLOT(setAudioChannels(const TQStringList &)));
|
|
|
|
|
connect(engine(), TQ_SIGNAL(subtitleChannelsChanged(const TQStringList &)),
|
|
|
|
|
this, TQ_SLOT(setSubtitleChannels(const TQStringList &)));
|
|
|
|
|
|
|
|
|
|
if( !engine()->init() ) {
|
|
|
|
|
KMessageBox::error( this, i18n(
|
|
|
|
|
"<qt>xine could not be successfully initialised. " PRETTY_NAME " will now exit. "
|
|
|
|
@ -212,7 +188,7 @@ MainWindow::init()
|
|
|
|
|
|
|
|
|
|
TQApplication::restoreOverrideCursor();
|
|
|
|
|
|
|
|
|
|
if( !tdeApp->isRestored() ) {
|
|
|
|
|
if( !kapp->isRestored() ) {
|
|
|
|
|
TDECmdLineArgs &args = *TDECmdLineArgs::parsedArgs();
|
|
|
|
|
if (args.isSet( "play-dvd" ))
|
|
|
|
|
open( "dvd:/" );
|
|
|
|
@ -245,9 +221,6 @@ MainWindow::~MainWindow()
|
|
|
|
|
bool
|
|
|
|
|
MainWindow::queryExit()
|
|
|
|
|
{
|
|
|
|
|
config("MainWindow")->writeEntry("showAnalyzer", m_showAnalyzer);
|
|
|
|
|
config("MainWindow")->sync();
|
|
|
|
|
|
|
|
|
|
if( toggleAction( "fullscreen" )->isChecked() ) {
|
|
|
|
|
// there seems to be no other way to stop TDEMainWindow
|
|
|
|
|
// saving the window state without any controls
|
|
|
|
@ -273,7 +246,7 @@ MainWindow::setupActions()
|
|
|
|
|
|
|
|
|
|
TDEActionCollection * const ac = actionCollection();
|
|
|
|
|
|
|
|
|
|
KStdAction::quit( tdeApp, TQ_SLOT(quit()), ac );
|
|
|
|
|
KStdAction::quit( kapp, TQ_SLOT(quit()), ac );
|
|
|
|
|
KStdAction::open( this, TQ_SLOT(playMedia()), ac, "play_media" )->setText( i18n("Play &Media...") );
|
|
|
|
|
connect( new FullScreenAction( this, ac ), TQ_SIGNAL(toggled( bool )), TQ_SLOT(fullScreenToggled( bool )) );
|
|
|
|
|
|
|
|
|
@ -284,22 +257,13 @@ MainWindow::setupActions()
|
|
|
|
|
|
|
|
|
|
new TDEAction( i18n("Reset Video Scale"), "viewmag1", Key_Equal, videoWindow(), TQ_SLOT(resetZoom()), ac, "reset_zoom" );
|
|
|
|
|
new TDEAction( i18n("Media Information"), "messagebox_info", Key_I, this, TQ_SLOT(streamInformation()), ac, "information" );
|
|
|
|
|
new TDEAction( i18n("Menu Toggle"), "media-optical-dvd-unmounted", Key_R, engine(), TQ_SLOT(toggleDVDMenu()), ac, "toggle_dvd_menu" );
|
|
|
|
|
new TDEAction( i18n("Menu Toggle"), "media-optical-dvd-unmounted", Key_R, engine(), TQ_SLOT(toggleDVDMenu()), ac, "media-optical-dvd-unmounted" );
|
|
|
|
|
new TDEAction( i18n("&Capture Frame"), "frame_image", Key_C, this, TQ_SLOT(captureFrame()), ac, "capture_frame" );
|
|
|
|
|
|
|
|
|
|
new TDEAction( i18n("Video Settings..."), "configure", Key_V, this, TQ_SLOT(configure()), ac, "video_settings" );
|
|
|
|
|
new TDEAction( i18n("Configure xine..."), "configure", 0, this, TQ_SLOT(configure()), ac, "xine_settings" );
|
|
|
|
|
|
|
|
|
|
(new KWidgetAction( m_positionSlider, i18n("Position Slider"), nullptr, nullptr, nullptr, ac, "position_slider" ))->setAutoSized( true );
|
|
|
|
|
|
|
|
|
|
const auto audioSelectAction = new TDESelectAction(i18n("A&udio Channels"), 0, ac, kAudioSelectActionName);
|
|
|
|
|
connect(audioSelectAction, TQ_SIGNAL(activated(int)), engine(), TQ_SLOT(setStreamParameter(int)));
|
|
|
|
|
|
|
|
|
|
const auto subSelectAction = new TDESelectAction(i18n("&Subtitles"), 0, ac, kSubtitleSelectActionName);
|
|
|
|
|
connect(subSelectAction, TQ_SIGNAL(activated(int)), engine(), TQ_SLOT(setStreamParameter(int)));
|
|
|
|
|
|
|
|
|
|
const auto aspectSelectAction = new TDESelectAction(i18n("Aspect &Ratio"), 0, ac, kAspectSelectActionName);
|
|
|
|
|
connect(aspectSelectAction, TQ_SIGNAL(activated(int)), engine(), TQ_SLOT(setStreamParameter(int)));
|
|
|
|
|
(new KWidgetAction( m_positionSlider, i18n("Position Slider"), 0, 0, 0, ac, "position_slider" ))->setAutoSized( true );
|
|
|
|
|
|
|
|
|
|
m_volumeAction = new VolumeAction( toolBar(), ac );
|
|
|
|
|
}
|
|
|
|
@ -318,24 +282,6 @@ MainWindow::readProperties( TDEConfig *config )
|
|
|
|
|
engine()->play( config->readNumEntry( "time" ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MainWindow::contextMenuEvent(TQContextMenuEvent *ev)
|
|
|
|
|
{
|
|
|
|
|
TQRect statusBarRect(mapTo(this, statusBar()->pos()), statusBar()->size());
|
|
|
|
|
if (statusBarRect.contains(ev->pos()) && TheStream::hasVideo())
|
|
|
|
|
{
|
|
|
|
|
ev->accept();
|
|
|
|
|
|
|
|
|
|
TDEPopupMenu menu;
|
|
|
|
|
menu.setCheckable(true);
|
|
|
|
|
|
|
|
|
|
int id = menu.insertItem(i18n("Show Analyzer"), this, TQ_SLOT(toggleAnalyzer()));
|
|
|
|
|
menu.setItemChecked(id, m_analyzer->isVisible());
|
|
|
|
|
|
|
|
|
|
menu.exec(ev->globalPos());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MainWindow::timerEvent( TQTimerEvent* )
|
|
|
|
|
{
|
|
|
|
@ -385,13 +331,6 @@ MainWindow::showTime( int pos )
|
|
|
|
|
m_timeLabel->setText( time );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MainWindow::toggleAnalyzer()
|
|
|
|
|
{
|
|
|
|
|
m_showAnalyzer = !m_showAnalyzer;
|
|
|
|
|
m_analyzer->setShown(m_showAnalyzer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MainWindow::engineMessage( const TQString &message )
|
|
|
|
|
{
|
|
|
|
@ -442,7 +381,7 @@ MainWindow::load( const KURL &url )
|
|
|
|
|
if (url.protocol() == "media") {
|
|
|
|
|
#define UDS_LOCAL_PATH (72 | TDEIO::UDS_STRING)
|
|
|
|
|
TDEIO::UDSEntry e;
|
|
|
|
|
if (!TDEIO::NetAccess::stat( url, e, nullptr ))
|
|
|
|
|
if (!TDEIO::NetAccess::stat( url, e, 0 ))
|
|
|
|
|
MessageBox::sorry( "There was an internal error with the media slave..." );
|
|
|
|
|
else {
|
|
|
|
|
TDEIO::UDSEntry::ConstIterator end = e.end();
|
|
|
|
@ -568,6 +507,7 @@ show_toolbar:
|
|
|
|
|
//we aren't managed by mainWindow when at FullScreen
|
|
|
|
|
videoWindow()->move( 0, 0 );
|
|
|
|
|
videoWindow()->resize( ((TQWidget*)o)->size() );
|
|
|
|
|
videoWindow()->lower();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (o == m_toolbar)
|
|
|
|
@ -624,12 +564,14 @@ MainWindow::fullScreenToggled( bool isFullScreen )
|
|
|
|
|
statusBar()->setHidden( isFullScreen );
|
|
|
|
|
|
|
|
|
|
setMouseTracking( isFullScreen ); /// @see mouseMoveEvent()
|
|
|
|
|
m_widgetStack->setMouseTracking(isFullScreen);
|
|
|
|
|
|
|
|
|
|
if (isFullScreen)
|
|
|
|
|
s_handler = new FullScreenToolBarHandler( this );
|
|
|
|
|
else
|
|
|
|
|
delete s_handler;
|
|
|
|
|
|
|
|
|
|
// prevent videoWindow() moving around when mouse moves
|
|
|
|
|
setCentralWidget( isFullScreen ? 0 : videoWindow() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -651,49 +593,54 @@ MainWindow::streamInformation()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MainWindow::setAudioChannels(const TQStringList &channels) const
|
|
|
|
|
MainWindow::setChannels( const TQStringList &channels )
|
|
|
|
|
{
|
|
|
|
|
DEBUG_FUNC_INFO
|
|
|
|
|
|
|
|
|
|
/* Xine uses -1 and -2 to indicate that a channel should be determined automatically or
|
|
|
|
|
* turned off. TDESelectAction inserts items starting from index 0, so we add 2 to the
|
|
|
|
|
* channel returned from TheStream to match. */
|
|
|
|
|
//TODO -1 = auto
|
|
|
|
|
|
|
|
|
|
if (const auto audioSelection = dynamic_cast<TDESelectAction *>(action(kAudioSelectActionName)))
|
|
|
|
|
{
|
|
|
|
|
TQStringList audioChannels(channels);
|
|
|
|
|
audioChannels.prepend("&Determine Automatically");
|
|
|
|
|
audioChannels.prepend("&Off");
|
|
|
|
|
audioSelection->setItems(audioChannels);
|
|
|
|
|
audioSelection->popupMenu()->insertSeparator(2);
|
|
|
|
|
audioSelection->setCurrentItem(TheStream::audioChannel() + 2);
|
|
|
|
|
audioSelection->setEnabled(channels.count());
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Debug::error() << "Failed to update the audio channels (selection menu not found)" << endl;
|
|
|
|
|
}
|
|
|
|
|
TQStringList::ConstIterator it = channels.begin();
|
|
|
|
|
|
|
|
|
|
TQPopupMenu *menu = (TQPopupMenu*)child( (*it).latin1() );
|
|
|
|
|
menu->clear();
|
|
|
|
|
|
|
|
|
|
menu->insertItem( i18n("&Determine Automatically"), 1 );
|
|
|
|
|
menu->insertSeparator();
|
|
|
|
|
|
|
|
|
|
//the id is crucial, since the slot this menu is connected to requires
|
|
|
|
|
//that information to set the correct channel
|
|
|
|
|
//NOTE we subtract 2 in xineEngine because TQMenuData doesn't allow negative id
|
|
|
|
|
int id = 2;
|
|
|
|
|
++it;
|
|
|
|
|
for( TQStringList::ConstIterator const end = channels.end(); it != end; ++it, ++id )
|
|
|
|
|
menu->insertItem( *it, id );
|
|
|
|
|
|
|
|
|
|
menu->insertSeparator();
|
|
|
|
|
menu->insertItem( i18n("&Off"), 0 );
|
|
|
|
|
|
|
|
|
|
id = channels.first() == "subtitle_channels_menu" ? SubtitleChannelsMenuItemId : AudioChannelsMenuItemId;
|
|
|
|
|
MainWindow::menu( "settings" )->setItemEnabled( id, channels.count() > 1 );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
MainWindow::setSubtitleChannels(const TQStringList &channels) const
|
|
|
|
|
MainWindow::aboutToShowMenu()
|
|
|
|
|
{
|
|
|
|
|
DEBUG_FUNC_INFO
|
|
|
|
|
|
|
|
|
|
if (const auto subSelection = dynamic_cast<TDESelectAction *>(action(kSubtitleSelectActionName)))
|
|
|
|
|
{
|
|
|
|
|
TQStringList subChannels(channels);
|
|
|
|
|
subChannels.prepend("&Determine Automatically");
|
|
|
|
|
subChannels.prepend("&Off");
|
|
|
|
|
subSelection->setItems(subChannels);
|
|
|
|
|
subSelection->popupMenu()->insertSeparator(2);
|
|
|
|
|
subSelection->setCurrentItem(TheStream::subtitleChannel() + 2);
|
|
|
|
|
subSelection->setEnabled(channels.count());
|
|
|
|
|
}
|
|
|
|
|
TQPopupMenu *menu = (TQPopupMenu*)sender();
|
|
|
|
|
TQCString name( sender() ? sender()->name() : 0 );
|
|
|
|
|
|
|
|
|
|
// uncheck all items first
|
|
|
|
|
for( uint x = 0; x < menu->count(); ++x )
|
|
|
|
|
menu->setItemChecked( menu->idAt( x ), false );
|
|
|
|
|
|
|
|
|
|
int id;
|
|
|
|
|
if( name == "subtitle_channels_menu" )
|
|
|
|
|
id = TheStream::subtitleChannel() + 2;
|
|
|
|
|
else if( name == "audio_channels_menu" )
|
|
|
|
|
id = TheStream::audioChannel() + 2;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Debug::error() << "Failed to update the subtitle channels (selection menu not found)" << endl;
|
|
|
|
|
}
|
|
|
|
|
id = TheStream::aspectRatio();
|
|
|
|
|
|
|
|
|
|
menu->setItemChecked( id, true );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -734,10 +681,10 @@ MainWindow::keyPressEvent( TQKeyEvent *e )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQPopupMenu*
|
|
|
|
|
MainWindow::menu( const TQString& name )
|
|
|
|
|
MainWindow::menu( const char *name )
|
|
|
|
|
{
|
|
|
|
|
// KXMLGUI is "really good".
|
|
|
|
|
return dynamic_cast<TQPopupMenu*>(factory()->container( name, this ));
|
|
|
|
|
return static_cast<TQPopupMenu*>(factory()->container( name, this ));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -745,7 +692,7 @@ MainWindow::menu( const TQString& name )
|
|
|
|
|
TDEActionCollection*
|
|
|
|
|
actionCollection()
|
|
|
|
|
{
|
|
|
|
|
return static_cast<MainWindow*>(tdeApp->mainWidget())->actionCollection();
|
|
|
|
|
return static_cast<MainWindow*>(kapp->mainWidget())->actionCollection();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Convenience class for other classes that need access to the actions
|
|
|
|
@ -754,23 +701,17 @@ action( const char *name )
|
|
|
|
|
{
|
|
|
|
|
#define QT_FATAL_ASSERT
|
|
|
|
|
|
|
|
|
|
MainWindow *mainWindow = nullptr;
|
|
|
|
|
TDEActionCollection *actionCollection = nullptr;
|
|
|
|
|
TDEAction *action = nullptr;
|
|
|
|
|
MainWindow *mainWindow = 0;
|
|
|
|
|
TDEActionCollection *actionCollection = 0;
|
|
|
|
|
TDEAction *action = 0;
|
|
|
|
|
|
|
|
|
|
mainWindow = dynamic_cast<MainWindow *>(tdeApp->mainWidget());
|
|
|
|
|
if (mainWindow)
|
|
|
|
|
{
|
|
|
|
|
actionCollection = mainWindow->actionCollection();
|
|
|
|
|
if (actionCollection)
|
|
|
|
|
{
|
|
|
|
|
action = actionCollection->action(name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if( mainWindow = (MainWindow*)kapp->mainWidget() )
|
|
|
|
|
if( actionCollection = mainWindow->actionCollection() )
|
|
|
|
|
action = actionCollection->action( name );
|
|
|
|
|
|
|
|
|
|
Q_ASSERT(mainWindow);
|
|
|
|
|
Q_ASSERT(actionCollection);
|
|
|
|
|
Q_ASSERT(action);
|
|
|
|
|
Q_ASSERT( mainWindow );
|
|
|
|
|
Q_ASSERT( actionCollection );
|
|
|
|
|
Q_ASSERT( action );
|
|
|
|
|
|
|
|
|
|
return action;
|
|
|
|
|
}
|
|
|
|
|