From 4a115e6a45c28479c2b4a2afd631c746392ca2cb Mon Sep 17 00:00:00 2001 From: adjam Date: Wed, 20 May 2009 12:11:23 +0000 Subject: Printing dialog pointer deleting git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@970526 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/mainwindow.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 930a4e64..83ff514b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -572,13 +572,11 @@ void MainWindow::printRequested(QWebFrame *frame) QPrinter printer; QPointer dialog = KdePrint::createPrintDialog(&printer, this); - if (dialog->exec() != QDialog::Accepted) + if (dialog->exec() == QDialog::Accepted) { - delete dialog; - return; + frame->print(&printer); } delete dialog; - frame->print(&printer); } -- cgit v1.2.1 From cf06e94904997aef63b06dd4c2584089d4c2762c Mon Sep 17 00:00:00 2001 From: adjam Date: Wed, 20 May 2009 12:11:29 +0000 Subject: YesNo --> ContinueCancel git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@970528 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/networkaccessmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp index 0de1dde0..6f0e2a3e 100644 --- a/src/networkaccessmanager.cpp +++ b/src/networkaccessmanager.cpp @@ -165,7 +165,7 @@ void NetworkAccessManager::sslErrors(QNetworkReply *reply, const QListurl().toString() + "\n\n" + QString(errors) + "\n\n"); + int ret = KMessageBox::warningContinueCancel(mainWindow, i18n("SSL Errors:\n\n") + reply->url().toString() + "\n\n" + QString(errors) + "\n\n"); if (ret == KMessageBox::Yes) reply->ignoreSslErrors(); } -- cgit v1.2.1 From bffad434d26503d24d9f3dc4b55ab2fb6e53b964 Mon Sep 17 00:00:00 2001 From: mlaurent Date: Mon, 8 Jun 2009 11:55:38 +0000 Subject: fixuifiles git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@978867 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/cookies.ui | 3 --- src/cookiesexceptions.ui | 3 --- src/history.ui | 3 --- 3 files changed, 9 deletions(-) (limited to 'src') diff --git a/src/cookies.ui b/src/cookies.ui index ae1c4a2b..992cd995 100644 --- a/src/cookies.ui +++ b/src/cookies.ui @@ -16,9 +16,6 @@ 0 - - Form - diff --git a/src/cookiesexceptions.ui b/src/cookiesexceptions.ui index 3e28b42a..0d8ae84f 100644 --- a/src/cookiesexceptions.ui +++ b/src/cookiesexceptions.ui @@ -10,9 +10,6 @@ 400 - - Form - diff --git a/src/history.ui b/src/history.ui index fb694f8f..1f3e1016 100644 --- a/src/history.ui +++ b/src/history.ui @@ -10,9 +10,6 @@ 381 - - Form - -- cgit v1.2.1 From c307691a6356a330940cd29b6f67b5a64f37d336 Mon Sep 17 00:00:00 2001 From: adjam Date: Mon, 8 Jun 2009 14:05:59 +0000 Subject: bookmark toolbar displaying ALL the bookmarks. This commit is based on patch from Matthieu Gicquel (many thanks). While I don't like this "super-filled" bm toolbar, this is probably the best solution, waiting for an akonadi based bookmarks model. git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@978915 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/application.cpp | 2 +- src/bookmarks.cpp | 56 +++++++++++++++++++++++++++++++++++++++-------------- src/bookmarks.h | 5 ++++- 3 files changed, 47 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/application.cpp b/src/application.cpp index bd6e6d48..94821653 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -178,7 +178,7 @@ BookmarkProvider *Application::bookmarkProvider() { if (!s_bookmarkProvider) { - s_bookmarkProvider = new BookmarkProvider(); + s_bookmarkProvider = new BookmarkProvider(instance()->mainWindow()); } return s_bookmarkProvider; } diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp index d280f376..ace45c2f 100644 --- a/src/bookmarks.cpp +++ b/src/bookmarks.cpp @@ -121,7 +121,12 @@ BookmarkMenu::~BookmarkMenu() KMenu *BookmarkMenu::viewContextMenu(QAction *action) { - return contextMenu(action); + // contextMenu() returns an invalid KMenu (seg fault) for the folders in the toolbar + KMenu *menu = contextMenu(action); + if(menu) + return menu; + + return 0; // new KMenu(); } @@ -145,10 +150,11 @@ void BookmarkMenu::slotAddBookmark() BookmarkProvider::BookmarkProvider(QWidget *parent) - : QWidget(parent) + : QObject(parent) + , m_parent(parent) , m_manager(0) , m_owner(0) - , m_menu(new KMenu(this)) + , m_menu(new KMenu(m_parent)) , m_actionCollection(new KActionCollection(this)) , m_bookmarkMenu(0) , m_bookmarkToolBar(0) @@ -197,7 +203,7 @@ BookmarkProvider::~BookmarkProvider() void BookmarkProvider::setupToolBar() { - m_bookmarkToolBar = new KToolBar(this); + m_bookmarkToolBar = new KToolBar(m_parent); m_bookmarkToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); m_bookmarkToolBar->setIconDimensions(16); m_bookmarkToolBar->setAcceptDrops(true); @@ -222,25 +228,18 @@ void BookmarkProvider::slotBookmarksChanged(const QString &group, const QString return; } - KActionCollection bookmarkCollection(this); - KBookmarkGroup toolBarGroup = m_manager->toolbar(); if (toolBarGroup.isNull()) return; + m_bookmarkToolBar->clear(); + KBookmark bookmark = toolBarGroup.first(); while (!bookmark.isNull()) { - if (!bookmark.isGroup()) - { - KAction *action = new KBookmarkAction(bookmark, m_owner, this); - QString text = bookmark.address(); - bookmarkCollection.addAction(text, action); - } + m_bookmarkToolBar->addAction(fillBookmarkBar(bookmark)); bookmark = toolBarGroup.next(bookmark); } - m_bookmarkToolBar->clear(); - m_bookmarkToolBar->addActions(bookmarkCollection.actions()); } @@ -282,3 +281,32 @@ KAction* BookmarkProvider::bookmarkToolBarAction() bookmarkToolBarAction->setShortcutConfigurable(false); return bookmarkToolBarAction; } + + +KAction *BookmarkProvider::fillBookmarkBar(const KBookmark &bookmark) +{ + if (bookmark.isGroup()) + { + KBookmarkGroup group = bookmark.toGroup(); + KBookmark bm = group.first(); + KActionMenu *menuAction = new KActionMenu(KIcon(bookmark.icon()), bookmark.text(), this); + menuAction->setDelayed(false); + while (!bm.isNull()) + { + menuAction->addAction(fillBookmarkBar(bm)); + bm = group.next(bm); + } + return menuAction; + } + + if(bookmark.isSeparator()) + { + KAction *a = new KAction(this); + a->setSeparator(true); + return a; + } + else + { + return new KBookmarkAction(bookmark, m_owner, this); + } +} diff --git a/src/bookmarks.h b/src/bookmarks.h index 1de181e3..4e2349ad 100644 --- a/src/bookmarks.h +++ b/src/bookmarks.h @@ -156,7 +156,7 @@ protected slots: * * */ -class BookmarkProvider : public QWidget +class BookmarkProvider : public QObject { Q_OBJECT @@ -221,8 +221,11 @@ public slots: void slotBookmarksChanged(const QString &group, const QString &caller); private: + KAction *fillBookmarkBar(const KBookmark &bookmark); void setupToolBar(); + QWidget *m_parent; + KBookmarkManager *m_manager; BookmarkOwner *m_owner; KMenu *m_menu; -- cgit v1.2.1 From 02ce36f8b274534a7c843c1a8acacb9a31b4d3d3 Mon Sep 17 00:00:00 2001 From: mlaurent Date: Thu, 11 Jun 2009 11:22:06 +0000 Subject: Fix forward declaration git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@980178 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/cookiejar.h | 1 - src/kaccessmanager.h | 2 -- src/mainview.h | 3 --- src/mainwindow.h | 1 - src/networkmanager.h | 2 -- src/webpage.h | 7 ------- src/webview.h | 8 -------- 7 files changed, 24 deletions(-) (limited to 'src') diff --git a/src/cookiejar.h b/src/cookiejar.h index 56adc0b3..5bfe7749 100644 --- a/src/cookiejar.h +++ b/src/cookiejar.h @@ -29,7 +29,6 @@ #include // Forward Declarations -class AutoSaver; class QUrl; diff --git a/src/kaccessmanager.h b/src/kaccessmanager.h index 8325c890..ed5c208d 100644 --- a/src/kaccessmanager.h +++ b/src/kaccessmanager.h @@ -27,8 +27,6 @@ #include // Forward Declarations -class QNetworkRequest; -class QIODevice; class NetworkAccessManager : public KNetworkAccessManager diff --git a/src/mainview.h b/src/mainview.h index dfa498f7..8a8ae3dc 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -31,17 +31,14 @@ #include // Forward Declarations -class QLineEdit; class QUrl; class QWebFrame; class QLabel; class KAction; -class KCompletion; class KMenu; class KUrl; -class HistoryCompletionModel; class StackedUrlBar; class TabBar; class UrlBar; diff --git a/src/mainwindow.h b/src/mainwindow.h index 411cbe6c..f1ea3a98 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -40,7 +40,6 @@ class QWebFrame; class KUrl; class KAction; class KActionMenu; -class KIcon; class KMenu; class HistoryMenu; diff --git a/src/networkmanager.h b/src/networkmanager.h index 681d296a..a402b6e0 100644 --- a/src/networkmanager.h +++ b/src/networkmanager.h @@ -26,8 +26,6 @@ #include // Forward Declarations -class QNetworkRequest; -class QIODevice; class NetworkAccessManager : public KIO::AccessManager diff --git a/src/webpage.h b/src/webpage.h index 0723cb6d..ac6780ff 100644 --- a/src/webpage.h +++ b/src/webpage.h @@ -34,18 +34,11 @@ #include // Forward Declarations -class MainWindow; -class Application; -class KActionCollection; class QWebFrame; -class QAuthenticator; -class QMouseEvent; -class QNetworkProxy; class QNetworkReply; -class WebView; class WebPage : public KWebPage diff --git a/src/webview.h b/src/webview.h index b5ffa887..389db154 100644 --- a/src/webview.h +++ b/src/webview.h @@ -35,16 +35,8 @@ #include // Forward Declarations -class MainWindow; -class Application; -class KActionCollection; -class QWebFrame; -class QAuthenticator; -class QMouseEvent; -class QNetworkProxy; -class QNetworkReply; class WebPage; -- cgit v1.2.1