comparison src/mainwindow.cpp @ 33:58f1b3c330af

(issue9) Show maximized by default If the Window geometry is not saved show maximized otherwise restore the Window state / geometry.
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 06 May 2015 15:41:42 +0200
parents 179239c94740
children 40a683d1a318
comparison
equal deleted inserted replaced
32:179239c94740 33:58f1b3c330af
82 mSettings.setValue("windowState", saveState()); 82 mSettings.setValue("windowState", saveState());
83 QMainWindow::closeEvent(event); 83 QMainWindow::closeEvent(event);
84 } 84 }
85 85
86 void MainWindow::readSettings() { 86 void MainWindow::readSettings() {
87 restoreGeometry(mSettings.value("geometry").toByteArray()); 87 if (mSettings.contains("geometry")) {
88 restoreState(mSettings.value("windowState").toByteArray()); 88 restoreGeometry(mSettings.value("geometry").toByteArray());
89 restoreState(mSettings.value("windowState").toByteArray());
90 }
89 } 91 }
90 /* 92 /*
91 void MainWindow::dragEnterEvent(QDragEnterEvent *event) 93 void MainWindow::dragEnterEvent(QDragEnterEvent *event)
92 { 94 {
93 if (event->mimeData()->hasUrls()) { 95 if (event->mimeData()->hasUrls()) {
153 statusBar()->showMessage(tr("Parsed: '%1'").arg(metaData.filePath())); 155 statusBar()->showMessage(tr("Parsed: '%1'").arg(metaData.filePath()));
154 qDebug() << "Parsed: " << metaData.filePath(); 156 qDebug() << "Parsed: " << metaData.filePath();
155 mCurFolder = folder; 157 mCurFolder = folder;
156 mPlayer->setBaseDir(folder); 158 mPlayer->setBaseDir(folder);
157 mDataView->selectNextRow(); 159 mDataView->selectNextRow();
158 show(); 160 if (!mSettings.contains("geometry")) {
161 qDebug() << "Showing maximized";
162 show();
163 showMaximized();
164 } else {
165 show();
166 }
159 } 167 }
160 168
161 void MainWindow::showPictureNameStatus(const QString& fileName, int current, 169 void MainWindow::showPictureNameStatus(const QString& fileName, int current,
162 int max, const QDateTime& timestamp) { 170 int max, const QDateTime& timestamp) {
163 if (current != 0 && max != 0) { 171 if (current != 0 && max != 0) {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)