summaryrefslogtreecommitdiffstats
path: root/shemov.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-08-07 11:55:20 +0200
committerArno <am@disconnect.de>2010-08-07 11:55:20 +0200
commitbd036870603e924c91d72285697c19e495991e0f (patch)
tree8d286c74c8766e3706e86fb38d08c65d94a81e33 /shemov.cpp
parent5f2427eb69366716994c8cca0319ead0c9dbb76b (diff)
downloadSheMov-bd036870603e924c91d72285697c19e495991e0f.tar.gz
SheMov-bd036870603e924c91d72285697c19e495991e0f.tar.bz2
SheMov-bd036870603e924c91d72285697c19e495991e0f.zip
Usability fix1.0.0
Remember selected tab on startup. Also remember selected view mode from archive.
Diffstat (limited to 'shemov.cpp')
-rw-r--r--shemov.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/shemov.cpp b/shemov.cpp
index 4bb7dd9..bb45bfb 100644
--- a/shemov.cpp
+++ b/shemov.cpp
@@ -41,6 +41,7 @@
#include "seriestreewidget.h"
#include "newmoviewizard.h"
#include "filestreewidget.h"
+#include "filestreemodel.h"
SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags), mOpenWithGroupFS(0), mOpenWithGroupAV(0) {
//application icon
@@ -86,9 +87,9 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla
QWidget *centralWidget = new QWidget;
centralWidget->setLayout(mainLayout);
setCentralWidget(centralWidget);
- readSettings();
- mFSWidget->readSettings();
mATree->seriesWidget()->readSettings();
+ mFSWidget->readSettings();
+ readSettings();
show();
mFSWidget->fileView()->setFocus(Qt::ActiveWindowFocusReason);
}
@@ -97,8 +98,8 @@ void SheMov::closeEvent(QCloseEvent *event){
mFSWidget->writeSettings();
mFSWidget->pictureViewer()->close();
mATree->seriesWidget()->writeSettings();
- delete SmGlobals::instance();
writeSettings();
+ delete SmGlobals::instance();
event->accept();
}
@@ -562,6 +563,9 @@ void SheMov::writeSettings(){
s.setValue("windows/mainsize", size());
bool winState = windowState() & Qt::WindowMaximized;
s.setValue("windows/maximized", winState);
+ s.setValue("ui/selectedtab", mTab->currentIndex());
+ FilesTreeModel *filesModel = static_cast<FilesTreeModel*>(SmGlobals::instance()->model("FilesModel"));
+ s.setValue("ui/filestreemode", filesModel->mode());
}
void SheMov::readSettings(){
@@ -574,4 +578,22 @@ void SheMov::readSettings(){
if(winState){
setWindowState(Qt::WindowMaximized);
}
+ int currentTab = s.value("ui/selectedtab", 0).toInt();
+ if(currentTab < mTab->count() && currentTab != mTab->currentIndex()){
+ mTab->setCurrentIndex(currentTab);
+ }
+ int filesMode = s.value("ui/filestreemode", FilesTreeModel::Normal).toInt();
+ switch(filesMode){
+ case FilesTreeModel::Normal:
+ mShowNormalA->trigger();
+ break;
+ case FilesTreeModel::Local:
+ mShowLocalA->trigger();
+ break;
+ case FilesTreeModel::Archived:
+ mShowArchivedA->trigger();
+ break;
+ default:
+ ;
+ }
}