From 0e4a3b6077a276767f76bf52b5c09036b3d89114 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 20 Jun 2009 19:25:43 +0200 Subject: Finally fixed F5 shortcut --- src/mainwindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index a555df9a..2e2cc6cd 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -251,7 +251,6 @@ void MainWindow::setupActions() // stop reload Action m_stopReloadAction = new KAction(KIcon("view-refresh"), i18n("Reload"), this); - m_stopReloadAction->setShortcut(KShortcut(Qt::Key_F5)); actionCollection()->addAction(QLatin1String("stop_reload") , m_stopReloadAction); m_stopReloadAction->setShortcutConfigurable(false); @@ -426,6 +425,11 @@ void MainWindow::slotOpenLocation() void MainWindow::slotFileSaveAs() { + QWebFrame* frame = m_view->currentWebView()->page()->currentFrame(); + + QString title = frame->title(); + QString content = frame->toPlainText(); + KUrl srcUrl = currentTab()->url(); // FIXME implement download file } -- cgit v1.2.1 From 9f9f30aec59b16b94711b3fdd3729b2ea160456d Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 20 Jun 2009 19:33:09 +0200 Subject: slot Save File As --- src/mainwindow.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2e2cc6cd..4e6ff643 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -425,13 +426,14 @@ void MainWindow::slotOpenLocation() void MainWindow::slotFileSaveAs() { - QWebFrame* frame = m_view->currentWebView()->page()->currentFrame(); - - QString title = frame->title(); - QString content = frame->toPlainText(); - KUrl srcUrl = currentTab()->url(); - // FIXME implement download file + + const QString destUrl = KFileDialog::getSaveFileName(srcUrl.fileName(), QString(), this); + if (destUrl.isEmpty()) return; + KIO::Job *job = KIO::file_copy(srcUrl, KUrl(destUrl), -1, KIO::Overwrite); + job->addMetaData("MaxCacheSize", "0"); // Don't store in http cache. + job->addMetaData("cache", "cache"); // Use entry from cache if available. + job->uiDelegate()->setAutoErrorHandlingEnabled(true); } -- cgit v1.2.1 From 8e094f1119d4073e78697052397c42a90c527601 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 21 Jun 2009 01:29:05 +0200 Subject: New notify system --- src/mainwindow.cpp | 67 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 50 insertions(+), 17 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4e6ff643..ccd40e3c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -58,6 +58,8 @@ #include #include #include +#include +#include #include #include @@ -159,9 +161,9 @@ void MainWindow::postLaunch() connect(m_view, SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int))); connect(m_view, SIGNAL(printRequested(QWebFrame *)), this, SLOT(printRequested(QWebFrame *))); - // status bar messages - connect(m_view, SIGNAL(showStatusBarMessage(const QString&)), statusBar(), SLOT(showMessage(const QString&))); - connect(m_view, SIGNAL(linkHovered(const QString&)), statusBar(), SLOT(showMessage(const QString&))); + // "status bar" messages + connect(m_view, SIGNAL(showStatusBarMessage(const QString&)), this, SLOT(notifyMessage(const QString&))); + connect(m_view, SIGNAL(linkHovered(const QString&)), this, SLOT(notifyMessage(const QString&))); // update toolbar actions signals connect(m_view, SIGNAL(tabsChanged()), this, SLOT(slotUpdateActions())); @@ -349,7 +351,6 @@ void MainWindow::setupHistoryMenu() { HistoryMenu *historyMenu = new HistoryMenu(this); connect(historyMenu, SIGNAL(openUrl(const KUrl&)), this, SLOT(loadUrl(const KUrl&))); - connect(historyMenu, SIGNAL(hovered(const QString&)), this, SLOT(slotUpdateStatusbar(const QString&))); historyMenu->setTitle(i18n("&History")); // setting history menu position @@ -455,12 +456,6 @@ void MainWindow::slotPreferences() } -void MainWindow::slotUpdateStatusbar(const QString &string) -{ - statusBar()->showMessage(string, 2000); -} - - void MainWindow::slotUpdateActions() { m_historyBackAction->setEnabled(currentTab()->history()->canGoBack()); @@ -590,7 +585,7 @@ void MainWindow::slotFindNext() if (!currentTab()->findText(m_lastSearch, options)) { - slotUpdateStatusbar(QString(m_lastSearch) + i18n(" not found.")); + notifyMessage(QString(m_lastSearch) + i18n(" not found.")); } } @@ -612,7 +607,7 @@ void MainWindow::slotFindPrevious() if (!currentTab()->findText(m_lastSearch, options)) { - slotUpdateStatusbar(QString(m_lastSearch) + i18n(" not found.")); + notifyMessage(QString(m_lastSearch) + i18n(" not found.")); } } @@ -647,7 +642,6 @@ void MainWindow::slotViewFullScreen(bool makeFullScreen) static bool menubarFlag; static bool mainToolBarFlag; static bool bookmarksToolBarFlag; - static bool statusBarFlag; static bool sidePanelFlag; if (makeFullScreen == true) @@ -656,13 +650,11 @@ void MainWindow::slotViewFullScreen(bool makeFullScreen) menubarFlag = menuBar()->isHidden(); mainToolBarFlag = toolBar("mainToolBar")->isHidden(); bookmarksToolBarFlag = toolBar("bookmarksToolBar")->isHidden(); - statusBarFlag = statusBar()->isHidden(); sidePanelFlag = sidePanel()->isHidden(); menuBar()->hide(); toolBar("mainToolBar")->hide(); toolBar("bookmarksToolBar")->hide(); - statusBar()->hide(); sidePanel()->hide(); } else @@ -673,8 +665,6 @@ void MainWindow::slotViewFullScreen(bool makeFullScreen) toolBar("mainToolBar")->show(); if (!bookmarksToolBarFlag) toolBar("bookmarksToolBar")->show(); - if (!statusBarFlag) - statusBar()->show(); if (!sidePanelFlag) sidePanel()->show(); } @@ -858,3 +848,46 @@ QAction *MainWindow::actionByName(const QString name) return new QAction(this); // return empty object instead of NULL pointer } + + +void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) +{ + if(msg.isEmpty()) + return; + + if(m_popup) + delete m_popup; + + m_popup = new KPassivePopup(this); + m_popup->setAutoDelete(true); + + QPixmap px; + + switch(status) + { + case Rekonq::Info: + m_popup->setView(msg); + break; + case Rekonq::Success: + px.load("hi32-actions-emoticon.png"); + m_popup->setView( i18n("Success!"), msg, px); + break; + case Rekonq::Error: + px.load("hi32-actions-edit-delete.png"); + m_popup->setView( i18n("Error!"), msg, px); + break; + case Rekonq::Download: + px.load( KStandardDirs::locate("appdata", "pics/hi64-actions-download.png") ); + m_popup->setView( i18n("Download!"), msg, px); + break; + default: + kDebug() << "nothing to be notified.."; + break; + } + + int x = geometry().x(); + int y = geometry().y() + height() - 45; + QPoint p(x,y); + + m_popup->show(p); +} -- cgit v1.2.1 From 554b30dd0101524d846df6c76a07db011d4d0c00 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 21 Jun 2009 12:17:36 +0200 Subject: Deleting popup in empty msg --- src/mainwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ccd40e3c..811d607b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -161,7 +161,7 @@ void MainWindow::postLaunch() connect(m_view, SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int))); connect(m_view, SIGNAL(printRequested(QWebFrame *)), this, SLOT(printRequested(QWebFrame *))); - // "status bar" messages + // "status bar" messages (new notifyMessage system) connect(m_view, SIGNAL(showStatusBarMessage(const QString&)), this, SLOT(notifyMessage(const QString&))); connect(m_view, SIGNAL(linkHovered(const QString&)), this, SLOT(notifyMessage(const QString&))); @@ -853,7 +853,10 @@ QAction *MainWindow::actionByName(const QString name) void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) { if(msg.isEmpty()) + { + delete m_popup; return; + } if(m_popup) delete m_popup; -- cgit v1.2.1 From 9501cf849628c5aeef669f12db87d43ed03c357a Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 21 Jun 2009 22:11:39 +0200 Subject: New notifying system. Perhaps this should be default for rekonq 0.2. Anyway, there are a lot of improvements needed. We'll see.. --- src/mainwindow.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 811d607b..c7e3c945 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -60,6 +60,7 @@ #include #include #include +#include #include #include @@ -162,7 +163,7 @@ void MainWindow::postLaunch() connect(m_view, SIGNAL(printRequested(QWebFrame *)), this, SLOT(printRequested(QWebFrame *))); // "status bar" messages (new notifyMessage system) - connect(m_view, SIGNAL(showStatusBarMessage(const QString&)), this, SLOT(notifyMessage(const QString&))); + connect(m_view, SIGNAL(showStatusBarMessage(const QString&, Rekonq::Notify)), this, SLOT(notifyMessage(const QString&, Rekonq::Notify))); connect(m_view, SIGNAL(linkHovered(const QString&)), this, SLOT(notifyMessage(const QString&))); // update toolbar actions signals @@ -850,8 +851,10 @@ QAction *MainWindow::actionByName(const QString name) } +// FIXME: better implement me, please!! void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) { + // deleting popus if empty msgs if(msg.isEmpty()) { delete m_popup; @@ -865,29 +868,26 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) m_popup->setAutoDelete(true); QPixmap px; + QString pixPath; switch(status) { case Rekonq::Info: - m_popup->setView(msg); break; case Rekonq::Success: - px.load("hi32-actions-emoticon.png"); - m_popup->setView( i18n("Success!"), msg, px); break; case Rekonq::Error: - px.load("hi32-actions-edit-delete.png"); - m_popup->setView( i18n("Error!"), msg, px); break; case Rekonq::Download: - px.load( KStandardDirs::locate("appdata", "pics/hi64-actions-download.png") ); - m_popup->setView( i18n("Download!"), msg, px); break; default: kDebug() << "nothing to be notified.."; break; } + m_popup->setView(msg); + + // setting popus in bottom-left position int x = geometry().x(); int y = geometry().y() + height() - 45; QPoint p(x,y); -- cgit v1.2.1 From a9b1302f2bf5b590c5352c7c90a9319fac5cc21b Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 22 Jun 2009 11:31:10 +0200 Subject: Fixing popup pos && removing unwanted statusBar --- src/mainwindow.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c7e3c945..519081d6 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -136,6 +136,9 @@ MainWindow::MainWindow() // toolbar position, icon size, etc. setupGUI(); + // no more status bar.. + setStatusBar(0); + QTimer::singleShot(0, this, SLOT(postLaunch())); } @@ -887,9 +890,12 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status) m_popup->setView(msg); + int h = KGlobalSettings::generalFont().pointSize(); + kWarning() << "h: " << h; + // setting popus in bottom-left position int x = geometry().x(); - int y = geometry().y() + height() - 45; + int y = geometry().y() + height() - h*4; QPoint p(x,y); m_popup->show(p); -- cgit v1.2.1