aboutsummaryrefslogtreecommitdiff
path: root/src/forms
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-07-03 14:47:24 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2017-07-03 14:47:24 +0200
commit089abd62383516eb33cbc1c93b06826a0cba3d7b (patch)
treeff74a37b5115052a8ea27679b32aef20523d86c9 /src/forms
parentAdded homepage button (diff)
downloadsmolbote-089abd62383516eb33cbc1c93b06826a0cba3d7b.tar.xz
Added homepage and newtab to profile widget
Diffstat (limited to 'src/forms')
-rw-r--r--src/forms/profileview.cpp18
-rw-r--r--src/forms/profileview.ui116
2 files changed, 82 insertions, 52 deletions
diff --git a/src/forms/profileview.cpp b/src/forms/profileview.cpp
index 9d2e9ed..cece4e4 100644
--- a/src/forms/profileview.cpp
+++ b/src/forms/profileview.cpp
@@ -30,6 +30,8 @@
#include <QDialogButtonBox>
+#include <QFormLayout>
+
ProfileView::ProfileView(WebEngineProfile *profile, QWidget *parent) :
QWidget(parent),
ui(new Ui::ProfileView)
@@ -58,16 +60,17 @@ void ProfileView::setProfile(WebEngineProfile *profile)
if(!profile) {
return;
}
+ //Q_ASSERT(profile);
_profile = profile;
- if(!_profile->storageName().isEmpty()) {
- setWindowTitle(_profile->storageName());
- } else {
- setWindowTitle(tr("Off-the-record"));
- }
+ setWindowTitle(_profile->name());
m_cookiesForm = new CookiesForm(_profile->cookieStore(), this);
- ui->tabWidget->addTab(m_cookiesForm, m_cookiesForm->windowTitle());
+ //ui->tabWidget->addTab(m_cookiesForm, m_cookiesForm->windowTitle());
+
+ // general
+ ui->homepage_lineEdit->setText(_profile->homepage().toString());
+ ui->newtab_lineEdit->setText(_profile->newtab().toString());
// http
ui->userAgent->setPlainText(_profile->httpUserAgent());
@@ -81,6 +84,9 @@ void ProfileView::setProfile(WebEngineProfile *profile)
// policy
ui->cookiePolicy->setCurrentIndex(_profile->persistentCookiesPolicy());
+
+ //ui->formLayout_3->addWidget(m_cookiesForm);
+ ui->verticalLayout_3->addWidget(m_cookiesForm);
}
void ProfileView::showProfile()
diff --git a/src/forms/profileview.ui b/src/forms/profileview.ui
index e7bcbae..bed045a 100644
--- a/src/forms/profileview.ui
+++ b/src/forms/profileview.ui
@@ -25,6 +25,33 @@
<property name="currentIndex">
<number>0</number>
</property>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>General</string>
+ </attribute>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Homepage</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="homepage_lineEdit"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Newtab</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLineEdit" name="newtab_lineEdit"/>
+ </item>
+ </layout>
+ </widget>
<widget class="QWidget" name="httpTab">
<attribute name="title">
<string>HTTP</string>
@@ -86,79 +113,83 @@
<item row="3" column="1">
<widget class="QLineEdit" name="cacheSize"/>
</item>
- </layout>
- </widget>
- <widget class="QWidget" name="pathTab">
- <attribute name="title">
- <string>Paths</string>
- </attribute>
- <layout class="QFormLayout" name="formLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label_2">
+ <item row="6" column="0">
+ <widget class="QLabel" name="storagePath_label">
<property name="text">
<string>Storage Path</string>
</property>
</widget>
</item>
- <item row="0" column="1">
+ <item row="6" column="1">
<widget class="QLineEdit" name="storagePath_lineEdit">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_3">
+ <item row="4" column="0">
+ <widget class="QLabel" name="cachePath_label">
<property name="text">
<string>Cache Path</string>
</property>
</widget>
</item>
- <item row="1" column="1">
+ <item row="4" column="1">
<widget class="QLineEdit" name="cachePath_lineEdit">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
+ <item row="5" column="1">
+ <widget class="QPushButton" name="clearCache_pushButton">
+ <property name="text">
+ <string>Clear Cache</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
<widget class="QWidget" name="policiesTab">
<attribute name="title">
- <string>Policies</string>
+ <string>Cookies</string>
</attribute>
- <layout class="QFormLayout" name="formLayout_3">
- <item row="0" column="0">
- <widget class="QLabel" name="label_7">
- <property name="text">
- <string>Cookies</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QComboBox" name="cookiePolicy">
- <item>
- <property name="text">
- <string>No Persistent Cookies</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Allow Persistent Cookies</string>
- </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <layout class="QFormLayout" name="cookies_formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>Cookies</string>
+ </property>
+ </widget>
</item>
- <item>
- <property name="text">
- <string>Force Persistent Cookies</string>
- </property>
+ <item row="0" column="1">
+ <widget class="QComboBox" name="cookiePolicy">
+ <item>
+ <property name="text">
+ <string>No Persistent Cookies</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Allow Persistent Cookies</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Force Persistent Cookies</string>
+ </property>
+ </item>
+ </widget>
</item>
- </widget>
+ </layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="actionsTab">
<attribute name="title">
- <string>Actions</string>
+ <string>History</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
@@ -169,13 +200,6 @@
</widget>
</item>
<item>
- <widget class="QPushButton" name="clearCache_pushButton">
- <property name="text">
- <string>Clear Cache</string>
- </property>
- </widget>
- </item>
- <item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>