]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt3/QPrefs.C
Add rc.geometry_height, geometry_width, geometry_xysaved to the preference dialogs...
[features.git] / src / frontends / qt3 / QPrefs.C
index bf9365965d51bec02dae0bfd3c96a8cd2dd10ec4..2e185d05efa01b89d56283e00d942c8f48fa2c53 100644 (file)
@@ -180,6 +180,14 @@ void QPrefs::apply()
        rc.bind_file = internal_path(uimod->bindFileED->text());
        rc.use_lastfilepos = uimod->restoreCursorCB->isChecked();
        rc.load_session = uimod->loadSessionCB->isChecked();
+       if (uimod->loadWindowSizeCB->isChecked()) {
+               rc.geometry_width = 0;
+               rc.geometry_height = 0;
+       } else {
+               rc.geometry_width = uimod->windowWidthSB->value();
+               rc.geometry_height = uimod->windowHeightSB->value();
+       }
+       rc.geometry_xysaved = uimod->loadWindowLocationCB->isChecked();
        rc.cursor_follows_scrollbar = uimod->cursorFollowsCB->isChecked();
        rc.autosave = uimod->autoSaveSB->value() * 60;
        rc.make_backup = uimod->autoSaveCB->isChecked();
@@ -508,6 +516,17 @@ void QPrefs::update_contents()
        uimod->bindFileED->setText(external_path(rc.bind_file));
        uimod->restoreCursorCB->setChecked(rc.use_lastfilepos);
        uimod->loadSessionCB->setChecked(rc.load_session);
+       bool loadWindowSize = rc.geometry_width == 0 && rc.geometry_height == 0;
+       uimod->loadWindowSizeCB->setChecked(loadWindowSize);
+       uimod->windowWidthSB->setEnabled(!loadWindowSize);
+       uimod->windowHeightSB->setEnabled(!loadWindowSize);
+       uimod->windowWidthLA->setEnabled(!loadWindowSize);
+       uimod->windowHeightLA->setEnabled(!loadWindowSize);
+       if (!loadWindowSize) {
+               uimod->windowWidthSB->setValue(rc.geometry_width);
+               uimod->windowHeightSB->setValue(rc.geometry_height);
+       }
+       uimod->loadWindowLocationCB->setChecked(rc.geometry_xysaved);
        uimod->cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar);
        // convert to minutes
        int mins(rc.autosave / 60);