aboutsummaryrefslogtreecommitdiff
path: root/src/forms
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-02-14 17:55:00 +0100
committerAqua-sama <aqua@iserlohn-fortress.net>2017-02-14 17:55:00 +0100
commit883a502cc1cee3b596cef9645a6832804d6cb67f (patch)
treefa137ec26a2965ac6f16272841f75d4945e1f571 /src/forms
parentSettings changes (diff)
downloadsmolbote-883a502cc1cee3b596cef9645a6832804d6cb67f.tar.xz
Global bookmarks and downloads dialogs
Diffstat (limited to 'src/forms')
-rw-r--r--src/forms/bookmarksdialog.cpp13
-rw-r--r--src/forms/bookmarksdialog.h8
2 files changed, 16 insertions, 5 deletions
diff --git a/src/forms/bookmarksdialog.cpp b/src/forms/bookmarksdialog.cpp
index c8a0425..c088fd8 100644
--- a/src/forms/bookmarksdialog.cpp
+++ b/src/forms/bookmarksdialog.cpp
@@ -24,11 +24,10 @@
#include "xbel/xbel.h"
#include "mainwindow.h"
-BookmarksDialog::BookmarksDialog(MainWindow *parent) :
+BookmarksDialog::BookmarksDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::BookmarksDialog)
{
- parentWindow = parent;
ui->setupUi(this);
ui->treeWidget->header()->setSectionResizeMode(QHeaderView::Stretch);
@@ -68,6 +67,12 @@ BookmarksDialog::~BookmarksDialog()
delete ui;
}
+void BookmarksDialog::show(MainWindow *window)
+{
+ w = window;
+ QDialog::show();
+}
+
void BookmarksDialog::deleteCurrentItem()
{
delete ui->treeWidget->currentItem();
@@ -77,7 +82,9 @@ void BookmarksDialog::openItem(QTreeWidgetItem *item, int column)
{
Q_UNUSED(column)
- parentWindow->addNewTab(QUrl::fromUserInput(item->text(1)));
+ if(w) {
+ w->addNewTab(QUrl::fromUserInput(item->text(1)));
+ }
}
void BookmarksDialog::showItemDetails()
diff --git a/src/forms/bookmarksdialog.h b/src/forms/bookmarksdialog.h
index e2387d7..17f4df7 100644
--- a/src/forms/bookmarksdialog.h
+++ b/src/forms/bookmarksdialog.h
@@ -34,10 +34,14 @@ class BookmarksDialog : public QDialog
Q_OBJECT
public:
- explicit BookmarksDialog(MainWindow *parent = 0);
+ explicit BookmarksDialog(QWidget *parent = 0);
~BookmarksDialog();
+signals:
+ void openUrl(const QUrl &url);
+
public slots:
+ void show(MainWindow *window);
// void addFolder(const QString &title);
// void addBookmark(const QString &title, const QString &href);
// void addSeparator();
@@ -48,7 +52,7 @@ private slots:
void showItemDetails();
private:
- MainWindow *parentWindow;
+ MainWindow *w;
Ui::BookmarksDialog *ui;
Xbel *xbel;
};