mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Save/restore the window position.
This commit is contained in:
parent
2d8f6481dc
commit
7a066ec4b2
@ -42,6 +42,11 @@ BrowserWindow::BrowserWindow()
|
||||
setCentralWidget(webView);
|
||||
connect(webView, SIGNAL(loadFinished(bool)), SLOT(finishLoading(bool)));
|
||||
|
||||
// Restore the geometry
|
||||
QSettings settings;
|
||||
restoreGeometry(settings.value("geometry").toByteArray());
|
||||
restoreState(settings.value("windowState").toByteArray());
|
||||
|
||||
// Display the app
|
||||
m_initialload = true;
|
||||
m_loadattempt = 1;
|
||||
@ -49,6 +54,16 @@ BrowserWindow::BrowserWindow()
|
||||
}
|
||||
|
||||
|
||||
// Save the window geometry on close
|
||||
void BrowserWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("geometry", saveGeometry());
|
||||
settings.setValue("windowState", saveState());
|
||||
QMainWindow::closeEvent(event);
|
||||
}
|
||||
|
||||
|
||||
// Create the actions for the window
|
||||
void BrowserWindow::createActions()
|
||||
{
|
||||
|
@ -36,6 +36,9 @@ class BrowserWindow : public QMainWindow
|
||||
public:
|
||||
BrowserWindow();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
||||
protected slots:
|
||||
void finishLoading(bool);
|
||||
|
||||
|
@ -33,6 +33,11 @@ int main(int argc, char * argv[])
|
||||
// Create the QT application
|
||||
QApplication app(argc, argv);
|
||||
|
||||
// Setup the settings management
|
||||
QCoreApplication::setOrganizationName("pgAdmin Development Team");
|
||||
QCoreApplication::setOrganizationDomain("pgadmin.org");
|
||||
QCoreApplication::setApplicationName(PGA_APP_NAME);
|
||||
|
||||
// Fire up the webserver
|
||||
// TODO: Find an unused port number to use
|
||||
Server *server = new Server();
|
||||
|
Loading…
Reference in New Issue
Block a user