diff options
Diffstat (limited to 'src/app/mainWindow.cpp')
-rw-r--r-- | src/app/mainWindow.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/app/mainWindow.cpp b/src/app/mainWindow.cpp index 78bf592..54204e9 100644 --- a/src/app/mainWindow.cpp +++ b/src/app/mainWindow.cpp @@ -11,6 +11,7 @@ #include <kcursor.h> #include <tdefiledialog.h> //::open() #include <tdeglobalsettings.h> //::timerEvent() +#include <tdepopupmenu.h> #include <tdeio/netaccess.h> #include <ksqueezedtextlabel.h> #include <kstatusbar.h> @@ -108,6 +109,9 @@ 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 @@ -241,6 +245,9 @@ 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 @@ -312,6 +319,24 @@ MainWindow::readProperties( TDEConfig *config ) } 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("Toggle Analyzer"), this, TQ_SLOT(toggleAnalyzer())); + menu.setItemChecked(id, m_analyzer->isVisible()); + + menu.exec(ev->globalPos()); + } +} + +void MainWindow::timerEvent( TQTimerEvent* ) { static int counter = 0; @@ -361,6 +386,13 @@ MainWindow::showTime( int pos ) } void +MainWindow::toggleAnalyzer() +{ + m_showAnalyzer = !m_showAnalyzer; + m_analyzer->setShown(m_showAnalyzer); +} + +void MainWindow::engineMessage( const TQString &message ) { statusBar()->message( message, 3500 ); |