소스 검색

Pre-populate database connection settings with last used values

Neal Wilson 8 년 전
부모
커밋
2fe3d26df0
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6
    1
      src/typica.w

+ 6
- 1
src/typica.w 파일 보기

@@ -13543,15 +13543,20 @@ SqlConnectionSetup::SqlConnectionSetup() :
13543 13543
     cancelButton(new QPushButton(tr("Cancel"))),
13544 13544
     connectButton(new QPushButton(tr("Connect")))@/
13545 13545
 {
13546
+	QSettings settings;
13546 13547
     driver->addItem("PostgreSQL", "QPSQL");
13547 13548
     formLayout->addRow(tr("Database driver:"), driver);
13548 13549
     formLayout->addRow(tr("Host name:"), hostname);
13550
+    hostname->setText(settings.value("database/hostname").toString());
13549 13551
     formLayout->addRow(tr("Port number:"), portnumber);
13550
-    portnumber->setText("5432");
13552
+    portnumber->setText(settings.value("database/portnumber", "5432").toString());
13551 13553
     formLayout->addRow(tr("Database name:"), dbname);
13554
+    dbname->setText(settings.value("database/dbname").toString());
13552 13555
     formLayout->addRow(tr("User name:"), user);
13556
+    user->setText(settings.value("database/user").toString());
13553 13557
     password->setEchoMode(QLineEdit::Password);
13554 13558
     formLayout->addRow(tr("Password:"), password);
13559
+    password->setText(settings.value("database/password").toString());
13555 13560
     layout->addLayout(formLayout);
13556 13561
     buttons->addStretch(1);
13557 13562
     buttons->addWidget(cancelButton);

Loading…
취소
저장