// Get handles for the views.
backButtonPointer = mainViewUi.backButton;
forwardButtonPointer = mainViewUi.forwardButton;
+ QPushButton *homeButtonPointer = mainViewUi.homeButton;
urlLineEditPointer = mainViewUi.urlLineEdit;
webEngineViewPointer = mainViewUi.webEngineView;
connect(webEngineViewPointer, SIGNAL(loadProgress(int)), this, SLOT(updateInterface()));
connect(webEngineViewPointer, SIGNAL(loadFinished(bool)), this, SLOT(updateInterface()));
- // Setup the forward and back buttons.
+ // Setup the URL bar buttons.
connect(backButtonPointer, SIGNAL(clicked()), webEngineViewPointer, SLOT(back()));
connect(forwardButtonPointer, SIGNAL(clicked()), webEngineViewPointer, SLOT(forward()));
+ connect(homeButtonPointer, SIGNAL(clicked()), this, SLOT(goHome()));
// Instantiate the mouse event pointer.
MouseEventFilter *mouseEventFilterPointer = new MouseEventFilter(webEngineViewPointer);
// Set the focus on the WebEngine view.
webEngineViewPointer->setFocus();
+ // Load the homepage.
+ goHome();
+}
+
+void MainView::goHome()
+{
// Load the homepage. TODO. Consider sanitizing the homepage input and adding things like protocols if they are missing.
webEngineViewPointer->setUrl(Settings::homepage());
}