aboutsummaryrefslogtreecommitdiff
path: root/mainwindow.cpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-05-30 02:58:43 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-05-30 02:58:43 +0200
commit79ff338a3427a236ef53adf806c56616faa3426c (patch)
tree8555fb0a7da2f5139cf5f9951c5d61d7f7a83506 /mainwindow.cpp
downloadkristall-79ff338a3427a236ef53adf806c56616faa3426c.tar.gz
Initial commit: Basic Gemini client.
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r--mainwindow.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp
new file mode 100644
index 0000000..9e5c3df
--- /dev/null
+++ b/mainwindow.cpp
@@ -0,0 +1,47 @@
+#include "mainwindow.hpp"
+#include "ui_mainwindow.h"
+#include "browsertab.hpp"
+
+#include <memory>
+
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent)
+ , ui(new Ui::MainWindow),
+ url_status(new QLabel())
+{
+ ui->setupUi(this);
+
+ this->statusBar()->addWidget(this->url_status);
+}
+
+MainWindow::~MainWindow()
+{
+ delete ui;
+}
+
+void MainWindow::addEmptyTab()
+{
+ auto tab = std::make_unique<BrowserTab>(this);
+
+
+
+ this->ui->browser_tabs->addTab(tab.release(), "Page");
+}
+
+void MainWindow::addNewTab(QUrl const & url)
+{
+ auto tab = std::make_unique<BrowserTab>(this);
+
+ tab->navigateTo(url);
+
+ this->ui->browser_tabs->addTab(tab.release(), "Page");
+}
+
+void MainWindow::setUrlPreview(const QUrl &url)
+{
+ if(url.isValid())
+ this->url_status->setText(url.toString());
+ else
+ this->url_status->setText("");
+}
+