From a194abf6097bd071fe56ed5676ef5075a826146f Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Fri, 4 Sep 2009 10:59:44 +0200 Subject: [PATCH] Save splitter state Removed "Application" menu --- CHANGES | 3 ++- TODO | 2 -- src/MainWindow.cpp | 3 +++ src/MediaView.cpp | 9 +++++++++ src/MediaView.h | 1 + 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 99eb28d..66cb244 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,10 @@ 0.6 - New search view look - Hide idle mouse cursor when above the video (Linux only) -- Volume keyboard shortcuts and status bar messages +- Volume keyboard shortcuts - Keyboard shortcuts appear in the status bar - Better error reporting +- Playlist width is saved accross restarts - Fixed Space key not pausing videos in fullscreen mode (Mac only) - Fixed window not having focus after exiting fullscreen (Mac only) - Spanish translation by Rafa diff --git a/TODO b/TODO index 21e2979..aa9a735 100644 --- a/TODO +++ b/TODO @@ -2,7 +2,6 @@ ## Bugs - Item positions when moving two items down -- Always remember the playlist width - Truncate overflowing text in the playlist - Fix Space key not working in fullscreen (Pause) @@ -45,7 +44,6 @@ ## Unsure features - Add menu entries for Most relevant, Most recent, Most viewed (Playlist => ...) -- YouTube video details - Saved playlists - Starred videos - Investigate fetchMore() and canFetchMore() in the Model/View API diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index a7f19c3..6e1697d 100755 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -232,11 +232,13 @@ void MainWindow::createMenus() { QMap *menus = The::globalMenus(); + /* fileMenu = menuBar()->addMenu(tr("&Application")); // menus->insert("file", fileMenu); // fileMenu->addAction(settingsAct); fileMenu->addSeparator(); fileMenu->addAction(quitAct); + */ playlistMenu = menuBar()->addMenu(tr("&Playlist")); menus->insert("playlist", playlistMenu); @@ -334,6 +336,7 @@ void MainWindow::writeSettings() { return; QSettings settings; settings.setValue("geometry", saveGeometry()); + mediaView->saveSplitterState(); } void MainWindow::goBack() { diff --git a/src/MediaView.cpp b/src/MediaView.cpp index c4ed91e..08173c5 100644 --- a/src/MediaView.cpp +++ b/src/MediaView.cpp @@ -98,6 +98,10 @@ MediaView::MediaView(QWidget *parent) : QWidget(parent) { layout->addWidget(splitter); setLayout(layout); + // restore splitter state + QSettings settings; + splitter->restoreState(settings.value("splitter").toByteArray()); + errorTimer = new QTimer(this); errorTimer->setSingleShot(true); errorTimer->setInterval(3000); @@ -389,3 +393,8 @@ void MediaView::timerPlay() { mediaObject->play(); } } + +void MediaView::saveSplitterState() { + QSettings settings; + settings.setValue("splitter", splitter->saveState()); +} diff --git a/src/MediaView.h b/src/MediaView.h index 616ad3e..954540d 100644 --- a/src/MediaView.h +++ b/src/MediaView.h @@ -46,6 +46,7 @@ public slots: void moveUpSelected(); void moveDownSelected(); void setPlaylistVisible(bool visible=true); + void saveSplitterState(); private slots: // list/model -- 2.39.5