aboutsummaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/tab_welcome.cpp24
-rw-r--r--src/widgets/tab_welcome.h29
-rw-r--r--src/widgets/tab_welcome.ui73
3 files changed, 126 insertions, 0 deletions
diff --git a/src/widgets/tab_welcome.cpp b/src/widgets/tab_welcome.cpp
new file mode 100644
index 0000000..2c8dc56
--- /dev/null
+++ b/src/widgets/tab_welcome.cpp
@@ -0,0 +1,24 @@
+#include "tab_welcome.h"
+
+TabWelcome::TabWelcome(QWidget* parent)
+ : QWidget(parent), ui(new Ui::TabWelcome)
+{
+ ui->setupUi(this);
+ ui->horizontalLayout->setContentsMargins(0, 0, 0, 0);
+
+ ui->welcomeLabel->setText(ui->welcomeLabel->text()
+ .arg(tr("Welcome to ActorViewer!"))
+ .arg(tr("Start by opening a Fediverse data export, using a button below.")));
+}
+
+TabWelcome::~TabWelcome() {
+ delete ui;
+}
+
+void TabWelcome::on_openFileButton_clicked(bool checked) {
+ emit show_file_open_dialog();
+}
+
+void TabWelcome::on_openRecentButton_clicked(bool checked) {
+ emit show_recent_files();
+}
diff --git a/src/widgets/tab_welcome.h b/src/widgets/tab_welcome.h
new file mode 100644
index 0000000..effc84f
--- /dev/null
+++ b/src/widgets/tab_welcome.h
@@ -0,0 +1,29 @@
+#pragma once
+#include <QWidget>
+#include "./ui_tab_welcome.h"
+
+QT_BEGIN_NAMESPACE
+namespace Ui { class TabWelcome; }
+QT_END_NAMESPACE
+
+class TabWelcome : public QWidget {
+ Q_OBJECT
+
+public:
+ TabWelcome(QWidget* parent = nullptr);
+ ~TabWelcome();
+
+signals:
+ // Show Open file dialog
+ void show_file_open_dialog();
+
+ // Show recents dropdown
+ void show_recent_files();
+
+private slots:
+ void on_openFileButton_clicked(bool checked);
+ void on_openRecentButton_clicked(bool checked);
+
+private:
+ Ui::TabWelcome* ui;
+};
diff --git a/src/widgets/tab_welcome.ui b/src/widgets/tab_welcome.ui
new file mode 100644
index 0000000..2f1e514
--- /dev/null
+++ b/src/widgets/tab_welcome.ui
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>TabWelcome</class>
+ <widget class="QWidget" name="TabWelcome">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="welcomeLabel">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;%1&lt;p/&gt;&lt;p&gt;%2&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QPushButton" name="openFileButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="sizeIncrement">
+ <size>
+ <width>30</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Open file…</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="openRecentButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="sizeIncrement">
+ <size>
+ <width>30</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Recent files…</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>