aboutsummaryrefslogtreecommitdiff
path: root/plugins/ProfileEditor
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-09-08 13:13:24 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-09-08 13:13:24 +0200
commitccae7d1520548aaec95f6bd7302dd72c6fbdd6b9 (patch)
treeda6706a388a4318bc309f840ca302b3a998b7572 /plugins/ProfileEditor
parentMove ProfileManager to libweb (diff)
downloadsmolbote-ccae7d1520548aaec95f6bd7302dd72c6fbdd6b9.tar.xz
Replace ProfileManager::profileList() with ProfileManager::idList()
Diffstat (limited to 'plugins/ProfileEditor')
-rw-r--r--plugins/ProfileEditor/forms/profilemanagerdialog.cpp4
-rw-r--r--plugins/ProfileEditor/forms/profileview.cpp15
-rw-r--r--plugins/ProfileEditor/forms/profileview.ui37
3 files changed, 54 insertions, 2 deletions
diff --git a/plugins/ProfileEditor/forms/profilemanagerdialog.cpp b/plugins/ProfileEditor/forms/profilemanagerdialog.cpp
index 7920f90..72c56de 100644
--- a/plugins/ProfileEditor/forms/profilemanagerdialog.cpp
+++ b/plugins/ProfileEditor/forms/profilemanagerdialog.cpp
@@ -27,8 +27,8 @@ ProfileManagerDialog::ProfileManagerDialog(const ProfileManager *profiles, QWidg
deleteProfile(ui->listWidget->currentItem());
});
- for(auto *profile : profiles->profileList().values()) {
- addProfile(profile);
+ for(const QString &profileId : profiles->idList()) {
+ addProfile(profiles->profile(profileId));
}
}
diff --git a/plugins/ProfileEditor/forms/profileview.cpp b/plugins/ProfileEditor/forms/profileview.cpp
index e265e16..2ffb119 100644
--- a/plugins/ProfileEditor/forms/profileview.cpp
+++ b/plugins/ProfileEditor/forms/profileview.cpp
@@ -35,6 +35,21 @@ ProfileView::ProfileView(WebProfile *profile, QWidget *parent)
ui->name->setText(profile->name());
ui->offTheRecord->setChecked(profile->isOffTheRecord());
+ ui->homepage->setText(profile->homepage().toString());
+ connect(ui->homepage, &QLineEdit::editingFinished, profile, [=]() {
+ profile->setHomepage(QUrl::fromUserInput(ui->homepage->text()));
+ });
+
+ ui->newtab->setText(profile->newtab().toString());
+ connect(ui->newtab, &QLineEdit::editingFinished, profile, [=]() {
+ profile->setNewtab(QUrl::fromUserInput(ui->newtab->text()));
+ });
+
+ ui->search->setText(profile->search());
+ connect(ui->search, &QLineEdit::editingFinished, profile, [=]() {
+ profile->setSearch(ui->search->text());
+ });
+
// http tab
ui->userAgent->setPlainText(m_profile->httpUserAgent());
connect(ui->userAgent, &QPlainTextEdit::textChanged, profile, [=]() {
diff --git a/plugins/ProfileEditor/forms/profileview.ui b/plugins/ProfileEditor/forms/profileview.ui
index 6c2edda..2b25184 100644
--- a/plugins/ProfileEditor/forms/profileview.ui
+++ b/plugins/ProfileEditor/forms/profileview.ui
@@ -68,6 +68,43 @@
</property>
</widget>
</item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="homepage_label">
+ <property name="text">
+ <string>Homepage</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="newtab_label">
+ <property name="text">
+ <string>New tab page</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0">
+ <widget class="QLabel" name="search_label">
+ <property name="text">
+ <string>Search</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QLineEdit" name="newtab"/>
+ </item>
+ <item row="6" column="1">
+ <widget class="QLineEdit" name="search"/>
+ </item>
+ <item row="4" column="1">
+ <widget class="QLineEdit" name="homepage"/>
+ </item>
+ <item row="3" column="1">
+ <widget class="Line" name="line_8">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
<widget class="QWidget" name="httpTab">