diff options
Diffstat (limited to 'src/forms')
-rw-r--r-- | src/forms/bookmarksdialog.cpp | 13 | ||||
-rw-r--r-- | src/forms/bookmarksdialog.h | 8 |
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; }; |