aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2020-02-10 23:06:43 -0500
committerAndrew Lee <alee14498@protonmail.com>2020-02-10 23:06:43 -0500
commitf36b6114e64d278c5876727ff435547789b35c7f (patch)
tree18ae72f3824ae582bd3da1b6a1887b23c5b48899
parent1a92e988d63753d2904ac775c4b30589e76c7e5c (diff)
downloadAleeBrowser-f36b6114e64d278c5876727ff435547789b35c7f.tar.gz
AleeBrowser-f36b6114e64d278c5876727ff435547789b35c7f.tar.bz2
AleeBrowser-f36b6114e64d278c5876727ff435547789b35c7f.zip
Added basic navigation and got rid of the search button
-rw-r--r--about.ui4
-rw-r--r--main.cpp2
-rw-r--r--mainbrowser.cpp20
-rw-r--r--mainbrowser.h8
-rw-r--r--mainbrowser.ui43
5 files changed, 43 insertions, 34 deletions
diff --git a/about.ui b/about.ui
index 89da092..40dc9f6 100644
--- a/about.ui
+++ b/about.ui
@@ -23,7 +23,7 @@
</size>
</property>
<property name="windowTitle">
- <string>About - Alee Music Player</string>
+ <string>About - Alee Browser</string>
</property>
<property name="modal">
<bool>false</bool>
@@ -53,7 +53,7 @@
</font>
</property>
<property name="text">
- <string>AleeBrowser 2.0 by Alee Productions</string>
+ <string>Alee Browser 2.0 by Alee Productions</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
diff --git a/main.cpp b/main.cpp
index 07bb4a7..0cac83d 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,11 +1,13 @@
#include "mainbrowser.h"
#include <QApplication>
+#include <QDebug>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
mainbrowser browser;
+ qDebug() << "Starting Alee Browser";
browser.show();
return a.exec();
}
diff --git a/mainbrowser.cpp b/mainbrowser.cpp
index 4dea0e3..04dafe1 100644
--- a/mainbrowser.cpp
+++ b/mainbrowser.cpp
@@ -14,13 +14,13 @@ mainbrowser::mainbrowser(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::mainbrowser)
{
- //QString url = ui->lineEdit->text();
ui->setupUi(this);
ui->webView->load(QUrl("https://about:blank"));
}
mainbrowser::~mainbrowser()
{
+ qDebug() << "Closing Alee Browser...";
delete ui;
}
@@ -30,11 +30,6 @@ void mainbrowser::on_actionQuit_triggered()
close();
}
-void mainbrowser::on_searchButton_clicked()
-{
- bUrl();
-}
-
void mainbrowser::on_lineEdit_returnPressed()
{
bUrl();
@@ -46,8 +41,17 @@ void mainbrowser::on_actionAbout_triggered()
about.exec();
}
-void mainbrowser::on_webView_urlChanged(const QUrl &arg1)
+void mainbrowser::on_backButton_clicked()
{
- qDebug() << "Loading" << url;
+ ui->webView->back();
+}
+void mainbrowser::on_forwardButton_clicked()
+{
+ ui->webView->forward();
+}
+
+void mainbrowser::on_refreshButton_clicked()
+{
+ ui->webView->reload();
}
diff --git a/mainbrowser.h b/mainbrowser.h
index af95f0a..b697ab6 100644
--- a/mainbrowser.h
+++ b/mainbrowser.h
@@ -18,15 +18,17 @@ public:
private slots:
void on_actionQuit_triggered();
- void on_searchButton_clicked();
-
void on_lineEdit_returnPressed();
void on_actionAbout_triggered();
void bUrl();
- void on_webView_urlChanged(const QUrl &arg1);
+ void on_backButton_clicked();
+
+ void on_forwardButton_clicked();
+
+ void on_refreshButton_clicked();
private:
Ui::mainbrowser *ui;
diff --git a/mainbrowser.ui b/mainbrowser.ui
index 9399ab0..786d0b3 100644
--- a/mainbrowser.ui
+++ b/mainbrowser.ui
@@ -11,18 +11,32 @@
</rect>
</property>
<property name="windowTitle">
- <string>AleeBrowser</string>
+ <string>Alee Browser</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
- <item row="0" column="2">
- <widget class="QPushButton" name="searchButton">
+ <item row="0" column="1">
+ <widget class="QPushButton" name="forwardButton">
+ <property name="text">
+ <string>-&gt;</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QPushButton" name="backButton">
<property name="text">
- <string>Search</string>
+ <string>&lt;-</string>
</property>
</widget>
</item>
- <item row="2" column="0" colspan="3">
+ <item row="0" column="3">
+ <widget class="QLineEdit" name="lineEdit">
+ <property name="text">
+ <string>about:blank</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="5">
<widget class="QWebView" name="webView">
<property name="url">
<url>
@@ -31,23 +45,10 @@
</property>
</widget>
</item>
- <item row="1" column="1">
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="0" column="0" colspan="2">
- <widget class="QLineEdit" name="lineEdit">
+ <item row="0" column="2">
+ <widget class="QPushButton" name="refreshButton">
<property name="text">
- <string>about:blank</string>
+ <string>Refresh</string>
</property>
</widget>
</item>